src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACPackagedTerminalAirConditioner.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/AirLoopHVAC.hpp" | ||
| 13 | #include "../../model/AirLoopHVAC_Impl.hpp" | ||
| 14 | #include "../../model/ZoneHVACPackagedTerminalAirConditioner.hpp" | ||
| 15 | #include "../../model/ZoneHVACPackagedTerminalAirConditioner_Impl.hpp" | ||
| 16 | #include "../../model/ThermalZone.hpp" | ||
| 17 | #include "../../model/ThermalZone_Impl.hpp" | ||
| 18 | #include "../../model/CoilCoolingDX.hpp" | ||
| 19 | #include "../../model/CoilCoolingDX_Impl.hpp" | ||
| 20 | #include "../../model/CoilCoolingDXSingleSpeed.hpp" | ||
| 21 | #include "../../model/CoilCoolingDXSingleSpeed_Impl.hpp" | ||
| 22 | #include "../../model/CoilCoolingDXVariableSpeed.hpp" | ||
| 23 | #include "../../model/CoilCoolingDXVariableSpeed_Impl.hpp" | ||
| 24 | #include "../../model/CoilSystemCoolingDXHeatExchangerAssisted.hpp" | ||
| 25 | #include "../../model/CoilSystemCoolingDXHeatExchangerAssisted_Impl.hpp" | ||
| 26 | #include "../../model/HeatExchangerAirToAirSensibleAndLatent.hpp" | ||
| 27 | #include "../../model/HeatExchangerAirToAirSensibleAndLatent_Impl.hpp" | ||
| 28 | #include <utilities/idd/ZoneHVAC_PackagedTerminalAirConditioner_FieldEnums.hxx> | ||
| 29 | #include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx> | ||
| 30 | #include <utilities/idd/Fan_OnOff_FieldEnums.hxx> | ||
| 31 | #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx> | ||
| 32 | #include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx> | ||
| 33 | #include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx> | ||
| 34 | #include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx> | ||
| 35 | #include <utilities/idd/Coil_Heating_Water_FieldEnums.hxx> | ||
| 36 | #include <utilities/idd/Coil_Cooling_DX_FieldEnums.hxx> | ||
| 37 | #include <utilities/idd/Coil_Cooling_DX_SingleSpeed_FieldEnums.hxx> | ||
| 38 | #include <utilities/idd/Coil_Cooling_DX_VariableSpeed_FieldEnums.hxx> | ||
| 39 | #include <utilities/idd/HeatExchanger_AirToAir_SensibleAndLatent_FieldEnums.hxx> | ||
| 40 | #include <utilities/idd/OutdoorAir_Mixer_FieldEnums.hxx> | ||
| 41 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 42 | #include "../../utilities/math/FloatCompare.hpp" | ||
| 43 | #include <utilities/idd/IddEnums.hxx> | ||
| 44 | #include <utilities/idd/IddFactory.hxx> | ||
| 45 | |||
| 46 | using namespace openstudio::model; | ||
| 47 | |||
| 48 | namespace openstudio { | ||
| 49 | |||
| 50 | namespace energyplus { | ||
| 51 | |||
| 52 | 9 | boost::optional<IdfObject> ForwardTranslator::translateZoneHVACPackagedTerminalAirConditioner(ZoneHVACPackagedTerminalAirConditioner& modelObject) { | |
| 53 | 9 | boost::optional<std::string> s; | |
| 54 | 9 | boost::optional<double> value; | |
| 55 | |||
| 56 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | IdfObject idfObject(IddObjectType::ZoneHVAC_PackagedTerminalAirConditioner); |
| 57 | |||
| 58 |
1/1✓ Branch 1 taken 9 times.
|
9 | m_idfObjects.push_back(idfObject); |
| 59 | |||
| 60 | // Name | ||
| 61 | |||
| 62 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
|
9 | std::string baseName = modelObject.name().get(); |
| 63 | |||
| 64 |
1/1✓ Branch 1 taken 9 times.
|
9 | idfObject.setName(baseName); |
| 65 | |||
| 66 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string mixedAirNodeName = baseName + " Mixed Air Node"; |
| 67 | |||
| 68 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string coolingCoilOutletNodeName = baseName + " Cooling Coil Outlet Node"; |
| 69 | |||
| 70 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string heatingCoilOutletNodeName = baseName + " Heating Coil Outlet Node"; |
| 71 | |||
| 72 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string fanOutletNodeName = baseName + " Fan Outlet Node"; |
| 73 | |||
| 74 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string reliefAirNodeName = baseName + " Relief Air Node"; |
| 75 | |||
| 76 |
1/1✓ Branch 1 taken 9 times.
|
9 | std::string oaNodeName = baseName + " OA Node"; |
| 77 | |||
| 78 | 9 | std::string airInletNodeName; | |
| 79 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (auto node = modelObject.inletNode()) { |
| 80 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | airInletNodeName = node->nameString(); |
| 81 | 9 | } | |
| 82 | |||
| 83 | 9 | std::string airOutletNodeName; | |
| 84 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (auto node = modelObject.outletNode()) { |
| 85 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | airOutletNodeName = node->nameString(); |
| 86 | 9 | } | |
| 87 | |||
| 88 | // AvailabilityScheduleName | ||
| 89 | |||
| 90 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 8 taken 9 times.
✗ Branch 9 not taken.
|
18 | if (boost::optional<Schedule> schedule = modelObject.availabilitySchedule()) { |
| 91 |
3/4✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 6 taken 9 times.
✗ Branch 7 not taken.
|
18 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) { |
| 92 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::AvailabilityScheduleName, _schedule->name().get()); |
| 93 | 9 | } | |
| 94 | 9 | } | |
| 95 | |||
| 96 | 18 | auto translateMixer = [&]() { | |
| 97 |
1/1✓ Branch 1 taken 18 times.
|
18 | auto t_airLoopHVAC = modelObject.airLoopHVAC(); |
| 98 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 18 times.
|
18 | if (t_airLoopHVAC) { |
| 99 | ✗ | return false; | |
| 100 | } | ||
| 101 | |||
| 102 | 18 | bool zeroOA = false; | |
| 103 |
2/3✓ Branch 1 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
|
36 | if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) { |
| 104 | ✗ | zeroOA = equal(value.get(), 0.0); | |
| 105 | } | ||
| 106 |
2/3✓ Branch 1 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
|
36 | if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) { |
| 107 | ✗ | zeroOA = (zeroOA && equal(value.get(), 0.0)); | |
| 108 | } | ||
| 109 |
2/3✓ Branch 1 taken 18 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
|
36 | if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) { |
| 110 | ✗ | zeroOA = (zeroOA && equal(value.get(), 0.0)); | |
| 111 | } | ||
| 112 | |||
| 113 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 18 times.
|
18 | if (zeroOA) { |
| 114 | ✗ | return false; | |
| 115 | } | ||
| 116 | |||
| 117 | 18 | return true; | |
| 118 | 18 | }; | |
| 119 | |||
| 120 | // AirInletNodeName | ||
| 121 |
1/1✓ Branch 1 taken 9 times.
|
9 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::AirInletNodeName, airInletNodeName); |
| 122 | |||
| 123 | // AirOutletNodeName | ||
| 124 |
1/1✓ Branch 1 taken 9 times.
|
9 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::AirOutletNodeName, airOutletNodeName); |
| 125 | |||
| 126 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (translateMixer()) { |
| 127 | // OutdoorAirMixerObjectType | ||
| 128 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::OutdoorAirMixerObjectType, modelObject.outdoorAirMixerObjectType()); |
| 129 | |||
| 130 | // OutdoorAirMixerName | ||
| 131 | |||
| 132 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
|
9 | std::string oaMixerName = modelObject.name().get() + " OA Mixer"; |
| 133 | |||
| 134 |
1/1✓ Branch 1 taken 9 times.
|
9 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::OutdoorAirMixerName, oaMixerName); |
| 135 | |||
| 136 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | IdfObject _outdoorAirMixer(IddObjectType::OutdoorAir_Mixer); |
| 137 |
1/1✓ Branch 1 taken 9 times.
|
9 | _outdoorAirMixer.setName(oaMixerName); |
| 138 |
1/1✓ Branch 1 taken 9 times.
|
9 | m_idfObjects.push_back(_outdoorAirMixer); |
| 139 | |||
| 140 |
1/1✓ Branch 1 taken 9 times.
|
9 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::MixedAirNodeName, mixedAirNodeName); |
| 141 | |||
| 142 |
1/1✓ Branch 1 taken 9 times.
|
9 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::OutdoorAirStreamNodeName, oaNodeName); |
| 143 | |||
| 144 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | IdfObject _oaNodeList(openstudio::IddObjectType::OutdoorAir_NodeList); |
| 145 |
1/1✓ Branch 1 taken 9 times.
|
9 | _oaNodeList.setString(0, oaNodeName); |
| 146 |
1/1✓ Branch 1 taken 9 times.
|
9 | m_idfObjects.push_back(_oaNodeList); |
| 147 | |||
| 148 |
1/1✓ Branch 1 taken 9 times.
|
9 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReliefAirStreamNodeName, reliefAirNodeName); |
| 149 |
1/1✓ Branch 1 taken 9 times.
|
9 | _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReturnAirStreamNodeName, airInletNodeName); |
| 150 | 9 | } | |
| 151 | |||
| 152 | // SupplyAirFlowRateDuringCoolingOperation | ||
| 153 | |||
| 154 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isSupplyAirFlowRateDuringCoolingOperationAutosized()) { |
| 155 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingSupplyAirFlowRate, "Autosize"); |
| 156 | ✗ | } else if ((value = modelObject.supplyAirFlowRateDuringCoolingOperation())) { | |
| 157 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingSupplyAirFlowRate, value.get()); | |
| 158 | } | ||
| 159 | |||
| 160 | // SupplyAirFlowRateDuringHeatingOperation | ||
| 161 | |||
| 162 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isSupplyAirFlowRateDuringHeatingOperationAutosized()) { |
| 163 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingSupplyAirFlowRate, "Autosize"); |
| 164 | ✗ | } else if ((value = modelObject.supplyAirFlowRateDuringHeatingOperation())) { | |
| 165 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingSupplyAirFlowRate, value.get()); | |
| 166 | } | ||
| 167 | |||
| 168 | // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded | ||
| 169 | |||
| 170 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) { |
| 171 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadSupplyAirFlowRate, "Autosize"); |
| 172 | ✗ | } else if ((value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded())) { | |
| 173 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadSupplyAirFlowRate, value.get()); | |
| 174 | } | ||
| 175 | |||
| 176 | // NoLoadSupplyAirFlowRateControlSetToLowSpeed | ||
| 177 | |||
| 178 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.noLoadSupplyAirFlowRateControlSetToLowSpeed()) { |
| 179 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "Yes"); |
| 180 | } else { | ||
| 181 | ✗ | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "No"); | |
| 182 | } | ||
| 183 | |||
| 184 | // OutdoorAirFlowRateDuringCoolingOperation | ||
| 185 | |||
| 186 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isOutdoorAirFlowRateDuringCoolingOperationAutosized()) { |
| 187 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingOutdoorAirFlowRate, "Autosize"); |
| 188 | ✗ | } else if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) { | |
| 189 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingOutdoorAirFlowRate, value.get()); | |
| 190 | } | ||
| 191 | |||
| 192 | // OutdoorAirFlowRateDuringHeatingOperation | ||
| 193 | |||
| 194 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isOutdoorAirFlowRateDuringHeatingOperationAutosized()) { |
| 195 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingOutdoorAirFlowRate, "Autosize"); |
| 196 | ✗ | } else if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) { | |
| 197 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingOutdoorAirFlowRate, value.get()); | |
| 198 | } | ||
| 199 | |||
| 200 | // OutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded | ||
| 201 | |||
| 202 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (modelObject.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) { |
| 203 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
18 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadOutdoorAirFlowRate, "Autosize"); |
| 204 | ✗ | } else if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) { | |
| 205 | ✗ | idfObject.setDouble(ZoneHVAC_PackagedTerminalAirConditionerFields::NoLoadOutdoorAirFlowRate, value.get()); | |
| 206 | } | ||
| 207 | |||
| 208 | // FanPlacement | ||
| 209 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | idfObject.setString(ZoneHVAC_PackagedTerminalAirConditionerFields::FanPlacement, modelObject.fanPlacement()); |
| 210 | |||
| 211 | // SupplyAirFanObjectType | ||
| 212 | |||
| 213 |
1/1✓ Branch 1 taken 9 times.
|
9 | HVACComponent supplyAirFan = modelObject.supplyAirFan(); |
| 214 | |||
| 215 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<IdfObject> _supplyAirFan = translateAndMapModelObject(supplyAirFan)) { |
| 216 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::SupplyAirFanObjectType, _supplyAirFan->iddObject().name()); |
| 217 | |||
| 218 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::SupplyAirFanName, _supplyAirFan->name().get()); |
| 219 | |||
| 220 |
4/5✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 9 times.
|
18 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 221 | ✗ | if (translateMixer()) { | |
| 222 | ✗ | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { | |
| 223 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, mixedAirNodeName); | |
| 224 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName); | |
| 225 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 226 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, mixedAirNodeName); | |
| 227 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); | |
| 228 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 229 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, mixedAirNodeName); | |
| 230 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 231 | } | ||
| 232 | } else { | ||
| 233 | ✗ | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { | |
| 234 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, airInletNodeName); | |
| 235 | ✗ | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName); | |
| 236 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 237 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, airInletNodeName); | |
| 238 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName); | |
| 239 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 240 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, airInletNodeName); | |
| 241 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName); | |
| 242 | } | ||
| 243 | } | ||
| 244 | } else { | ||
| 245 | // Drawthrough position | ||
| 246 |
5/6✓ 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 15 not taken.
|
9 | if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { |
| 247 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, heatingCoilOutletNodeName); |
| 248 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, airOutletNodeName); |
| 249 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 250 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 251 | ✗ | _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, airOutletNodeName); | |
| 252 | ✗ | } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 253 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, heatingCoilOutletNodeName); | |
| 254 | ✗ | _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, airOutletNodeName); | |
| 255 | } | ||
| 256 | } | ||
| 257 | 9 | } | |
| 258 | |||
| 259 | // HeatingCoilObjectType | ||
| 260 | |||
| 261 |
1/1✓ Branch 1 taken 9 times.
|
9 | HVACComponent heatingCoil = modelObject.heatingCoil(); |
| 262 | |||
| 263 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<IdfObject> _heatingCoil = translateAndMapModelObject(heatingCoil)) { |
| 264 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingCoilObjectType, _heatingCoil->iddObject().name()); |
| 265 | |||
| 266 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::HeatingCoilName, _heatingCoil->name().get()); |
| 267 | |||
| 268 |
4/5✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 9 times.
|
18 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 269 | ✗ | if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) { | |
| 270 | ✗ | _heatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, coolingCoilOutletNodeName); | |
| 271 | |||
| 272 | ✗ | _heatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, airOutletNodeName); | |
| 273 | ✗ | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) { | |
| 274 | ✗ | _heatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, coolingCoilOutletNodeName); | |
| 275 | |||
| 276 | ✗ | _heatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName); | |
| 277 | ✗ | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) { | |
| 278 | ✗ | _heatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, coolingCoilOutletNodeName); | |
| 279 | |||
| 280 | ✗ | _heatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName); | |
| 281 | } | ||
| 282 | } else { | ||
| 283 |
6/6✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
✓ Branch 14 taken 4 times.
✓ Branch 15 taken 5 times.
|
9 | if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) { |
| 284 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | _heatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, coolingCoilOutletNodeName); |
| 285 | |||
| 286 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | _heatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, heatingCoilOutletNodeName); |
| 287 |
5/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 5 times.
|
5 | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) { |
| 288 | ✗ | _heatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, coolingCoilOutletNodeName); | |
| 289 | |||
| 290 | ✗ | _heatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, heatingCoilOutletNodeName); | |
| 291 |
5/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 14 taken 5 times.
✗ Branch 15 not taken.
|
5 | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) { |
| 292 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | _heatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, coolingCoilOutletNodeName); |
| 293 | |||
| 294 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | _heatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, heatingCoilOutletNodeName); |
| 295 | } | ||
| 296 | } | ||
| 297 | 9 | } | |
| 298 | |||
| 299 | // CoolingCoilObjectType | ||
| 300 | |||
| 301 |
1/1✓ Branch 1 taken 9 times.
|
9 | HVACComponent coolingCoil = modelObject.coolingCoil(); |
| 302 | |||
| 303 | // No need for any extra checks and calling translateCoilCoolingDXSingleSpeedWithoutUnitary manually | ||
| 304 | // Indeed, coil.containingZoneHVACComponent is true so FT::isHVACComponentWithinUnitary will return true, | ||
| 305 | // and therefore translateCoilCoolingDXSingleSpeedWithoutUnitary will be called | ||
| 306 |
1/1✓ Branch 1 taken 9 times.
|
9 | boost::optional<IdfObject> _coolingCoil = translateAndMapModelObject(coolingCoil); |
| 307 | |||
| 308 |
1/2✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
|
9 | if (_coolingCoil) { |
| 309 | 9 | std::string coolingCoilInletNodeName; | |
| 310 | |||
| 311 |
4/5✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 9 times.
|
18 | if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) { |
| 312 | ✗ | coolingCoilInletNodeName = fanOutletNodeName; | |
| 313 | } else { | ||
| 314 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
9 | if (translateMixer()) { |
| 315 |
1/1✓ Branch 1 taken 9 times.
|
9 | coolingCoilInletNodeName = mixedAirNodeName; |
| 316 | } else { | ||
| 317 | ✗ | coolingCoilInletNodeName = airInletNodeName; | |
| 318 | } | ||
| 319 | } | ||
| 320 | |||
| 321 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingCoilObjectType, _coolingCoil->iddObject().name()); |
| 322 | |||
| 323 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::CoolingCoilName, _coolingCoil->name().get()); |
| 324 | |||
| 325 |
6/6✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 9 times.
✓ Branch 14 taken 6 times.
✓ Branch 15 taken 3 times.
|
9 | if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_SingleSpeed) { |
| 326 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName, coolingCoilInletNodeName); |
| 327 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirOutletNodeName, coolingCoilOutletNodeName); |
| 328 |
6/6✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 14 taken 1 time.
✓ Branch 15 taken 2 times.
|
3 | } else if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_VariableSpeed) { |
| 329 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirInletNodeName, coolingCoilInletNodeName); |
| 330 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirOutletNodeName, coolingCoilOutletNodeName); |
| 331 |
6/6✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 14 taken 1 time.
✓ Branch 15 taken 1 time.
|
2 | } else if (_coolingCoil->iddObject().type() == IddObjectType::CoilSystem_Cooling_DX_HeatExchangerAssisted) { |
| 332 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | auto hx = coolingCoil.cast<CoilSystemCoolingDXHeatExchangerAssisted>().heatExchanger(); |
| 333 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _heatExchanger = translateAndMapModelObject(hx); |
| 334 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_heatExchanger) { |
| 335 |
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 | if (_heatExchanger->iddObject().type() == IddObjectType::HeatExchanger_AirToAir_SensibleAndLatent) { |
| 336 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _heatExchanger->setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNodeName, coolingCoilInletNodeName); |
| 337 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _heatExchanger->setString(HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirOutletNodeName, coolingCoilOutletNodeName); |
| 338 | } | ||
| 339 | } | ||
| 340 |
5/6✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 16 taken 1 time.
✗ Branch 17 not taken.
|
2 | } else if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX) { |
| 341 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _coolingCoil->setString(Coil_Cooling_DXFields::EvaporatorInletNodeName, coolingCoilInletNodeName); |
| 342 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _coolingCoil->setString(Coil_Cooling_DXFields::EvaporatorOutletNodeName, coolingCoilOutletNodeName); |
| 343 | } | ||
| 344 | 9 | } | |
| 345 | |||
| 346 | // SupplyAirFanOperatingModeScheduleName | ||
| 347 | |||
| 348 |
1/1✓ Branch 1 taken 9 times.
|
9 | Schedule fanOpSchedule = modelObject.supplyAirFanOperatingModeSchedule(); |
| 349 |
2/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
|
18 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(fanOpSchedule)) { |
| 350 |
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(ZoneHVAC_PackagedTerminalAirConditionerFields::SupplyAirFanOperatingModeScheduleName, _schedule->name().get()); |
| 351 | 9 | } | |
| 352 | |||
| 353 |
1/1✓ Branch 1 taken 9 times.
|
18 | return idfObject; |
| 354 | 9 | } | |
| 355 | |||
| 356 | } // namespace energyplus | ||
| 357 | |||
| 358 | } // namespace openstudio | ||
| 359 |