src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACWaterToAirHeatPump.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/AirLoopHVAC.hpp" | ||
| 11 | #include "../../model/AirLoopHVAC_Impl.hpp" | ||
| 12 | #include "../../model/Node.hpp" | ||
| 13 | #include "../../model/Node_Impl.hpp" | ||
| 14 | #include "../../model/ThermalZone.hpp" | ||
| 15 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 16 | #include "../../model/ZoneHVACWaterToAirHeatPump.hpp" | ||
| 17 | #include "../../model/ZoneHVACWaterToAirHeatPump_Impl.hpp" | ||
| 18 | #include "../../model/FanOnOff.hpp" | ||
| 19 | #include "../../model/FanOnOff_Impl.hpp" | ||
| 20 | #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp" | ||
| 21 | #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp" | ||
| 22 | #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp" | ||
| 23 | #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" | ||
| 24 | #include "../../model/CoilHeatingElectric.hpp" | ||
| 25 | #include "../../model/CoilHeatingElectric_Impl.hpp" | ||
| 26 | #include "../../model/CoilHeatingGas.hpp" | ||
| 27 | #include "../../model/CoilHeatingGas_Impl.hpp" | ||
| 28 | #include "../../model/CoilHeatingWater.hpp" | ||
| 29 | #include "../../model/CoilHeatingWater_Impl.hpp" | ||
| 30 | #include <utilities/idd/ZoneHVAC_WaterToAirHeatPump_FieldEnums.hxx> | ||
| 31 | #include <utilities/idd/OutdoorAir_Mixer_FieldEnums.hxx> | ||
| 32 | #include <utilities/idd/Fan_OnOff_FieldEnums.hxx> | ||
| 33 | #include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx> | ||
| 34 | #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx> | ||
| 35 | #include <utilities/idd/Coil_Cooling_WaterToAirHeatPump_EquationFit_FieldEnums.hxx> | ||
| 36 | #include <utilities/idd/Coil_Heating_WaterToAirHeatPump_EquationFit_FieldEnums.hxx> | ||
| 37 | #include <utilities/idd/Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit_FieldEnums.hxx> | ||
| 38 | #include <utilities/idd/Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFit_FieldEnums.hxx> | ||
| 39 | #include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx> | ||
| 40 | #include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx> | ||
| 41 | #include <utilities/idd/Coil_Heating_Water_FieldEnums.hxx> | ||
| 42 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 43 | #include "../../utilities/math/FloatCompare.hpp" | ||
| 44 | #include <utilities/idd/IddEnums.hxx> | ||
| 45 | #include <utilities/idd/IddFactory.hxx> | ||
| 46 | |||
| 47 | using namespace openstudio::model; | ||
| 48 | |||
| 49 | namespace openstudio { | ||
| 50 | |||
| 51 | namespace energyplus { | ||
| 52 | |||
| 53 | 2 | boost::optional<IdfObject> ForwardTranslator::translateZoneHVACWaterToAirHeatPump(ZoneHVACWaterToAirHeatPump& modelObject) { | |
| 54 | 2 | boost::optional<std::string> s; | |
| 55 | 2 | boost::optional<double> value; | |
| 56 | |||
| 57 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject idfObject(IddObjectType::ZoneHVAC_WaterToAirHeatPump); |
| 58 | |||
| 59 |
1/1✓ Branch 1 taken 2 times.
|
2 | m_idfObjects.push_back(idfObject); |
| 60 | |||
| 61 | // Name | ||
| 62 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | std::string baseName = modelObject.name().get(); |
| 63 | |||
| 64 |
1/1✓ Branch 1 taken 2 times.
|
2 | idfObject.setName(baseName); |
| 65 | |||
| 66 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string mixedAirNodeName = baseName + " Mixed Air Node"; |
| 67 | |||
| 68 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string coolingCoilOutletNodeName = baseName + " Cooling Coil Outlet Node"; |
| 69 | |||
| 70 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string heatingCoilOutletNodeName = baseName + " Heating Coil Outlet Node"; |
| 71 | |||
| 72 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string fanOutletNodeName = baseName + " Fan Outlet Node"; |
| 73 | |||
| 74 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string reliefAirNodeName = baseName + " Relief Air Node"; |
| 75 | |||
| 76 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string oaNodeName = baseName + " OA Node"; |
| 77 | |||
| 78 | 2 | std::string airInletNodeName; | |
| 79 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (auto node = modelObject.inletNode()) { |
| 80 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | airInletNodeName = node->nameString(); |
| 81 | 2 | } | |
| 82 | |||
| 83 | 2 | std::string airOutletNodeName; | |
| 84 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (auto node = modelObject.outletNode()) { |
| 85 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | airOutletNodeName = node->nameString(); |
| 86 | 2 | } | |
| 87 | |||
| 88 | 4 | auto translateMixer = [&]() { | |
| 89 |
1/1✓ Branch 1 taken 4 times.
|
4 | auto t_airLoopHVAC = modelObject.airLoopHVAC(); |
| 90 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | if (t_airLoopHVAC) { |
| 91 | ✗ | return false; | |
| 92 | } | ||
| 93 | |||
| 94 | 4 | bool zeroOA = false; | |
| 95 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
|
8 | if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) { |
| 96 |
1/1✓ Branch 2 taken 4 times.
|
4 | zeroOA = equal(value.get(), 0.0); |
| 97 | } | ||
| 98 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
|
8 | if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) { |
| 99 |
1/5✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
|
4 | zeroOA = (zeroOA && equal(value.get(), 0.0)); |
| 100 | } | ||
| 101 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
|
8 | if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) { |
| 102 |
1/5✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
|
4 | zeroOA = (zeroOA && equal(value.get(), 0.0)); |
| 103 | } | ||
| 104 | |||
| 105 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | if (zeroOA) { |
| 106 | ✗ | return false; | |
| 107 | } | ||
| 108 | |||
| 109 | 4 | return true; | |
| 110 | 4 | }; | |
| 111 | |||
| 112 | // AvailabilityScheduleName | ||
| 113 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
|
4 | if (boost::optional<Schedule> schedule = modelObject.availabilitySchedule()) { |
| 114 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) { |
| 115 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::AvailabilityScheduleName, _schedule->name().get()); |
| 116 | 2 | } | |
| 117 | 2 | } | |
| 118 | |||
| 119 | // AirInletNodeName | ||
| 120 |
1/1✓ Branch 1 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::AirInletNodeName, airInletNodeName); |
| 121 | |||
| 122 | // AirOutletNodeName | ||
| 123 |
1/1✓ Branch 1 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::AirOutletNodeName, airOutletNodeName); |
| 124 | |||
| 125 | // Outdoor Air Mixer | ||
| 126 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
2 | if (translateMixer()) { |
| 127 |
1/1✓ Branch 1 taken 2 times.
|
2 | std::string oaMixerName = baseName + " OA Mixer"; |
| 128 | |||
| 129 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject _outdoorAirMixer(IddObjectType::OutdoorAir_Mixer); |
| 130 |
1/1✓ Branch 1 taken 2 times.
|
2 | _outdoorAirMixer.setName(oaMixerName); |
| 131 |
1/1✓ Branch 1 taken 2 times.
|
2 | m_idfObjects.push_back(_outdoorAirMixer); |
| 132 | |||
| 133 |
1/1✓ Branch 1 taken 2 times.
|
2 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::MixedAirNodeName, mixedAirNodeName); |
| 134 | |||
| 135 |
1/1✓ Branch 1 taken 2 times.
|
2 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::OutdoorAirStreamNodeName, oaNodeName); |
| 136 | |||
| 137 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject _oaNodeList(openstudio::IddObjectType::OutdoorAir_NodeList); |
| 138 |
1/1✓ Branch 1 taken 2 times.
|
2 | _oaNodeList.setString(0, oaNodeName); |
| 139 |
1/1✓ Branch 1 taken 2 times.
|
2 | m_idfObjects.push_back(_oaNodeList); |
| 140 | |||
| 141 |
1/1✓ Branch 1 taken 2 times.
|
2 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReliefAirStreamNodeName, reliefAirNodeName); |
| 142 | |||
| 143 |
1/1✓ Branch 1 taken 2 times.
|
2 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReturnAirStreamNodeName, airInletNodeName); |
| 144 | |||
| 145 | // OutdoorAirMixerObjectType | ||
| 146 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::OutdoorAirMixerObjectType, _outdoorAirMixer.iddObject().name()); |
| 147 | |||
| 148 | // OutdoorAirMixerName | ||
| 149 |
1/1✓ Branch 1 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::OutdoorAirMixerName, oaMixerName); |
| 150 | 2 | } | |
| 151 | |||
| 152 | // SupplyAirFlowRateDuringCoolingOperation | ||
| 153 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isSupplyAirFlowRateDuringCoolingOperationAutosized()) { |
| 154 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::CoolingSupplyAirFlowRate, "Autosize"); | |
| 155 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.supplyAirFlowRateDuringCoolingOperation())) { |
| 156 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::CoolingSupplyAirFlowRate, value.get()); |
| 157 | } | ||
| 158 | |||
| 159 | // SupplyAirFlowRateDuringHeatingOperation | ||
| 160 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isSupplyAirFlowRateDuringHeatingOperationAutosized()) { |
| 161 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::HeatingSupplyAirFlowRate, "Autosize"); | |
| 162 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.supplyAirFlowRateDuringHeatingOperation())) { |
| 163 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::HeatingSupplyAirFlowRate, value.get()); |
| 164 | } | ||
| 165 | |||
| 166 | // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded | ||
| 167 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) { |
| 168 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadSupplyAirFlowRate, "Autosize"); | |
| 169 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded())) { |
| 170 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadSupplyAirFlowRate, value.get()); |
| 171 | } | ||
| 172 | |||
| 173 | // NoLoadSupplyAirFlowRateControlSetToLowSpeed | ||
| 174 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
2 | if (modelObject.noLoadSupplyAirFlowRateControlSetToLowSpeed()) { |
| 175 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "Yes"); |
| 176 | } else { | ||
| 177 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "No"); | |
| 178 | } | ||
| 179 | |||
| 180 | // OutdoorAirFlowRateDuringCoolingOperation | ||
| 181 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isOutdoorAirFlowRateDuringCoolingOperationAutosized()) { |
| 182 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::CoolingOutdoorAirFlowRate, "Autosize"); | |
| 183 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) { |
| 184 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::CoolingOutdoorAirFlowRate, value.get()); |
| 185 | } | ||
| 186 | |||
| 187 | // OutdoorAirFlowRateDuringHeatingOperation | ||
| 188 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isOutdoorAirFlowRateDuringHeatingOperationAutosized()) { |
| 189 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::HeatingOutdoorAirFlowRate, "Autosize"); | |
| 190 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) { |
| 191 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::HeatingOutdoorAirFlowRate, value.get()); |
| 192 | } | ||
| 193 | |||
| 194 | // OutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded | ||
| 195 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) { |
| 196 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadOutdoorAirFlowRate, "Autosize"); | |
| 197 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) { |
| 198 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::NoLoadOutdoorAirFlowRate, value.get()); |
| 199 | } | ||
| 200 | |||
| 201 | // SupplyAirFanObjectType and Name | ||
| 202 |
1/1✓ Branch 1 taken 2 times.
|
2 | HVACComponent supplyAirFan = modelObject.supplyAirFan(); |
| 203 | |||
| 204 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<IdfObject> _supplyAirFan = translateAndMapModelObject(supplyAirFan)) { |
| 205 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::SupplyAirFanObjectType, _supplyAirFan->iddObject().name()); |
| 206 | |||
| 207 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::SupplyAirFanName, _supplyAirFan->name().get()); |
| 208 | |||
| 209 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 1 time.
|
4 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 210 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (translateMixer()) { |
| 211 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { |
| 212 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, mixedAirNodeName); | |
| 213 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName); | |
| 214 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
1 | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { |
| 215 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, mixedAirNodeName); |
| 216 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); |
| 217 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 218 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, mixedAirNodeName); | |
| 219 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 220 | } | ||
| 221 | } else { | ||
| 222 | ✗ | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { | |
| 223 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, airInletNodeName); | |
| 224 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName); | |
| 225 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 226 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, airInletNodeName); | |
| 227 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); | |
| 228 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 229 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, airInletNodeName); | |
| 230 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 231 | } | ||
| 232 | } | ||
| 233 | } else { | ||
| 234 | // Drawthrough position | ||
| 235 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { |
| 236 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 237 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName); | |
| 238 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
1 | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { |
| 239 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, heatingCoilOutletNodeName); |
| 240 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); |
| 241 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 242 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 243 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 244 | } | ||
| 245 | } | ||
| 246 | 2 | } | |
| 247 | |||
| 248 | // HeatingCoilObjectType and Name | ||
| 249 |
1/1✓ Branch 1 taken 2 times.
|
2 | HVACComponent heatingCoil = modelObject.heatingCoil(); |
| 250 | |||
| 251 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<IdfObject> _heatingCoil = translateAndMapModelObject(heatingCoil)) { |
| 252 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::HeatingCoilObjectType, _heatingCoil->iddObject().name()); |
| 253 | |||
| 254 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::HeatingCoilName, _heatingCoil->name().get()); |
| 255 | |||
| 256 |
5/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
|
2 | if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_WaterToAirHeatPump_EquationFit) { |
| 257 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_EquationFitFields::AirInletNodeName, coolingCoilOutletNodeName); |
| 258 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_EquationFitFields::AirOutletNodeName, heatingCoilOutletNodeName); |
| 259 | ✗ | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFit) { | |
| 260 | ✗ | _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirInletNodeName, coolingCoilOutletNodeName); | |
| 261 | ✗ | _heatingCoil->setString(Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirOutletNodeName, heatingCoilOutletNodeName); | |
| 262 | } | ||
| 263 | 2 | } | |
| 264 | |||
| 265 | // CoolingCoilObjectType and Name | ||
| 266 |
1/1✓ Branch 1 taken 2 times.
|
2 | HVACComponent coolingCoil = modelObject.coolingCoil(); |
| 267 | |||
| 268 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<IdfObject> _coolingCoil = translateAndMapModelObject(coolingCoil)) { |
| 269 | 2 | std::string coolingCoilInletNodeName; | |
| 270 | |||
| 271 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 1 time.
|
4 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 272 |
1/1✓ Branch 1 taken 1 time.
|
1 | coolingCoilInletNodeName = fanOutletNodeName; |
| 273 | } else { | ||
| 274 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (translateMixer()) { |
| 275 |
1/1✓ Branch 1 taken 1 time.
|
1 | coolingCoilInletNodeName = mixedAirNodeName; |
| 276 | } else { | ||
| 277 | ✗ | coolingCoilInletNodeName = airInletNodeName; | |
| 278 | } | ||
| 279 | } | ||
| 280 | |||
| 281 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::CoolingCoilObjectType, _coolingCoil->iddObject().name()); |
| 282 | |||
| 283 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::CoolingCoilName, _coolingCoil->name().get()); |
| 284 | |||
| 285 |
5/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
|
2 | if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_WaterToAirHeatPump_EquationFit) { |
| 286 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_EquationFitFields::AirInletNodeName, coolingCoilInletNodeName); |
| 287 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_EquationFitFields::AirOutletNodeName, coolingCoilOutletNodeName); |
| 288 | ✗ | } else if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit) { | |
| 289 | ✗ | _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirInletNodeName, coolingCoilInletNodeName); | |
| 290 | ✗ | _coolingCoil->setString(Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirOutletNodeName, coolingCoilOutletNodeName); | |
| 291 | } | ||
| 292 | 4 | } | |
| 293 | |||
| 294 | // SupplementalHeatingCoilObjectType and SupplementalHeatingCoilName | ||
| 295 |
1/1✓ Branch 1 taken 2 times.
|
2 | HVACComponent supplementalHeatingCoil = modelObject.supplementalHeatingCoil(); |
| 296 | |||
| 297 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<IdfObject> _supplementalHeatingCoil = translateAndMapModelObject(supplementalHeatingCoil)) { |
| 298 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::SupplementalHeatingCoilObjectType, _supplementalHeatingCoil->iddObject().name()); |
| 299 | |||
| 300 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::SupplementalHeatingCoilName, _supplementalHeatingCoil->name().get()); |
| 301 | |||
| 302 |
5/5✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 1 time.
|
4 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 303 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) { |
| 304 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 305 | |||
| 306 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName); | |
| 307 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
1 | } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) { |
| 308 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, heatingCoilOutletNodeName); |
| 309 | |||
| 310 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName); |
| 311 | ✗ | } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) { | |
| 312 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 313 | |||
| 314 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, airOutletNodeName); | |
| 315 | } | ||
| 316 | } else { | ||
| 317 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 time.
|
1 | if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) { |
| 318 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, fanOutletNodeName); | |
| 319 | |||
| 320 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName); | |
| 321 |
5/6✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✗ Branch 15 not taken.
|
1 | } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) { |
| 322 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, fanOutletNodeName); |
| 323 | |||
| 324 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName); |
| 325 | ✗ | } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) { | |
| 326 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, fanOutletNodeName); | |
| 327 | |||
| 328 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, airOutletNodeName); | |
| 329 | } | ||
| 330 | } | ||
| 331 | 2 | } | |
| 332 | |||
| 333 | // MaximumSupplyAirTemperaturefromSupplementalHeater | ||
| 334 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (modelObject.isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized()) { |
| 335 | ✗ | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "Autosize"); | |
| 336 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | } else if ((value = modelObject.maximumSupplyAirTemperaturefromSupplementalHeater())) { |
| 337 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::MaximumSupplyAirTemperaturefromSupplementalHeater, value.get()); |
| 338 | } | ||
| 339 | |||
| 340 | // MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation | ||
| 341 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
4 | if ((value = modelObject.maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation())) { |
| 342 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, value.get()); |
| 343 | } | ||
| 344 | |||
| 345 | // Outdoor Dry-bulb Temperature Sensor Node Name | ||
| 346 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::OutdoorDryBulbTemperatureSensorNodeName, ""); |
| 347 | |||
| 348 | // FanPlacement | ||
| 349 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::FanPlacement, modelObject.fanPlacement()); |
| 350 | |||
| 351 | // SupplyAirFanOperatingModeScheduleName | ||
| 352 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (boost::optional<Schedule> schedule = modelObject.supplyAirFanOperatingModeSchedule()) { |
| 353 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
|
4 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) { |
| 354 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::SupplyAirFanOperatingModeScheduleName, _schedule->name().get()); |
| 355 | 2 | } | |
| 356 | 2 | } | |
| 357 | |||
| 358 | // TODO: field 'Availability Manager List Name' isn't implemented | ||
| 359 | |||
| 360 | // HeatPumpCoilWaterFlowMode | ||
| 361 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::HeatPumpCoilWaterFlowMode, modelObject.heatPumpCoilWaterFlowMode()); |
| 362 | |||
| 363 | // TODO: field 'Design Specification ZoneHVAC Sizing' isn't implemented since the object isn't wrapped in SDK | ||
| 364 | |||
| 365 | // DXHeatingCoilSizingRatio | ||
| 366 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
|
4 | if ((value = modelObject.dXHeatingCoilSizingRatio())) { |
| 367 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(ZoneHVAC_WaterToAirHeatPumpFields::DXHeatingCoilSizingRatio, value.get()); |
| 368 | } | ||
| 369 | |||
| 370 |
1/1✓ Branch 1 taken 2 times.
|
4 | return idfObject; |
| 371 | 2 | } | |
| 372 | |||
| 373 | } // namespace energyplus | ||
| 374 | |||
| 375 | } // namespace openstudio | ||
| 376 |