src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAir.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/AirLoopHVACUnitaryHeatPumpAirToAir.hpp" | ||
| 11 | #include "../../model/AirLoopHVACUnitaryHeatPumpAirToAir_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/CoilCoolingDXSingleSpeed.hpp" | ||
| 17 | #include "../../model/CoilCoolingDXSingleSpeed_Impl.hpp" | ||
| 18 | #include "../../model/CoilHeatingDXSingleSpeed.hpp" | ||
| 19 | #include "../../model/CoilHeatingDXSingleSpeed_Impl.hpp" | ||
| 20 | #include "../../model/CoilCoolingDXVariableSpeed.hpp" | ||
| 21 | #include "../../model/CoilCoolingDXVariableSpeed_Impl.hpp" | ||
| 22 | #include "../../model/CoilHeatingDXVariableSpeed.hpp" | ||
| 23 | #include "../../model/CoilHeatingDXVariableSpeed_Impl.hpp" | ||
| 24 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource.hpp" | ||
| 25 | #include "../../model/CoilSystemIntegratedHeatPumpAirSource_Impl.hpp" | ||
| 26 | #include <utilities/idd/AirLoopHVAC_UnitaryHeatPump_AirToAir_FieldEnums.hxx> | ||
| 27 | #include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx> | ||
| 28 | #include <utilities/idd/Fan_OnOff_FieldEnums.hxx> | ||
| 29 | #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx> | ||
| 30 | #include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx> | ||
| 31 | #include <utilities/idd/Coil_Heating_DX_VariableSpeed_FieldEnums.hxx> | ||
| 32 | #include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx> | ||
| 33 | #include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx> | ||
| 34 | #include <utilities/idd/Coil_Cooling_DX_SingleSpeed_FieldEnums.hxx> | ||
| 35 | #include <utilities/idd/Coil_Cooling_DX_VariableSpeed_FieldEnums.hxx> | ||
| 36 | #include <utilities/idd/Coil_WaterHeating_AirToWaterHeatPump_VariableSpeed_FieldEnums.hxx> | ||
| 37 | #include "../../utilities/idd/IddEnums.hpp" | ||
| 38 | #include <utilities/idd/IddEnums.hxx> | ||
| 39 | #include <utilities/idd/IddFactory.hxx> | ||
| 40 | |||
| 41 | using namespace openstudio::model; | ||
| 42 | |||
| 43 | namespace openstudio { | ||
| 44 | |||
| 45 | namespace energyplus { | ||
| 46 | |||
| 47 | 1 | boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACUnitaryHeatPumpAirToAir(AirLoopHVACUnitaryHeatPumpAirToAir& modelObject) { | |
| 48 | 1 | boost::optional<std::string> s; | |
| 49 | 1 | boost::optional<double> value; | |
| 50 | |||
| 51 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | IdfObject idfObject(IddObjectType::AirLoopHVAC_UnitaryHeatPump_AirToAir); |
| 52 | |||
| 53 |
1/1✓ Branch 1 taken 1 time.
|
1 | m_idfObjects.push_back(idfObject); |
| 54 | |||
| 55 | // Name | ||
| 56 | |||
| 57 |
1/1✓ Branch 1 taken 1 time.
|
1 | s = modelObject.name(); |
| 58 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (s) { |
| 59 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setName(*s); |
| 60 | } | ||
| 61 | |||
| 62 | // AvailabilityScheduleName | ||
| 63 | |||
| 64 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if (boost::optional<Schedule> schedule = modelObject.availabilitySchedule()) { |
| 65 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) { |
| 66 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AvailabilityScheduleName, _schedule->name().get()); |
| 67 | 1 | } | |
| 68 | 1 | } | |
| 69 | |||
| 70 | // AirInletNodeName | ||
| 71 | |||
| 72 | 1 | boost::optional<std::string> airInletNodeName; | |
| 73 | |||
| 74 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<ModelObject> mo = modelObject.inletModelObject()) { |
| 75 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Node> node = mo->optionalCast<Node>()) { |
| 76 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((s = node->name())) { |
| 77 |
1/1✓ Branch 1 taken 1 time.
|
1 | airInletNodeName = s; |
| 78 | |||
| 79 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AirInletNodeName, s.get()); |
| 80 | } | ||
| 81 | 1 | } | |
| 82 | 1 | } | |
| 83 | |||
| 84 | // AirOutletNodeName | ||
| 85 | |||
| 86 | 1 | boost::optional<std::string> airOutletNodeName; | |
| 87 | |||
| 88 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if (boost::optional<ModelObject> mo = modelObject.outletModelObject()) { |
| 89 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
|
2 | if (boost::optional<Node> node = mo->optionalCast<Node>()) { |
| 90 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((s = node->name())) { |
| 91 |
1/1✓ Branch 1 taken 1 time.
|
1 | airOutletNodeName = s; |
| 92 | |||
| 93 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AirOutletNodeName, s.get()); |
| 94 | } | ||
| 95 | 1 | } | |
| 96 | 1 | } | |
| 97 | |||
| 98 | // SupplyAirFlowRateDuringCoolingOperation | ||
| 99 | |||
| 100 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (modelObject.isSupplyAirFlowRateDuringCoolingOperationAutosized()) { |
| 101 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingSupplyAirFlowRate, "Autosize"); |
| 102 | ✗ | } else if ((value = modelObject.supplyAirFlowRateDuringCoolingOperation())) { | |
| 103 | ✗ | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingSupplyAirFlowRate, value.get()); | |
| 104 | } | ||
| 105 | |||
| 106 | // SupplyAirFlowRateDuringHeatingOperation | ||
| 107 | |||
| 108 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (modelObject.isSupplyAirFlowRateDuringHeatingOperationAutosized()) { |
| 109 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingSupplyAirFlowRate, "Autosize"); |
| 110 | ✗ | } else if ((value = modelObject.supplyAirFlowRateDuringHeatingOperation())) { | |
| 111 | ✗ | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingSupplyAirFlowRate, value.get()); | |
| 112 | } | ||
| 113 | |||
| 114 | // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded | ||
| 115 | |||
| 116 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) { |
| 117 | ✗ | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::NoLoadSupplyAirFlowRate, "Autosize"); | |
| 118 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | } else if ((value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded())) { |
| 119 | ✗ | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::NoLoadSupplyAirFlowRate, value.get()); | |
| 120 | } | ||
| 121 | |||
| 122 | // ControllingZoneorThermostatLocation | ||
| 123 | |||
| 124 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<ThermalZone> tz = modelObject.controllingZone()) { |
| 125 | ✗ | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::ControllingZoneorThermostatLocation, tz->name().get()); | |
| 126 | 1 | } | |
| 127 | |||
| 128 | // SupplyAirFanName | ||
| 129 | |||
| 130 |
1/1✓ Branch 1 taken 1 time.
|
1 | HVACComponent fan = modelObject.supplyAirFan(); |
| 131 | |||
| 132 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _fan = translateAndMapModelObject(fan); |
| 133 | |||
| 134 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_fan) { |
| 135 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanObjectType, _fan->iddObject().name()); |
| 136 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanName, _fan->name().get()); |
| 137 | } | ||
| 138 | |||
| 139 | // HeatingCoilName | ||
| 140 | |||
| 141 | 1 | boost::optional<IdfObject> _heatingCoil; | |
| 142 | |||
| 143 |
1/1✓ Branch 1 taken 1 time.
|
1 | HVACComponent heatingCoil = modelObject.heatingCoil(); |
| 144 | |||
| 145 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<CoilHeatingDXSingleSpeed> coilHeatingDXSingleSpeed = heatingCoil.optionalCast<CoilHeatingDXSingleSpeed>()) { |
| 146 | ✗ | _heatingCoil = translateCoilHeatingDXSingleSpeedWithoutUnitary(coilHeatingDXSingleSpeed.get()); | |
| 147 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | } else if (boost::optional<CoilHeatingDXVariableSpeed> coilHeatingDXVariableSpeed = heatingCoil.optionalCast<CoilHeatingDXVariableSpeed>()) { |
| 148 | ✗ | _heatingCoil = translateCoilHeatingDXVariableSpeedWithoutUnitary(coilHeatingDXVariableSpeed.get()); | |
| 149 | 1 | } else if (boost::optional<CoilSystemIntegratedHeatPumpAirSource> coilSystemIntegratedHeatPumpAirSource = | |
| 150 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | heatingCoil.optionalCast<CoilSystemIntegratedHeatPumpAirSource>()) { |
| 151 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _heatingCoil = translateAndMapModelObject(coilSystemIntegratedHeatPumpAirSource.get()); |
| 152 | 3 | } | |
| 153 | |||
| 154 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_heatingCoil) { |
| 155 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingCoilObjectType, _heatingCoil->iddObject().name()); |
| 156 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingCoilName, _heatingCoil->name().get()); |
| 157 | } | ||
| 158 | |||
| 159 | // CoolingCoilName | ||
| 160 | |||
| 161 | 1 | boost::optional<IdfObject> _coolingCoil; | |
| 162 | |||
| 163 |
1/1✓ Branch 1 taken 1 time.
|
1 | HVACComponent coolingCoil = modelObject.coolingCoil(); |
| 164 | |||
| 165 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<CoilCoolingDXSingleSpeed> coilCoolingDXSingleSpeed = coolingCoil.optionalCast<CoilCoolingDXSingleSpeed>()) { |
| 166 | ✗ | _coolingCoil = translateCoilCoolingDXSingleSpeedWithoutUnitary(coilCoolingDXSingleSpeed.get()); | |
| 167 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | } else if (boost::optional<CoilCoolingDXVariableSpeed> coilCoolingDXVariableSpeed = coolingCoil.optionalCast<CoilCoolingDXVariableSpeed>()) { |
| 168 | ✗ | _coolingCoil = translateCoilCoolingDXVariableSpeedWithoutUnitary(coilCoolingDXVariableSpeed.get()); | |
| 169 | 1 | } else if (boost::optional<CoilSystemIntegratedHeatPumpAirSource> coilSystemIntegratedHeatPumpAirSource = | |
| 170 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | coolingCoil.optionalCast<CoilSystemIntegratedHeatPumpAirSource>()) { |
| 171 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _coolingCoil = translateAndMapModelObject(coilSystemIntegratedHeatPumpAirSource.get()); |
| 172 | 3 | } | |
| 173 | |||
| 174 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_coolingCoil) { |
| 175 | // Need to explicitly add it to m_map for CoilCoolingDXSingleSpeed since translateCoilCoolingDXSingleSpeedWithoutUnitary doesn't | ||
| 176 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | m_map.insert(std::make_pair(coolingCoil.handle(), _coolingCoil.get())); |
| 177 | |||
| 178 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingCoilObjectType, _coolingCoil->iddObject().name()); |
| 179 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingCoilName, _coolingCoil->name().get()); |
| 180 | } | ||
| 181 | |||
| 182 | // SupplementalHeatingCoilName | ||
| 183 | |||
| 184 | 1 | boost::optional<IdfObject> _supplementalHeatingCoil; | |
| 185 | |||
| 186 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<HVACComponent> supplementalHeatingCoil = modelObject.supplementalHeatingCoil(); |
| 187 | |||
| 188 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (supplementalHeatingCoil) { |
| 189 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil = translateAndMapModelObject(supplementalHeatingCoil.get()); |
| 190 | } | ||
| 191 | |||
| 192 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_supplementalHeatingCoil) { |
| 193 |
1/1✓ Branch 1 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplementalHeatingCoilObjectType, |
| 194 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
2 | _supplementalHeatingCoil->iddObject().name()); |
| 195 |
4/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplementalHeatingCoilName, _supplementalHeatingCoil->name().get()); |
| 196 | } | ||
| 197 | |||
| 198 | // MaximumSupplyAirTemperaturefromSupplementalHeater | ||
| 199 | |||
| 200 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (modelObject.isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized()) { |
| 201 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "Autosize"); |
| 202 | ✗ | } else if ((value = modelObject.maximumSupplyAirTemperaturefromSupplementalHeater())) { | |
| 203 | ✗ | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, value.get()); | |
| 204 | } | ||
| 205 | |||
| 206 | // MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation | ||
| 207 | |||
| 208 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation())) { |
| 209 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, value.get()); |
| 210 | } | ||
| 211 | |||
| 212 | // FanPlacement | ||
| 213 | |||
| 214 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
2 | if ((s = modelObject.fanPlacement())) { |
| 215 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement, s.get()); |
| 216 | } | ||
| 217 | |||
| 218 | // SupplyAirFanOperatingModeScheduleName | ||
| 219 | |||
| 220 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
2 | if (boost::optional<Schedule> schedule = modelObject.supplyAirFanOperatingModeSchedule()) { |
| 221 | ✗ | boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get()); | |
| 222 | |||
| 223 | ✗ | if (_schedule) { | |
| 224 | ✗ | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanOperatingModeScheduleName, _schedule->name().get()); | |
| 225 | } | ||
| 226 | 1 | } | |
| 227 | |||
| 228 | // Dehumidification Control Type | ||
| 229 |
2/3✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
|
1 | if (!modelObject.isDehumidificationControlTypeDefaulted()) { |
| 230 | ✗ | idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType, modelObject.dehumidificationControlType()); | |
| 231 | } | ||
| 232 | |||
| 233 | // DX Heating Coil Sizing Ratio | ||
| 234 |
3/4✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
|
2 | if ((value = modelObject.dXHeatingCoilSizingRatio())) { |
| 235 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DXHeatingCoilSizingRatio, value.get()); |
| 236 | } | ||
| 237 | |||
| 238 | // Fill in node names for inner components | ||
| 239 | |||
| 240 |
3/6✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
2 | if (airInletNodeName && _fan) { |
| 241 |
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 (_fan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { |
| 242 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | _fan->setString(Fan_ConstantVolumeFields::AirInletNodeName, airInletNodeName.get()); |
| 243 | ✗ | } else if (_fan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 244 | ✗ | _fan->setString(Fan_OnOffFields::AirInletNodeName, airInletNodeName.get()); | |
| 245 | ✗ | } else if (_fan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 246 | // This isn't supported by E+ right now | ||
| 247 | ✗ | _fan->setString(Fan_SystemModelFields::AirInletNodeName, airInletNodeName.get()); | |
| 248 | ✗ | OS_ASSERT(false); | |
| 249 | } | ||
| 250 | } | ||
| 251 | |||
| 252 | 1 | std::string fanOutletNodeName; | |
| 253 | |||
| 254 | 1 | boost::optional<CoilSystemIntegratedHeatPumpAirSource> coilSystemIntegratedHeatPumpAirSource; | |
| 255 | |||
| 256 |
3/6✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
2 | if (_fan && _coolingCoil) { |
| 257 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | std::string nodeName = modelObject.name().get() + " Fan - Cooling Coil Node"; |
| 258 |
1/1✓ Branch 1 taken 1 time.
|
1 | fanOutletNodeName = nodeName; |
| 259 | |||
| 260 |
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 (_fan->iddObject().type() == IddObjectType::Fan_ConstantVolume) { |
| 261 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _fan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, nodeName); |
| 262 | ✗ | } else if (_fan->iddObject().type() == IddObjectType::Fan_OnOff) { | |
| 263 | ✗ | _fan->setString(Fan_OnOffFields::AirOutletNodeName, nodeName); | |
| 264 | ✗ | } else if (_fan->iddObject().type() == IddObjectType::Fan_SystemModel) { | |
| 265 | // This isn't supported by E+ right now | ||
| 266 | ✗ | _fan->setString(Fan_SystemModelFields::AirOutletNodeName, nodeName); | |
| 267 | ✗ | OS_ASSERT(false); | |
| 268 | } | ||
| 269 | |||
| 270 |
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 (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_SingleSpeed) { |
| 271 | ✗ | _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName, nodeName); | |
| 272 |
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 | } else if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_VariableSpeed) { |
| 273 | ✗ | _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); | |
| 274 |
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 (_coolingCoil->iddObject().type() == IddObjectType::CoilSystem_IntegratedHeatPump_AirSource) { |
| 275 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | coilSystemIntegratedHeatPumpAirSource = coolingCoil.cast<CoilSystemIntegratedHeatPumpAirSource>(); |
| 276 | |||
| 277 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | StraightComponent spaceCoolingCoil = coilSystemIntegratedHeatPumpAirSource->spaceCoolingCoil(); |
| 278 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _spaceCoolingCoil = translateAndMapModelObject(spaceCoolingCoil); |
| 279 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _spaceCoolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); |
| 280 | |||
| 281 |
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()) { |
| 282 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scwhCoil = translateAndMapModelObject(scwhCoil.get()); |
| 283 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scwhCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirInletNodeName, nodeName); |
| 284 | 2 | } | |
| 285 | |||
| 286 |
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<StraightComponent> scdwhCoolingCoil = coilSystemIntegratedHeatPumpAirSource->scdwhCoolingCoil()) { |
| 287 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scdwhCoolingCoil = translateAndMapModelObject(scdwhCoolingCoil.get()); |
| 288 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhCoolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); |
| 289 | 2 | } | |
| 290 | 1 | } | |
| 291 | 1 | } | |
| 292 | |||
| 293 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (airInletNodeName) { |
| 294 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | fixSPMsForUnitarySystem(modelObject, airInletNodeName.get(), fanOutletNodeName); |
| 295 | } | ||
| 296 | |||
| 297 |
3/6✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
2 | if (_coolingCoil && _heatingCoil) { |
| 298 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | std::string nodeName = modelObject.name().get() + " Cooling Coil - Heating Coil Node"; |
| 299 | |||
| 300 |
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 (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_SingleSpeed) { |
| 301 | ✗ | _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirOutletNodeName, nodeName); | |
| 302 |
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 | } else if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_VariableSpeed) { |
| 303 | ✗ | _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); | |
| 304 |
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 (_coolingCoil->iddObject().type() == IddObjectType::CoilSystem_IntegratedHeatPump_AirSource) { |
| 305 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | StraightComponent spaceCoolingCoil = coilSystemIntegratedHeatPumpAirSource->spaceCoolingCoil(); |
| 306 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _spaceCoolingCoil = translateAndMapModelObject(spaceCoolingCoil); |
| 307 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _spaceCoolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); |
| 308 | |||
| 309 |
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()) { |
| 310 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scwhCoil = translateAndMapModelObject(scwhCoil.get()); |
| 311 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scwhCoil->setString(Coil_WaterHeating_AirToWaterHeatPump_VariableSpeedFields::EvaporatorAirOutletNodeName, nodeName); |
| 312 | 2 | } | |
| 313 | |||
| 314 |
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<StraightComponent> scdwhCoolingCoil = coilSystemIntegratedHeatPumpAirSource->scdwhCoolingCoil()) { |
| 315 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _scdwhCoolingCoil = translateAndMapModelObject(scdwhCoolingCoil.get()); |
| 316 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _scdwhCoolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); |
| 317 | 2 | } | |
| 318 | 1 | } | |
| 319 | |||
| 320 |
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 (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_SingleSpeed) { |
| 321 | ✗ | _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirInletNodeName, nodeName); | |
| 322 |
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 | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_VariableSpeed) { |
| 323 | ✗ | _heatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); | |
| 324 |
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 (_heatingCoil->iddObject().type() == IddObjectType::CoilSystem_IntegratedHeatPump_AirSource) { |
| 325 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | coilSystemIntegratedHeatPumpAirSource = heatingCoil.cast<CoilSystemIntegratedHeatPumpAirSource>(); |
| 326 | |||
| 327 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | StraightComponent spaceHeatingCoil = coilSystemIntegratedHeatPumpAirSource->spaceHeatingCoil(); |
| 328 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _spaceHeatingCoil = translateAndMapModelObject(spaceHeatingCoil); |
| 329 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _spaceHeatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); |
| 330 | |||
| 331 |
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<StraightComponent> shdwhHeatingCoil = coilSystemIntegratedHeatPumpAirSource->shdwhHeatingCoil()) { |
| 332 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _shdwhHeatingCoil = translateAndMapModelObject(shdwhHeatingCoil.get()); |
| 333 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhHeatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirInletNodeName, nodeName); |
| 334 | 2 | } | |
| 335 | 1 | } | |
| 336 | 1 | } | |
| 337 | |||
| 338 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_supplementalHeatingCoil) { |
| 339 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | std::string nodeName = modelObject.name().get() + " Heating Coil - Supplemental Coil Node"; |
| 340 | |||
| 341 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (_heatingCoil) { |
| 342 |
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 (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_SingleSpeed) { |
| 343 | ✗ | _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirOutletNodeName, nodeName); | |
| 344 |
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 | } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_VariableSpeed) { |
| 345 | ✗ | _heatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); | |
| 346 |
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 (_heatingCoil->iddObject().type() == IddObjectType::CoilSystem_IntegratedHeatPump_AirSource) { |
| 347 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | coilSystemIntegratedHeatPumpAirSource = heatingCoil.cast<CoilSystemIntegratedHeatPumpAirSource>(); |
| 348 | |||
| 349 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | StraightComponent spaceHeatingCoil = coilSystemIntegratedHeatPumpAirSource->spaceHeatingCoil(); |
| 350 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<IdfObject> _spaceHeatingCoil = translateAndMapModelObject(spaceHeatingCoil); |
| 351 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _spaceHeatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); |
| 352 | |||
| 353 |
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<StraightComponent> shdwhHeatingCoil = coilSystemIntegratedHeatPumpAirSource->shdwhHeatingCoil()) { |
| 354 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | boost::optional<IdfObject> _shdwhHeatingCoil = translateAndMapModelObject(shdwhHeatingCoil.get()); |
| 355 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _shdwhHeatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirOutletNodeName, nodeName); |
| 356 | 2 | } | |
| 357 | 1 | } | |
| 358 | } | ||
| 359 | |||
| 360 |
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) { |
| 361 | ✗ | if (airOutletNodeName) { | |
| 362 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName.get()); | |
| 363 | ✗ | _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, nodeName); | |
| 364 | } | ||
| 365 |
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) { |
| 366 |
1/2✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
|
1 | if (airOutletNodeName) { |
| 367 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName.get()); |
| 368 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, nodeName); |
| 369 | } | ||
| 370 | } | ||
| 371 | 1 | } | |
| 372 | |||
| 373 |
1/1✓ Branch 1 taken 1 time.
|
2 | return idfObject; |
| 374 | 1 | } | |
| 375 | |||
| 376 | } // namespace energyplus | ||
| 377 | |||
| 378 | } // namespace openstudio | ||
| 379 |