src/energyplus/ReverseTranslator/ReverseTranslateSizingPeriodDesignDay.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "../ReverseTranslator.hpp" | ||
| 7 | #include "../../model/DesignDay.hpp" | ||
| 8 | #include "../../model/DesignDay_Impl.hpp" | ||
| 9 | #include "../../model/ScheduleDay.hpp" | ||
| 10 | #include "../../model/ScheduleDay_Impl.hpp" | ||
| 11 | #include <utilities/idd/SizingPeriod_DesignDay_FieldEnums.hxx> | ||
| 12 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 13 | #include <utilities/idd/IddEnums.hxx> | ||
| 14 | #include "../../utilities/core/Compare.hpp" | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | namespace energyplus { | ||
| 20 | |||
| 21 | 24 | OptionalModelObject ReverseTranslator::translateSizingPeriodDesignDay(const WorkspaceObject& workspaceObject) { | |
| 22 |
4/5✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
|
24 | if (workspaceObject.iddObject().type() != IddObjectType::SizingPeriod_DesignDay) { |
| 23 | ✗ | LOG(Error, "WorkspaceObject is not IddObjectType: SizingPeriod_DesignDay"); | |
| 24 | ✗ | return boost::none; | |
| 25 | } | ||
| 26 | |||
| 27 |
1/1✓ Branch 1 taken 24 times.
|
24 | DesignDay designDay(m_model); |
| 28 | |||
| 29 | // Name | ||
| 30 |
1/1✓ Branch 1 taken 24 times.
|
24 | boost::optional<std::string> s = workspaceObject.getString(SizingPeriod_DesignDayFields::Name); |
| 31 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (s) { |
| 32 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | designDay.setName(s.get()); |
| 33 | } else { | ||
| 34 | ✗ | LOG(Error, "SizingPeriod:DesignDay missing required field Name"); | |
| 35 | } | ||
| 36 | |||
| 37 | // Month | ||
| 38 |
1/1✓ Branch 1 taken 24 times.
|
24 | boost::optional<int> i = workspaceObject.getInt(SizingPeriod_DesignDayFields::Month); |
| 39 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (i) { |
| 40 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setMonth(i.get()); |
| 41 | } else { | ||
| 42 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Month"); |
| 43 | } | ||
| 44 | |||
| 45 | // Day of Month | ||
| 46 |
1/1✓ Branch 1 taken 24 times.
|
24 | i = workspaceObject.getInt(SizingPeriod_DesignDayFields::DayofMonth); |
| 47 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (i) { |
| 48 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setDayOfMonth(i.get()); |
| 49 | } else { | ||
| 50 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Day of Month"); |
| 51 | } | ||
| 52 | |||
| 53 | // Day Type | ||
| 54 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::DayType); |
| 55 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (s) { |
| 56 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | designDay.setDayType(s.get()); |
| 57 | } else { | ||
| 58 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Day Type"); | |
| 59 | } | ||
| 60 | |||
| 61 | // Maximum Dry-Bulb Temperature | ||
| 62 |
1/1✓ Branch 1 taken 24 times.
|
24 | boost::optional<double> value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::MaximumDryBulbTemperature); |
| 63 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 64 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setMaximumDryBulbTemperature(value.get()); |
| 65 | } else { | ||
| 66 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Maximum Dry Bulb Temperature"); |
| 67 | } | ||
| 68 | |||
| 69 | // Dry-Bulb Temperature Range Modifier Type | ||
| 70 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::DryBulbTemperatureRangeModifierType); |
| 71 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (s) { |
| 72 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | designDay.setDryBulbTemperatureRangeModifierType(s.get()); |
| 73 | } | ||
| 74 |
1/1✓ Branch 1 taken 24 times.
|
24 | std::string dryBulbTemperatureRangeModifierType = designDay.dryBulbTemperatureRangeModifierType(); |
| 75 | |||
| 76 | // Daily Dry-Bulb Temperature Range | ||
| 77 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✗ Branch 8 not taken.
|
48 | if (!istringEqual(dryBulbTemperatureRangeModifierType, "DifferenceSchedule")) { |
| 78 |
1/1✓ Branch 1 taken 24 times.
|
24 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::DailyDryBulbTemperatureRange); |
| 79 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 80 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setDailyDryBulbTemperatureRange(value.get()); |
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 84 | // Dry-Bulb Temperature Range Modifier Schedule Name | ||
| 85 |
3/9✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 24 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
|
72 | if (istringEqual(dryBulbTemperatureRangeModifierType, "MultiplierSchedule") |
| 86 |
8/17✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 24 times.
✓ Branch 9 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
✓ Branch 13 taken 24 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 24 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 24 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
96 | || istringEqual(dryBulbTemperatureRangeModifierType, "DifferenceSchedule")) { |
| 87 | ✗ | boost::optional<WorkspaceObject> wo = workspaceObject.getTarget(SizingPeriod_DesignDayFields::DryBulbTemperatureRangeModifierDayScheduleName); | |
| 88 | ✗ | if (wo) { | |
| 89 | ✗ | boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(wo.get()); | |
| 90 | ✗ | if (mo) { | |
| 91 | ✗ | if (boost::optional<ScheduleDay> schedule = mo->optionalCast<ScheduleDay>()) { | |
| 92 | ✗ | designDay.setDryBulbTemperatureRangeModifierDaySchedule(*schedule); | |
| 93 | ✗ | } | |
| 94 | } | ||
| 95 | ✗ | } | |
| 96 | |||
| 97 | ✗ | if (!designDay.dryBulbTemperatureRangeModifierDaySchedule()) { | |
| 98 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Maximum Dry Bulb Temperature"); | |
| 99 | } | ||
| 100 | ✗ | } | |
| 101 | |||
| 102 | // Humidity Condition Type | ||
| 103 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::HumidityConditionType); |
| 104 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (s) { |
| 105 |
2/2✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
|
24 | designDay.setHumidityConditionType(s.get()); |
| 106 | } | ||
| 107 |
1/1✓ Branch 1 taken 24 times.
|
24 | std::string humidityConditionType = designDay.humidityConditionType(); |
| 108 | |||
| 109 | // Wetbulb or DewPoint at Maximum Dry-Bulb | ||
| 110 |
5/21✓ Branch 1 taken 24 times.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 24 times.
✓ Branch 14 taken 24 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 24 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 24 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
|
72 | if (istringEqual(humidityConditionType, "WetBulb") || istringEqual(humidityConditionType, "DewPoint") |
| 111 |
2/12✗ Branch 1 not taken.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
24 | || istringEqual(humidityConditionType, "WetBulbProfileMultiplierSchedule") |
| 112 |
2/12✗ Branch 1 not taken.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
24 | || istringEqual(humidityConditionType, "WetBulbProfileDifferenceSchedule") |
| 113 |
5/17✓ Branch 1 taken 24 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 24 times.
✗ Branch 6 not taken.
✗ Branch 9 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 24 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 24 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 24 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
48 | || istringEqual(humidityConditionType, "WetBulbProfileDefaultMultipliers")) { |
| 114 |
1/1✓ Branch 1 taken 24 times.
|
24 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::WetbulborDewPointatMaximumDryBulb); |
| 115 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 116 | // units for this field are C | ||
| 117 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setWetBulbOrDewPointAtMaximumDryBulb(value.get()); |
| 118 | } else { | ||
| 119 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Wetbulb or Dew Point at Maximum Dry Bulb"); |
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | // Humidity Condition Day Schedule Name | ||
| 124 |
8/21✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✓ Branch 9 taken 24 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 24 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 24 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 24 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 24 times.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
|
120 | if (istringEqual(humidityConditionType, "RelativeHumiditySchedule") || istringEqual(humidityConditionType, "WetBulbProfileMultiplierSchedule") |
| 125 |
5/12✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 24 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 24 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 24 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
72 | || istringEqual(humidityConditionType, "WetBulbProfileDifferenceSchedule") |
| 126 |
8/17✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 24 times.
✓ Branch 9 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
✓ Branch 13 taken 24 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 24 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 24 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
96 | || istringEqual(humidityConditionType, "RelativeHumiditySchedule")) { |
| 127 | |||
| 128 | ✗ | boost::optional<WorkspaceObject> wo = workspaceObject.getTarget(SizingPeriod_DesignDayFields::HumidityConditionDayScheduleName); | |
| 129 | ✗ | if (wo) { | |
| 130 | ✗ | boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(wo.get()); | |
| 131 | ✗ | if (mo) { | |
| 132 | ✗ | boost::optional<ScheduleDay> schedule = mo->optionalCast<ScheduleDay>(); | |
| 133 | ✗ | if (schedule) { | |
| 134 | ✗ | designDay.setHumidityConditionDaySchedule(schedule.get()); | |
| 135 | } | ||
| 136 | ✗ | } | |
| 137 | ✗ | } | |
| 138 | |||
| 139 | ✗ | if (!designDay.humidityConditionDaySchedule()) { | |
| 140 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Humidity Condition Day Schedule Name"); | |
| 141 | } | ||
| 142 | ✗ | } | |
| 143 | |||
| 144 | // Humidity Ratio at Maximum Dry-Bulb | ||
| 145 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 24 times.
|
48 | if (istringEqual(humidityConditionType, "HumidityRatio")) { |
| 146 | // units for this field are kgWater/kgDryAir | ||
| 147 | ✗ | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::HumidityRatioatMaximumDryBulb); | |
| 148 | ✗ | if (value) { | |
| 149 | ✗ | designDay.setHumidityRatioAtMaximumDryBulb(value.get()); | |
| 150 | } else { | ||
| 151 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Humidity Ratio at Maximum Dry Bulb"); | |
| 152 | } | ||
| 153 | } | ||
| 154 | |||
| 155 | // Enthalpy at Maximum Dry-Bulb | ||
| 156 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 24 times.
|
48 | if (istringEqual(humidityConditionType, "Enthalpy")) { |
| 157 | // units for this field are J/kg | ||
| 158 | ✗ | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::EnthalpyatMaximumDryBulb); | |
| 159 | ✗ | if (value) { | |
| 160 | ✗ | designDay.setEnthalpyAtMaximumDryBulb(value.get()); | |
| 161 | } else { | ||
| 162 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Enthalpy at Maximum Dry Bulb"); | |
| 163 | } | ||
| 164 | } | ||
| 165 | |||
| 166 | // Daily Wet-Bulb Temperature Range | ||
| 167 |
3/9✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 24 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
|
72 | if (istringEqual(humidityConditionType, "WetbulbProfileMultiplierSchedule") |
| 168 |
8/17✓ Branch 1 taken 24 times.
✓ Branch 3 taken 24 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 24 times.
✓ Branch 9 taken 24 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 24 times.
✓ Branch 13 taken 24 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 24 times.
✗ Branch 17 not taken.
✓ Branch 18 taken 24 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
|
96 | || istringEqual(humidityConditionType, "WetBulbProfileDefaultMultipliers")) { |
| 169 | ✗ | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::DailyWetBulbTemperatureRange); | |
| 170 | ✗ | if (value) { | |
| 171 | ✗ | designDay.setDailyWetBulbTemperatureRange(*value); | |
| 172 | } else { | ||
| 173 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Daily Wet Bulb Temperature Range"); | |
| 174 | } | ||
| 175 | } | ||
| 176 | |||
| 177 | // Barometric Pressure | ||
| 178 |
1/1✓ Branch 1 taken 24 times.
|
24 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::BarometricPressure); |
| 179 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 180 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setBarometricPressure(value.get()); |
| 181 | } | ||
| 182 | |||
| 183 | // Site Wind Speed | ||
| 184 |
1/1✓ Branch 1 taken 24 times.
|
24 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::WindSpeed); |
| 185 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 186 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setWindSpeed(value.get()); |
| 187 | } else { | ||
| 188 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Site Wind Speed"); |
| 189 | } | ||
| 190 | |||
| 191 | // Site Wind Direction | ||
| 192 |
1/1✓ Branch 1 taken 24 times.
|
24 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::WindDirection); |
| 193 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (value) { |
| 194 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setWindDirection(value.get()); |
| 195 | } else { | ||
| 196 |
9/9✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
|
2 | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Site Wind Direction"); |
| 197 | } | ||
| 198 | |||
| 199 | // Rain Indicator | ||
| 200 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::RainIndicator); |
| 201 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (s) { |
| 202 |
4/5✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
✓ Branch 7 taken 22 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 22 times.
|
44 | if (istringEqual(*s, "Yes")) { |
| 203 | ✗ | designDay.setRainIndicator(true); | |
| 204 | } else { | ||
| 205 |
1/1✓ Branch 1 taken 22 times.
|
22 | designDay.setRainIndicator(false); |
| 206 | } | ||
| 207 | } | ||
| 208 | |||
| 209 | // Snow Indicator | ||
| 210 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::SnowIndicator); |
| 211 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (s) { |
| 212 |
4/5✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
✓ Branch 7 taken 22 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 22 times.
|
44 | if (istringEqual(*s, "Yes")) { |
| 213 | ✗ | designDay.setSnowIndicator(true); | |
| 214 | } else { | ||
| 215 |
1/1✓ Branch 1 taken 22 times.
|
22 | designDay.setSnowIndicator(false); |
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | // Site Daylight Saving Time Status | ||
| 220 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::DaylightSavingTimeIndicator); |
| 221 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (s) { |
| 222 |
4/5✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
✓ Branch 7 taken 22 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 22 times.
|
44 | if (istringEqual(*s, "Yes")) { |
| 223 | ✗ | designDay.setDaylightSavingTimeIndicator(true); | |
| 224 | } else { | ||
| 225 |
1/1✓ Branch 1 taken 22 times.
|
22 | designDay.setDaylightSavingTimeIndicator(false); |
| 226 | } | ||
| 227 | } | ||
| 228 | |||
| 229 | // Solar Model Indicator | ||
| 230 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::SolarModelIndicator); |
| 231 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 2 times.
|
24 | if (s) { |
| 232 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | designDay.setSolarModelIndicator(s.get()); |
| 233 | } | ||
| 234 |
1/1✓ Branch 1 taken 24 times.
|
24 | std::string solarModelIndicator = designDay.solarModelIndicator(); |
| 235 | |||
| 236 | // Beam Solar Day Schedule Name and Site Diffuse Solar Radiation Rate per Area Radiation Rate per Area Day Schedule Name | ||
| 237 |
3/4✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 24 times.
|
48 | if (istringEqual(solarModelIndicator, "Schedule")) { |
| 238 | |||
| 239 | // Beam Solar Day Schedule Name | ||
| 240 | ✗ | boost::optional<WorkspaceObject> wo = workspaceObject.getTarget(SizingPeriod_DesignDayFields::BeamSolarDayScheduleName); | |
| 241 | ✗ | if (wo) { | |
| 242 | ✗ | boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(wo.get()); | |
| 243 | ✗ | if (mo) { | |
| 244 | ✗ | boost::optional<ScheduleDay> schedule = mo->optionalCast<ScheduleDay>(); | |
| 245 | ✗ | if (schedule) { | |
| 246 | ✗ | designDay.setBeamSolarDaySchedule(schedule.get()); | |
| 247 | } | ||
| 248 | ✗ | } | |
| 249 | ✗ | } | |
| 250 | ✗ | if (!designDay.beamSolarDaySchedule()) { | |
| 251 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Beam Solar Day Schedule Name"); | |
| 252 | } | ||
| 253 | |||
| 254 | // Site Diffuse Solar Radiation Rate per Area Radiation Rate per Area Day Schedule Name | ||
| 255 | ✗ | wo = workspaceObject.getTarget(SizingPeriod_DesignDayFields::DiffuseSolarDayScheduleName); | |
| 256 | ✗ | if (wo) { | |
| 257 | ✗ | boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(wo.get()); | |
| 258 | ✗ | if (mo) { | |
| 259 | ✗ | boost::optional<ScheduleDay> schedule = mo->optionalCast<ScheduleDay>(); | |
| 260 | ✗ | if (schedule) { | |
| 261 | ✗ | designDay.setDiffuseSolarDaySchedule(schedule.get()); | |
| 262 | } | ||
| 263 | ✗ | } | |
| 264 | ✗ | } | |
| 265 | ✗ | if (!designDay.diffuseSolarDaySchedule()) { | |
| 266 | ✗ | LOG(Error, "SizingPeriod:DesignDay " << designDay.name().get() << " missing required field Diffuse Solar Schedule Name"); | |
| 267 | } | ||
| 268 | ✗ | } | |
| 269 | |||
| 270 |
15/26✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 17 times.
✓ Branch 7 taken 7 times.
✓ Branch 9 taken 17 times.
✓ Branch 12 taken 17 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 17 times.
✓ Branch 16 taken 17 times.
✓ Branch 17 taken 7 times.
✓ Branch 19 taken 17 times.
✓ Branch 20 taken 7 times.
✓ Branch 21 taken 24 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 24 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 7 times.
✓ Branch 27 taken 17 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
|
106 | if (istringEqual(solarModelIndicator, "ASHRAETau") || istringEqual(solarModelIndicator, "ASHRAETau2017")) { |
| 271 | // ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) | ||
| 272 |
1/1✓ Branch 1 taken 7 times.
|
7 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::ASHRAEClearSkyOpticalDepthforBeamIrradiance_taub_); |
| 273 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (value) { |
| 274 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | designDay.setAshraeClearSkyOpticalDepthForBeamIrradiance(*value); |
| 275 | } | ||
| 276 | |||
| 277 | // ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) | ||
| 278 |
1/1✓ Branch 1 taken 7 times.
|
7 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::ASHRAEClearSkyOpticalDepthforDiffuseIrradiance_taud_); |
| 279 |
1/2✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
|
7 | if (value) { |
| 280 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | designDay.setAshraeClearSkyOpticalDepthForDiffuseIrradiance(*value); |
| 281 | } | ||
| 282 | } | ||
| 283 | |||
| 284 | // Sky Clearness | ||
| 285 |
15/26✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 6 taken 7 times.
✓ Branch 7 taken 17 times.
✓ Branch 9 taken 7 times.
✓ Branch 12 taken 7 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 7 times.
✓ Branch 16 taken 7 times.
✓ Branch 17 taken 17 times.
✓ Branch 19 taken 7 times.
✓ Branch 20 taken 17 times.
✓ Branch 21 taken 24 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 24 times.
✗ Branch 25 not taken.
✓ Branch 26 taken 17 times.
✓ Branch 27 taken 7 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
|
86 | if (istringEqual(solarModelIndicator, "ASHRAEClearSky") || istringEqual(solarModelIndicator, "ZhangHuang")) { |
| 286 |
1/1✓ Branch 1 taken 17 times.
|
17 | value = workspaceObject.getDouble(SizingPeriod_DesignDayFields::SkyClearness); |
| 287 |
2/2✓ Branch 0 taken 15 times.
✓ Branch 1 taken 2 times.
|
17 | if (value) { |
| 288 |
2/2✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
|
15 | designDay.setSkyClearness(value.get()); |
| 289 | } | ||
| 290 | } | ||
| 291 | |||
| 292 | // Maximum Number Warmup Days | ||
| 293 |
1/1✓ Branch 1 taken 24 times.
|
24 | i = workspaceObject.getInt(SizingPeriod_DesignDayFields::MaximumNumberWarmupDays); |
| 294 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
|
24 | if (i) { |
| 295 | ✗ | designDay.setMaximumNumberWarmupDays(i.get()); | |
| 296 | } | ||
| 297 | |||
| 298 | // Begin Environment Reset Mode | ||
| 299 |
1/1✓ Branch 1 taken 24 times.
|
24 | s = workspaceObject.getString(SizingPeriod_DesignDayFields::BeginEnvironmentResetMode); |
| 300 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
|
24 | if (s) { |
| 301 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | designDay.setBeginEnvironmentResetMode(s.get()); |
| 302 | } | ||
| 303 | |||
| 304 |
1/1✓ Branch 1 taken 24 times.
|
24 | return designDay; |
| 305 | 24 | } | |
| 306 | |||
| 307 | } // namespace energyplus | ||
| 308 | } // namespace openstudio | ||
| 309 |