GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 72.1% 158 / 0 / 219
Functions: 100.0% 2 / 0 / 2
Branches: 59.2% 316 / 0 / 534

src/energyplus/ForwardTranslator/ForwardTranslateZoneHVACPackagedTerminalHeatPump.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/ZoneHVACPackagedTerminalHeatPump.hpp"
13 #include "../../model/ZoneHVACPackagedTerminalHeatPump_Impl.hpp"
14 #include "../../model/ThermalZone.hpp"
15 #include "../../model/ThermalZone_Impl.hpp"
16 #include "../../model/CoilCoolingDX.hpp"
17 #include "../../model/CoilCoolingDX_Impl.hpp"
18 #include "../../model/CoilCoolingDXSingleSpeed.hpp"
19 #include "../../model/CoilCoolingDXSingleSpeed_Impl.hpp"
20 #include "../../model/CoilCoolingDXVariableSpeed.hpp"
21 #include "../../model/CoilCoolingDXVariableSpeed_Impl.hpp"
22 #include "../../model/CoilSystemCoolingDXHeatExchangerAssisted.hpp"
23 #include "../../model/CoilSystemCoolingDXHeatExchangerAssisted_Impl.hpp"
24 #include "../../model/HeatExchangerAirToAirSensibleAndLatent.hpp"
25 #include "../../model/HeatExchangerAirToAirSensibleAndLatent_Impl.hpp"
26 #include "../../model/CoilHeatingDXSingleSpeed.hpp"
27 #include "../../model/CoilHeatingDXSingleSpeed_Impl.hpp"
28 #include "../../model/CoilHeatingDXVariableSpeed.hpp"
29 #include "../../model/CoilHeatingDXVariableSpeed_Impl.hpp"
30 #include "../../model/AirLoopHVAC.hpp"
31 #include "../../model/AirLoopHVAC_Impl.hpp"
32 #include <utilities/idd/ZoneHVAC_PackagedTerminalHeatPump_FieldEnums.hxx>
33 #include <utilities/idd/Fan_ConstantVolume_FieldEnums.hxx>
34 #include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
35 #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
36 #include <utilities/idd/Coil_Heating_DX_SingleSpeed_FieldEnums.hxx>
37 #include <utilities/idd/Coil_Heating_DX_VariableSpeed_FieldEnums.hxx>
38 #include <utilities/idd/Coil_Heating_Fuel_FieldEnums.hxx>
39 #include <utilities/idd/Coil_Heating_Electric_FieldEnums.hxx>
40 #include <utilities/idd/Coil_Heating_Water_FieldEnums.hxx>
41 #include <utilities/idd/Coil_Cooling_DX_FieldEnums.hxx>
42 #include <utilities/idd/Coil_Cooling_DX_SingleSpeed_FieldEnums.hxx>
43 #include <utilities/idd/Coil_Cooling_DX_VariableSpeed_FieldEnums.hxx>
44 #include <utilities/idd/HeatExchanger_AirToAir_SensibleAndLatent_FieldEnums.hxx>
45 #include <utilities/idd/OutdoorAir_Mixer_FieldEnums.hxx>
46 #include "../../utilities/idd/IddEnums.hpp"
47 #include "../../utilities/math/FloatCompare.hpp"
48 #include <utilities/idd/IddEnums.hxx>
49 #include <utilities/idd/IddFactory.hxx>
50
51 using namespace openstudio::model;
52
53 namespace openstudio {
54
55 namespace energyplus {
56
57 4 boost::optional<IdfObject> ForwardTranslator::translateZoneHVACPackagedTerminalHeatPump(ZoneHVACPackagedTerminalHeatPump& modelObject) {
58 4 boost::optional<std::string> s;
59 4 boost::optional<double> value;
60
61
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 IdfObject idfObject(IddObjectType::ZoneHVAC_PackagedTerminalHeatPump);
62
63
1/1
✓ Branch 1 taken 4 times.
4 m_idfObjects.push_back(idfObject);
64
65 // Name
66
67
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 std::string baseName = modelObject.name().get();
68
69
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setName(baseName);
70
71
1/1
✓ Branch 1 taken 4 times.
4 std::string mixedAirNodeName = baseName + " Mixed Air Node";
72
73
1/1
✓ Branch 1 taken 4 times.
4 std::string coolingCoilOutletNodeName = baseName + " Cooling Coil Outlet Node";
74
75
1/1
✓ Branch 1 taken 4 times.
4 std::string heatingCoilOutletNodeName = baseName + " Heating Coil Outlet Node";
76
77
1/1
✓ Branch 1 taken 4 times.
4 std::string fanOutletNodeName = baseName + " Fan Outlet Node";
78
79
1/1
✓ Branch 1 taken 4 times.
4 std::string reliefAirNodeName = baseName + " Relief Air Node";
80
81
1/1
✓ Branch 1 taken 4 times.
4 std::string oaNodeName = baseName + " OA Node";
82
83 4 std::string airInletNodeName;
84
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (auto node = modelObject.inletNode()) {
85
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 airInletNodeName = node->nameString();
86 4 }
87
88 4 std::string airOutletNodeName;
89
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (auto node = modelObject.outletNode()) {
90
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 airOutletNodeName = node->nameString();
91 4 }
92
93 8 auto translateMixer = [&]() {
94
1/1
✓ Branch 1 taken 8 times.
8 auto t_airLoopHVAC = modelObject.airLoopHVAC();
95
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 if (t_airLoopHVAC) {
96 ✗ return false;
97 }
98
99 8 bool zeroOA = false;
100
2/3
✓ Branch 1 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
16 if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) {
101 ✗ zeroOA = equal(value.get(), 0.0);
102 }
103
2/3
✓ Branch 1 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
16 if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) {
104 ✗ zeroOA = (zeroOA && equal(value.get(), 0.0));
105 }
106
2/3
✓ Branch 1 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 8 times.
16 if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) {
107 ✗ zeroOA = (zeroOA && equal(value.get(), 0.0));
108 }
109
110
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 if (zeroOA) {
111 ✗ return false;
112 }
113
114 8 return true;
115 8 };
116
117 // AvailabilityScheduleName
118
119
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.availabilitySchedule()) {
120
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<IdfObject> _schedule = translateAndMapModelObject(schedule.get())) {
121
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(ZoneHVAC_PackagedTerminalHeatPumpFields::AvailabilityScheduleName, _schedule->name().get());
122 4 }
123 4 }
124
125 // AirInletNodeName
126
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::AirInletNodeName, airInletNodeName);
127
128 // AirOutletNodeName
129
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::AirOutletNodeName, airOutletNodeName);
130
131
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (translateMixer()) {
132 // OutdoorAirMixerObjectType
133
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::OutdoorAirMixerObjectType, modelObject.outdoorAirMixerObjectType());
134
135 // OutdoorAirMixerName
136
137
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 std::string oaMixerName = modelObject.name().get() + " OA Mixer";
138
139
1/1
✓ Branch 1 taken 4 times.
4 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::OutdoorAirMixerName, oaMixerName);
140
141
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 IdfObject _outdoorAirMixer(IddObjectType::OutdoorAir_Mixer);
142
1/1
✓ Branch 1 taken 4 times.
4 _outdoorAirMixer.setName(oaMixerName);
143
1/1
✓ Branch 1 taken 4 times.
4 m_idfObjects.push_back(_outdoorAirMixer);
144
145
1/1
✓ Branch 1 taken 4 times.
4 _outdoorAirMixer.setString(OutdoorAir_MixerFields::MixedAirNodeName, mixedAirNodeName);
146
147
1/1
✓ Branch 1 taken 4 times.
4 _outdoorAirMixer.setString(OutdoorAir_MixerFields::OutdoorAirStreamNodeName, oaNodeName);
148
149
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 IdfObject _oaNodeList(openstudio::IddObjectType::OutdoorAir_NodeList);
150
1/1
✓ Branch 1 taken 4 times.
4 _oaNodeList.setString(0, oaNodeName);
151
1/1
✓ Branch 1 taken 4 times.
4 m_idfObjects.push_back(_oaNodeList);
152
153
1/1
✓ Branch 1 taken 4 times.
4 _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReliefAirStreamNodeName, reliefAirNodeName);
154
155
1/1
✓ Branch 1 taken 4 times.
4 _outdoorAirMixer.setString(OutdoorAir_MixerFields::ReturnAirStreamNodeName, airInletNodeName);
156 4 }
157
158 // SupplyAirFlowRateDuringCoolingOperation
159
160
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSupplyAirFlowRateDuringCoolingOperationAutosized()) {
161
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingSupplyAirFlowRate, "Autosize");
162 ✗ } else if ((value = modelObject.supplyAirFlowRateDuringCoolingOperation())) {
163 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingSupplyAirFlowRate, value.get());
164 }
165
166 // SupplyAirFlowRateDuringHeatingOperation
167
168
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSupplyAirFlowRateDuringHeatingOperationAutosized()) {
169
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingSupplyAirFlowRate, "Autosize");
170 ✗ } else if ((value = modelObject.supplyAirFlowRateDuringHeatingOperation())) {
171 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingSupplyAirFlowRate, value.get());
172 }
173
174 // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded
175
176
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) {
177
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadSupplyAirFlowRate, "Autosize");
178 ✗ } else if ((value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded())) {
179 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadSupplyAirFlowRate, value.get());
180 }
181
182 // NoLoadSupplyAirFlowRateControlSetToLowSpeed
183
184
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.noLoadSupplyAirFlowRateControlSetToLowSpeed()) {
185
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "Yes");
186 } else {
187 ✗ idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadSupplyAirFlowRateControlSetToLowSpeed, "No");
188 }
189
190 // OutdoorAirFlowRateDuringCoolingOperation
191
192
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isOutdoorAirFlowRateDuringCoolingOperationAutosized()) {
193
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingOutdoorAirFlowRate, "Autosize");
194 ✗ } else if ((value = modelObject.outdoorAirFlowRateDuringCoolingOperation())) {
195 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingOutdoorAirFlowRate, value.get());
196 }
197
198 // OutdoorAirFlowRateDuringHeatingOperation
199
200
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isOutdoorAirFlowRateDuringHeatingOperationAutosized()) {
201
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingOutdoorAirFlowRate, "Autosize");
202 ✗ } else if ((value = modelObject.outdoorAirFlowRateDuringHeatingOperation())) {
203 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingOutdoorAirFlowRate, value.get());
204 }
205
206 // OutdoorAirFlowRateWhenNoCoolingorHeatingisNeeded
207
208
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isOutdoorAirFlowRateWhenNoCoolingorHeatingisNeededAutosized()) {
209
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadOutdoorAirFlowRate, "Autosize");
210 ✗ } else if ((value = modelObject.outdoorAirFlowRateWhenNoCoolingorHeatingisNeeded())) {
211 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::NoLoadOutdoorAirFlowRate, value.get());
212 }
213
214 // SupplyAirFanObjectType
215
216
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent supplyAirFan = modelObject.supplyAirFan();
217
218
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<IdfObject> _supplyAirFan = translateAndMapModelObject(supplyAirFan)) {
219
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(ZoneHVAC_PackagedTerminalHeatPumpFields::SupplyAirFanObjectType, _supplyAirFan->iddObject().name());
220
221
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(ZoneHVAC_PackagedTerminalHeatPumpFields::SupplyAirFanName, _supplyAirFan->name().get());
222
223
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 4 times.
8 if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) {
224 ✗ if (translateMixer()) {
225 ✗ if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) {
226 ✗ _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, mixedAirNodeName);
227 ✗ _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName);
228 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) {
229 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, mixedAirNodeName);
230 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName);
231 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) {
232 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, mixedAirNodeName);
233 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
234 }
235 } else {
236 ✗ if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) {
237 ✗ _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, airInletNodeName);
238 ✗ _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName);
239 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) {
240 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, airInletNodeName);
241 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName);
242 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) {
243 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, airInletNodeName);
244 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
245 }
246 }
247 } else {
248 // Drawthrough position
249
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 (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) {
250
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, heatingCoilOutletNodeName);
251
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName);
252 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_OnOff) {
253 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirInletNodeName, heatingCoilOutletNodeName);
254 ✗ _supplyAirFan->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName);
255 ✗ } else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) {
256 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, heatingCoilOutletNodeName);
257 ✗ _supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
258 }
259 }
260 4 }
261
262 // HeatingCoilObjectType
263
264
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent heatingCoil = modelObject.heatingCoil();
265
266
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 3 times.
8 if (boost::optional<CoilHeatingDXSingleSpeed> coilHeatingDXSingleSpeed = heatingCoil.optionalCast<CoilHeatingDXSingleSpeed>()) {
267
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> _heatingCoil = translateCoilHeatingDXSingleSpeedWithoutUnitary(coilHeatingDXSingleSpeed.get())) {
268
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(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingCoilObjectType, _heatingCoil->iddObject().name());
269
270
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(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingCoilName, _heatingCoil->name().get());
271
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 taken 1 time.
✗ Branch 15 not taken.
1 if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_SingleSpeed) {
273
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirInletNodeName, coolingCoilOutletNodeName);
274
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _heatingCoil->setString(Coil_Heating_DX_SingleSpeedFields::AirOutletNodeName, heatingCoilOutletNodeName);
275 }
276 1 }
277
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 } else if (boost::optional<CoilHeatingDXVariableSpeed> coilHeatingDXVariableSpeed = heatingCoil.optionalCast<CoilHeatingDXVariableSpeed>()) {
278
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
6 if (boost::optional<IdfObject> _heatingCoil = translateCoilHeatingDXVariableSpeedWithoutUnitary(coilHeatingDXVariableSpeed.get())) {
279
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingCoilObjectType, _heatingCoil->iddObject().name());
280
281
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingCoilName, _heatingCoil->name().get());
282
283
5/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 14 taken 3 times.
✗ Branch 15 not taken.
3 if (_heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_DX_VariableSpeed) {
284
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 _heatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirInletNodeName, coolingCoilOutletNodeName);
285
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 _heatingCoil->setString(Coil_Heating_DX_VariableSpeedFields::IndoorAirOutletNodeName, heatingCoilOutletNodeName);
286 }
287 3 }
288 7 }
289
290 // HeatingConvergenceTolerance
291
292
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.heatingConvergenceTolerance())) {
293
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::HeatingConvergenceTolerance, value.get());
294 }
295
296 // CoolingCoilObjectType
297
298
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent coolingCoil = modelObject.coolingCoil();
299
300 4 boost::optional<IdfObject> _coolingCoil;
301
302
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 3 times.
8 if (boost::optional<CoilCoolingDXSingleSpeed> dxCoil = coolingCoil.optionalCast<CoilCoolingDXSingleSpeed>()) {
303
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil = translateCoilCoolingDXSingleSpeedWithoutUnitary(dxCoil.get());
304
305
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()));
306
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 } else if (boost::optional<CoilCoolingDXVariableSpeed> dxCoil = coolingCoil.optionalCast<CoilCoolingDXVariableSpeed>()) {
307
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil = translateCoilCoolingDXVariableSpeedWithoutUnitary(dxCoil.get());
308
309
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()));
310
3/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
4 } else if (boost::optional<CoilCoolingDX> dxCoil = coolingCoil.optionalCast<CoilCoolingDX>()) {
311
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil = translateCoilCoolingDXWithoutUnitary(dxCoil.get());
312
313
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()));
314 } else {
315
1/1
✓ Branch 1 taken 1 time.
1 _coolingCoil = translateAndMapModelObject(coolingCoil);
316 9 }
317
318
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (_coolingCoil) {
319 4 std::string coolingCoilInletNodeName;
320
321
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 4 times.
8 if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) {
322 ✗ coolingCoilInletNodeName = fanOutletNodeName;
323 } else {
324
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (translateMixer()) {
325
1/1
✓ Branch 1 taken 4 times.
4 coolingCoilInletNodeName = mixedAirNodeName;
326 } else {
327 ✗ coolingCoilInletNodeName = airInletNodeName;
328 }
329 }
330
331
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(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingCoilObjectType, _coolingCoil->iddObject().name());
332
333
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(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingCoilName, _coolingCoil->name().get());
334
335
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 1 time.
✓ Branch 15 taken 3 times.
4 if (_coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_SingleSpeed) {
336
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirInletNodeName, coolingCoilInletNodeName);
337
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DX_SingleSpeedFields::AirOutletNodeName, coolingCoilOutletNodeName);
338
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) {
339
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirInletNodeName, coolingCoilInletNodeName);
340
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DX_VariableSpeedFields::IndoorAirOutletNodeName, coolingCoilOutletNodeName);
341
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) {
342
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 auto hx = coolingCoil.cast<CoilSystemCoolingDXHeatExchangerAssisted>().heatExchanger();
343
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<IdfObject> _heatExchanger = translateAndMapModelObject(hx);
344
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (_heatExchanger) {
345
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) {
346
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _heatExchanger->setString(HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNodeName, coolingCoilInletNodeName);
347
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _heatExchanger->setString(HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirOutletNodeName, coolingCoilOutletNodeName);
348 }
349 }
350
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) {
351
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DXFields::EvaporatorInletNodeName, coolingCoilInletNodeName);
352
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _coolingCoil->setString(Coil_Cooling_DXFields::EvaporatorOutletNodeName, coolingCoilOutletNodeName);
353 }
354 4 }
355
356 // CoolingConvergenceTolerance
357
358
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.coolingConvergenceTolerance())) {
359
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::CoolingConvergenceTolerance, value.get());
360 }
361
362 // SupplementalHeatingCoilObjectType
363
364
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent supplementalHeatingCoil = modelObject.supplementalHeatingCoil();
365
366
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<IdfObject> _supplementalHeatingCoil = translateAndMapModelObject(supplementalHeatingCoil)) {
367
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(ZoneHVAC_PackagedTerminalHeatPumpFields::SupplementalHeatingCoilObjectType, _supplementalHeatingCoil->iddObject().name());
368
369
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(ZoneHVAC_PackagedTerminalHeatPumpFields::SupplementalHeatingCoilName, _supplementalHeatingCoil->name().get());
370
371
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 4 times.
8 if (istringEqual(modelObject.fanPlacement(), "BlowThrough")) {
372 ✗ if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Fuel) {
373 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, heatingCoilOutletNodeName);
374
375 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName);
376 ✗ } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric) {
377 ✗ _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, heatingCoilOutletNodeName);
378
379 ✗ _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName);
380 ✗ } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) {
381 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, heatingCoilOutletNodeName);
382
383 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, airOutletNodeName);
384 }
385 } else {
386
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_Fuel) {
387 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirInletNodeName, fanOutletNodeName);
388
389 ✗ _supplementalHeatingCoil->setString(Coil_Heating_FuelFields::AirOutletNodeName, airOutletNodeName);
390
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) {
391
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName, fanOutletNodeName);
392
393
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName, airOutletNodeName);
394 ✗ } else if (_supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water) {
395 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName, fanOutletNodeName);
396
397 ✗ _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName, airOutletNodeName);
398 }
399 }
400 4 }
401
402 // MaximumSupplyAirTemperaturefromSupplementalHeater
403
404
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
4 if (modelObject.isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized()) {
405
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "Autosize");
406 ✗ } else if ((value = modelObject.maximumSupplyAirTemperaturefromSupplementalHeater())) {
407 ✗ idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::MaximumSupplyAirTemperaturefromSupplementalHeater, value.get());
408 }
409
410 // MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation
411
412
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())) {
413
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, value.get());
414 }
415
416 // FanPlacement
417
418
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setString(ZoneHVAC_PackagedTerminalHeatPumpFields::FanPlacement, modelObject.fanPlacement());
419
420 // SupplyAirFanOperatingModeScheduleName
421
422
1/1
✓ Branch 1 taken 4 times.
4 Schedule fanOpSchedule = modelObject.supplyAirFanOperatingModeSchedule();
423
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(fanOpSchedule)) {
424
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(ZoneHVAC_PackagedTerminalHeatPumpFields::SupplyAirFanOperatingModeScheduleName, _schedule->name().get());
425 4 }
426
427 // DXHeatingCoilSizingRatio
428
429
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())) {
430
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 idfObject.setDouble(ZoneHVAC_PackagedTerminalHeatPumpFields::DXHeatingCoilSizingRatio, value.get());
431 }
432
433
1/1
✓ Branch 1 taken 4 times.
8 return idfObject;
434 4 }
435
436 } // namespace energyplus
437
438 } // namespace openstudio
439