GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 73.2% 142 / 0 / 194
Functions: 100.0% 1 / 0 / 1
Branches: 59.6% 257 / 0 / 431

src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.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/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp"
11 #include "../../model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_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/CoilCoolingDXMultiSpeed.hpp"
17 #include "../../model/CoilCoolingDXMultiSpeed_Impl.hpp"
18 #include <utilities/idd/AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed_FieldEnums.hxx>
19 #include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
20 #include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
21 #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
22 #include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx>
23 #include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx>
24 #include <utilities/idd/Coil_Heating_Gas_MultiStage_FieldEnums.hxx>
25 #include <utilities/idd/Coil_Heating_Electric_MultiStage_FieldEnums.hxx>
26 #include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx>
27 #include <utilities/idd/Coil_Heating_Water_FieldEnums.hxx>
28 #include <utilities/idd/Coil_Heating_DX_MultiSpeed_FieldEnums.hxx>
29 #include <utilities/idd/Coil_Cooling_DX_MultiSpeed_FieldEnums.hxx>
30 #include "../../utilities/idd/IddEnums.hpp"
31 #include <utilities/idd/IddEnums.hxx>
32 #include <utilities/idd/IddFactory.hxx>
33
34 using namespace openstudio::model;
35
36 namespace openstudio {
37
38 namespace energyplus {
39
40 boost::optional<IdfObject>
41 4 ForwardTranslator::translateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed& modelObject) {
42 4 boost::optional<std::string> s;
43 4 boost::optional<double> value;
44 4 boost::optional<int> num;
45
46
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 IdfObject idfObject(IddObjectType::AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed);
47
48
1/1
✓ Branch 1 taken 4 times.
4 m_idfObjects.push_back(idfObject);
49
50 // Name
51
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 std::string baseName = modelObject.name().get();
52
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setName(baseName);
53
54 // AvailabilityScheduleName
55
2/3
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
8 if (boost::optional<Schedule> schedule = modelObject.availabilitySchedule()) {
56 ✗ if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) {
57 ✗ idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilityScheduleName, _schedule->name().get());
58 ✗ }
59 4 }
60
61 // AirInletNodeName
62 4 std::string airInletNodeName;
63
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<ModelObject> mo = modelObject.inletModelObject()) {
64
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
8 if (boost::optional<Node> node = mo->optionalCast<Node>()) {
65
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
8 if ((s = node->name())) {
66
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 airInletNodeName = s.get();
67
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirInletNodeName, s.get());
68 }
69 4 }
70 4 }
71
72 // AirOutletNodeName
73 4 std::string airOutletNodeName;
74
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<ModelObject> mo = modelObject.outletModelObject()) {
75
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
8 if (boost::optional<Node> node = mo->optionalCast<Node>()) {
76
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
8 if ((s = node->name())) {
77
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 airOutletNodeName = s.get();
78
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirOutletNodeName, s.get());
79 }
80 4 }
81 4 }
82
83 // DXHeatingCoilSizingRatio
84
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.dXHeatingCoilSizingRatio())) {
85
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::DXHeatingCoilSizingRatio, value.get());
86 }
87
88
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent coolingCoil = modelObject.coolingCoil();
89
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<IdfObject> _coolingCoil = translateAndMapModelObject(coolingCoil);
90
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_coolingCoil) {
91
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoilObjectType, _coolingCoil->iddObject().name());
92
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoilName, _coolingCoil->name().get());
93 }
94
95
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent heatingCoil = modelObject.heatingCoil();
96
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<IdfObject> _heatingCoil = translateAndMapModelObject(heatingCoil);
97
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_heatingCoil) {
98
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoilObjectType, _heatingCoil->iddObject().name());
99
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoilName, _heatingCoil->name().get());
100 }
101
102 // ControllingZoneorThermostatLocation
103
2/3
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
8 if (boost::optional<ThermalZone> tz = modelObject.controllingZoneorThermostatLocation()) {
104 ✗ idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation, tz->name().get());
105
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 } else if (auto airLoop = modelObject.airLoopHVAC()) {
106
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 auto zones = airLoop->thermalZones();
107
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (zones.size() == 1u) {
108 ✗ if (auto zone = translateAndMapModelObject(zones.front())) {
109 ✗ idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation, zone->name().get());
110 ✗ }
111 }
112 12 }
113
114 // SupplyAirFanName
115
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent fan = modelObject.supplyAirFan();
116
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<IdfObject> _fan = translateAndMapModelObject(fan);
117
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_fan) {
118
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanObjectType, _fan->iddObject().name());
119
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanName, _fan->name().get());
120 }
121
122 // SupplementalHeatingCoilName
123 4 boost::optional<IdfObject> _supplementalHeatingCoil;
124
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<HVACComponent> supplementalHeatingCoil = modelObject.supplementalHeatingCoil();
125
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (supplementalHeatingCoil) {
126
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplementalHeatingCoil = translateAndMapModelObject(supplementalHeatingCoil.get());
127 }
128
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_supplementalHeatingCoil) {
129
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoilObjectType,
130
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 _supplementalHeatingCoil->iddObject().name());
131
132
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoilName, _supplementalHeatingCoil->name().get());
133 }
134
135 // FanPlacement
136 4 bool t_blowThrough = true;
137
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
8 if ((s = modelObject.supplyAirFanPlacement())) {
138
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanPlacement, s.get());
139
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
8 if (istringEqual(s.get(), "DrawThrough")) {
140 4 t_blowThrough = false;
141 }
142 }
143
144 // SupplyAirFanOperatingModeScheduleName
145
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
8 if (boost::optional<Schedule> schedule = modelObject.supplyAirFanOperatingModeSchedule()) {
146
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule.get());
147
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_schedule) {
148
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeScheduleName, _schedule->name().get());
149 }
150 8 }
151
152 // MaximumSupplyAirTemperaturefromSupplementalHeater
153
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized()) {
154
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "AutoSize");
155 ✗ } else if ((value = modelObject.maximumSupplyAirTemperaturefromSupplementalHeater())) {
156 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater, value.get());
157 }
158
159 // MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation
160
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation())) {
161 4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation,
162
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 value.get());
163 }
164
165 // AuxiliaryOnCycleElectricPower
166
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.auxiliaryOnCycleElectricPower())) {
167
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOnCycleElectricPower, value.get());
168 }
169
170 // AuxiliaryOffCycleElectricPower
171
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.auxiliaryOffCycleElectricPower())) {
172
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOffCycleElectricPower, value.get());
173 }
174
175 // DesignHeatRecoveryWaterFlowRate
176
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.designHeatRecoveryWaterFlowRate())) {
177
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::DesignHeatRecoveryWaterFlowRate, value.get());
178 }
179
180 // MaximumTemperatureforHeatRecovery
181
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((value = modelObject.maximumTemperatureforHeatRecovery())) {
182
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumTemperatureforHeatRecovery, value.get());
183 }
184
185 // HeatRecoveryWaterInletNodeName
186
187 // HeatRecoveryWaterOutletNodeName
188
189 // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded
190
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) {
191
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NoLoadSupplyAirFlowRate, "AutoSize");
192 ✗ } else if ((value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded())) {
193 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NoLoadSupplyAirFlowRate, value.get());
194 }
195
196 // NumberofSpeedsforHeating
197
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((num = modelObject.numberofSpeedsforHeating())) {
198
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setInt(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforHeating, num.get());
199 }
200
201 // NumberofSpeedsforCooling
202
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
8 if ((num = modelObject.numberofSpeedsforCooling())) {
203
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setInt(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforCooling, num.get());
204 }
205
206 // Speed1SupplyAirFlowRateDuringHeatingOperation
207
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized()) {
208
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed1SupplyAirFlowRate, "AutoSize");
209 ✗ } else if ((value = modelObject.speed1SupplyAirFlowRateDuringHeatingOperation())) {
210 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed1SupplyAirFlowRate, value.get());
211 }
212
213 // Speed2SupplyAirFlowRateDuringHeatingOperation
214
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized()) {
215
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed2SupplyAirFlowRate, "AutoSize");
216 ✗ } else if ((value = modelObject.speed2SupplyAirFlowRateDuringHeatingOperation())) {
217 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed2SupplyAirFlowRate, value.get());
218 }
219
220 // Speed3SupplyAirFlowRateDuringHeatingOperation
221
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized()) {
222
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed3SupplyAirFlowRate, "AutoSize");
223 ✗ } else if ((value = modelObject.speed3SupplyAirFlowRateDuringHeatingOperation())) {
224 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed3SupplyAirFlowRate, value.get());
225 }
226
227 // Speed4SupplyAirFlowRateDuringHeatingOperation
228
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized()) {
229
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed4SupplyAirFlowRate, "AutoSize");
230 ✗ } else if ((value = modelObject.speed4SupplyAirFlowRateDuringHeatingOperation())) {
231 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingSpeed4SupplyAirFlowRate, value.get());
232 }
233
234 // Speed1SupplyAirFlowRateDuringCoolingOperation
235
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized()) {
236
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed1SupplyAirFlowRate, "AutoSize");
237 ✗ } else if ((value = modelObject.speed1SupplyAirFlowRateDuringCoolingOperation())) {
238 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed1SupplyAirFlowRate, value.get());
239 }
240
241 // Speed2SupplyAirFlowRateDuringCoolingOperation
242
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized()) {
243
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed2SupplyAirFlowRate, "AutoSize");
244 ✗ } else if ((value = modelObject.speed2SupplyAirFlowRateDuringCoolingOperation())) {
245 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed2SupplyAirFlowRate, value.get());
246 }
247
248 // Speed3SupplyAirFlowRateDuringCoolingOperation
249
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized()) {
250
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed3SupplyAirFlowRate, "AutoSize");
251 ✗ } else if ((value = modelObject.speed3SupplyAirFlowRateDuringCoolingOperation())) {
252 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed3SupplyAirFlowRate, value.get());
253 }
254
255 // Speed4SupplyAirFlowRateDuringCoolingOperation
256
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized()) {
257
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed4SupplyAirFlowRate, "AutoSize");
258 ✗ } else if ((value = modelObject.speed4SupplyAirFlowRateDuringCoolingOperation())) {
259 ✗ idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingSpeed4SupplyAirFlowRate, value.get());
260 }
261
262 4 std::string fanOutletNodeName;
263 4 std::string fanInletNodeName;
264 4 std::string coolingCoilOutletNodeName;
265 4 std::string coolingCoilInletNodeName;
266 4 std::string heatingCoilOutletNodeName;
267 4 std::string heatingCoilInletNodeName;
268 4 std::string suppCoilOutletNodeName;
269 4 std::string suppCoilInletNodeName;
270
271
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (t_blowThrough) {
272 ✗ fanInletNodeName = airInletNodeName;
273 ✗ fanOutletNodeName = baseName + " Fan Outlet";
274
275 ✗ coolingCoilInletNodeName = fanOutletNodeName;
276 ✗ coolingCoilOutletNodeName = baseName + " Cool Coil Outlet";
277
278 ✗ heatingCoilInletNodeName = coolingCoilOutletNodeName;
279 ✗ heatingCoilOutletNodeName = baseName + " Heat Coil Outlet";
280
281 ✗ suppCoilInletNodeName = heatingCoilOutletNodeName;
282 ✗ suppCoilOutletNodeName = airOutletNodeName;
283 } else {
284
1/1
✓ Branch 1 taken 4 times.
4 coolingCoilInletNodeName = airInletNodeName;
285
1/1
✓ Branch 1 taken 4 times.
4 coolingCoilOutletNodeName = baseName + " Cool Coil Outlet";
286
287
1/1
✓ Branch 1 taken 4 times.
4 heatingCoilInletNodeName = coolingCoilOutletNodeName;
288
1/1
✓ Branch 1 taken 4 times.
4 heatingCoilOutletNodeName = baseName + " Heat Coil Outlet";
289
290
1/1
✓ Branch 1 taken 4 times.
4 fanInletNodeName = heatingCoilOutletNodeName;
291
1/1
✓ Branch 1 taken 4 times.
4 fanOutletNodeName = baseName + " Fan Outlet";
292
293
1/1
✓ Branch 1 taken 4 times.
4 suppCoilInletNodeName = fanOutletNodeName;
294
1/1
✓ Branch 1 taken 4 times.
4 suppCoilOutletNodeName = airOutletNodeName;
295 }
296
297
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_fan) {
298
5/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
4 if (_fan->iddObject().type() == IddObjectType::Fan_ConstantVolume) {
299
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _fan->setString(Fan_ConstantVolumeFields::AirInletNodeName, fanInletNodeName);
300
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _fan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName);
301 ✗ } else if (_fan->iddObject().type() == IddObjectType::Fan_OnOff) {
302 ✗ _fan->setString(Fan_OnOffFields::AirInletNodeName, fanInletNodeName);
303 ✗ _fan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName);
304 ✗ } else if (_fan->iddObject().type() == IddObjectType::Fan_SystemModel) {
305 // This isn't supported by E+ right now
306 ✗ _fan->setString(Fan_SystemModelFields::AirInletNodeName, fanInletNodeName);
307 ✗ _fan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
308 ✗ OS_ASSERT(false);
309 }
310 }
311
312
1/1
✓ Branch 1 taken 4 times.
4 fixSPMsForUnitarySystem(modelObject, fanInletNodeName, fanOutletNodeName);
313
314
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_coolingCoil) {
315
5/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
4 if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_MultiSpeed) {
316
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _coolingCoil->setString(Coil_Cooling_DX_MultiSpeedFields::AirInletNodeName, coolingCoilInletNodeName);
317
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _coolingCoil->setString(Coil_Cooling_DX_MultiSpeedFields::AirOutletNodeName, coolingCoilOutletNodeName);
318 }
319 }
320
321
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_heatingCoil) {
322
6/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 14 taken 2 times.
✓ Branch 15 taken 2 times.
4 if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Gas_MultiStage) {
323
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 _heatingCoil->setString(Coil_Heating_Gas_MultiStageFields::AirInletNodeName, heatingCoilInletNodeName);
324
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 _heatingCoil->setString(Coil_Heating_Gas_MultiStageFields::AirOutletNodeName, heatingCoilOutletNodeName);
325
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 } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric_MultiStage) {
326
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 _heatingCoil->setString(Coil_Heating_Electric_MultiStageFields::AirInletNodeName, heatingCoilInletNodeName);
327
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 _heatingCoil->setString(Coil_Heating_Electric_MultiStageFields::AirOutletNodeName, heatingCoilOutletNodeName);
328 ✗ } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) {
329 ✗ _heatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, heatingCoilInletNodeName);
330 ✗ _heatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, heatingCoilOutletNodeName);
331 ✗ } else if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_MultiSpeed) {
332 ✗ _heatingCoil->setString(Coil_Heating_DX_MultiSpeedFields::AirInletNodeName, heatingCoilInletNodeName);
333 ✗ _heatingCoil->setString(Coil_Heating_DX_MultiSpeedFields::AirOutletNodeName, heatingCoilOutletNodeName);
334 }
335 }
336
337
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_supplementalHeatingCoil) {
338
5/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 4 times.
4 if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) {
339 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, suppCoilInletNodeName);
340 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, suppCoilOutletNodeName);
341
5/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 4 times.
4 } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) {
342 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, suppCoilInletNodeName);
343 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, suppCoilOutletNodeName);
344
5/6
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 14 taken 4 times.
✗ Branch 15 not taken.
4 } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) {
345
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, suppCoilInletNodeName);
346
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, suppCoilOutletNodeName);
347 }
348 }
349
350
1/1
✓ Branch 1 taken 4 times.
8 return idfObject;
351 4 }
352
353 } // namespace energyplus
354
355 } // namespace openstudio
356