src/energyplus/ForwardTranslator/ForwardTranslateWaterHeaterHeatPump.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/WaterHeaterHeatPump.hpp" | ||
| 8 | #include "../../model/WaterHeaterHeatPump_Impl.hpp" | ||
| 9 | #include "../../model/WaterHeaterMixed.hpp" | ||
| 10 | #include "../../model/WaterHeaterMixed_Impl.hpp" | ||
| 11 | #include "../../model/WaterHeaterStratified.hpp" | ||
| 12 | #include "../../model/WaterHeaterStratified_Impl.hpp" | ||
| 13 | #include "../../model/CoilWaterHeatingAirToWaterHeatPump.hpp" | ||
| 14 | #include "../../model/CoilWaterHeatingAirToWaterHeatPump_Impl.hpp" | ||
| 15 | #include "../../model/CoilWaterHeatingAirToWaterHeatPumpVariableSpeed.hpp" | ||
| 16 | #include "../../model/CoilWaterHeatingAirToWaterHeatPumpVariableSpeed_Impl.hpp" | ||
| 17 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource.hpp" | ||
| 18 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource_Impl.hpp" | ||
| 19 | #include "../../model/Model.hpp" | ||
| 20 | #include "../../model/Schedule.hpp" | ||
| 21 | #include "../../model/Schedule_Impl.hpp" | ||
| 22 | #include "../../model/Curve.hpp" | ||
| 23 | #include "../../model/Curve_Impl.hpp" | ||
| 24 | #include "../../model/ThermalZone.hpp" | ||
| 25 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 26 | #include "../../model/Node.hpp" | ||
| 27 | #include "../../model/Node_Impl.hpp" | ||
| 28 | #include "../../utilities/core/Assert.hpp" | ||
| 29 | #include <utilities/idd/WaterHeater_HeatPump_PumpedCondenser_FieldEnums.hxx> | ||
| 30 | #include <utilities/idd/Coil_WaterHeating_AirToWaterHeatPump_Pumped_FieldEnums.hxx> | ||
| 31 | #include <utilities/idd/Coil_WaterHeating_AirToWaterHeatPump_VariableSpeed_FieldEnums.hxx> | ||
| 32 | #include <utilities/idd/CoilSystem_IntegratedHeatPump_AirSource_FieldEnums.hxx> | ||
| 33 | #include <utilities/idd/WaterHeater_Mixed_FieldEnums.hxx> | ||
| 34 | #include <utilities/idd/WaterHeater_Stratified_FieldEnums.hxx> | ||
| 35 | #include <utilities/idd/Fan_OnOff_FieldEnums.hxx> | ||
| 36 | #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx> | ||
| 37 | #include <utilities/idd/IddEnums.hxx> | ||
| 38 | |||
| 39 | using namespace openstudio::model; | ||
| 40 | using namespace std; | ||
| 41 | |||
| 42 | namespace openstudio { | ||
| 43 | |||
| 44 | namespace energyplus { | ||
| 45 | |||
| 46 | 3 | boost::optional<IdfObject> ForwardTranslator::translateWaterHeaterHeatPump(WaterHeaterHeatPump& modelObject) { | |
| 47 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject idfObject(IddObjectType::WaterHeater_HeatPump_PumpedCondenser); |
| 48 |
1/1✓ Branch 1 taken 3 times.
|
3 | m_idfObjects.push_back(idfObject); |
| 49 | |||
| 50 | // Name | ||
| 51 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto s = modelObject.name()) { |
| 52 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idfObject.setName(*s); |
| 53 | 3 | } | |
| 54 | |||
| 55 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
6 | if (auto mo = modelObject.availabilitySchedule()) { |
| 56 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::AvailabilityScheduleName, mo->name().get()); | |
| 57 | 3 | } | |
| 58 | |||
| 59 | { | ||
| 60 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto mo = modelObject.compressorSetpointTemperatureSchedule(); |
| 61 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CompressorSetpointTemperatureScheduleName, mo.name().get()); |
| 62 | 3 | } | |
| 63 | |||
| 64 | { | ||
| 65 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.deadBandTemperatureDifference(); |
| 66 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::DeadBandTemperatureDifference, value); |
| 67 | } | ||
| 68 | |||
| 69 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.isCondenserWaterFlowRateAutosized()) { |
| 70 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CondenserWaterFlowRate, "Autosize"); |
| 71 | ✗ | } else if (auto value = modelObject.condenserWaterFlowRate()) { | |
| 72 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::CondenserWaterFlowRate, value.get()); | |
| 73 | } | ||
| 74 | |||
| 75 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
3 | if (modelObject.isEvaporatorAirFlowRateAutosized()) { |
| 76 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::EvaporatorAirFlowRate, "Autosize"); |
| 77 | ✗ | } else if (auto value = modelObject.evaporatorAirFlowRate()) { | |
| 78 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::EvaporatorAirFlowRate, value.get()); | |
| 79 | } | ||
| 80 | |||
| 81 | { | ||
| 82 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.inletAirConfiguration(); |
| 83 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirConfiguration, value); |
| 84 | |||
| 85 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(value, "Schedule")) { |
| 86 | ✗ | if (auto mo = modelObject.inletAirTemperatureSchedule()) { | |
| 87 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirTemperatureScheduleName, mo->name().get()); | |
| 88 | ✗ | } | |
| 89 | |||
| 90 | ✗ | if (auto mo = modelObject.inletAirHumiditySchedule()) { | |
| 91 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirHumidityScheduleName, mo->name().get()); | |
| 92 | ✗ | } | |
| 93 | } | ||
| 94 | |||
| 95 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(value, "ZoneAndOutdoorAir")) { |
| 96 | ✗ | auto mo = modelObject.inletAirMixerSchedule(); | |
| 97 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirMixerScheduleName, mo.name().get()); | |
| 98 | ✗ | } | |
| 99 | 3 | } | |
| 100 | |||
| 101 | { | ||
| 102 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.minimumInletAirTemperatureforCompressorOperation(); |
| 103 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::MinimumInletAirTemperatureforCompressorOperation, value); |
| 104 | } | ||
| 105 | |||
| 106 | { | ||
| 107 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.maximumInletAirTemperatureforCompressorOperation(); |
| 108 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::MaximumInletAirTemperatureforCompressorOperation, value); |
| 109 | } | ||
| 110 | |||
| 111 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::MaximumInletAirTemperatureforCompressorOperation, 94); |
| 112 | |||
| 113 | { | ||
| 114 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.compressorLocation(); |
| 115 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CompressorLocation, value); |
| 116 | |||
| 117 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
|
6 | if (istringEqual(value, "Schedule")) { |
| 118 | ✗ | if (auto mo = modelObject.compressorAmbientTemperatureSchedule()) { | |
| 119 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CompressorAmbientTemperatureScheduleName, mo->name().get()); | |
| 120 | ✗ | } | |
| 121 | } | ||
| 122 | 3 | } | |
| 123 | |||
| 124 | { | ||
| 125 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.fanPlacement(); |
| 126 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::FanPlacement, value); |
| 127 | 3 | } | |
| 128 | |||
| 129 | { | ||
| 130 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.onCycleParasiticElectricLoad(); |
| 131 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::OnCycleParasiticElectricLoad, value); |
| 132 | } | ||
| 133 | |||
| 134 | { | ||
| 135 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.offCycleParasiticElectricLoad(); |
| 136 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::OffCycleParasiticElectricLoad, value); |
| 137 | } | ||
| 138 | |||
| 139 | { | ||
| 140 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.parasiticHeatRejectionLocation(); |
| 141 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::ParasiticHeatRejectionLocation, value); |
| 142 | 3 | } | |
| 143 | |||
| 144 | { | ||
| 145 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto value = modelObject.tankElementControlLogic(); |
| 146 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankElementControlLogic, value); |
| 147 | 3 | } | |
| 148 | |||
| 149 | { | ||
| 150 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto tank = modelObject.tank(); |
| 151 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
6 | if (auto stratifiedTank = tank.optionalCast<model::WaterHeaterStratified>()) { |
| 152 | ✗ | auto value = modelObject.controlSensorLocationInStratifiedTank(); | |
| 153 | ✗ | if (istringEqual(value, "Heater1")) { | |
| 154 | ✗ | auto height = stratifiedTank->heater1Height(); | |
| 155 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height); | |
| 156 | ✗ | } else if (istringEqual(value, "Heater2")) { | |
| 157 | ✗ | auto height = stratifiedTank->heater2Height(); | |
| 158 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height); | |
| 159 | ✗ | } else if (istringEqual(value, "SourceInlet")) { | |
| 160 | ✗ | if (auto height = stratifiedTank->sourceSideInletHeight()) { | |
| 161 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height.get()); | |
| 162 | } | ||
| 163 | ✗ | } else if (istringEqual(value, "SourceOutlet")) { | |
| 164 | ✗ | auto height = stratifiedTank->sourceSideOutletHeight(); | |
| 165 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height); | |
| 166 | ✗ | } else if (istringEqual(value, "UseInlet")) { | |
| 167 | ✗ | auto height = stratifiedTank->useSideInletHeight(); | |
| 168 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height); | |
| 169 | ✗ | } else if (istringEqual(value, "UseOutlet")) { | |
| 170 | ✗ | if (auto height = stratifiedTank->useSideOutletHeight()) { | |
| 171 | ✗ | idfObject.setDouble(WaterHeater_HeatPump_PumpedCondenserFields::ControlSensor1HeightInStratifiedTank, height.get()); | |
| 172 | } | ||
| 173 | } | ||
| 174 | 3 | } | |
| 175 | 3 | } | |
| 176 | |||
| 177 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | std::string condOutletTankInletNodeName = modelObject.name().get() + " Condenser Outlet - Tank Inlet"; |
| 178 | |||
| 179 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | std::string tankOutletCondInletNodeName = modelObject.name().get() + " Tank Outlet - Condenser Inlet"; |
| 180 | |||
| 181 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CondenserWaterInletNodeName, tankOutletCondInletNodeName); |
| 182 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::CondenserWaterOutletNodeName, condOutletTankInletNodeName); |
| 183 | |||
| 184 | 3 | std::string airInletNodeName; | |
| 185 | 3 | std::string airOutletNodeName; | |
| 186 | 3 | std::string outdoorAirNodeName; | |
| 187 | 3 | std::string exhaustAirNodeName; | |
| 188 | 3 | std::string inletAirZoneName; | |
| 189 | 3 | std::string inletAirMixerNodeName; | |
| 190 | 3 | std::string outletAirSplitterNodeName; | |
| 191 | 3 | std::string fanInletNodeName; | |
| 192 | 3 | std::string fanOutletNodeName; | |
| 193 | 3 | std::string evapInletNodeName; | |
| 194 | 3 | std::string evapOutletNodeName; | |
| 195 | |||
| 196 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto inletAirConfiguration = modelObject.inletAirConfiguration(); |
| 197 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
|
6 | if (istringEqual(modelObject.fanPlacement(), "DrawThrough")) { |
| 198 | |||
| 199 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
6 | if (istringEqual(inletAirConfiguration, "ZoneAirOnly")) { |
| 200 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto thermalZone = modelObject.thermalZone()) { |
| 201 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto inletNode = modelObject.inletNode(); |
| 202 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(inletNode); |
| 203 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | airInletNodeName = inletNode->name().get(); |
| 204 | |||
| 205 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto outletNode = modelObject.outletNode(); |
| 206 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(outletNode); |
| 207 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | airOutletNodeName = outletNode->name().get(); |
| 208 | |||
| 209 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | inletAirZoneName = thermalZone->name().get(); |
| 210 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet"; |
| 211 |
1/1✓ Branch 1 taken 3 times.
|
3 | fanOutletNodeName = airOutletNodeName; |
| 212 |
1/1✓ Branch 1 taken 3 times.
|
3 | evapInletNodeName = airInletNodeName; |
| 213 |
1/1✓ Branch 1 taken 3 times.
|
3 | evapOutletNodeName = fanInletNodeName; |
| 214 | 6 | } | |
| 215 | ✗ | } else if (istringEqual(inletAirConfiguration, "ZoneAndOutdoorAir")) { | |
| 216 | ✗ | if (auto thermalZone = modelObject.thermalZone()) { | |
| 217 | ✗ | auto inletNode = modelObject.inletNode(); | |
| 218 | ✗ | OS_ASSERT(inletNode); | |
| 219 | ✗ | airInletNodeName = inletNode->name().get(); | |
| 220 | |||
| 221 | ✗ | auto outletNode = modelObject.outletNode(); | |
| 222 | ✗ | OS_ASSERT(outletNode); | |
| 223 | ✗ | airOutletNodeName = outletNode->name().get(); | |
| 224 | |||
| 225 | ✗ | outdoorAirNodeName = modelObject.name().get() + " Outdoor Air"; | |
| 226 | ✗ | exhaustAirNodeName = modelObject.name().get() + " Exhaust Air"; | |
| 227 | ✗ | inletAirZoneName = thermalZone->name().get(); | |
| 228 | ✗ | inletAirMixerNodeName = modelObject.name().get() + " Mixer Outlet - Evap Inlet"; | |
| 229 | ✗ | outletAirSplitterNodeName = modelObject.name().get() + " Fan Outlet - Splitter Inlet"; | |
| 230 | ✗ | fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet"; | |
| 231 | ✗ | fanOutletNodeName = outletAirSplitterNodeName; | |
| 232 | ✗ | evapInletNodeName = inletAirMixerNodeName; | |
| 233 | ✗ | evapOutletNodeName = fanInletNodeName; | |
| 234 | ✗ | } | |
| 235 | ✗ | } else if (istringEqual(inletAirConfiguration, "OutdoorAirOnly")) { | |
| 236 | ✗ | outdoorAirNodeName = modelObject.name().get() + " Outdoor Air"; | |
| 237 | ✗ | exhaustAirNodeName = modelObject.name().get() + " Exhaust Air"; | |
| 238 | ✗ | fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet"; | |
| 239 | ✗ | fanOutletNodeName = exhaustAirNodeName; | |
| 240 | ✗ | evapInletNodeName = outdoorAirNodeName; | |
| 241 | ✗ | evapOutletNodeName = fanInletNodeName; | |
| 242 | ✗ | } else if (istringEqual(inletAirConfiguration, "Schedule")) { | |
| 243 | ✗ | airInletNodeName = modelObject.name().get() + " Inlet"; | |
| 244 | ✗ | airOutletNodeName = modelObject.name().get() + " Outlet"; | |
| 245 | ✗ | fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet"; | |
| 246 | ✗ | fanOutletNodeName = airOutletNodeName; | |
| 247 | ✗ | evapInletNodeName = airInletNodeName; | |
| 248 | ✗ | evapOutletNodeName = fanInletNodeName; | |
| 249 | } | ||
| 250 | |||
| 251 | } else { // BlowThrough | ||
| 252 | |||
| 253 | ✗ | if (istringEqual(inletAirConfiguration, "ZoneAirOnly")) { | |
| 254 | ✗ | if (auto thermalZone = modelObject.thermalZone()) { | |
| 255 | ✗ | auto inletNode = modelObject.inletNode(); | |
| 256 | ✗ | OS_ASSERT(inletNode); | |
| 257 | ✗ | airInletNodeName = inletNode->name().get(); | |
| 258 | |||
| 259 | ✗ | auto outletNode = modelObject.outletNode(); | |
| 260 | ✗ | OS_ASSERT(outletNode); | |
| 261 | ✗ | airOutletNodeName = outletNode->name().get(); | |
| 262 | |||
| 263 | ✗ | inletAirZoneName = thermalZone->name().get(); | |
| 264 | ✗ | fanInletNodeName = airInletNodeName; | |
| 265 | ✗ | fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet"; | |
| 266 | ✗ | evapInletNodeName = fanOutletNodeName; | |
| 267 | ✗ | evapOutletNodeName = airOutletNodeName; | |
| 268 | ✗ | } | |
| 269 | ✗ | } else if (istringEqual(inletAirConfiguration, "ZoneAndOutdoorAir")) { | |
| 270 | ✗ | if (auto thermalZone = modelObject.thermalZone()) { | |
| 271 | ✗ | auto inletNode = modelObject.inletNode(); | |
| 272 | ✗ | OS_ASSERT(inletNode); | |
| 273 | ✗ | airInletNodeName = inletNode->name().get(); | |
| 274 | |||
| 275 | ✗ | auto outletNode = modelObject.outletNode(); | |
| 276 | ✗ | OS_ASSERT(outletNode); | |
| 277 | ✗ | airOutletNodeName = outletNode->name().get(); | |
| 278 | |||
| 279 | ✗ | outdoorAirNodeName = modelObject.name().get() + " Outdoor Air"; | |
| 280 | ✗ | exhaustAirNodeName = modelObject.name().get() + " Exhaust Air"; | |
| 281 | ✗ | inletAirZoneName = thermalZone->name().get(); | |
| 282 | ✗ | inletAirMixerNodeName = modelObject.name().get() + " Mixer Outlet - Fan Inlet"; | |
| 283 | ✗ | outletAirSplitterNodeName = modelObject.name().get() + " Evap Outlet - Splitter Inlet"; | |
| 284 | ✗ | fanInletNodeName = inletAirMixerNodeName; | |
| 285 | ✗ | fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet"; | |
| 286 | ✗ | evapInletNodeName = fanOutletNodeName; | |
| 287 | ✗ | evapOutletNodeName = outletAirSplitterNodeName; | |
| 288 | ✗ | } | |
| 289 | ✗ | } else if (istringEqual(inletAirConfiguration, "OutdoorAirOnly")) { | |
| 290 | ✗ | outdoorAirNodeName = modelObject.name().get() + " Outdoor Air"; | |
| 291 | ✗ | exhaustAirNodeName = modelObject.name().get() + " Exhaust Air"; | |
| 292 | ✗ | fanInletNodeName = outdoorAirNodeName; | |
| 293 | ✗ | fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet"; | |
| 294 | ✗ | evapInletNodeName = fanOutletNodeName; | |
| 295 | ✗ | evapOutletNodeName = exhaustAirNodeName; | |
| 296 | ✗ | } else if (istringEqual(inletAirConfiguration, "Schedule")) { | |
| 297 | ✗ | airInletNodeName = modelObject.name().get() + " Inlet"; | |
| 298 | ✗ | airOutletNodeName = modelObject.name().get() + " Outlet"; | |
| 299 | ✗ | fanInletNodeName = airInletNodeName; | |
| 300 | ✗ | fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet"; | |
| 301 | ✗ | evapInletNodeName = fanOutletNodeName; | |
| 302 | ✗ | evapOutletNodeName = airOutletNodeName; | |
| 303 | } | ||
| 304 | } | ||
| 305 | |||
| 306 | { | ||
| 307 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto mo = modelObject.tank(); |
| 308 |
2/3✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
|
6 | if (auto idf = translateAndMapModelObject(mo)) { |
| 309 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankName, idf->name().get()); | |
| 310 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankObjectType, idf->iddObject().name()); | |
| 311 | ✗ | if (mo.iddObjectType() == model::WaterHeaterMixed::iddObjectType()) { | |
| 312 | ✗ | idf->setString(WaterHeater_MixedFields::SourceSideOutletNodeName, tankOutletCondInletNodeName); | |
| 313 | ✗ | idf->setString(WaterHeater_MixedFields::SourceSideInletNodeName, condOutletTankInletNodeName); | |
| 314 | ✗ | auto waterHeaterMixed = mo.cast<model::WaterHeaterMixed>(); | |
| 315 | ✗ | if (auto node = waterHeaterMixed.supplyInletModelObject()) { | |
| 316 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankUseSideInletNodeName, node->name().get()); | |
| 317 | ✗ | } | |
| 318 | ✗ | if (auto node = waterHeaterMixed.supplyOutletModelObject()) { | |
| 319 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankUseSideOutletNodeName, node->name().get()); | |
| 320 | ✗ | } | |
| 321 | ✗ | } else if (mo.iddObjectType() == model::WaterHeaterStratified::iddObjectType()) { | |
| 322 | ✗ | idf->setString(WaterHeater_StratifiedFields::SourceSideOutletNodeName, tankOutletCondInletNodeName); | |
| 323 | ✗ | idf->setString(WaterHeater_StratifiedFields::SourceSideInletNodeName, condOutletTankInletNodeName); | |
| 324 | ✗ | auto waterHeaterStratified = mo.cast<model::WaterHeaterStratified>(); | |
| 325 | ✗ | if (auto node = waterHeaterStratified.supplyInletModelObject()) { | |
| 326 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankUseSideInletNodeName, node->name().get()); | |
| 327 | ✗ | } | |
| 328 | ✗ | if (auto node = waterHeaterStratified.supplyOutletModelObject()) { | |
| 329 | ✗ | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::TankUseSideOutletNodeName, node->name().get()); | |
| 330 | ✗ | } | |
| 331 | ✗ | } else { | |
| 332 | ✗ | LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of tank: " << mo.briefDescription()); | |
| 333 | } | ||
| 334 | 3 | } | |
| 335 | 3 | } | |
| 336 | |||
| 337 | { | ||
| 338 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto mo = modelObject.dXCoil(); |
| 339 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto idf = translateAndMapModelObject(mo)) { |
| 340 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::DXCoilName, idf->name().get()); |
| 341 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::DXCoilObjectType, idf->iddObject().name()); |
| 342 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 2 times.
|
3 | if (mo.iddObjectType() == model::CoilWaterHeatingAirToWaterHeatPump::iddObjectType()) { |
| 343 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_PumpedFields::CondenserWaterInletNodeName, tankOutletCondInletNodeName); |
| 344 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_PumpedFields::CondenserWaterOutletNodeName, condOutletTankInletNodeName); |
| 345 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_PumpedFields::EvaporatorAirInletNodeName, evapInletNodeName); |
| 346 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_PumpedFields::EvaporatorAirOutletNodeName, evapOutletNodeName); |
| 347 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
|
2 | } else if (mo.iddObjectType() == model::CoilWaterHeatingAirToWaterHeatPumpVariableSpeed::iddObjectType()) { |
| 348 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterInletNodeName, tankOutletCondInletNodeName); |
| 349 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterOutletNodeName, condOutletTankInletNodeName); |
| 350 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirInletNodeName, evapInletNodeName); |
| 351 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirOutletNodeName, evapOutletNodeName); |
| 352 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
1 | } else if (mo.iddObjectType() == model::CoilSystemIntegratedHeatPumpAirSource::iddObjectType()) { |
| 353 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idf->setString(CoilSystem_IntegratedHeatPump_AirSourceFields::SupplyHotWaterFlowSensorNodeName, condOutletTankInletNodeName); |
| 354 | |||
| 355 | boost::optional<CoilSystemIntegratedHeatPumpAirSource> coilSystemIntegratedHeatPumpAirSource = | ||
| 356 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | mo.cast<CoilSystemIntegratedHeatPumpAirSource>(); |
| 357 | |||
| 358 |
4/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 11 taken 1 time.
✗ Branch 12 not taken.
|
2 | if (boost::optional<HVACComponent> dedicatedWaterHeatingCoil = coilSystemIntegratedHeatPumpAirSource->dedicatedWaterHeatingCoil()) { |
| 359 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _dedicatedWaterHeatingCoil = translateAndMapModelObject(dedicatedWaterHeatingCoil.get()); |
| 360 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _dedicatedWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterInletNodeName, |
| 361 | tankOutletCondInletNodeName); | ||
| 362 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _dedicatedWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterOutletNodeName, |
| 363 | condOutletTankInletNodeName); | ||
| 364 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _dedicatedWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirInletNodeName, |
| 365 | evapInletNodeName); | ||
| 366 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _dedicatedWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirOutletNodeName, |
| 367 | evapOutletNodeName); | ||
| 368 | 2 | } | |
| 369 | |||
| 370 |
4/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 11 taken 1 time.
✗ Branch 12 not taken.
|
2 | if (boost::optional<HVACComponent> scwhCoil = coilSystemIntegratedHeatPumpAirSource->scwhCoil()) { |
| 371 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scwhCoil = translateAndMapModelObject(scwhCoil.get()); |
| 372 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scwhCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterInletNodeName, tankOutletCondInletNodeName); |
| 373 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scwhCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterOutletNodeName, condOutletTankInletNodeName); |
| 374 | 2 | } | |
| 375 | |||
| 376 |
4/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 11 taken 1 time.
✗ Branch 12 not taken.
|
2 | if (boost::optional<HVACComponent> scdwhWaterHeatingCoil = coilSystemIntegratedHeatPumpAirSource->scdwhWaterHeatingCoil()) { |
| 377 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scdwhWaterHeatingCoil = translateAndMapModelObject(scdwhWaterHeatingCoil.get()); |
| 378 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterInletNodeName, |
| 379 | tankOutletCondInletNodeName); | ||
| 380 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterOutletNodeName, |
| 381 | condOutletTankInletNodeName); | ||
| 382 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirInletNodeName, |
| 383 | evapInletNodeName); | ||
| 384 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirOutletNodeName, |
| 385 | evapOutletNodeName); | ||
| 386 | 2 | } | |
| 387 | |||
| 388 |
4/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 11 taken 1 time.
✗ Branch 12 not taken.
|
2 | if (boost::optional<HVACComponent> shdwhWaterHeatingCoil = coilSystemIntegratedHeatPumpAirSource->shdwhWaterHeatingCoil()) { |
| 389 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _shdwhWaterHeatingCoil = translateAndMapModelObject(shdwhWaterHeatingCoil.get()); |
| 390 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterInletNodeName, |
| 391 | tankOutletCondInletNodeName); | ||
| 392 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::CondenserWaterOutletNodeName, |
| 393 | condOutletTankInletNodeName); | ||
| 394 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirInletNodeName, |
| 395 | evapInletNodeName); | ||
| 396 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhWaterHeatingCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirOutletNodeName, |
| 397 | evapOutletNodeName); | ||
| 398 | 2 | } | |
| 399 | 1 | } else { | |
| 400 | ✗ | LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of coil: " << mo.briefDescription()); | |
| 401 | } | ||
| 402 | 3 | } | |
| 403 | 3 | } | |
| 404 | |||
| 405 | { | ||
| 406 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto mo = modelObject.fan(); |
| 407 |
2/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
|
6 | if (auto idf = translateAndMapModelObject(mo)) { |
| 408 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::FanName, idf->name().get()); |
| 409 |
4/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::FanObjectType, idf->iddObject().name()); |
| 410 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
|
3 | if (mo.iddObjectType() == IddObjectType::OS_Fan_OnOff) { |
| 411 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idf->setString(Fan_OnOffFields::AirInletNodeName, fanInletNodeName); |
| 412 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | idf->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); |
| 413 | ✗ | } else if (mo.iddObjectType() == IddObjectType::OS_Fan_SystemModel) { | |
| 414 | ✗ | idf->setString(Fan_SystemModelFields::AirInletNodeName, fanInletNodeName); | |
| 415 | ✗ | idf->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 416 | } else { | ||
| 417 | ✗ | LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of fan: " << mo.briefDescription()); | |
| 418 | } | ||
| 419 | 3 | } | |
| 420 | 3 | } | |
| 421 | |||
| 422 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::AirInletNodeName, airInletNodeName); |
| 423 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::AirOutletNodeName, airOutletNodeName); |
| 424 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::OutdoorAirNodeName, outdoorAirNodeName); |
| 425 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::ExhaustAirNodeName, exhaustAirNodeName); |
| 426 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirZoneName, inletAirZoneName); |
| 427 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::InletAirMixerNodeName, inletAirMixerNodeName); |
| 428 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setString(WaterHeater_HeatPump_PumpedCondenserFields::OutletAirSplitterNodeName, outletAirSplitterNodeName); |
| 429 | |||
| 430 |
1/1✓ Branch 1 taken 3 times.
|
6 | return idfObject; |
| 431 | 3 | } | |
| 432 | |||
| 433 | } // namespace energyplus | ||
| 434 | } // namespace openstudio | ||
| 435 |