GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 67.1% 145 / 0 / 216
Functions: 100.0% 1 / 0 / 1
Branches: 51.4% 216 / 0 / 420

src/energyplus/ForwardTranslator/ForwardTranslateWaterHeaterHeatPumpWrappedCondenser.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/WaterHeaterHeatPumpWrappedCondenser.hpp"
8 #include "../../model/WaterHeaterHeatPumpWrappedCondenser_Impl.hpp"
9 #include "../../model/WaterHeaterMixed.hpp"
10 #include "../../model/WaterHeaterMixed_Impl.hpp"
11 #include "../../model/WaterHeaterStratified.hpp"
12 #include "../../model/WaterHeaterStratified_Impl.hpp"
13 #include "../../model/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp"
14 #include "../../model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp"
15 #include "../../model/Model.hpp"
16 #include "../../model/Schedule.hpp"
17 #include "../../model/Schedule_Impl.hpp"
18 #include "../../model/Curve.hpp"
19 #include "../../model/Curve_Impl.hpp"
20 #include "../../model/ThermalZone.hpp"
21 #include "../../model/ThermalZone_Impl.hpp"
22 #include "../../model/Node.hpp"
23 #include "../../model/Node_Impl.hpp"
24 #include "../../utilities/core/Assert.hpp"
25 #include <utilities/idd/WaterHeater_HeatPump_WrappedCondenser_FieldEnums.hxx>
26 #include <utilities/idd/Coil_WaterHeating_AirToWaterHeatPump_Wrapped_FieldEnums.hxx>
27 #include <utilities/idd/WaterHeater_Mixed_FieldEnums.hxx>
28 #include <utilities/idd/WaterHeater_Stratified_FieldEnums.hxx>
29 #include <utilities/idd/Fan_OnOff_FieldEnums.hxx>
30 #include <utilities/idd/Fan_SystemModel_FieldEnums.hxx>
31 #include <utilities/idd/IddEnums.hxx>
32
33 using namespace openstudio::model;
34 using namespace std;
35
36 namespace openstudio {
37
38 namespace energyplus {
39
40 3 boost::optional<IdfObject> ForwardTranslator::translateWaterHeaterHeatPumpWrappedCondenser(WaterHeaterHeatPumpWrappedCondenser& modelObject) {
41
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 IdfObject idfObject(IddObjectType::WaterHeater_HeatPump_WrappedCondenser);
42
1/1
✓ Branch 1 taken 3 times.
3 m_idfObjects.push_back(idfObject);
43
44 // Name
45
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto s = modelObject.name()) {
46
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setName(*s);
47 3 }
48
49
1/1
✓ Branch 1 taken 3 times.
3 auto tank = modelObject.tank();
50
1/1
✓ Branch 1 taken 3 times.
3 auto stratifiedTank = tank.optionalCast<model::WaterHeaterStratified>();
51
52
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto height = modelObject.controlSensor1HeightInStratifiedTank()) {
53
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::ControlSensor1HeightInStratifiedTank, height.get());
54 } else {
55 ✗ if (stratifiedTank) {
56 ✗ auto heater1Height = stratifiedTank->heater1Height();
57 ✗ idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::ControlSensor1HeightInStratifiedTank, heater1Height);
58 }
59 }
60
61 {
62
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.controlSensor1Weight();
63
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::ControlSensor1Weight, value);
64 }
65
66
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto height = modelObject.controlSensor2HeightInStratifiedTank()) {
67
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::ControlSensor2HeightInStratifiedTank, height.get());
68 } else {
69 ✗ if (stratifiedTank) {
70 ✗ auto heater2Height = stratifiedTank->heater2Height();
71 ✗ idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::ControlSensor2HeightInStratifiedTank, heater2Height);
72 }
73 }
74
75
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto schedule = modelObject.availabilitySchedule()) {
76
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
6 if (auto _schedule = translateAndMapModelObject(schedule.get())) {
77
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::AvailabilityScheduleName, _schedule->nameString());
78 3 }
79 3 }
80
81 {
82
1/1
✓ Branch 1 taken 3 times.
3 auto schedule = modelObject.compressorSetpointTemperatureSchedule();
83
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto _schedule = translateAndMapModelObject(schedule)) {
84
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::CompressorSetpointTemperatureScheduleName, _schedule->nameString());
85 3 }
86 3 }
87
88 {
89
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.deadBandTemperatureDifference();
90
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::DeadBandTemperatureDifference, value);
91 }
92
93 {
94
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.condenserBottomLocation();
95
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::CondenserBottomLocation, value);
96 }
97
98 {
99
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.condenserTopLocation();
100
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::CondenserTopLocation, value);
101 }
102
103 {
104
2/3
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
3 if (modelObject.isEvaporatorAirFlowRateAutocalculated()) {
105 ✗ idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::EvaporatorAirFlowRate, "Autocalculate");
106
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 } else if (auto value = modelObject.evaporatorAirFlowRate()) {
107
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::EvaporatorAirFlowRate, value.get());
108 }
109 }
110
111 // Logic is in model namespace for these two for EMS, cf #5547
112
1/1
✓ Branch 1 taken 3 times.
3 std::string airInletNodeName = modelObject.airInletNodeName();
113
1/1
✓ Branch 1 taken 3 times.
3 std::string airOutletNodeName = modelObject.airOutletNodeName();
114
115 3 std::string outdoorAirNodeName;
116 3 std::string exhaustAirNodeName;
117 3 std::string inletAirZoneName;
118 3 std::string inletAirMixerNodeName;
119 3 std::string outletAirSplitterNodeName;
120 3 std::string fanInletNodeName;
121 3 std::string fanOutletNodeName;
122 3 std::string evapInletNodeName;
123 3 std::string evapOutletNodeName;
124
125
1/1
✓ Branch 1 taken 3 times.
3 auto inletAirConfiguration = modelObject.inletAirConfiguration();
126
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirConfiguration, inletAirConfiguration);
127
128
4/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
6 if (istringEqual(modelObject.fanPlacement(), "DrawThrough")) {
129
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::FanPlacement, "DrawThrough");
130
131 // Depending on inletAirConfiguration, what this returns will be different
132 // * "ZoneAirOnly" and "ZoneAndOutdoorAir" need to get nodes from the thermal zone
133 // * "OutdoorAirOnly" and "Schedule", it just constructs a node name.
134 // This is helpful if you need to control this via EMS
135
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 1 time.
6 if (istringEqual(inletAirConfiguration, "ZoneAirOnly")) {
136
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (auto thermalZone = modelObject.thermalZone()) {
137
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 inletAirZoneName = thermalZone->name().get();
138
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet";
139
1/1
✓ Branch 1 taken 2 times.
2 fanOutletNodeName = airOutletNodeName;
140
1/1
✓ Branch 1 taken 2 times.
2 evapInletNodeName = airInletNodeName;
141
1/1
✓ Branch 1 taken 2 times.
2 evapOutletNodeName = fanInletNodeName;
142 2 }
143
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 time.
2 } else if (istringEqual(inletAirConfiguration, "ZoneAndOutdoorAir")) {
144 ✗ if (auto thermalZone = modelObject.thermalZone()) {
145 ✗ outdoorAirNodeName = modelObject.name().get() + " Outdoor Air";
146 ✗ exhaustAirNodeName = modelObject.name().get() + " Exhaust Air";
147 ✗ inletAirZoneName = thermalZone->name().get();
148 ✗ inletAirMixerNodeName = modelObject.name().get() + " Mixer Outlet - Evap Inlet";
149 ✗ outletAirSplitterNodeName = modelObject.name().get() + " Fan Outlet - Splitter Inlet";
150 ✗ fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet";
151 ✗ fanOutletNodeName = outletAirSplitterNodeName;
152 ✗ evapInletNodeName = inletAirMixerNodeName;
153 ✗ evapOutletNodeName = fanInletNodeName;
154 ✗ }
155
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 time.
2 } else if (istringEqual(inletAirConfiguration, "OutdoorAirOnly")) {
156 ✗ outdoorAirNodeName = modelObject.name().get() + " Outdoor Air";
157 ✗ exhaustAirNodeName = modelObject.name().get() + " Exhaust Air";
158 ✗ fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet";
159 ✗ fanOutletNodeName = exhaustAirNodeName;
160 ✗ evapInletNodeName = outdoorAirNodeName;
161 ✗ evapOutletNodeName = fanInletNodeName;
162
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
2 } else if (istringEqual(inletAirConfiguration, "Schedule")) {
163
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 fanInletNodeName = modelObject.name().get() + " Evap Outlet - Fan Inlet";
164
1/1
✓ Branch 1 taken 1 time.
1 fanOutletNodeName = airOutletNodeName;
165
1/1
✓ Branch 1 taken 1 time.
1 evapInletNodeName = airInletNodeName;
166
1/1
✓ Branch 1 taken 1 time.
1 evapOutletNodeName = fanInletNodeName;
167 }
168
169 } else { // BlowThrough
170 ✗ idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::FanPlacement, "BlowThrough");
171
172 ✗ if (istringEqual(inletAirConfiguration, "ZoneAirOnly")) {
173 ✗ if (auto thermalZone = modelObject.thermalZone()) {
174 ✗ inletAirZoneName = thermalZone->name().get();
175 ✗ fanInletNodeName = airInletNodeName;
176 ✗ fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet";
177 ✗ evapInletNodeName = fanOutletNodeName;
178 ✗ evapOutletNodeName = airOutletNodeName;
179 ✗ }
180 ✗ } else if (istringEqual(inletAirConfiguration, "ZoneAndOutdoorAir")) {
181 ✗ if (auto thermalZone = modelObject.thermalZone()) {
182 ✗ outdoorAirNodeName = modelObject.name().get() + " Outdoor Air";
183 ✗ exhaustAirNodeName = modelObject.name().get() + " Exhaust Air";
184 ✗ inletAirZoneName = thermalZone->name().get();
185 ✗ inletAirMixerNodeName = modelObject.name().get() + " Mixer Outlet - Fan Inlet";
186 ✗ outletAirSplitterNodeName = modelObject.name().get() + " Evap Outlet - Splitter Inlet";
187 ✗ fanInletNodeName = inletAirMixerNodeName;
188 ✗ fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet";
189 ✗ evapInletNodeName = fanOutletNodeName;
190 ✗ evapOutletNodeName = outletAirSplitterNodeName;
191 ✗ }
192 ✗ } else if (istringEqual(inletAirConfiguration, "OutdoorAirOnly")) {
193 ✗ outdoorAirNodeName = modelObject.name().get() + " Outdoor Air";
194 ✗ exhaustAirNodeName = modelObject.name().get() + " Exhaust Air";
195 ✗ fanInletNodeName = outdoorAirNodeName;
196 ✗ fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet";
197 ✗ evapInletNodeName = fanOutletNodeName;
198 ✗ evapOutletNodeName = exhaustAirNodeName;
199 ✗ } else if (istringEqual(inletAirConfiguration, "Schedule")) {
200 ✗ fanInletNodeName = airInletNodeName;
201 ✗ fanOutletNodeName = modelObject.name().get() + " Fan Outlet - Evap Inlet";
202 ✗ evapInletNodeName = fanOutletNodeName;
203 ✗ evapOutletNodeName = airOutletNodeName;
204 }
205 }
206
207
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::AirInletNodeName, airInletNodeName);
208
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::AirOutletNodeName, airOutletNodeName);
209
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::OutdoorAirNodeName, outdoorAirNodeName);
210
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::ExhaustAirNodeName, exhaustAirNodeName);
211
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirZoneName, inletAirZoneName);
212
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirMixerNodeName, inletAirMixerNodeName);
213
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::OutletAirSplitterNodeName, outletAirSplitterNodeName);
214
215
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto schedule = modelObject.inletAirTemperatureSchedule()) {
216
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
6 if (auto _schedule = translateAndMapModelObject(schedule.get())) {
217
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirTemperatureScheduleName, _schedule->nameString());
218 3 }
219 3 }
220
221
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto schedule = modelObject.inletAirHumiditySchedule()) {
222
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
6 if (auto _schedule = translateAndMapModelObject(schedule.get())) {
223
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirHumidityScheduleName, _schedule->nameString());
224 3 }
225 3 }
226
227 {
228
1/1
✓ Branch 1 taken 3 times.
3 auto mo = modelObject.tank();
229
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
6 if (auto idf = translateAndMapModelObject(mo)) {
230
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankName, idf->name().get());
231
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankObjectType, idf->iddObject().name());
232
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
2 if (mo.iddObjectType() == model::WaterHeaterMixed::iddObjectType()) {
233 ✗ auto waterHeaterMixed = mo.cast<model::WaterHeaterMixed>();
234 ✗ if (auto node = waterHeaterMixed.supplyInletModelObject()) {
235 ✗ idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankUseSideInletNodeName, node->name().get());
236 ✗ }
237 ✗ if (auto node = waterHeaterMixed.supplyOutletModelObject()) {
238 ✗ idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankUseSideOutletNodeName, node->name().get());
239 ✗ }
240
3/4
✓ Branch 2 taken 2 times.
✓ Branch 5 taken 2 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
2 } else if (mo.iddObjectType() == model::WaterHeaterStratified::iddObjectType()) {
241
1/1
✓ Branch 1 taken 2 times.
2 auto waterHeaterStratified = mo.cast<model::WaterHeaterStratified>();
242
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (auto node = waterHeaterStratified.supplyInletModelObject()) {
243
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankUseSideInletNodeName, node->name().get());
244 2 }
245
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (auto node = waterHeaterStratified.supplyOutletModelObject()) {
246
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankUseSideOutletNodeName, node->name().get());
247 2 }
248 2 } else {
249 ✗ LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of tank: " << mo.briefDescription());
250 }
251 3 }
252 3 }
253
254 {
255
1/1
✓ Branch 1 taken 3 times.
3 auto mo = modelObject.dXCoil();
256
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(mo)) {
257
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(WaterHeater_HeatPump_WrappedCondenserFields::DXCoilName, idf->name().get());
258
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(WaterHeater_HeatPump_WrappedCondenserFields::DXCoilObjectType, idf->iddObject().name());
259
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (mo.iddObjectType() == model::CoilWaterHeatingAirToWaterHeatPumpWrapped::iddObjectType()) {
260
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idf->setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorAirInletNodeName, evapInletNodeName);
261
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idf->setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorAirOutletNodeName, evapOutletNodeName);
262 } else {
263 ✗ LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of coil: " << mo.briefDescription());
264 }
265 3 }
266 3 }
267
268 {
269
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.minimumInletAirTemperatureforCompressorOperation();
270
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::MinimumInletAirTemperatureforCompressorOperation, value);
271 }
272
273 {
274
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.maximumInletAirTemperatureforCompressorOperation();
275
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::MaximumInletAirTemperatureforCompressorOperation, value);
276 }
277
278 {
279
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.compressorLocation();
280
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::CompressorLocation, value);
281 3 }
282
283
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 2 times.
9 if (istringEqual("Schedule", modelObject.compressorLocation())) {
284
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (auto schedule = modelObject.compressorAmbientTemperatureSchedule()) {
285
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (auto _schedule = translateAndMapModelObject(schedule.get())) {
286
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::CompressorAmbientTemperatureScheduleName, _schedule->nameString());
287 1 }
288 1 }
289 }
290
291 {
292
1/1
✓ Branch 1 taken 3 times.
3 auto mo = modelObject.fan();
293
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(mo)) {
294
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(WaterHeater_HeatPump_WrappedCondenserFields::FanName, idf->name().get());
295
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(WaterHeater_HeatPump_WrappedCondenserFields::FanObjectType, idf->iddObject().name());
296
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (mo.iddObjectType() == IddObjectType::OS_Fan_OnOff) {
297
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idf->setString(Fan_OnOffFields::AirInletNodeName, fanInletNodeName);
298
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idf->setString(Fan_OnOffFields::AirOutletNodeName, fanOutletNodeName);
299 ✗ } else if (mo.iddObjectType() == IddObjectType::OS_Fan_SystemModel) {
300 ✗ idf->setString(Fan_SystemModelFields::AirInletNodeName, fanInletNodeName);
301 ✗ idf->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
302 } else {
303 ✗ LOG(Error, modelObject.briefDescription() << " is attached to an unsupported type of fan: " << mo.briefDescription());
304 }
305 3 }
306 3 }
307
308 {
309
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.onCycleParasiticElectricLoad();
310
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::OnCycleParasiticElectricLoad, value);
311 }
312
313 {
314
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.offCycleParasiticElectricLoad();
315
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(WaterHeater_HeatPump_WrappedCondenserFields::OffCycleParasiticElectricLoad, value);
316 }
317
318 {
319
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.parasiticHeatRejectionLocation();
320
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::ParasiticHeatRejectionLocation, value);
321 3 }
322
323
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
6 if (auto schedule = modelObject.inletAirMixerSchedule()) {
324
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
4 if (auto _schedule = translateAndMapModelObject(schedule.get())) {
325
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::InletAirMixerScheduleName, _schedule->nameString());
326 2 }
327 3 }
328
329 {
330
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.tankElementControlLogic();
331
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
6 if (istringEqual(value, "MutuallyExlcusive")) {
332 ✗ idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankElementControlLogic, "MutuallyExclusive");
333 } else {
334
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(WaterHeater_HeatPump_WrappedCondenserFields::TankElementControlLogic, value);
335 }
336 3 }
337
338
1/1
✓ Branch 1 taken 3 times.
6 return idfObject;
339 3 }
340
341 } // namespace energyplus
342 } // namespace openstudio
343