GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 99.3% 150 / 0 / 151
Functions: 100.0% 2 / 0 / 2
Branches: 94.5% 240 / 0 / 254

src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXTwoSpeed.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/CoilCoolingDXTwoSpeed.hpp"
11 #include "../../model/CoilCoolingDXTwoSpeed_Impl.hpp"
12 #include "../../model/Curve.hpp"
13 #include "../../model/Curve_Impl.hpp"
14 #include "../../utilities/core/Logger.hpp"
15 #include "../../utilities/core/Assert.hpp"
16 #include <utilities/idd/CoilSystem_Cooling_DX_FieldEnums.hxx>
17 #include <utilities/idd/Coil_Cooling_DX_TwoSpeed_FieldEnums.hxx>
18 #include "../../utilities/idd/IddEnums.hpp"
19 #include <utilities/idd/IddEnums.hxx>
20 #include <utilities/idd/IddFactory.hxx>
21
22 using namespace openstudio::model;
23
24 using namespace std;
25
26 namespace openstudio {
27
28 namespace energyplus {
29
30 9 boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXTwoSpeedWithoutUnitary(model::CoilCoolingDXTwoSpeed& modelObject) {
31 //setup two boost optionals to use to store get method returns
32 9 boost::optional<std::string> s;
33 9 boost::optional<double> d;
34
35 //create the IdfObject that will be the coil
36
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 IdfObject idfObject(IddObjectType::Coil_Cooling_DX_TwoSpeed);
37
38 //Name
39
1/1
✓ Branch 1 taken 9 times.
9 m_idfObjects.push_back(idfObject);
40
1/1
✓ Branch 1 taken 9 times.
9 s = modelObject.name();
41
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (s) {
42
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setName(*s);
43 }
44
45 // A2 , \field Availability Schedule Name
46
1/1
✓ Branch 1 taken 9 times.
9 Schedule sched = modelObject.availabilitySchedule();
47
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(sched);
48
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AvailabilityScheduleName, sched.name().get());
49
50 // N1 , \field Rated High Speed Total Cooling Capacity
51
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedHighSpeedTotalCoolingCapacity();
52
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
53
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedGrossRatedTotalCoolingCapacity, *d);
54 } else {
55
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::HighSpeedGrossRatedTotalCoolingCapacity, "Autosize");
56 }
57
58 // N2 , \field Rated High Speed Sensible Heat Ratio
59
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedHighSpeedSensibleHeatRatio();
60
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
61
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedSensibleHeatRatio, *d);
62 } else {
63
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedSensibleHeatRatio, "Autosize");
64 }
65
66 // N3 , \field Rated High Speed COP
67
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.ratedHighSpeedCOP();
68
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
69
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedGrossRatedCoolingCOP, *d);
70 }
71
72 // N4 , \field Rated High Speed Air Flow Rate
73
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedHighSpeedAirFlowRate();
74
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
75
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedAirFlowRate, *d);
76 } else {
77
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedAirFlowRate, "Autosize");
78 }
79
80
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedEvaporatorFanPowerPerVolumeFlowRate2017,
81 modelObject.ratedHighSpeedEvaporatorFanPowerPerVolumeFlowRate2017());
82
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedRatedEvaporatorFanPowerPerVolumeFlowRate2023,
83 modelObject.ratedHighSpeedEvaporatorFanPowerPerVolumeFlowRate2023());
84
85 // Unit Internal Static Air Pressure
86 {
87
1/1
✓ Branch 1 taken 9 times.
9 auto value = modelObject.unitInternalStaticAirPressure();
88
1/1
✓ Branch 1 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::UnitInternalStaticAirPressure, value);
89 }
90
91 //A3 , \field Air Inlet Node Name
92
1/1
✓ Branch 1 taken 9 times.
9 OptionalModelObject omo = modelObject.inletModelObject();
93
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
9 if (omo) {
94
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 translateAndMapModelObject(*omo);
95
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 s = omo->name();
96
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
97
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AirInletNodeName, *s);
98 }
99 }
100
101 //A4 , \field Air Outlet Node Name
102
1/1
✓ Branch 1 taken 9 times.
9 omo = modelObject.outletModelObject();
103
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
9 if (omo) {
104
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 translateAndMapModelObject(*omo);
105
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 s = omo->name();
106
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
107
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::AirOutletNodeName, *s);
108 }
109 }
110
111 // A5 , \field Total Cooling Capacity Function of Temperature Curve Name
112
1/1
✓ Branch 1 taken 9 times.
9 Curve cb = modelObject.totalCoolingCapacityFunctionOfTemperatureCurve();
113
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cb);
114
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::TotalCoolingCapacityFunctionofTemperatureCurveName, cb.name().get());
115
116 // A6 , \field Total Cooling Capacity Function of Flow Fraction Curve Name
117
1/1
✓ Branch 1 taken 9 times.
9 cb = modelObject.totalCoolingCapacityFunctionOfFlowFractionCurve();
118
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cb);
119
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::TotalCoolingCapacityFunctionofFlowFractionCurveName, cb.name().get());
120
121 // A7 , \field Energy Input Ratio Function of Temperature Curve Name
122
1/1
✓ Branch 1 taken 9 times.
9 cb = modelObject.energyInputRatioFunctionOfTemperatureCurve();
123
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cb);
124
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::EnergyInputRatioFunctionofTemperatureCurveName, cb.name().get());
125
126 // A8 , \field Energy Input Ratio Function of Flow Fraction Curve Name
127
1/1
✓ Branch 1 taken 9 times.
9 Curve cq = modelObject.energyInputRatioFunctionOfFlowFractionCurve();
128
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cq);
129
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::EnergyInputRatioFunctionofFlowFractionCurveName, cq.name().get());
130
131 // A9 , \field Part Load Fraction Correlation Curve Name
132
1/1
✓ Branch 1 taken 9 times.
9 cq = modelObject.partLoadFractionCorrelationCurve();
133
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cq);
134
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::PartLoadFractionCorrelationCurveName, cq.name().get());
135
136 // N5 , \field Rated Low Speed Total Cooling Capacity
137
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedLowSpeedTotalCoolingCapacity();
138
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
139
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedGrossRatedTotalCoolingCapacity, *d);
140 } else {
141
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedGrossRatedTotalCoolingCapacity, "Autosize");
142 }
143
144 // N6 , \field Rated Low Speed Sensible Heat Ratio
145
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedLowSpeedSensibleHeatRatio();
146
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 1 time.
9 if (d) {
147
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedGrossRatedSensibleHeatRatio, *d);
148 } else {
149
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedGrossRatedSensibleHeatRatio, "Autosize");
150 }
151
152 // N7 , \field Rated Low Speed COP
153
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.ratedLowSpeedCOP();
154
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
155
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedGrossRatedCoolingCOP, *d);
156 }
157
158 // N8 , \field Rated Low Speed Air Flow Rate
159
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.ratedLowSpeedAirFlowRate();
160
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
161
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedRatedAirFlowRate, *d);
162 } else {
163
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedRatedAirFlowRate, "Autosize");
164 }
165
166
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedRatedEvaporatorFanPowerPerVolumeFlowRate2017,
167 modelObject.ratedLowSpeedEvaporatorFanPowerPerVolumeFlowRate2017());
168
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedRatedEvaporatorFanPowerPerVolumeFlowRate2023,
169 modelObject.ratedLowSpeedEvaporatorFanPowerPerVolumeFlowRate2023());
170
171 // A10, \field Low Speed Total Cooling Capacity Function of Temperature Curve Name
172
1/1
✓ Branch 1 taken 9 times.
9 cq = modelObject.lowSpeedTotalCoolingCapacityFunctionOfTemperatureCurve();
173
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cq);
174
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedTotalCoolingCapacityFunctionofTemperatureCurveName, cq.name().get());
175
176 // A11, \field Low Speed Energy Input Ratio Function of Temperature Curve Name
177
1/1
✓ Branch 1 taken 9 times.
9 cq = modelObject.lowSpeedEnergyInputRatioFunctionOfTemperatureCurve();
178
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(cq);
179
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEnergyInputRatioFunctionofTemperatureCurveName, cq.name().get());
180
181 // A12, \field Condenser Air Inlet Node Name
182
1/1
✓ Branch 1 taken 9 times.
9 s = modelObject.condenserAirInletNodeName();
183
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (s) {
184
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::CondenserAirInletNodeName, *s);
185 }
186
187 // A13, \field Condenser Type
188
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::CondenserType, modelObject.condenserType());
189
190 // Minimum Outdoor Dry-Bulb Temperature for Compressor Operation
191 {
192
1/1
✓ Branch 1 taken 9 times.
9 auto value = modelObject.minimumOutdoorDryBulbTemperatureforCompressorOperation();
193
1/1
✓ Branch 1 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation, value);
194 }
195
196 // N9, \field High Speed Evaporative Condenser Effectiveness
197
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.highSpeedEvaporativeCondenserEffectiveness();
198
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
199
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedEvaporativeCondenserEffectiveness, *d);
200 }
201
202 // N10, \field High Speed Evaporative Condenser Air Flow Rate
203
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.highSpeedEvaporativeCondenserAirFlowRate();
204
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
205
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedEvaporativeCondenserAirFlowRate, *d);
206 } else {
207
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::HighSpeedEvaporativeCondenserAirFlowRate, "Autosize");
208 }
209
210 // N11, \field High Speed Evaporative Condenser Pump Rated Power Consumption
211
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.highSpeedEvaporativeCondenserPumpRatedPowerConsumption();
212
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
213
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::HighSpeedEvaporativeCondenserPumpRatedPowerConsumption, *d);
214 } else {
215
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::HighSpeedEvaporativeCondenserPumpRatedPowerConsumption, "Autosize");
216 }
217
218 // N12, \field Low Speed Evaporative Condenser Effectiveness
219
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.lowSpeedEvaporativeCondenserEffectiveness();
220
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
221
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEvaporativeCondenserEffectiveness, *d);
222 }
223
224 // N13, \field Low Speed Evaporative Condenser Air Flow Rate
225
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.lowSpeedEvaporativeCondenserAirFlowRate();
226
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
227
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEvaporativeCondenserAirFlowRate, *d);
228 } else {
229
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEvaporativeCondenserAirFlowRate, "Autosize");
230 }
231
232 // N14, \field Low Speed Evaporative Condenser Pump Rated Power Consumption
233
1/1
✓ Branch 1 taken 9 times.
9 d = modelObject.lowSpeedEvaporativeCondenserPumpRatedPowerConsumption();
234
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (d) {
235
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEvaporativeCondenserPumpRatedPowerConsumption, *d);
236 } else {
237
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 idfObject.setString(Coil_Cooling_DX_TwoSpeedFields::LowSpeedEvaporativeCondenserPumpRatedPowerConsumption, "Autosize");
238 }
239
240 //TODO
241 // A14, \field Supply Water Storage Tank Name
242 //getSupplyWaterStorageTankName
243
244 //TODO
245 // A15, \field Condensate Collection Water Storage Tank Name
246 //getCondensateCollectionWaterStorageTankName
247
248 // N15, \field Basin Heater Capacity
249
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.basinHeaterCapacity();
250
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
251
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::BasinHeaterCapacity, *d);
252 }
253
254 // N16, \field Basin Heater Setpoint Temperature
255
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 d = modelObject.basinHeaterSetpointTemperature();
256
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (d) {
257
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 idfObject.setDouble(Coil_Cooling_DX_TwoSpeedFields::BasinHeaterSetpointTemperature, *d);
258 }
259
260 // A16; \field Basin Heater Operating Schedule Name
261
1/1
✓ Branch 1 taken 9 times.
9 OptionalSchedule os = modelObject.basinHeaterOperatingSchedule();
262
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 8 times.
9 if (os) {
263
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 translateAndMapModelObject(*os);
264
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(Coil_Cooling_DX_TwoSpeedFields::BasinHeaterOperatingScheduleName, os->name().get());
265 }
266
267
1/1
✓ Branch 1 taken 9 times.
18 return idfObject;
268 9 }
269
270 9 boost::optional<IdfObject> ForwardTranslator::translateCoilCoolingDXTwoSpeed(CoilCoolingDXTwoSpeed& modelObject) {
271
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 IdfObject coilSystemCoolingDXIdf(IddObjectType::CoilSystem_Cooling_DX);
272
273
1/1
✓ Branch 1 taken 9 times.
9 m_idfObjects.push_back(coilSystemCoolingDXIdf);
274
275
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<IdfObject> oIdfObject = translateCoilCoolingDXTwoSpeedWithoutUnitary(modelObject);
276
277
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
9 if (!oIdfObject) {
278 ✗ return boost::none;
279 }
280
281
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 IdfObject idfObject = oIdfObject.get();
282
283 9 OptionalString s;
284
285
1/1
✓ Branch 1 taken 9 times.
9 s = modelObject.name();
286
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (s) {
287
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::CoolingCoilObjectType, idfObject.iddObject().name());
288
289
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::CoolingCoilName, *s);
290
291
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 coilSystemCoolingDXIdf.setName(*s + " CoilSystem");
292 }
293
294
1/1
✓ Branch 1 taken 9 times.
9 Schedule sched = modelObject.availabilitySchedule();
295
1/1
✓ Branch 1 taken 9 times.
9 translateAndMapModelObject(sched);
296
297
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
9 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::AvailabilityScheduleName, sched.name().get());
298
299
1/1
✓ Branch 1 taken 9 times.
9 OptionalModelObject omo = modelObject.inletModelObject();
300
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
9 if (omo) {
301
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 translateAndMapModelObject(*omo);
302
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 s = omo->name();
303
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
304
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemInletNodeName, *s);
305 }
306 }
307
308
1/1
✓ Branch 1 taken 9 times.
9 omo = modelObject.outletModelObject();
309
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 7 times.
9 if (omo) {
310
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 translateAndMapModelObject(*omo);
311
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 s = omo->name();
312
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (s) {
313
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemOutletNodeName, *s);
314
315
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 coilSystemCoolingDXIdf.setString(CoilSystem_Cooling_DXFields::DXCoolingCoilSystemSensorNodeName, *s);
316 }
317 }
318
319
1/1
✓ Branch 1 taken 9 times.
9 return coilSystemCoolingDXIdf;
320 9 }
321
322 } // namespace energyplus
323
324 } // namespace openstudio
325