GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 51.9% 270 / 0 / 520
Functions: 50.8% 66 / 0 / 130
Branches: 37.1% 251 / 0 / 676

src/model/AirLoopHVACUnitaryHeatPumpAirToAir.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 "AirLoopHVACUnitaryHeatPumpAirToAir.hpp"
7 #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp"
8
9 #include "Schedule.hpp"
10 #include "Schedule_Impl.hpp"
11 #include "ThermalZone.hpp"
12 #include "ThermalZone_Impl.hpp"
13 #include "Model.hpp"
14 #include "Model_Impl.hpp"
15 #include "HVACComponent.hpp"
16 #include "HVACComponent_Impl.hpp"
17 #include "CoilHeatingDXSingleSpeed.hpp"
18 #include "CoilHeatingDXSingleSpeed_Impl.hpp"
19 #include "CoilCoolingDXSingleSpeed.hpp"
20 #include "CoilCoolingDXSingleSpeed_Impl.hpp"
21 #include "CoilHeatingDXVariableSpeed.hpp"
22 #include "CoilHeatingDXVariableSpeed_Impl.hpp"
23 #include "CoilCoolingDXVariableSpeed.hpp"
24 #include "CoilCoolingDXVariableSpeed_Impl.hpp"
25 #include "CoilSystemCoolingDXHeatExchangerAssisted.hpp"
26 #include "CoilSystemCoolingDXHeatExchangerAssisted_Impl.hpp"
27 #include "CoilSystemIntegratedHeatPumpAirSource.hpp"
28 #include "CoilSystemIntegratedHeatPumpAirSource_Impl.hpp"
29 #include "CoilHeatingElectric.hpp"
30 #include "CoilHeatingElectric_Impl.hpp"
31 #include "CoilHeatingGas.hpp"
32 #include "CoilHeatingGas_Impl.hpp"
33 #include "CoilHeatingWater.hpp"
34 #include "CoilHeatingWater_Impl.hpp"
35 #include "FanConstantVolume.hpp"
36 #include "FanConstantVolume_Impl.hpp"
37 #include "FanOnOff.hpp"
38 #include "FanOnOff_Impl.hpp"
39 #include "FanSystemModel.hpp"
40 #include "FanSystemModel_Impl.hpp"
41 #include "Node.hpp"
42 #include "Node_Impl.hpp"
43
44 #include "../utilities/core/Assert.hpp"
45 #include "../utilities/data/DataEnums.hpp"
46
47 #include <utilities/idd/IddFactory.hxx>
48 #include <utilities/idd/OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_FieldEnums.hxx>
49 #include <utilities/idd/IddEnums.hxx>
50
51 namespace openstudio {
52 namespace model {
53
54 namespace detail {
55
56 12 AirLoopHVACUnitaryHeatPumpAirToAir_Impl::AirLoopHVACUnitaryHeatPumpAirToAir_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
57 12 : StraightComponent_Impl(idfObject, model, keepHandle) {
58
4/6
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 13 not taken.
12 OS_ASSERT(idfObject.iddObject().type() == AirLoopHVACUnitaryHeatPumpAirToAir::iddObjectType());
59 12 }
60
61 1 AirLoopHVACUnitaryHeatPumpAirToAir_Impl::AirLoopHVACUnitaryHeatPumpAirToAir_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
62 1 Model_Impl* model, bool keepHandle)
63 1 : StraightComponent_Impl(other, model, keepHandle) {
64
4/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
1 OS_ASSERT(other.iddObject().type() == AirLoopHVACUnitaryHeatPumpAirToAir::iddObjectType());
65 1 }
66
67 7 AirLoopHVACUnitaryHeatPumpAirToAir_Impl::AirLoopHVACUnitaryHeatPumpAirToAir_Impl(const AirLoopHVACUnitaryHeatPumpAirToAir_Impl& other,
68 7 Model_Impl* model, bool keepHandle)
69 7 : StraightComponent_Impl(other, model, keepHandle) {}
70
71 3 ModelObject AirLoopHVACUnitaryHeatPumpAirToAir_Impl::clone(Model model) const {
72
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 auto newUnitary = StraightComponent_Impl::clone(model).cast<AirLoopHVACUnitaryHeatPumpAirToAir>();
73
74
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 auto newFan = this->supplyAirFan().clone(model).cast<HVACComponent>();
75
76
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 auto newCoolingCoil = this->coolingCoil().clone(model).cast<HVACComponent>();
77
78
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 auto newHeatingCoil = this->heatingCoil().clone(model).cast<HVACComponent>();
79
80
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 auto newSupHeatingCoil = this->supplementalHeatingCoil().clone(model).cast<HVACComponent>();
81
82
1/1
✓ Branch 1 taken 3 times.
3 newUnitary.setCoolingCoil(newCoolingCoil);
83
84
1/1
✓ Branch 1 taken 3 times.
3 newUnitary.setHeatingCoil(newHeatingCoil);
85
86
1/1
✓ Branch 1 taken 3 times.
3 newUnitary.setSupplyAirFan(newFan);
87
88
1/1
✓ Branch 1 taken 3 times.
3 newUnitary.setSupplementalHeatingCoil(newSupHeatingCoil);
89
90 6 return std::move(newUnitary);
91 3 }
92
93 ✗ const std::vector<std::string>& AirLoopHVACUnitaryHeatPumpAirToAir_Impl::outputVariableNames() const {
94 ✗ static const std::vector<std::string> result;
95 ✗ return result;
96 }
97
98 10 IddObjectType AirLoopHVACUnitaryHeatPumpAirToAir_Impl::iddObjectType() const {
99 10 return AirLoopHVACUnitaryHeatPumpAirToAir::iddObjectType();
100 }
101
102 ✗ std::vector<ScheduleTypeKey> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
103 ✗ std::vector<ScheduleTypeKey> result;
104 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
105 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
106 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
107 ✗ if (std::find(b, e, OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AvailabilityScheduleName) != e) {
108 ✗ result.push_back(ScheduleTypeKey("AirLoopHVACUnitaryHeatPumpAirToAir", "Availability"));
109 }
110 ✗ if (std::find(b, e, OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanOperatingModeScheduleName) != e) {
111 ✗ result.push_back(ScheduleTypeKey("AirLoopHVACUnitaryHeatPumpAirToAir", "Supply Air Fan Operating Mode"));
112 }
113 ✗ return result;
114 ✗ }
115
116 2 std::vector<ModelObject> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::children() const {
117 2 std::vector<ModelObject> result;
118
119 // Avoid crashing when calling remove() in Ctor when failing to set one of the child component by calling the optional one
120
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (boost::optional<HVACComponent> supplyFan = this->optionalSupplyAirFan()) {
121
2/2
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
2 result.push_back(std::move(*supplyFan));
122 2 }
123
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (boost::optional<HVACComponent> coolingCoil = this->optionalCoolingCoil()) {
124
2/2
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
2 result.push_back(std::move(*coolingCoil));
125 2 }
126
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (boost::optional<HVACComponent> heatingCoil = this->optionalHeatingCoil()) {
127
2/2
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
2 result.push_back(std::move(*heatingCoil));
128 2 }
129
3/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 1 time.
4 if (boost::optional<HVACComponent> supplementalHeatingCoil = this->optionalSupplementalHeatingCoil()) {
130
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
1 result.push_back(std::move(*supplementalHeatingCoil));
131 2 }
132
133 2 return result;
134 ✗ }
135
136 13 unsigned AirLoopHVACUnitaryHeatPumpAirToAir_Impl::inletPort() const {
137 13 return OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AirInletNodeName;
138 }
139
140 62 unsigned AirLoopHVACUnitaryHeatPumpAirToAir_Impl::outletPort() const {
141 62 return OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AirOutletNodeName;
142 }
143
144 1 Schedule AirLoopHVACUnitaryHeatPumpAirToAir_Impl::availabilitySchedule() const {
145 boost::optional<Schedule> value =
146
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AvailabilityScheduleName);
147
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (!value) {
148 // it is an error if we get here, however we don't want to crash
149 // so we hook up to global always on schedule
150 ✗ LOG(Error, "Required availability schedule not set, using 'Always On' schedule");
151 ✗ value = this->model().alwaysOnDiscreteSchedule();
152 ✗ OS_ASSERT(value);
153 ✗ const_cast<AirLoopHVACUnitaryHeatPumpAirToAir_Impl*>(this)->setAvailabilitySchedule(*value);
154 ✗ value = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AvailabilityScheduleName);
155 }
156
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
1 OS_ASSERT(value);
157
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 return value.get();
158 1 }
159
160 16 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::addToNode(Node& node) {
161
3/3
✓ Branch 1 taken 16 times.
✓ Branch 3 taken 10 times.
✓ Branch 4 taken 6 times.
32 if (boost::optional<AirLoopHVAC> airLoop = node.airLoopHVAC()) {
162
5/5
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 10 taken 7 times.
✓ Branch 11 taken 3 times.
20 if (airLoop->supplyComponent(node.handle())) {
163
1/1
✓ Branch 1 taken 7 times.
7 return StraightComponent_Impl::addToNode(node);
164 }
165 16 }
166
167 9 return false;
168 }
169
170 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplyAirFlowRateDuringCoolingOperation() const {
171 ✗ return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringCoolingOperation, true);
172 }
173
174 1 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isSupplyAirFlowRateDuringCoolingOperationAutosized() const {
175 1 bool result = false;
176
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<std::string> value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringCoolingOperation, true);
177
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (value) {
178
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
2 result = openstudio::istringEqual(value.get(), "Autosize");
179 }
180 1 return result;
181 1 }
182
183 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplyAirFlowRateDuringHeatingOperation() const {
184 ✗ return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringHeatingOperation, true);
185 }
186
187 1 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isSupplyAirFlowRateDuringHeatingOperationAutosized() const {
188 1 bool result = false;
189
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<std::string> value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringHeatingOperation, true);
190
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (value) {
191
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
2 result = openstudio::istringEqual(value.get(), "Autosize");
192 }
193 1 return result;
194 1 }
195
196 1 boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const {
197 1 return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, true);
198 }
199
200 1 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const {
201 1 bool result = false;
202 boost::optional<std::string> value =
203
1/1
✓ Branch 1 taken 1 time.
1 getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, true);
204
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (value) {
205
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
2 result = openstudio::istringEqual(value.get(), "Autosize");
206 }
207 1 return result;
208 1 }
209
210 1 boost::optional<ThermalZone> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::controllingZone() const {
211 1 boost::optional<ThermalZone> result;
212
213
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 result = getObject<ModelObject>().getModelObjectTarget<ThermalZone>(
214 1 OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::ControllingZoneorThermostatLocation);
215
216 1 return result;
217 ✗ }
218
219 5 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplyAirFan() const {
220
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<HVACComponent> value = optionalSupplyAirFan();
221
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
5 if (!value) {
222 ✗ LOG_AND_THROW(briefDescription() << " does not have an Supply Air Fan attached.");
223 }
224
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 return value.get();
225 5 }
226
227 7 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir_Impl::heatingCoil() const {
228
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<HVACComponent> value = optionalHeatingCoil();
229
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
7 if (!value) {
230 ✗ LOG_AND_THROW(briefDescription() << " does not have an Heating Coil attached.");
231 }
232
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
14 return value.get();
233 7 }
234
235 10 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir_Impl::coolingCoil() const {
236
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<HVACComponent> value = optionalCoolingCoil();
237
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 10 times.
10 if (!value) {
238 ✗ LOG_AND_THROW(briefDescription() << " does not have an Cooling Coil attached.");
239 }
240
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 return value.get();
241 10 }
242
243 4 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplementalHeatingCoil() const {
244
1/1
✓ Branch 1 taken 4 times.
4 auto value = optionalSupplementalHeatingCoil();
245
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (!value) {
246 ✗ LOG_AND_THROW(briefDescription() << " does not have a Supplemental Heating Coil attached.");
247 }
248
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 return value.get();
249 4 }
250
251 7 boost::optional<HVACComponent> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::optionalSupplyAirFan() const {
252
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
7 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanName);
253 }
254
255 9 boost::optional<HVACComponent> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::optionalHeatingCoil() const {
256
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingCoilName);
257 }
258
259 12 boost::optional<HVACComponent> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::optionalCoolingCoil() const {
260
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingCoilName);
261 }
262
263 6 boost::optional<HVACComponent> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::optionalSupplementalHeatingCoil() const {
264
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplementalHeatingCoilName);
265 }
266
267 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::maximumSupplyAirTemperaturefromSupplementalHeater() const {
268 ✗ return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, true);
269 }
270
271 1 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const {
272 1 bool result = false;
273 boost::optional<std::string> value =
274
1/1
✓ Branch 1 taken 1 time.
1 getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, true);
275
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (value) {
276
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
2 result = openstudio::istringEqual(value.get(), "Autosize");
277 }
278 1 return result;
279 1 }
280
281 1 double AirLoopHVACUnitaryHeatPumpAirToAir_Impl::maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const {
282 boost::optional<double> value =
283
1/1
✓ Branch 1 taken 1 time.
1 getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, true);
284
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
1 OS_ASSERT(value);
285
1/1
✓ Branch 1 taken 1 time.
2 return value.get();
286 }
287
288 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperationDefaulted() const {
289 ✗ return isEmpty(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation);
290 }
291
292 1 std::string AirLoopHVACUnitaryHeatPumpAirToAir_Impl::fanPlacement() const {
293
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<std::string> value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement, true);
294
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
1 OS_ASSERT(value);
295
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 return value.get();
296 1 }
297
298 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isFanPlacementDefaulted() const {
299 ✗ return isEmpty(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement);
300 }
301
302 1 boost::optional<Schedule> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::supplyAirFanOperatingModeSchedule() const {
303
1/1
✓ Branch 1 taken 1 time.
2 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
304
1/1
✓ Branch 1 taken 1 time.
2 OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanOperatingModeScheduleName);
305 }
306
307 ✗ std::string AirLoopHVACUnitaryHeatPumpAirToAir_Impl::dehumidificationControlType() const {
308 ✗ boost::optional<std::string> value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType, true);
309 ✗ OS_ASSERT(value);
310 ✗ return value.get();
311 ✗ }
312
313 1 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::isDehumidificationControlTypeDefaulted() const {
314 1 return isEmpty(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType);
315 }
316
317 1 double AirLoopHVACUnitaryHeatPumpAirToAir_Impl::dXHeatingCoilSizingRatio() const {
318
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<double> value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DXHeatingCoilSizingRatio, true);
319
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
✗ Branch 4 not taken.
1 OS_ASSERT(value);
320
1/1
✓ Branch 1 taken 1 time.
2 return value.get();
321 }
322
323 11 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setAvailabilitySchedule(Schedule& schedule) {
324
3/3
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
44 bool result = setSchedule(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::AvailabilityScheduleName, "AirLoopHVACUnitaryHeatPumpAirToAir",
325 "Availability", schedule);
326 11 return result;
327 }
328
329 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplyAirFlowRateDuringCoolingOperation(
330 boost::optional<double> supplyAirFlowRateDuringCoolingOperation) {
331 ✗ bool result = false;
332 ✗ if (supplyAirFlowRateDuringCoolingOperation) {
333 ✗ result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringCoolingOperation,
334 ✗ supplyAirFlowRateDuringCoolingOperation.get());
335 } else {
336 ✗ result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringCoolingOperation, "");
337 }
338 ✗ return result;
339 }
340
341 10 void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizeSupplyAirFlowRateDuringCoolingOperation() {
342
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringCoolingOperation, "Autosize");
343
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
10 OS_ASSERT(result);
344 10 }
345
346 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplyAirFlowRateDuringHeatingOperation(boost::optional<double> n2) {
347 ✗ bool result = false;
348 ✗ if (n2) {
349 ✗ result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringHeatingOperation, n2.get());
350 } else {
351 ✗ result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringHeatingOperation, "");
352 }
353 ✗ return result;
354 }
355
356 10 void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizeSupplyAirFlowRateDuringHeatingOperation() {
357
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateDuringHeatingOperation, "Autosize");
358
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
10 OS_ASSERT(result);
359 10 }
360
361 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(
362 boost::optional<double> supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) {
363 ✗ bool result = false;
364 ✗ if (supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) {
365 ✗ result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded,
366 ✗ supplyAirFlowRateWhenNoCoolingorHeatingisNeeded.get());
367 } else {
368 ✗ result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, "");
369 }
370 ✗ return result;
371 }
372
373 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() {
374 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, "");
375 ✗ OS_ASSERT(result);
376 ✗ }
377
378 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() {
379 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, "Autosize");
380 ✗ OS_ASSERT(result);
381 ✗ }
382
383 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setControllingZone(ThermalZone& zone) {
384 ✗ return setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::ControllingZoneorThermostatLocation, zone.handle());
385 ;
386 }
387
388 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetControllingZone() {
389 ✗ setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::ControllingZoneorThermostatLocation, "");
390 ✗ }
391
392 16 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplyAirFan(HVACComponent& hvacComponent) {
393 // TODO: Doesn't support Fan:SystemModel yet
394
11/16
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 11 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 2 times.
✓ Branch 11 taken 3 times.
✓ Branch 12 taken 5 times.
✓ Branch 13 taken 11 times.
✓ Branch 15 taken 16 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 2 times.
✓ Branch 19 taken 14 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
16 if (!hvacComponent.optionalCast<FanConstantVolume>() && !hvacComponent.optionalCast<FanOnOff>() // &&
395 // ! hvacComponent.optionalCast<FanSystemModel>()
396 ) {
397 2 return false;
398 }
399
400
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 return setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanName, hvacComponent.handle());
401 }
402
403 14 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setHeatingCoil(HVACComponent& hvacComponent) {
404 14 bool isTypeOK = false;
405
406
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 7 times.
28 if (hvacComponent.optionalCast<CoilHeatingDXSingleSpeed>()) {
407 7 isTypeOK = true;
408
3/3
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 3 times.
✓ Branch 5 taken 4 times.
14 } else if (hvacComponent.optionalCast<CoilHeatingDXVariableSpeed>()) {
409 3 isTypeOK = true;
410
2/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
8 } else if (hvacComponent.optionalCast<CoilSystemIntegratedHeatPumpAirSource>()) {
411 4 isTypeOK = true;
412 }
413
414
1/2
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
14 if (isTypeOK) {
415
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 return setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::HeatingCoilName, hvacComponent.handle());
416 }
417 ✗ return false;
418 }
419
420 15 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setCoolingCoil(HVACComponent& hvacComponent) {
421 15 bool isTypeOK = false;
422
423
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 7 times.
✓ Branch 5 taken 8 times.
30 if (hvacComponent.optionalCast<CoilCoolingDXSingleSpeed>()) {
424 7 isTypeOK = true;
425
3/3
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 3 times.
✓ Branch 5 taken 5 times.
16 } else if (hvacComponent.optionalCast<CoilCoolingDXVariableSpeed>()) {
426 3 isTypeOK = true;
427
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 4 times.
10 } else if (hvacComponent.optionalCast<CoilSystemCoolingDXHeatExchangerAssisted>()) {
428 1 isTypeOK = true;
429
2/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
8 } else if (hvacComponent.optionalCast<CoilSystemIntegratedHeatPumpAirSource>()) {
430 4 isTypeOK = true;
431 }
432
433
1/2
✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
15 if (isTypeOK) {
434
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
15 return setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::CoolingCoilName, hvacComponent.handle());
435 }
436 ✗ return false;
437 }
438
439 14 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplementalHeatingCoil(HVACComponent& hvacComponent) {
440 14 bool isTypeOK = false;
441
442
2/3
✓ Branch 1 taken 14 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 14 times.
28 if (hvacComponent.optionalCast<CoilHeatingGas>()) {
443 ✗ isTypeOK = true;
444
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 13 times.
✓ Branch 5 taken 1 time.
28 } else if (hvacComponent.optionalCast<CoilHeatingElectric>()) {
445 13 isTypeOK = true;
446
2/3
✓ Branch 1 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 time.
2 } else if (hvacComponent.optionalCast<CoilHeatingWater>()) {
447 ✗ isTypeOK = true;
448 }
449
450
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 1 time.
14 if (isTypeOK) {
451
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 return setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplementalHeatingCoilName, hvacComponent.handle());
452 }
453 1 return false;
454 }
455
456 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setMaximumSupplyAirTemperaturefromSupplementalHeater(
457 boost::optional<double> maximumSupplyAirTemperaturefromSupplementalHeater) {
458 ✗ bool result = false;
459 ✗ if (maximumSupplyAirTemperaturefromSupplementalHeater) {
460 ✗ result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater,
461 ✗ maximumSupplyAirTemperaturefromSupplementalHeater.get());
462 } else {
463 ✗ result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "");
464 }
465 ✗ OS_ASSERT(result);
466 ✗ return result;
467 }
468
469 10 void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizeMaximumSupplyAirTemperaturefromSupplementalHeater() {
470
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "Autosize");
471
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
10 OS_ASSERT(result);
472 10 }
473
474 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(
475 double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) {
476 ✗ bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation,
477 maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation);
478 ✗ return result;
479 }
480
481 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() {
482 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, "");
483 ✗ OS_ASSERT(result);
484 ✗ }
485
486 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setFanPlacement(const std::string& fanPlacement) {
487 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement, fanPlacement);
488 ✗ return result;
489 }
490
491 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetFanPlacement() {
492 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement, "");
493 ✗ OS_ASSERT(result);
494 ✗ }
495
496 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) {
497 ✗ bool result = setSchedule(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanOperatingModeScheduleName,
498 "AirLoopHVACUnitaryHeatPumpAirToAir", "Supply Air Fan Operating Mode", schedule);
499 ✗ return result;
500 }
501
502 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetSupplyAirFanOperatingModeSchedule() {
503 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::SupplyAirFanOperatingModeScheduleName, "");
504 ✗ OS_ASSERT(result);
505 ✗ }
506
507 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setDehumidificationControlType(const std::string& dehumidificationControlType) {
508 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType, dehumidificationControlType);
509 ✗ return result;
510 }
511
512 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::resetDehumidificationControlType() {
513 ✗ bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType, "");
514 ✗ OS_ASSERT(result);
515 ✗ }
516
517 10 bool AirLoopHVACUnitaryHeatPumpAirToAir_Impl::setDXHeatingCoilSizingRatio(double dxHeatingCoilSizingRatio) {
518 10 bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DXHeatingCoilSizingRatio, dxHeatingCoilSizingRatio);
519 10 return result;
520 }
521
522 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizedSupplyAirFlowRateDuringCoolingOperation() const {
523 ✗ return getAutosizedValue("Supply Air Flow Rate During Cooling Operation", "m3/s");
524 }
525
526 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizedSupplyAirFlowRateDuringHeatingOperation() const {
527 ✗ return getAutosizedValue("Supply Air Flow Rate During Heating Operation", "m3/s");
528 }
529
530 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizedSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const {
531 ✗ return getAutosizedValue("Supply Air Flow Rate", "m3/s");
532 }
533
534 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosizedMaximumSupplyAirTemperaturefromSupplementalHeater() const {
535 ✗ return getAutosizedValue("Maximum Supply Air Temperature from Supplemental Heater", "C");
536 }
537
538 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::autosize() {
539 ✗ autosizeSupplyAirFlowRateDuringCoolingOperation();
540 ✗ autosizeSupplyAirFlowRateDuringHeatingOperation();
541 ✗ autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
542 ✗ autosizeMaximumSupplyAirTemperaturefromSupplementalHeater();
543 ✗ }
544
545 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir_Impl::applySizingValues() {
546 ✗ boost::optional<double> val;
547 ✗ val = autosizedSupplyAirFlowRateDuringCoolingOperation();
548 ✗ if (val) {
549 ✗ setSupplyAirFlowRateDuringCoolingOperation(val.get());
550 }
551
552 ✗ val = autosizedSupplyAirFlowRateDuringHeatingOperation();
553 ✗ if (val) {
554 ✗ setSupplyAirFlowRateDuringHeatingOperation(val.get());
555 }
556
557 ✗ val = autosizedSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
558 ✗ if (val) {
559 ✗ setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(val.get());
560 }
561
562 ✗ val = autosizedMaximumSupplyAirTemperaturefromSupplementalHeater();
563 ✗ if (val) {
564 ✗ setMaximumSupplyAirTemperaturefromSupplementalHeater(val.get());
565 }
566 ✗ }
567
568 ✗ std::vector<EMSActuatorNames> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::emsActuatorNames() const {
569 std::vector<EMSActuatorNames> actuators{{"AirLoopHVAC:UnitaryHeatPump:AirToAir", "Autosized Supply Air Flow Rate"},
570 {"Unitary HVAC", "Sensible Load Request"},
571 ✗ {"Unitary HVAC", "Moisture Load Request"}};
572 ✗ return actuators;
573 ✗ }
574
575 ✗ std::vector<std::string> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::emsInternalVariableNames() const {
576 ✗ std::vector<std::string> types{"Unitary HVAC Design Heating Capacity", "Unitary HVAC Design Cooling Capacity"};
577 ✗ return types;
578 ✗ }
579
580 ✗ ComponentType AirLoopHVACUnitaryHeatPumpAirToAir_Impl::componentType() const {
581 ✗ return ComponentType::Both;
582 }
583
584 ✗ std::vector<FuelType> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::coolingFuelTypes() const {
585 ✗ return coolingCoil().coolingFuelTypes();
586 }
587
588 ✗ std::vector<FuelType> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::heatingFuelTypes() const {
589 ✗ std::set<FuelType> result;
590 ✗ for (auto ft : heatingCoil().heatingFuelTypes()) {
591 ✗ result.insert(ft);
592 ✗ }
593 ✗ for (auto ft : supplementalHeatingCoil().heatingFuelTypes()) {
594 ✗ result.insert(ft);
595 ✗ }
596 ✗ return {result.begin(), result.end()};
597 ✗ }
598
599 ✗ std::vector<AppGFuelType> AirLoopHVACUnitaryHeatPumpAirToAir_Impl::appGHeatingFuelTypes() const {
600 ✗ std::set<AppGFuelType> result;
601 ✗ for (auto ft : heatingCoil().appGHeatingFuelTypes()) {
602 ✗ result.insert(ft);
603 ✗ }
604 ✗ for (auto ft : supplementalHeatingCoil().appGHeatingFuelTypes()) {
605 ✗ result.insert(ft);
606 ✗ }
607 ✗ return {result.begin(), result.end()};
608 ✗ }
609
610 } // namespace detail
611
612 11 AirLoopHVACUnitaryHeatPumpAirToAir::AirLoopHVACUnitaryHeatPumpAirToAir(const Model& model, Schedule& availabilitySchedule, HVACComponent& supplyFan,
613 HVACComponent& heatingCoil, HVACComponent& coolingCoil,
614 11 HVACComponent& supplementalHeatingCoil)
615 11 : StraightComponent(AirLoopHVACUnitaryHeatPumpAirToAir::iddObjectType(), model) {
616
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 11 times.
✗ Branch 5 not taken.
11 OS_ASSERT(getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>());
617
618
1/1
✓ Branch 1 taken 11 times.
11 bool ok = setAvailabilitySchedule(availabilitySchedule);
619
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
11 if (!ok) {
620 ✗ remove();
621 ✗ LOG_AND_THROW("Unable to set " << briefDescription() << "'s availability schedule to " << availabilitySchedule.briefDescription() << ".");
622 }
623
624
1/1
✓ Branch 1 taken 11 times.
11 ok = setSupplyAirFan(supplyFan);
625
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
11 if (!ok) {
626 ✗ remove(); // Funny thing: you can't remove it, because it'll call children, which will try to get the supplyAirFan, which will not work and hit an OS_ASSERT...
627 ✗ LOG_AND_THROW("Unable to set " << briefDescription() << "'s supply fan to " << supplyFan.briefDescription() << ".");
628 }
629
630
1/1
✓ Branch 1 taken 11 times.
11 ok = setHeatingCoil(heatingCoil);
631
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
11 if (!ok) {
632 ✗ remove();
633 ✗ LOG_AND_THROW("Unable to set " << briefDescription() << "'s heating coil to " << heatingCoil.briefDescription() << ".");
634 }
635
636
1/1
✓ Branch 1 taken 11 times.
11 ok = setCoolingCoil(coolingCoil);
637
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
11 if (!ok) {
638 ✗ remove();
639 ✗ LOG_AND_THROW("Unable to set " << briefDescription() << "'s cooling coil to " << coolingCoil.briefDescription() << ".");
640 }
641
642
1/1
✓ Branch 1 taken 11 times.
11 ok = setSupplementalHeatingCoil(supplementalHeatingCoil);
643
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 10 times.
11 if (!ok) {
644
1/1
✓ Branch 1 taken 1 time.
1 remove();
645
25/25
✓ 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.
✓ Branch 39 taken 1 time.
✓ Branch 42 taken 1 time.
✓ Branch 45 taken 1 time.
✓ Branch 48 taken 1 time.
✓ Branch 51 taken 1 time.
✓ Branch 54 taken 1 time.
✓ Branch 57 taken 1 time.
✓ Branch 60 taken 1 time.
✓ Branch 63 taken 1 time.
✓ Branch 66 taken 1 time.
✓ Branch 69 taken 1 time.
✓ Branch 72 taken 1 time.
✓ Branch 78 taken 1 time.
✓ Branch 81 taken 1 time.
1 LOG_AND_THROW("Unable to set " << briefDescription() << "'s supplemental heating coil to " << supplementalHeatingCoil.briefDescription()
646 << ".");
647 }
648
649
1/1
✓ Branch 1 taken 10 times.
10 autosizeSupplyAirFlowRateDuringCoolingOperation();
650
1/1
✓ Branch 1 taken 10 times.
10 autosizeSupplyAirFlowRateDuringHeatingOperation();
651
1/1
✓ Branch 1 taken 10 times.
10 autosizeMaximumSupplyAirTemperaturefromSupplementalHeater();
652
1/1
✓ Branch 1 taken 10 times.
10 setDXHeatingCoilSizingRatio(1.0);
653 11 }
654
655 8078 IddObjectType AirLoopHVACUnitaryHeatPumpAirToAir::iddObjectType() {
656
1/1
✓ Branch 1 taken 8078 times.
8078 IddObjectType result(IddObjectType::OS_AirLoopHVAC_UnitaryHeatPump_AirToAir);
657 8078 return result;
658 }
659
660 ✗ std::vector<std::string> AirLoopHVACUnitaryHeatPumpAirToAir::validFanPlacementValues() {
661 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::FanPlacement);
662 }
663
664 ✗ std::vector<std::string> AirLoopHVACUnitaryHeatPumpAirToAir::validDehumidificationControlTypeValues() {
665 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(),
666 ✗ OS_AirLoopHVAC_UnitaryHeatPump_AirToAirFields::DehumidificationControlType);
667 }
668
669 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::supplyAirFlowRateDuringCoolingOperation() const {
670 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplyAirFlowRateDuringCoolingOperation();
671 }
672
673 1 bool AirLoopHVACUnitaryHeatPumpAirToAir::isSupplyAirFlowRateDuringCoolingOperationAutosized() const {
674
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isSupplyAirFlowRateDuringCoolingOperationAutosized();
675 }
676
677 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::supplyAirFlowRateDuringHeatingOperation() const {
678 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplyAirFlowRateDuringHeatingOperation();
679 }
680
681 1 bool AirLoopHVACUnitaryHeatPumpAirToAir::isSupplyAirFlowRateDuringHeatingOperationAutosized() const {
682
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isSupplyAirFlowRateDuringHeatingOperationAutosized();
683 }
684
685 1 boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const {
686
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
687 }
688
689 1 bool AirLoopHVACUnitaryHeatPumpAirToAir::isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const {
690
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized();
691 }
692
693 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::maximumSupplyAirTemperaturefromSupplementalHeater() const {
694 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->maximumSupplyAirTemperaturefromSupplementalHeater();
695 }
696
697 1 bool AirLoopHVACUnitaryHeatPumpAirToAir::isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const {
698
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized();
699 }
700
701 1 double AirLoopHVACUnitaryHeatPumpAirToAir::maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const {
702
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation();
703 }
704
705 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::isMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperationDefaulted() const {
706 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperationDefaulted();
707 }
708
709 1 std::string AirLoopHVACUnitaryHeatPumpAirToAir::fanPlacement() const {
710
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->fanPlacement();
711 }
712
713 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::isFanPlacementDefaulted() const {
714 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isFanPlacementDefaulted();
715 }
716
717 ✗ std::string AirLoopHVACUnitaryHeatPumpAirToAir::dehumidificationControlType() const {
718 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->dehumidificationControlType();
719 }
720
721 1 bool AirLoopHVACUnitaryHeatPumpAirToAir::isDehumidificationControlTypeDefaulted() const {
722
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->isDehumidificationControlTypeDefaulted();
723 }
724
725 1 double AirLoopHVACUnitaryHeatPumpAirToAir::dXHeatingCoilSizingRatio() const {
726
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->dXHeatingCoilSizingRatio();
727 }
728
729 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setSupplyAirFlowRateDuringCoolingOperation(double supplyAirFlowRateDuringCoolingOperation) {
730 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplyAirFlowRateDuringCoolingOperation(
731 ✗ supplyAirFlowRateDuringCoolingOperation);
732 }
733
734 10 void AirLoopHVACUnitaryHeatPumpAirToAir::autosizeSupplyAirFlowRateDuringCoolingOperation() {
735
1/1
✓ Branch 3 taken 10 times.
10 getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizeSupplyAirFlowRateDuringCoolingOperation();
736 10 }
737
738 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setSupplyAirFlowRateDuringHeatingOperation(double n2) {
739 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplyAirFlowRateDuringHeatingOperation(n2);
740 }
741
742 10 void AirLoopHVACUnitaryHeatPumpAirToAir::autosizeSupplyAirFlowRateDuringHeatingOperation() {
743
1/1
✓ Branch 3 taken 10 times.
10 getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizeSupplyAirFlowRateDuringHeatingOperation();
744 10 }
745
746 bool
747 ✗ AirLoopHVACUnitaryHeatPumpAirToAir::setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(double supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) {
748 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(
749 ✗ supplyAirFlowRateWhenNoCoolingorHeatingisNeeded);
750 }
751
752 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() {
753 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
754 ✗ }
755
756 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() {
757 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
758 ✗ }
759
760 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setMaximumSupplyAirTemperaturefromSupplementalHeater(
761 double maximumSupplyAirTemperaturefromSupplementalHeater) {
762 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setMaximumSupplyAirTemperaturefromSupplementalHeater(
763 ✗ maximumSupplyAirTemperaturefromSupplementalHeater);
764 }
765
766 10 void AirLoopHVACUnitaryHeatPumpAirToAir::autosizeMaximumSupplyAirTemperaturefromSupplementalHeater() {
767
1/1
✓ Branch 3 taken 10 times.
10 getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizeMaximumSupplyAirTemperaturefromSupplementalHeater();
768 10 }
769
770 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(
771 double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) {
772 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(
773 ✗ maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation);
774 }
775
776 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() {
777 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation();
778 ✗ }
779
780 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setFanPlacement(const std::string& fanPlacement) {
781 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setFanPlacement(fanPlacement);
782 }
783
784 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetFanPlacement() {
785 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetFanPlacement();
786 ✗ }
787
788 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) {
789 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplyAirFanOperatingModeSchedule(schedule);
790 }
791
792 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetSupplyAirFanOperatingModeSchedule() {
793 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetSupplyAirFanOperatingModeSchedule();
794 ✗ }
795
796 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setDehumidificationControlType(const std::string& dehumidificationControlType) {
797 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setDehumidificationControlType(dehumidificationControlType);
798 }
799
800 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetDehumidificationControlType() {
801 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetDehumidificationControlType();
802 ✗ }
803
804 10 bool AirLoopHVACUnitaryHeatPumpAirToAir::setDXHeatingCoilSizingRatio(double dxHeatingCoilSizingRatio) {
805
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setDXHeatingCoilSizingRatio(dxHeatingCoilSizingRatio);
806 }
807
808 11 bool AirLoopHVACUnitaryHeatPumpAirToAir::setAvailabilitySchedule(Schedule& schedule) {
809
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setAvailabilitySchedule(schedule);
810 }
811
812 ✗ bool AirLoopHVACUnitaryHeatPumpAirToAir::setControllingZone(ThermalZone& zone) {
813 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setControllingZone(zone);
814 }
815
816 ✗ void AirLoopHVACUnitaryHeatPumpAirToAir::resetControllingZone() {
817 ✗ getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->resetControllingZone();
818 ✗ }
819
820 16 bool AirLoopHVACUnitaryHeatPumpAirToAir::setSupplyAirFan(HVACComponent& hvacComponent) {
821
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplyAirFan(hvacComponent);
822 }
823
824 14 bool AirLoopHVACUnitaryHeatPumpAirToAir::setHeatingCoil(HVACComponent& hvacComponent) {
825
1/1
✓ Branch 3 taken 14 times.
14 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setHeatingCoil(hvacComponent);
826 }
827
828 15 bool AirLoopHVACUnitaryHeatPumpAirToAir::setCoolingCoil(HVACComponent& hvacComponent) {
829
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setCoolingCoil(hvacComponent);
830 }
831
832 14 bool AirLoopHVACUnitaryHeatPumpAirToAir::setSupplementalHeatingCoil(HVACComponent& hvacComponent) {
833
1/1
✓ Branch 3 taken 14 times.
14 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->setSupplementalHeatingCoil(hvacComponent);
834 }
835
836 1 boost::optional<Schedule> AirLoopHVACUnitaryHeatPumpAirToAir::supplyAirFanOperatingModeSchedule() const {
837
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplyAirFanOperatingModeSchedule();
838 }
839
840 1 Schedule AirLoopHVACUnitaryHeatPumpAirToAir::availabilitySchedule() const {
841
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->availabilitySchedule();
842 }
843
844 1 boost::optional<ThermalZone> AirLoopHVACUnitaryHeatPumpAirToAir::controllingZone() const {
845
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->controllingZone();
846 }
847
848 2 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir::supplyAirFan() const {
849
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplyAirFan();
850 }
851
852 4 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir::heatingCoil() const {
853
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->heatingCoil();
854 }
855
856 7 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir::coolingCoil() const {
857
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->coolingCoil();
858 }
859
860 1 HVACComponent AirLoopHVACUnitaryHeatPumpAirToAir::supplementalHeatingCoil() const {
861
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->supplementalHeatingCoil();
862 }
863
864 /// @cond
865 15 AirLoopHVACUnitaryHeatPumpAirToAir::AirLoopHVACUnitaryHeatPumpAirToAir(std::shared_ptr<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl> impl)
866
1/1
✓ Branch 3 taken 15 times.
15 : StraightComponent(std::move(impl)) {}
867 /// @endcond
868
869 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::autosizedSupplyAirFlowRateDuringCoolingOperation() const {
870 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizedSupplyAirFlowRateDuringCoolingOperation();
871 }
872
873 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::autosizedSupplyAirFlowRateDuringHeatingOperation() const {
874 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizedSupplyAirFlowRateDuringHeatingOperation();
875 }
876
877 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::autosizedSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const {
878 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizedSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded();
879 }
880
881 ✗ boost::optional<double> AirLoopHVACUnitaryHeatPumpAirToAir::autosizedMaximumSupplyAirTemperaturefromSupplementalHeater() const {
882 ✗ return getImpl<detail::AirLoopHVACUnitaryHeatPumpAirToAir_Impl>()->autosizedMaximumSupplyAirTemperaturefromSupplementalHeater();
883 }
884
885 } // namespace model
886 } // namespace openstudio
887