GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 73.6% 349 / 0 / 474
Functions: 76.4% 94 / 0 / 123
Branches: 54.9% 278 / 0 / 506

src/model/CoilHeatingDXMultiSpeed.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 "Model.hpp"
7 #include "Model_Impl.hpp"
8 #include "CoilHeatingDXMultiSpeed.hpp"
9 #include "CoilHeatingDXMultiSpeed_Impl.hpp"
10 #include "Schedule.hpp"
11 #include "Schedule_Impl.hpp"
12 #include "Curve.hpp"
13 #include "Curve_Impl.hpp"
14 #include "CoilHeatingDXMultiSpeedStageData.hpp"
15 #include "CoilHeatingDXMultiSpeedStageData_Impl.hpp"
16 #include "AirLoopHVACUnitarySystem.hpp"
17 #include "AirLoopHVACUnitarySystem_Impl.hpp"
18 #include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp"
19 #include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp"
20 #include "ScheduleTypeLimits.hpp"
21 #include "ScheduleTypeRegistry.hpp"
22 #include "AirflowNetworkEquivalentDuct.hpp"
23 #include "AirflowNetworkEquivalentDuct_Impl.hpp"
24 #include <utilities/idd/IddFactory.hxx>
25
26 #include <utilities/idd/OS_Coil_Heating_DX_MultiSpeed_FieldEnums.hxx>
27 #include <utilities/idd/IddEnums.hxx>
28 #include "../utilities/core/Assert.hpp"
29 #include "../utilities/data/DataEnums.hpp"
30 #include "../utilities/idf/WorkspaceExtensibleGroup.hpp"
31
32 namespace openstudio {
33 namespace model {
34
35 namespace detail {
36
37 20 CoilHeatingDXMultiSpeed_Impl::CoilHeatingDXMultiSpeed_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
38 20 : StraightComponent_Impl(idfObject, model, keepHandle) {
39
4/6
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 7 taken 20 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 20 times.
✗ Branch 13 not taken.
20 OS_ASSERT(idfObject.iddObject().type() == CoilHeatingDXMultiSpeed::iddObjectType());
40 20 }
41
42 3 CoilHeatingDXMultiSpeed_Impl::CoilHeatingDXMultiSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
43 3 bool keepHandle)
44 3 : StraightComponent_Impl(other, model, keepHandle) {
45
4/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 13 not taken.
3 OS_ASSERT(other.iddObject().type() == CoilHeatingDXMultiSpeed::iddObjectType());
46 3 }
47
48 9 CoilHeatingDXMultiSpeed_Impl::CoilHeatingDXMultiSpeed_Impl(const CoilHeatingDXMultiSpeed_Impl& other, Model_Impl* model, bool keepHandle)
49 9 : StraightComponent_Impl(other, model, keepHandle) {}
50
51 ✗ const std::vector<std::string>& CoilHeatingDXMultiSpeed_Impl::outputVariableNames() const {
52 static const std::vector<std::string> result{
53 "Heating Coil Total Heating Rate",
54 "Heating Coil Total Heating Energy",
55 "Heating Coil Electricity Rate",
56 "Heating Coil Electricity Energy",
57 "Heating Coil Defrost Electricity Rate",
58 "Heating Coil Defrost Electricity Energy",
59 "Heating Coil Defrost Gas Rate",
60 "Heating Coil Defrost Gas Energy",
61 "Heating Coil Crankcase Heater Electricity Rate",
62 "Heating Coil Crankcase Heater Electricity Energy",
63 "Heating Coil Runtime Fraction"
64 // TODO: Implement this
65 // If Fuel Type is not Electricity:
66 // "Heating Coil <Fuel Type> Rate",
67 // "Heating Coil <Fuel Type> Energy"
68
69 ✗ };
70 ✗ return result;
71 ✗ }
72
73 6 IddObjectType CoilHeatingDXMultiSpeed_Impl::iddObjectType() const {
74 6 return CoilHeatingDXMultiSpeed::iddObjectType();
75 }
76
77 ✗ std::vector<ScheduleTypeKey> CoilHeatingDXMultiSpeed_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
78 // TODO: Check schedule display names.
79 ✗ std::vector<ScheduleTypeKey> result;
80 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
81 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
82 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
83 ✗ if (std::find(b, e, OS_Coil_Heating_DX_MultiSpeedFields::AvailabilityScheduleName) != e) {
84 ✗ result.push_back(ScheduleTypeKey("CoilHeatingDXMultiSpeed", "Availability"));
85 }
86 ✗ return result;
87 ✗ }
88
89 9 boost::optional<Schedule> CoilHeatingDXMultiSpeed_Impl::availabilitySchedule() const {
90
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Coil_Heating_DX_MultiSpeedFields::AvailabilityScheduleName);
91 }
92
93 11 double CoilHeatingDXMultiSpeed_Impl::minimumOutdoorDryBulbTemperatureforCompressorOperation() const {
94
1/1
✓ Branch 1 taken 11 times.
11 boost::optional<double> value = getDouble(OS_Coil_Heating_DX_MultiSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation, true);
95
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 11 times.
✗ Branch 4 not taken.
11 OS_ASSERT(value);
96
1/1
✓ Branch 1 taken 11 times.
22 return value.get();
97 }
98
99 9 boost::optional<double> CoilHeatingDXMultiSpeed_Impl::outdoorDryBulbTemperaturetoTurnOnCompressor() const {
100 9 return getDouble(OS_Coil_Heating_DX_MultiSpeedFields::OutdoorDryBulbTemperaturetoTurnOnCompressor, true);
101 }
102
103 9 double CoilHeatingDXMultiSpeed_Impl::crankcaseHeaterCapacity() const {
104
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_Coil_Heating_DX_MultiSpeedFields::CrankcaseHeaterCapacity, true);
105
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
106
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
107 }
108
109 9 double CoilHeatingDXMultiSpeed_Impl::maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const {
110 boost::optional<double> value =
111
1/1
✓ Branch 1 taken 9 times.
9 getDouble(OS_Coil_Heating_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation, true);
112
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
113
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
114 }
115
116 19 boost::optional<Curve> CoilHeatingDXMultiSpeed_Impl::defrostEnergyInputRatioFunctionofTemperatureCurve() const {
117
1/1
✓ Branch 1 taken 19 times.
38 return getObject<ModelObject>().getModelObjectTarget<Curve>(
118
1/1
✓ Branch 1 taken 19 times.
38 OS_Coil_Heating_DX_MultiSpeedFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName);
119 }
120
121 9 double CoilHeatingDXMultiSpeed_Impl::maximumOutdoorDryBulbTemperatureforDefrostOperation() const {
122
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_Coil_Heating_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforDefrostOperation, true);
123
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
124
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
125 }
126
127 9 std::string CoilHeatingDXMultiSpeed_Impl::defrostStrategy() const {
128
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_Coil_Heating_DX_MultiSpeedFields::DefrostStrategy, true);
129
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
130
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
131 9 }
132
133 9 std::string CoilHeatingDXMultiSpeed_Impl::defrostControl() const {
134
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_Coil_Heating_DX_MultiSpeedFields::DefrostControl, true);
135
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
136
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
137 9 }
138
139 9 double CoilHeatingDXMultiSpeed_Impl::defrostTimePeriodFraction() const {
140
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_Coil_Heating_DX_MultiSpeedFields::DefrostTimePeriodFraction, true);
141
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
142
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
143 }
144
145 1 boost::optional<double> CoilHeatingDXMultiSpeed_Impl::resistiveDefrostHeaterCapacity() const {
146 1 return getDouble(OS_Coil_Heating_DX_MultiSpeedFields::ResistiveDefrostHeaterCapacity, true);
147 }
148
149 9 bool CoilHeatingDXMultiSpeed_Impl::isResistiveDefrostHeaterCapacityAutosized() const {
150 9 bool result = false;
151
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_Coil_Heating_DX_MultiSpeedFields::ResistiveDefrostHeaterCapacity, true);
152
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
153
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autosize");
154 }
155 9 return result;
156 9 }
157
158 9 bool CoilHeatingDXMultiSpeed_Impl::applyPartLoadFractiontoSpeedsGreaterthan1() const {
159
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_Coil_Heating_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1, true);
160
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
161
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 return openstudio::istringEqual(value.get(), "Yes");
162 9 }
163
164 9 std::string CoilHeatingDXMultiSpeed_Impl::fuelType() const {
165
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_Coil_Heating_DX_MultiSpeedFields::FuelType, true);
166
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
167
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
168 9 }
169
170 9 int CoilHeatingDXMultiSpeed_Impl::regionnumberforCalculatingHSPF() const {
171
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<int> value = getInt(OS_Coil_Heating_DX_MultiSpeedFields::RegionnumberforCalculatingHSPF, true);
172
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
173
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
174 }
175
176 18 bool CoilHeatingDXMultiSpeed_Impl::setAvailabilitySchedule(Schedule& schedule) {
177
3/3
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
✓ Branch 7 taken 18 times.
72 bool result = setSchedule(OS_Coil_Heating_DX_MultiSpeedFields::AvailabilityScheduleName, "CoilHeatingDXMultiSpeed", "Availability", schedule);
178 18 return result;
179 }
180
181 ✗ void CoilHeatingDXMultiSpeed_Impl::resetAvailabilitySchedule() {
182 ✗ bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::AvailabilityScheduleName, "");
183 ✗ OS_ASSERT(result);
184 ✗ }
185
186 20 bool CoilHeatingDXMultiSpeed_Impl::setMinimumOutdoorDryBulbTemperatureforCompressorOperation(
187 double minimumOutdoorDryBulbTemperatureforCompressorOperation) {
188 20 bool result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation,
189 minimumOutdoorDryBulbTemperatureforCompressorOperation);
190
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 20 times.
20 OS_ASSERT(result);
191 20 return result;
192 }
193
194 1 bool CoilHeatingDXMultiSpeed_Impl::setOutdoorDryBulbTemperaturetoTurnOnCompressor(
195 boost::optional<double> outdoorDryBulbTemperaturetoTurnOnCompressor) {
196 1 bool result(false);
197
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (outdoorDryBulbTemperaturetoTurnOnCompressor) {
198 1 result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::OutdoorDryBulbTemperaturetoTurnOnCompressor,
199 1 outdoorDryBulbTemperaturetoTurnOnCompressor.get());
200 } else {
201 ✗ resetOutdoorDryBulbTemperaturetoTurnOnCompressor();
202 ✗ result = true;
203 }
204
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
205 1 return result;
206 }
207
208 ✗ void CoilHeatingDXMultiSpeed_Impl::resetOutdoorDryBulbTemperaturetoTurnOnCompressor() {
209 ✗ bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::OutdoorDryBulbTemperaturetoTurnOnCompressor, "");
210 ✗ OS_ASSERT(result);
211 ✗ }
212
213 18 bool CoilHeatingDXMultiSpeed_Impl::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) {
214 18 bool result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::CrankcaseHeaterCapacity, crankcaseHeaterCapacity);
215 18 return result;
216 }
217
218 18 bool CoilHeatingDXMultiSpeed_Impl::setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(
219 double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation) {
220 18 bool result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation,
221 maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation);
222 18 return result;
223 }
224
225 1 bool CoilHeatingDXMultiSpeed_Impl::setDefrostEnergyInputRatioFunctionofTemperatureCurve(const boost::optional<Curve>& curve) {
226 1 bool result(false);
227
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (curve) {
228
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 result = setPointer(OS_Coil_Heating_DX_MultiSpeedFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName, curve.get().handle());
229 } else {
230 ✗ resetDefrostEnergyInputRatioFunctionofTemperatureCurve();
231 ✗ result = true;
232 }
233 1 return result;
234 }
235
236 ✗ void CoilHeatingDXMultiSpeed_Impl::resetDefrostEnergyInputRatioFunctionofTemperatureCurve() {
237 ✗ bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName, "");
238 ✗ OS_ASSERT(result);
239 ✗ }
240
241 18 bool CoilHeatingDXMultiSpeed_Impl::setMaximumOutdoorDryBulbTemperatureforDefrostOperation(
242 double maximumOutdoorDryBulbTemperatureforDefrostOperation) {
243 18 bool result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforDefrostOperation,
244 maximumOutdoorDryBulbTemperatureforDefrostOperation);
245 18 return result;
246 }
247
248 18 bool CoilHeatingDXMultiSpeed_Impl::setDefrostStrategy(const std::string& defrostStrategy) {
249 18 bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::DefrostStrategy, defrostStrategy);
250 18 return result;
251 }
252
253 18 bool CoilHeatingDXMultiSpeed_Impl::setDefrostControl(const std::string& defrostControl) {
254 18 bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::DefrostControl, defrostControl);
255 18 return result;
256 }
257
258 18 bool CoilHeatingDXMultiSpeed_Impl::setDefrostTimePeriodFraction(double defrostTimePeriodFraction) {
259 18 bool result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::DefrostTimePeriodFraction, defrostTimePeriodFraction);
260 18 return result;
261 }
262
263 1 bool CoilHeatingDXMultiSpeed_Impl::setResistiveDefrostHeaterCapacity(boost::optional<double> resistiveDefrostHeaterCapacity) {
264 1 bool result(false);
265
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (resistiveDefrostHeaterCapacity) {
266 1 result = setDouble(OS_Coil_Heating_DX_MultiSpeedFields::ResistiveDefrostHeaterCapacity, resistiveDefrostHeaterCapacity.get());
267 }
268 1 return result;
269 }
270
271 17 void CoilHeatingDXMultiSpeed_Impl::autosizeResistiveDefrostHeaterCapacity() {
272
2/2
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
34 bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::ResistiveDefrostHeaterCapacity, "autosize");
273
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
17 OS_ASSERT(result);
274 17 }
275
276 18 bool CoilHeatingDXMultiSpeed_Impl::setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1) {
277 18 return setBooleanFieldValue(OS_Coil_Heating_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1,
278 18 applyPartLoadFractiontoSpeedsGreaterthan1);
279 ;
280 }
281
282 18 bool CoilHeatingDXMultiSpeed_Impl::setFuelType(const std::string& fuelType) {
283 18 bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::FuelType, fuelType);
284 18 return result;
285 }
286
287 18 bool CoilHeatingDXMultiSpeed_Impl::setRegionnumberforCalculatingHSPF(int regionnumberforCalculatingHSPF) {
288 18 bool result = setInt(OS_Coil_Heating_DX_MultiSpeedFields::RegionnumberforCalculatingHSPF, regionnumberforCalculatingHSPF);
289 18 return result;
290 }
291
292 19 boost::optional<Curve> CoilHeatingDXMultiSpeed_Impl::crankcaseHeaterCapacityFunctionofTemperatureCurve() const {
293
1/1
✓ Branch 1 taken 19 times.
38 return getObject<ModelObject>().getModelObjectTarget<Curve>(
294
1/1
✓ Branch 1 taken 19 times.
38 OS_Coil_Heating_DX_MultiSpeedFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName);
295 }
296
297 1 bool CoilHeatingDXMultiSpeed_Impl::setCrankcaseHeaterCapacityFunctionofTemperatureCurve(const Curve& curve) {
298
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 const bool result = setPointer(OS_Coil_Heating_DX_MultiSpeedFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName, curve.handle());
299 1 return result;
300 }
301
302 ✗ void CoilHeatingDXMultiSpeed_Impl::resetCrankcaseHeaterCapacityFunctionofTemperatureCurve() {
303 ✗ const bool result = setString(OS_Coil_Heating_DX_MultiSpeedFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName, "");
304 ✗ OS_ASSERT(result);
305 ✗ }
306
307 9 unsigned CoilHeatingDXMultiSpeed_Impl::inletPort() const {
308 9 return OS_Coil_Heating_DX_MultiSpeedFields::AirInletNodeName;
309 }
310
311 9 unsigned CoilHeatingDXMultiSpeed_Impl::outletPort() const {
312 9 return OS_Coil_Heating_DX_MultiSpeedFields::AirOutletNodeName;
313 }
314
315 ✗ ModelObject CoilHeatingDXMultiSpeed_Impl::clone(Model model) const {
316 ✗ auto t_clone = StraightComponent_Impl::clone(model).cast<CoilHeatingDXMultiSpeed>();
317
318 ✗ for (const auto& stage : stages()) {
319 ✗ auto stageClone = stage.clone(model).cast<CoilHeatingDXMultiSpeedStageData>();
320 ✗ t_clone.addStage(stageClone);
321 ✗ }
322 ✗ return std::move(t_clone);
323 ✗ }
324
325 10 std::vector<ModelObject> CoilHeatingDXMultiSpeed_Impl::children() const {
326
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 std::vector<ModelObject> children = subsetCastVector<ModelObject>(stages());
327
328
3/3
✓ Branch 1 taken 10 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 9 times.
20 if (auto const curve = defrostEnergyInputRatioFunctionofTemperatureCurve()) {
329
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 children.push_back(curve.get());
330 10 }
331
332
3/3
✓ Branch 1 taken 10 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 9 times.
20 if (auto c_ = crankcaseHeaterCapacityFunctionofTemperatureCurve()) {
333
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
1 children.emplace_back(std::move(*c_));
334 10 }
335
336 std::vector<AirflowNetworkEquivalentDuct> myAFNItems =
337
3/3
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
10 getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
338
1/1
✓ Branch 5 taken 10 times.
10 children.insert(children.end(), myAFNItems.begin(), myAFNItems.end());
339
340 20 return children;
341 10 }
342
343 29 unsigned CoilHeatingDXMultiSpeed_Impl::numberOfStages() const {
344 29 return numExtensibleGroups();
345 }
346
347 57 std::vector<CoilHeatingDXMultiSpeedStageData> CoilHeatingDXMultiSpeed_Impl::stages() const {
348 57 std::vector<CoilHeatingDXMultiSpeedStageData> result;
349
3/3
✓ Branch 1 taken 57 times.
✓ Branch 8 taken 126 times.
✓ Branch 9 taken 57 times.
183 for (const auto& group : extensibleGroups()) {
350
3/4
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
✓ Branch 8 taken 126 times.
✗ Branch 9 not taken.
252 if (auto target = group.cast<WorkspaceExtensibleGroup>().getTarget(OS_Coil_Heating_DX_MultiSpeedExtensibleFields::Stage)) {
351
3/4
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
✓ Branch 6 taken 126 times.
✗ Branch 7 not taken.
252 if (auto stage = target->optionalCast<CoilHeatingDXMultiSpeedStageData>()) {
352
2/2
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
126 result.push_back(stage.get());
353 126 }
354 126 }
355 57 }
356 57 return result;
357 ✗ }
358
359 8 boost::optional<unsigned> CoilHeatingDXMultiSpeed_Impl::stageIndex(const CoilHeatingDXMultiSpeedStageData& stage) const {
360
361 8 boost::optional<unsigned> result;
362
363
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 auto egs = castVector<WorkspaceExtensibleGroup>(extensibleGroups());
364
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 auto h = openstudio::toString(stage.handle());
365
1/1
✓ Branch 3 taken 8 times.
8 auto it = std::find_if(egs.begin(), egs.end(), [&](const WorkspaceExtensibleGroup& eg) {
366
2/2
✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
22 return (eg.getField(OS_Coil_Heating_DX_MultiSpeedExtensibleFields::Stage).get() == h);
367 });
368
369 // If found, we compute the index by using std::distance between the start of vector and the iterator returned by std::find_if
370
2/2
✓ Branch 2 taken 7 times.
✓ Branch 3 taken 1 time.
8 if (it != egs.end()) {
371
1/1
✓ Branch 2 taken 7 times.
14 result = std::distance(egs.begin(), it) + 1;
372 }
373
374 8 return result;
375 8 }
376
377 42 bool CoilHeatingDXMultiSpeed_Impl::addStage(const CoilHeatingDXMultiSpeedStageData& stage) {
378
3/3
✓ Branch 1 taken 42 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 41 times.
84 if (auto _c = stage.parentCoil()) {
379
5/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 time.
1 if (this->handle() == _c->handle()) {
380 ✗ return true; // already the case
381 } else {
382
15/15
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 25 taken 1 time.
✓ Branch 28 taken 1 time.
✓ Branch 31 taken 1 time.
✓ Branch 34 taken 1 time.
✓ Branch 40 taken 1 time.
✓ Branch 43 taken 1 time.
✓ Branch 46 taken 1 time.
1 LOG(Error, "For " << briefDescription() << " cannot add " << stage.briefDescription()
383 << " since this Stage is already in use by another coil ('" << _c->nameString() << "').");
384 1 return false;
385 }
386 42 }
387
3/3
✓ Branch 1 taken 41 times.
✓ Branch 4 taken 41 times.
✓ Branch 7 taken 41 times.
41 auto group = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>();
388
3/3
✓ Branch 1 taken 41 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 39 times.
41 if (group.empty()) {
389
11/11
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 19 taken 2 times.
✓ Branch 22 taken 2 times.
✓ Branch 26 taken 2 times.
✓ Branch 29 taken 2 times.
✓ Branch 32 taken 2 times.
2 LOG(Error, "You have reached the maximum number of stages (=" << numberOfStages() << "), occurred for " << briefDescription() << ".");
390 2 return false;
391 }
392
2/2
✓ Branch 1 taken 39 times.
✓ Branch 4 taken 39 times.
39 bool result = group.setPointer(OS_Coil_Heating_DX_MultiSpeedExtensibleFields::Stage, stage.handle());
393
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 38 times.
39 if (!result) {
394 // Something went wrong, so erase the new extensible group
395
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 getObject<ModelObject>().eraseExtensibleGroup(group.groupIndex());
396 }
397 39 return result;
398 41 }
399
400 1 bool CoilHeatingDXMultiSpeed_Impl::setStageIndex(const CoilHeatingDXMultiSpeedStageData& stage, unsigned index) {
401
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<unsigned> idx = stageIndex(stage);
402
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (!idx) {
403 ✗ LOG(Warn, "For " << briefDescription() << " cannot set the index of stage " << stage.briefDescription() << " since it is not part of it.");
404 ✗ return false;
405 }
406
407 // TODO: we could just set via string instead of doing a ton of typechecking below...
408
409
1/1
✓ Branch 1 taken 1 time.
1 std::vector<CoilHeatingDXMultiSpeedStageData> stageVector = stages();
410
411
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (index > stageVector.size()) {
412 ✗ LOG(Warn, "Requested a stage index of " << index << " to be assigned to " << stage.briefDescription() << ", but " << briefDescription()
413 << " only has " << stageVector.size() << " stages, resetting to that.");
414 ✗ index = stageVector.size();
415
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 } else if (index < 1) {
416 ✗ LOG(Warn, "Requested a stage index of " << index << " < 1 to be assigned to " << stage.briefDescription() << ", resetting to 1");
417 ✗ index = 1;
418 }
419
420
2/2
✓ Branch 1 taken 1 time.
✓ Branch 8 taken 1 time.
1 stageVector.erase(stageVector.begin() + idx.get() - 1); // stageIndex is 1-indexed, and vector is 0-indexed
421
422
1/1
✓ Branch 4 taken 1 time.
1 stageVector.insert(stageVector.begin() + (index - 1), stage);
423
424
1/1
✓ Branch 1 taken 1 time.
1 return setStages(stageVector);
425 1 }
426
427 ✗ bool CoilHeatingDXMultiSpeed_Impl::addStage(const CoilHeatingDXMultiSpeedStageData& stage, unsigned index) {
428 ✗ bool ok = addStage(stage);
429 ✗ if (!ok) {
430 ✗ return false;
431 }
432 ✗ ok = setStageIndex(stage, index);
433 ✗ return ok;
434 }
435
436 3 bool CoilHeatingDXMultiSpeed_Impl::setStages(const std::vector<CoilHeatingDXMultiSpeedStageData>& stages) {
437 // Clear the extensible groups, and redo them
438 3 bool ok = true;
439
1/1
✓ Branch 1 taken 3 times.
3 clearExtensibleGroups();
440
2/2
✓ Branch 4 taken 11 times.
✓ Branch 5 taken 3 times.
14 for (const CoilHeatingDXMultiSpeedStageData& s : stages) {
441
1/1
✓ Branch 1 taken 11 times.
11 ok &= addStage(s);
442 }
443 3 return ok;
444 }
445
446 3 void CoilHeatingDXMultiSpeed_Impl::removeAllStages() {
447
1/1
✓ Branch 1 taken 3 times.
3 clearExtensibleGroups();
448 3 }
449
450 3 bool CoilHeatingDXMultiSpeed_Impl::removeStage(const CoilHeatingDXMultiSpeedStageData& stage) {
451
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<unsigned> idx = stageIndex(stage);
452
2/2
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 2 times.
3 if (!idx) {
453
11/11
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 27 taken 1 time.
✓ Branch 30 taken 1 time.
✓ Branch 33 taken 1 time.
1 LOG(Warn, "For " << briefDescription() << " cannot remove stage " << stage.briefDescription() << " since it is not part of it.");
454 1 return false;
455 }
456
457
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 return removeStage(idx.get());
458 }
459
460 3 bool CoilHeatingDXMultiSpeed_Impl::removeStage(unsigned index) {
461 3 bool result = false;
462
3/6
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
3 if ((index > 0) && (index <= numberOfStages())) {
463
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 getObject<ModelObject>().eraseExtensibleGroup(index - 1);
464 3 result = true;
465 }
466 3 return result;
467 }
468
469 2 boost::optional<HVACComponent> CoilHeatingDXMultiSpeed_Impl::containingHVACComponent() const {
470 // AirLoopHVACUnitarySystem
471 {
472
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 auto systems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>();
473
474
2/2
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 1 time.
2 for (auto const& system : systems) {
475
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (auto heatingCoil = system.heatingCoil()) {
476
5/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
1 if (heatingCoil->handle() == this->handle()) {
477
1/1
✓ Branch 1 taken 1 time.
1 return system;
478 }
479 1 }
480 }
481 2 }
482
483 // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed
484 {
485
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 auto systems = this->model().getConcreteModelObjects<AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed>();
486
487
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 1 time.
1 for (const auto& system : systems) {
488 ✗ auto heatingCoil = system.heatingCoil();
489 ✗ if (heatingCoil.handle() == this->handle()) {
490 ✗ return system;
491 }
492 ✗ }
493 1 }
494 1 return boost::none;
495 }
496
497 ✗ bool CoilHeatingDXMultiSpeed_Impl::addToNode(Node& /*node*/) {
498 ✗ return false;
499 }
500
501 ✗ AirflowNetworkEquivalentDuct CoilHeatingDXMultiSpeed_Impl::getAirflowNetworkEquivalentDuct(double length, double diameter) {
502 ✗ boost::optional<AirflowNetworkEquivalentDuct> opt = airflowNetworkEquivalentDuct();
503 ✗ if (opt) {
504 ✗ if (opt->airPathLength() != length) {
505 ✗ opt->setAirPathLength(length);
506 }
507 ✗ if (opt->airPathHydraulicDiameter() != diameter) {
508 ✗ opt->setAirPathHydraulicDiameter(diameter);
509 }
510 }
511 ✗ return AirflowNetworkEquivalentDuct(model(), length, diameter, handle());
512 ✗ }
513
514 ✗ boost::optional<AirflowNetworkEquivalentDuct> CoilHeatingDXMultiSpeed_Impl::airflowNetworkEquivalentDuct() const {
515 std::vector<AirflowNetworkEquivalentDuct> myAFN =
516 ✗ getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
517 ✗ auto count = myAFN.size();
518 ✗ if (count == 1) {
519 ✗ return myAFN[0];
520 ✗ } else if (count > 1) {
521 ✗ LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first.");
522 ✗ return myAFN[0];
523 }
524 ✗ return boost::none;
525 ✗ }
526
527 ✗ boost::optional<double> CoilHeatingDXMultiSpeed_Impl::autosizedResistiveDefrostHeaterCapacity() const {
528 ✗ return getAutosizedValue("Design Size Resistive Defrost Heater Capacity", "");
529 }
530
531 ✗ void CoilHeatingDXMultiSpeed_Impl::autosize() {
532 ✗ autosizeResistiveDefrostHeaterCapacity();
533 ✗ }
534
535 ✗ void CoilHeatingDXMultiSpeed_Impl::applySizingValues() {
536 ✗ boost::optional<double> val;
537 ✗ val = autosizedResistiveDefrostHeaterCapacity();
538 ✗ if (val) {
539 ✗ setResistiveDefrostHeaterCapacity(val.get());
540 }
541 ✗ }
542
543 ✗ ComponentType CoilHeatingDXMultiSpeed_Impl::componentType() const {
544 ✗ return ComponentType::Heating;
545 }
546
547 ✗ std::vector<FuelType> CoilHeatingDXMultiSpeed_Impl::coolingFuelTypes() const {
548 ✗ return {};
549 }
550
551 ✗ std::vector<FuelType> CoilHeatingDXMultiSpeed_Impl::heatingFuelTypes() const {
552 ✗ return {FuelType::Electricity};
553 }
554
555 ✗ std::vector<AppGFuelType> CoilHeatingDXMultiSpeed_Impl::appGHeatingFuelTypes() const {
556 ✗ return {AppGFuelType::HeatPump};
557 }
558
559 } // namespace detail
560
561 17 CoilHeatingDXMultiSpeed::CoilHeatingDXMultiSpeed(const Model& model) : StraightComponent(CoilHeatingDXMultiSpeed::iddObjectType(), model) {
562
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 17 times.
✗ Branch 5 not taken.
17 OS_ASSERT(getImpl<detail::CoilHeatingDXMultiSpeed_Impl>());
563
564 17 bool ok = true;
565
1/1
✓ Branch 1 taken 17 times.
17 auto always_on = model.alwaysOnDiscreteSchedule();
566
1/1
✓ Branch 1 taken 17 times.
17 ok = setAvailabilitySchedule(always_on);
567
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
568
1/1
✓ Branch 1 taken 17 times.
17 ok = setMinimumOutdoorDryBulbTemperatureforCompressorOperation(-8.0);
569
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
570
1/1
✓ Branch 1 taken 17 times.
17 ok = setCrankcaseHeaterCapacity(0.0);
571
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
572
1/1
✓ Branch 1 taken 17 times.
17 ok = setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(10.0);
573
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
574
1/1
✓ Branch 1 taken 17 times.
17 ok = setMaximumOutdoorDryBulbTemperatureforDefrostOperation(5.0);
575
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
576
2/2
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
17 ok = setDefrostStrategy("Resistive");
577
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
578
2/2
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
17 ok = setDefrostControl("OnDemand");
579
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
580
1/1
✓ Branch 1 taken 17 times.
17 ok = setDefrostTimePeriodFraction(0.058333);
581
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
582
1/1
✓ Branch 1 taken 17 times.
17 autosizeResistiveDefrostHeaterCapacity();
583
1/1
✓ Branch 1 taken 17 times.
17 ok = setApplyPartLoadFractiontoSpeedsGreaterthan1(false);
584
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
585
2/2
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
17 ok = setFuelType("NaturalGas");
586
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
587
1/1
✓ Branch 1 taken 17 times.
17 ok = setRegionnumberforCalculatingHSPF(4);
588
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 3 not taken.
17 OS_ASSERT(ok);
589 17 }
590
591 7714 IddObjectType CoilHeatingDXMultiSpeed::iddObjectType() {
592
1/1
✓ Branch 1 taken 7714 times.
7714 return {IddObjectType::OS_Coil_Heating_DX_MultiSpeed};
593 }
594
595 ✗ std::vector<std::string> CoilHeatingDXMultiSpeed::defrostStrategyValues() {
596 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Coil_Heating_DX_MultiSpeedFields::DefrostStrategy);
597 }
598
599 ✗ std::vector<std::string> CoilHeatingDXMultiSpeed::defrostControlValues() {
600 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Coil_Heating_DX_MultiSpeedFields::DefrostControl);
601 }
602
603 ✗ std::vector<std::string> CoilHeatingDXMultiSpeed::fuelTypeValues() {
604 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Coil_Heating_DX_MultiSpeedFields::FuelType);
605 }
606
607 9 boost::optional<Schedule> CoilHeatingDXMultiSpeed::availabilitySchedule() const {
608
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->availabilitySchedule();
609 }
610
611 11 double CoilHeatingDXMultiSpeed::minimumOutdoorDryBulbTemperatureforCompressorOperation() const {
612
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->minimumOutdoorDryBulbTemperatureforCompressorOperation();
613 }
614
615 9 boost::optional<double> CoilHeatingDXMultiSpeed::outdoorDryBulbTemperaturetoTurnOnCompressor() const {
616
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->outdoorDryBulbTemperaturetoTurnOnCompressor();
617 }
618
619 9 double CoilHeatingDXMultiSpeed::crankcaseHeaterCapacity() const {
620
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->crankcaseHeaterCapacity();
621 }
622
623 9 double CoilHeatingDXMultiSpeed::maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const {
624
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation();
625 }
626
627 9 boost::optional<Curve> CoilHeatingDXMultiSpeed::defrostEnergyInputRatioFunctionofTemperatureCurve() const {
628
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->defrostEnergyInputRatioFunctionofTemperatureCurve();
629 }
630
631 9 double CoilHeatingDXMultiSpeed::maximumOutdoorDryBulbTemperatureforDefrostOperation() const {
632
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->maximumOutdoorDryBulbTemperatureforDefrostOperation();
633 }
634
635 9 std::string CoilHeatingDXMultiSpeed::defrostStrategy() const {
636
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->defrostStrategy();
637 }
638
639 9 std::string CoilHeatingDXMultiSpeed::defrostControl() const {
640
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->defrostControl();
641 }
642
643 9 double CoilHeatingDXMultiSpeed::defrostTimePeriodFraction() const {
644
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->defrostTimePeriodFraction();
645 }
646
647 1 boost::optional<double> CoilHeatingDXMultiSpeed::resistiveDefrostHeaterCapacity() const {
648
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->resistiveDefrostHeaterCapacity();
649 }
650
651 9 bool CoilHeatingDXMultiSpeed::isResistiveDefrostHeaterCapacityAutosized() const {
652
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->isResistiveDefrostHeaterCapacityAutosized();
653 }
654
655 9 bool CoilHeatingDXMultiSpeed::applyPartLoadFractiontoSpeedsGreaterthan1() const {
656
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->applyPartLoadFractiontoSpeedsGreaterthan1();
657 }
658
659 9 std::string CoilHeatingDXMultiSpeed::fuelType() const {
660
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->fuelType();
661 }
662
663 9 int CoilHeatingDXMultiSpeed::regionnumberforCalculatingHSPF() const {
664
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->regionnumberforCalculatingHSPF();
665 }
666
667 18 bool CoilHeatingDXMultiSpeed::setAvailabilitySchedule(Schedule& schedule) {
668
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setAvailabilitySchedule(schedule);
669 }
670
671 ✗ void CoilHeatingDXMultiSpeed::resetAvailabilitySchedule() {
672 ✗ getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->resetAvailabilitySchedule();
673 ✗ }
674
675 20 bool CoilHeatingDXMultiSpeed::setMinimumOutdoorDryBulbTemperatureforCompressorOperation(
676 double minimumOutdoorDryBulbTemperatureforCompressorOperation) {
677
1/1
✓ Branch 3 taken 20 times.
40 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setMinimumOutdoorDryBulbTemperatureforCompressorOperation(
678 40 minimumOutdoorDryBulbTemperatureforCompressorOperation);
679 }
680
681 1 bool CoilHeatingDXMultiSpeed::setOutdoorDryBulbTemperaturetoTurnOnCompressor(double outdoorDryBulbTemperaturetoTurnOnCompressor) {
682
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
2 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setOutdoorDryBulbTemperaturetoTurnOnCompressor(
683 2 outdoorDryBulbTemperaturetoTurnOnCompressor);
684 }
685
686 ✗ void CoilHeatingDXMultiSpeed::resetOutdoorDryBulbTemperaturetoTurnOnCompressor() {
687 ✗ getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->resetOutdoorDryBulbTemperaturetoTurnOnCompressor();
688 ✗ }
689
690 18 bool CoilHeatingDXMultiSpeed::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) {
691
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setCrankcaseHeaterCapacity(crankcaseHeaterCapacity);
692 }
693
694 18 bool CoilHeatingDXMultiSpeed::setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(
695 double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation) {
696
1/1
✓ Branch 3 taken 18 times.
36 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(
697 36 maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation);
698 }
699
700 1 bool CoilHeatingDXMultiSpeed::setDefrostEnergyInputRatioFunctionofTemperatureCurve(const Curve& curve) {
701
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setDefrostEnergyInputRatioFunctionofTemperatureCurve(curve);
702 }
703
704 ✗ void CoilHeatingDXMultiSpeed::resetDefrostEnergyInputRatioFunctionofTemperatureCurve() {
705 ✗ getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->resetDefrostEnergyInputRatioFunctionofTemperatureCurve();
706 ✗ }
707
708 18 bool CoilHeatingDXMultiSpeed::setMaximumOutdoorDryBulbTemperatureforDefrostOperation(double maximumOutdoorDryBulbTemperatureforDefrostOperation) {
709
1/1
✓ Branch 3 taken 18 times.
36 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setMaximumOutdoorDryBulbTemperatureforDefrostOperation(
710 36 maximumOutdoorDryBulbTemperatureforDefrostOperation);
711 }
712
713 18 bool CoilHeatingDXMultiSpeed::setDefrostStrategy(const std::string& defrostStrategy) {
714
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setDefrostStrategy(defrostStrategy);
715 }
716
717 18 bool CoilHeatingDXMultiSpeed::setDefrostControl(const std::string& defrostControl) {
718
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setDefrostControl(defrostControl);
719 }
720
721 18 bool CoilHeatingDXMultiSpeed::setDefrostTimePeriodFraction(double defrostTimePeriodFraction) {
722
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setDefrostTimePeriodFraction(defrostTimePeriodFraction);
723 }
724
725 1 bool CoilHeatingDXMultiSpeed::setResistiveDefrostHeaterCapacity(double resistiveDefrostHeaterCapacity) {
726
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setResistiveDefrostHeaterCapacity(resistiveDefrostHeaterCapacity);
727 }
728
729 17 void CoilHeatingDXMultiSpeed::autosizeResistiveDefrostHeaterCapacity() {
730
1/1
✓ Branch 3 taken 17 times.
17 getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->autosizeResistiveDefrostHeaterCapacity();
731 17 }
732
733 18 bool CoilHeatingDXMultiSpeed::setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1) {
734
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setApplyPartLoadFractiontoSpeedsGreaterthan1(applyPartLoadFractiontoSpeedsGreaterthan1);
735 }
736
737 18 bool CoilHeatingDXMultiSpeed::setFuelType(const std::string& fuelType) {
738
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setFuelType(fuelType);
739 }
740
741 18 bool CoilHeatingDXMultiSpeed::setRegionnumberforCalculatingHSPF(int regionnumberforCalculatingHSPF) {
742
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setRegionnumberforCalculatingHSPF(regionnumberforCalculatingHSPF);
743 }
744
745 9 boost::optional<Curve> CoilHeatingDXMultiSpeed::crankcaseHeaterCapacityFunctionofTemperatureCurve() const {
746
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->crankcaseHeaterCapacityFunctionofTemperatureCurve();
747 }
748
749 1 bool CoilHeatingDXMultiSpeed::setCrankcaseHeaterCapacityFunctionofTemperatureCurve(const Curve& curve) {
750
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setCrankcaseHeaterCapacityFunctionofTemperatureCurve(curve);
751 }
752
753 ✗ void CoilHeatingDXMultiSpeed::resetCrankcaseHeaterCapacityFunctionofTemperatureCurve() {
754 ✗ getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->resetCrankcaseHeaterCapacityFunctionofTemperatureCurve();
755 ✗ }
756
757 24 unsigned CoilHeatingDXMultiSpeed::numberOfStages() const {
758
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->numberOfStages();
759 }
760
761 4 boost::optional<unsigned> CoilHeatingDXMultiSpeed::stageIndex(const CoilHeatingDXMultiSpeedStageData& stage) const {
762
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->stageIndex(stage);
763 }
764
765 46 std::vector<CoilHeatingDXMultiSpeedStageData> CoilHeatingDXMultiSpeed::stages() const {
766
1/1
✓ Branch 3 taken 46 times.
46 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->stages();
767 }
768
769 31 bool CoilHeatingDXMultiSpeed::addStage(const CoilHeatingDXMultiSpeedStageData& stage) {
770
1/1
✓ Branch 3 taken 31 times.
31 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->addStage(stage);
771 }
772
773 ✗ bool CoilHeatingDXMultiSpeed::addStage(const CoilHeatingDXMultiSpeedStageData& stage, unsigned index) {
774 ✗ return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->addStage(stage, index);
775 }
776
777 1 bool CoilHeatingDXMultiSpeed::setStageIndex(const CoilHeatingDXMultiSpeedStageData& stage, unsigned index) {
778
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setStageIndex(stage, index);
779 }
780
781 2 bool CoilHeatingDXMultiSpeed::setStages(const std::vector<CoilHeatingDXMultiSpeedStageData>& stages) {
782
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->setStages(stages);
783 }
784
785 3 void CoilHeatingDXMultiSpeed::removeAllStages() {
786
1/1
✓ Branch 3 taken 3 times.
3 getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->removeAllStages();
787 3 }
788
789 3 bool CoilHeatingDXMultiSpeed::removeStage(const CoilHeatingDXMultiSpeedStageData& stage) {
790
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->removeStage(stage);
791 }
792
793 1 bool CoilHeatingDXMultiSpeed::removeStage(unsigned index) {
794
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->removeStage(index);
795 }
796
797 ✗ AirflowNetworkEquivalentDuct CoilHeatingDXMultiSpeed::getAirflowNetworkEquivalentDuct(double length, double diameter) {
798 ✗ return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->getAirflowNetworkEquivalentDuct(length, diameter);
799 }
800
801 ✗ boost::optional<AirflowNetworkEquivalentDuct> CoilHeatingDXMultiSpeed::airflowNetworkEquivalentDuct() const {
802 ✗ return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->airflowNetworkEquivalentDuct();
803 }
804
805 /// @cond
806
1/1
✓ Branch 3 taken 22 times.
22 CoilHeatingDXMultiSpeed::CoilHeatingDXMultiSpeed(std::shared_ptr<detail::CoilHeatingDXMultiSpeed_Impl> impl) : StraightComponent(std::move(impl)) {}
807 /// @endcond
808
809 ✗ boost::optional<double> CoilHeatingDXMultiSpeed::autosizedResistiveDefrostHeaterCapacity() const {
810 ✗ return getImpl<detail::CoilHeatingDXMultiSpeed_Impl>()->autosizedResistiveDefrostHeaterCapacity();
811 }
812
813 } // namespace model
814 } // namespace openstudio
815