src/energyplus/ForwardTranslator/ForwardTranslateWaterHeaterStratified.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 "../ForwardTranslator.hpp" | ||
| 7 | #include "../../model/Model.hpp" | ||
| 8 | #include "../../model/Schedule.hpp" | ||
| 9 | #include "../../model/Schedule_Impl.hpp" | ||
| 10 | #include "../../model/Node.hpp" | ||
| 11 | #include "../../model/Node_Impl.hpp" | ||
| 12 | #include "../../model/WaterHeaterStratified.hpp" | ||
| 13 | #include "../../model/WaterHeaterStratified_Impl.hpp" | ||
| 14 | #include "../../model/ThermalZone.hpp" | ||
| 15 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 16 | #include "../../model/PlantLoop.hpp" | ||
| 17 | #include "../../model/WaterHeaterSizing.hpp" | ||
| 18 | |||
| 19 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 20 | #include "../../utilities/core/Optional.hpp" | ||
| 21 | |||
| 22 | #include <utilities/idd/WaterHeater_Stratified_FieldEnums.hxx> | ||
| 23 | #include <utilities/idd/IddEnums.hxx> | ||
| 24 | #include <utilities/idd/IddFactory.hxx> | ||
| 25 | |||
| 26 | using namespace openstudio::model; | ||
| 27 | |||
| 28 | namespace openstudio { | ||
| 29 | |||
| 30 | namespace energyplus { | ||
| 31 | |||
| 32 | 18 | boost::optional<IdfObject> ForwardTranslator::translateWaterHeaterStratified(WaterHeaterStratified& modelObject) { | |
| 33 | 18 | boost::optional<std::string> s; | |
| 34 | 18 | boost::optional<double> value; | |
| 35 | 18 | boost::optional<Schedule> schedule; | |
| 36 | |||
| 37 |
14/19✓ Branch 1 taken 18 times.
✓ Branch 4 taken 10 times.
✓ Branch 5 taken 8 times.
✓ Branch 7 taken 10 times.
✓ Branch 9 taken 2 times.
✓ Branch 10 taken 8 times.
✓ Branch 12 taken 2 times.
✓ Branch 15 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 17 taken 2 times.
✓ Branch 18 taken 16 times.
✓ Branch 20 taken 18 times.
✗ Branch 21 not taken.
✓ Branch 23 taken 9 times.
✓ Branch 24 taken 9 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
|
30 | if (!modelObject.plantLoop() && !(modelObject.peakUseFlowRate() && modelObject.useFlowRateFractionSchedule())) { |
| 38 |
7/7✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
✓ Branch 14 taken 9 times.
✓ Branch 17 taken 9 times.
✓ Branch 20 taken 9 times.
|
9 | LOG(Warn, |
| 39 | modelObject.briefDescription() << " will not be translated as it is not on a PlantLoop, and it does not have both a Peak Use Flow Rate " | ||
| 40 | "and a Use Flow Rate Fraction Schedule which is a required condition for stand-alone operation"); | ||
| 41 | 9 | return boost::none; | |
| 42 | } | ||
| 43 | |||
| 44 | // Name | ||
| 45 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::WaterHeater_Stratified, modelObject); |
| 46 | |||
| 47 | // Trigger translation of the WaterHeater:Sizing object, if any | ||
| 48 | 9 | bool hasWaterHeaterSizing = true; | |
| 49 | try { | ||
| 50 |
1/1✓ Branch 1 taken 9 times.
|
9 | auto siz = modelObject.waterHeaterSizing(); |
| 51 |
1/1✓ Branch 1 taken 9 times.
|
9 | translateAndMapModelObject(siz); |
| 52 | 9 | } catch (...) { | |
| 53 | ✗ | hasWaterHeaterSizing = false; | |
| 54 | ✗ | } | |
| 55 | |||
| 56 | // End-Use Subcategory | ||
| 57 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.endUseSubcategory(); |
| 58 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 59 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::EndUseSubcategory, s.get()); |
| 60 | } | ||
| 61 | |||
| 62 | // Tank Volume | ||
| 63 |
2/3✓ Branch 1 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
|
9 | if (modelObject.isTankVolumeAutosized()) { |
| 64 | ✗ | idfObject.setString(WaterHeater_StratifiedFields::TankVolume, "Autosize"); | |
| 65 | ✗ | if (!hasWaterHeaterSizing) { | |
| 66 | ✗ | LOG(Error, modelObject.briefDescription() << " has its Tank Volume autosized but it does not have a WaterHeaterSizing object attached"); | |
| 67 | } | ||
| 68 | } else { | ||
| 69 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.tankVolume(); |
| 70 | |||
| 71 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 72 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::TankVolume, value.get()); |
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | // Tank Height | ||
| 77 |
2/3✓ Branch 1 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
|
9 | if (modelObject.isTankHeightAutosized()) { |
| 78 | ✗ | idfObject.setString(WaterHeater_StratifiedFields::TankHeight, "Autosize"); | |
| 79 | } else { | ||
| 80 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.tankHeight(); |
| 81 | |||
| 82 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 83 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::TankHeight, value.get()); |
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 87 | // Tank Shape | ||
| 88 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.tankShape(); |
| 89 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 90 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::TankShape, s.get()); |
| 91 | } | ||
| 92 | |||
| 93 | // Tank Perimeter | ||
| 94 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.tankPerimeter(); |
| 95 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if (value) { |
| 96 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::TankPerimeter, value.get()); | |
| 97 | } | ||
| 98 | |||
| 99 | // Maximum Temperature Limit | ||
| 100 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.maximumTemperatureLimit(); |
| 101 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 102 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::MaximumTemperatureLimit, value.get()); |
| 103 | } | ||
| 104 | |||
| 105 | // Heater Priority Control | ||
| 106 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.heaterPriorityControl(); |
| 107 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 108 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::HeaterPriorityControl, s.get()); |
| 109 | } | ||
| 110 | |||
| 111 | // Heater 1 Setpoint Temperature Schedule Name | ||
| 112 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 8 taken 9 times.
✗ Branch 9 not taken.
|
18 | if ((schedule = modelObject.heater1SetpointTemperatureSchedule())) { |
| 113 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto _schedule = translateAndMapModelObject(schedule.get()); |
| 114 | |||
| 115 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (_schedule) { |
| 116 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::Heater1SetpointTemperatureScheduleName, _schedule->name().get()); |
| 117 | } | ||
| 118 | 9 | } | |
| 119 | |||
| 120 | // Heater 1 Deadband Temperature Difference | ||
| 121 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heater1DeadbandTemperatureDifference(); |
| 122 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 123 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater1DeadbandTemperatureDifference, value.get()); |
| 124 | } | ||
| 125 | |||
| 126 | // Heater 1 Capacity | ||
| 127 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 8 times.
|
9 | if (modelObject.isHeater1CapacityAutosized()) { |
| 128 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(WaterHeater_StratifiedFields::Heater1Capacity, "Autosize"); |
| 129 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (!hasWaterHeaterSizing) { |
| 130 | ✗ | LOG(Error, modelObject.briefDescription() << " has its Heater1 Capacity autosized but it does not have a WaterHeaterSizing object attached"); | |
| 131 | } | ||
| 132 | } else { | ||
| 133 |
1/1✓ Branch 1 taken 8 times.
|
8 | value = modelObject.heater1Capacity(); |
| 134 | |||
| 135 |
1/2✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
|
8 | if (value) { |
| 136 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater1Capacity, value.get()); |
| 137 | } | ||
| 138 | } | ||
| 139 | |||
| 140 | // Heater 1 Height | ||
| 141 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heater1Height(); |
| 142 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 143 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater1Height, value.get()); |
| 144 | } | ||
| 145 | |||
| 146 | // Heater 2 Setpoint Temperature Schedule Name | ||
| 147 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 8 taken 9 times.
✗ Branch 9 not taken.
|
18 | if ((schedule = modelObject.heater2SetpointTemperatureSchedule())) { |
| 148 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto _schedule = translateAndMapModelObject(schedule.get()); |
| 149 | |||
| 150 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (_schedule) { |
| 151 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::Heater2SetpointTemperatureScheduleName, _schedule->name().get()); |
| 152 | } | ||
| 153 | 9 | } | |
| 154 | |||
| 155 | // Heater 2 Deadband Temperature Difference | ||
| 156 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heater2DeadbandTemperatureDifference(); |
| 157 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 158 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater2DeadbandTemperatureDifference, value.get()); |
| 159 | } | ||
| 160 | |||
| 161 | // Heater 2 Capacity | ||
| 162 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heater2Capacity(); |
| 163 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 164 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater2Capacity, value.get()); |
| 165 | } | ||
| 166 | |||
| 167 | // Heater 2 Height | ||
| 168 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heater2Height(); |
| 169 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 170 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Heater2Height, value.get()); |
| 171 | } | ||
| 172 | |||
| 173 | // Heater Fuel Type | ||
| 174 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.heaterFuelType(); |
| 175 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 176 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::HeaterFuelType, s.get()); |
| 177 | } | ||
| 178 | |||
| 179 | // Heater Thermal Efficiency | ||
| 180 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.heaterThermalEfficiency(); |
| 181 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 182 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::HeaterThermalEfficiency, value.get()); |
| 183 | } | ||
| 184 | |||
| 185 | // Off Cycle Parasitic Fuel Consumption Rate | ||
| 186 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.offCycleParasiticFuelConsumptionRate(); |
| 187 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 188 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OffCycleParasiticFuelConsumptionRate, value.get()); |
| 189 | } | ||
| 190 | |||
| 191 | // Off Cycle Parasitic Fuel Type | ||
| 192 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.offCycleParasiticFuelType(); |
| 193 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 194 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::OffCycleParasiticFuelType, s.get()); |
| 195 | } | ||
| 196 | |||
| 197 | // Off Cycle Parasitic Heat Fraction to Tank | ||
| 198 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.offCycleParasiticHeatFractiontoTank(); |
| 199 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 200 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OffCycleParasiticHeatFractiontoTank, value.get()); |
| 201 | } | ||
| 202 | |||
| 203 | // Off Cycle Parasitic Height | ||
| 204 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.offCycleParasiticHeight(); |
| 205 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 206 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OffCycleParasiticHeight, value.get()); |
| 207 | } | ||
| 208 | |||
| 209 | // On Cycle Parasitic Fuel Consumption Rate | ||
| 210 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.onCycleParasiticFuelConsumptionRate(); |
| 211 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 212 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OnCycleParasiticFuelConsumptionRate, value.get()); |
| 213 | } | ||
| 214 | |||
| 215 | // On Cycle Parasitic Fuel Type | ||
| 216 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.onCycleParasiticFuelType(); |
| 217 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 218 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::OnCycleParasiticFuelType, s.get()); |
| 219 | } | ||
| 220 | |||
| 221 | // On Cycle Parasitic Heat Fraction to Tank | ||
| 222 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.onCycleParasiticHeatFractiontoTank(); |
| 223 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 224 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OnCycleParasiticHeatFractiontoTank, value.get()); |
| 225 | } | ||
| 226 | |||
| 227 | // On Cycle Parasitic Height | ||
| 228 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.onCycleParasiticHeight(); |
| 229 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 230 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OnCycleParasiticHeight, value.get()); |
| 231 | } | ||
| 232 | |||
| 233 | // Ambient Temperature Indicator | ||
| 234 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.ambientTemperatureIndicator(); |
| 235 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 236 |
5/5✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 8 times.
|
18 | if (istringEqual(s.get(), "ThermalZone")) { |
| 237 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(WaterHeater_StratifiedFields::AmbientTemperatureIndicator, "Zone"); |
| 238 | } else { | ||
| 239 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | idfObject.setString(WaterHeater_StratifiedFields::AmbientTemperatureIndicator, s.get()); |
| 240 | } | ||
| 241 | } | ||
| 242 | |||
| 243 | // Ambient Temperature Schedule Name | ||
| 244 |
1/1✓ Branch 1 taken 9 times.
|
9 | schedule = modelObject.ambientTemperatureSchedule(); |
| 245 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (schedule) { |
| 246 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | auto _schedule = translateAndMapModelObject(schedule.get()); |
| 247 | |||
| 248 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (_schedule) { |
| 249 |
4/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::AmbientTemperatureScheduleName, _schedule->name().get()); |
| 250 | } | ||
| 251 | 9 | } | |
| 252 | |||
| 253 | // Ambient Temperature Zone Name | ||
| 254 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 8 times.
|
18 | if (auto zone = modelObject.ambientTemperatureThermalZone()) { |
| 255 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto _zone = translateAndMapModelObject(zone.get()); |
| 256 | |||
| 257 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_zone) { |
| 258 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(WaterHeater_StratifiedFields::AmbientTemperatureZoneName, _zone->name().get()); |
| 259 | } | ||
| 260 | 10 | } | |
| 261 | |||
| 262 | // Ambient Temperature Outdoor Air Node Name | ||
| 263 |
1/1✓ Branch 1 taken 9 times.
|
9 | s = modelObject.ambientTemperatureOutdoorAirNodeName(); |
| 264 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 265 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::AmbientTemperatureOutdoorAirNodeName, s.get()); |
| 266 | } | ||
| 267 | |||
| 268 | // Uniform Skin Loss Coefficient per Unit Area to Ambient Temperature | ||
| 269 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.uniformSkinLossCoefficientperUnitAreatoAmbientTemperature(); |
| 270 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 271 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::UniformSkinLossCoefficientperUnitAreatoAmbientTemperature, value.get()); |
| 272 | } | ||
| 273 | |||
| 274 | // Skin Loss Fraction to Zone | ||
| 275 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.skinLossFractiontoZone(); |
| 276 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 277 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::SkinLossFractiontoZone, value.get()); |
| 278 | } | ||
| 279 | |||
| 280 | // Off Cycle Flue Loss Coefficient to Ambient Temperature | ||
| 281 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.offCycleFlueLossCoefficienttoAmbientTemperature(); |
| 282 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 283 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OffCycleFlueLossCoefficienttoAmbientTemperature, value.get()); |
| 284 | } | ||
| 285 | |||
| 286 | // Off Cycle Flue Loss Fraction to Zone | ||
| 287 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.offCycleFlueLossFractiontoZone(); |
| 288 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 289 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::OffCycleFlueLossFractiontoZone, value.get()); |
| 290 | } | ||
| 291 | |||
| 292 | // Peak Use Flow Rate | ||
| 293 |
1/1✓ Branch 1 taken 9 times.
|
9 | value = modelObject.peakUseFlowRate(); |
| 294 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
|
9 | if (value) { |
| 295 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(WaterHeater_StratifiedFields::PeakUseFlowRate, value.get()); |
| 296 | } | ||
| 297 | |||
| 298 | // Use Flow Rate Fraction Schedule Name | ||
| 299 |
1/1✓ Branch 1 taken 9 times.
|
9 | schedule = modelObject.useFlowRateFractionSchedule(); |
| 300 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
|
9 | if (schedule) { |
| 301 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto _schedule = translateAndMapModelObject(schedule.get()); |
| 302 | |||
| 303 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_schedule) { |
| 304 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(WaterHeater_StratifiedFields::UseFlowRateFractionScheduleName, _schedule->name().get()); |
| 305 | } | ||
| 306 | 1 | } | |
| 307 | |||
| 308 | // Cold Water Supply Temperature Schedule Name | ||
| 309 |
1/1✓ Branch 1 taken 9 times.
|
9 | schedule = modelObject.coldWaterSupplyTemperatureSchedule(); |
| 310 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if (schedule) { |
| 311 | ✗ | auto _schedule = translateAndMapModelObject(schedule.get()); | |
| 312 | |||
| 313 | ✗ | if (_schedule) { | |
| 314 | ✗ | idfObject.setString(WaterHeater_StratifiedFields::ColdWaterSupplyTemperatureScheduleName, _schedule->name().get()); | |
| 315 | } | ||
| 316 | ✗ | } | |
| 317 | |||
| 318 | // Use Side Inlet Node Name | ||
| 319 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 1 time.
|
18 | if (auto mo = modelObject.supplyInletModelObject()) { |
| 320 |
3/4✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
|
16 | if (auto node = mo->optionalCast<Node>()) { |
| 321 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | translateAndMapModelObject(node.get()); |
| 322 | |||
| 323 |
4/4✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
|
8 | idfObject.setString(WaterHeater_StratifiedFields::UseSideInletNodeName, node->name().get()); |
| 324 | 8 | } | |
| 325 | 9 | } | |
| 326 | |||
| 327 | // Use Side Outlet Node Name | ||
| 328 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 1 time.
|
18 | if (auto mo = modelObject.supplyOutletModelObject()) { |
| 329 |
3/4✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 6 taken 8 times.
✗ Branch 7 not taken.
|
16 | if (auto node = mo->optionalCast<Node>()) { |
| 330 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | translateAndMapModelObject(node.get()); |
| 331 | |||
| 332 |
4/4✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
|
8 | idfObject.setString(WaterHeater_StratifiedFields::UseSideOutletNodeName, node->name().get()); |
| 333 | 8 | } | |
| 334 | 9 | } | |
| 335 | |||
| 336 | // Use Side Effectiveness | ||
| 337 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.useSideEffectiveness(); |
| 338 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 339 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::UseSideEffectiveness, value.get()); |
| 340 | } | ||
| 341 | |||
| 342 | // Use Side Inlet Height | ||
| 343 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.useSideInletHeight(); |
| 344 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 345 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::UseSideInletHeight, value.get()); |
| 346 | } | ||
| 347 | |||
| 348 | // Use Side Outlet Height | ||
| 349 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isUseSideOutletHeightAutocalculated()) { |
| 350 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(WaterHeater_StratifiedFields::UseSideOutletHeight, "Autocalculate"); |
| 351 | } else { | ||
| 352 | ✗ | value = modelObject.useSideOutletHeight(); | |
| 353 | |||
| 354 | ✗ | if (value) { | |
| 355 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::UseSideOutletHeight, value.get()); | |
| 356 | } | ||
| 357 | } | ||
| 358 | |||
| 359 | // Source Side Inlet Node Name | ||
| 360 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 8 times.
|
18 | if (auto mo = modelObject.demandInletModelObject()) { |
| 361 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (auto node = mo->optionalCast<Node>()) { |
| 362 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | translateAndMapModelObject(node.get()); |
| 363 | |||
| 364 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(WaterHeater_StratifiedFields::SourceSideInletNodeName, node->name().get()); |
| 365 | 1 | } | |
| 366 | 9 | } | |
| 367 | |||
| 368 | // Source Side Outlet Node Name | ||
| 369 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 8 times.
|
18 | if (auto mo = modelObject.demandOutletModelObject()) { |
| 370 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (auto node = mo->optionalCast<Node>()) { |
| 371 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | translateAndMapModelObject(node.get()); |
| 372 | |||
| 373 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(WaterHeater_StratifiedFields::SourceSideOutletNodeName, node->name().get()); |
| 374 | 1 | } | |
| 375 | 9 | } | |
| 376 | |||
| 377 | // Source Side Effectiveness | ||
| 378 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.sourceSideEffectiveness(); |
| 379 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 380 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::SourceSideEffectiveness, value.get()); |
| 381 | } | ||
| 382 | |||
| 383 | // Source Side Inlet Height | ||
| 384 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isSourceSideInletHeightAutocalculated()) { |
| 385 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(WaterHeater_StratifiedFields::SourceSideInletHeight, "Autocalculate"); |
| 386 | } else { | ||
| 387 | ✗ | value = modelObject.sourceSideInletHeight(); | |
| 388 | |||
| 389 | ✗ | if (value) { | |
| 390 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::SourceSideInletHeight, value.get()); | |
| 391 | } | ||
| 392 | } | ||
| 393 | |||
| 394 | // Source Side Outlet Height | ||
| 395 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.sourceSideOutletHeight(); |
| 396 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 397 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::SourceSideOutletHeight, value.get()); |
| 398 | } | ||
| 399 | |||
| 400 | // Inlet Mode | ||
| 401 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.inletMode(); |
| 402 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 403 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::InletMode, s.get()); |
| 404 | } | ||
| 405 | |||
| 406 | // Use Side Design Flow Rate | ||
| 407 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isUseSideDesignFlowRateAutosized()) { |
| 408 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(WaterHeater_StratifiedFields::UseSideDesignFlowRate, "Autosize"); |
| 409 | } else { | ||
| 410 | ✗ | value = modelObject.useSideDesignFlowRate(); | |
| 411 | |||
| 412 | ✗ | if (value) { | |
| 413 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::UseSideDesignFlowRate, value.get()); | |
| 414 | } | ||
| 415 | } | ||
| 416 | |||
| 417 | // Source Side Design Flow Rate | ||
| 418 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isSourceSideDesignFlowRateAutosized()) { |
| 419 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(WaterHeater_StratifiedFields::SourceSideDesignFlowRate, "Autosize"); |
| 420 | } else { | ||
| 421 | ✗ | value = modelObject.sourceSideDesignFlowRate(); | |
| 422 | |||
| 423 | ✗ | if (value) { | |
| 424 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::SourceSideDesignFlowRate, value.get()); | |
| 425 | } | ||
| 426 | } | ||
| 427 | // Indirect Water Heating Recovery Time | ||
| 428 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.indirectWaterHeatingRecoveryTime(); |
| 429 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 430 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::IndirectWaterHeatingRecoveryTime, value.get()); |
| 431 | } | ||
| 432 | |||
| 433 | // Number of Nodes | ||
| 434 |
1/1✓ Branch 1 taken 9 times.
|
9 | auto num_nodes = modelObject.numberofNodes(); |
| 435 |
1/1✓ Branch 1 taken 9 times.
|
9 | idfObject.setInt(WaterHeater_StratifiedFields::NumberofNodes, num_nodes); |
| 436 | |||
| 437 | // Additional Destratification Conductivity | ||
| 438 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.additionalDestratificationConductivity(); |
| 439 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (value) { |
| 440 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::AdditionalDestratificationConductivity, value.get()); |
| 441 | } | ||
| 442 | |||
| 443 | // Node 1 Additional Loss Coefficient | ||
| 444 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node1AdditionalLossCoefficient(); |
| 445 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 1)) { |
| 446 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node1AdditionalLossCoefficient, value.get()); |
| 447 | } | ||
| 448 | |||
| 449 | // Node 2 Additional Loss Coefficient | ||
| 450 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node2AdditionalLossCoefficient(); |
| 451 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 2)) { |
| 452 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node2AdditionalLossCoefficient, value.get()); |
| 453 | } | ||
| 454 | |||
| 455 | // Node 3 Additional Loss Coefficient | ||
| 456 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node3AdditionalLossCoefficient(); |
| 457 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 3)) { |
| 458 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node3AdditionalLossCoefficient, value.get()); |
| 459 | } | ||
| 460 | |||
| 461 | // Node 4 Additional Loss Coefficient | ||
| 462 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node4AdditionalLossCoefficient(); |
| 463 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 4)) { |
| 464 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node4AdditionalLossCoefficient, value.get()); |
| 465 | } | ||
| 466 | |||
| 467 | // Node 5 Additional Loss Coefficient | ||
| 468 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node5AdditionalLossCoefficient(); |
| 469 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 5)) { |
| 470 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node5AdditionalLossCoefficient, value.get()); |
| 471 | } | ||
| 472 | |||
| 473 | // Node 6 Additional Loss Coefficient | ||
| 474 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node6AdditionalLossCoefficient(); |
| 475 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
|
9 | if (value && (num_nodes >= 6)) { |
| 476 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setDouble(WaterHeater_StratifiedFields::Node6AdditionalLossCoefficient, value.get()); |
| 477 | } | ||
| 478 | |||
| 479 | // Node 7 Additional Loss Coefficient | ||
| 480 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node7AdditionalLossCoefficient(); |
| 481 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 7)) { |
| 482 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node7AdditionalLossCoefficient, value.get()); | |
| 483 | } | ||
| 484 | |||
| 485 | // Node 8 Additional Loss Coefficient | ||
| 486 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node8AdditionalLossCoefficient(); |
| 487 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 8)) { |
| 488 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node8AdditionalLossCoefficient, value.get()); | |
| 489 | } | ||
| 490 | |||
| 491 | // Node 9 Additional Loss Coefficient | ||
| 492 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node9AdditionalLossCoefficient(); |
| 493 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 9)) { |
| 494 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node9AdditionalLossCoefficient, value.get()); | |
| 495 | } | ||
| 496 | |||
| 497 | // Node 10 Additional Loss Coefficient | ||
| 498 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node10AdditionalLossCoefficient(); |
| 499 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 10)) { |
| 500 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node10AdditionalLossCoefficient, value.get()); | |
| 501 | } | ||
| 502 | |||
| 503 | // Node 11 Additional Loss Coefficient | ||
| 504 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node11AdditionalLossCoefficient(); |
| 505 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 11)) { |
| 506 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node11AdditionalLossCoefficient, value.get()); | |
| 507 | } | ||
| 508 | |||
| 509 | // Node 12 Additional Loss Coefficient | ||
| 510 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | value = modelObject.node12AdditionalLossCoefficient(); |
| 511 |
3/6✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 9 times.
|
9 | if (value && (num_nodes >= 12)) { |
| 512 | ✗ | idfObject.setDouble(WaterHeater_StratifiedFields::Node12AdditionalLossCoefficient, value.get()); | |
| 513 | } | ||
| 514 | |||
| 515 | // Source Side Flow Control Mode | ||
| 516 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | s = modelObject.sourceSideFlowControlMode(); |
| 517 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (s) { |
| 518 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(WaterHeater_StratifiedFields::SourceSideFlowControlMode, s.get()); |
| 519 | } | ||
| 520 | |||
| 521 | // Indirect Alternate Setpoint Temperature Schedule Name | ||
| 522 |
1/1✓ Branch 1 taken 9 times.
|
9 | schedule = modelObject.indirectAlternateSetpointTemperatureSchedule(); |
| 523 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if (schedule) { |
| 524 | ✗ | auto _schedule = translateAndMapModelObject(schedule.get()); | |
| 525 | |||
| 526 | ✗ | if (_schedule) { | |
| 527 | ✗ | idfObject.setString(WaterHeater_StratifiedFields::IndirectAlternateSetpointTemperatureScheduleName, _schedule->name().get()); | |
| 528 | } | ||
| 529 | ✗ | } | |
| 530 | |||
| 531 |
1/1✓ Branch 1 taken 9 times.
|
9 | return boost::optional<IdfObject>(idfObject); |
| 532 | 18 | } | |
| 533 | |||
| 534 | } // namespace energyplus | ||
| 535 | |||
| 536 | } // namespace openstudio | ||
| 537 |