GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 72.3% 388 / 0 / 537
Functions: 80.7% 117 / 0 / 145
Branches: 43.5% 262 / 0 / 602

src/model/WaterHeaterHeatPump.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 "WaterHeaterHeatPump.hpp"
7 #include "WaterHeaterHeatPump_Impl.hpp"
8 #include "Model.hpp"
9 #include "Model_Impl.hpp"
10 #include "WaterHeaterMixed.hpp"
11 #include "WaterHeaterMixed_Impl.hpp"
12 #include "WaterHeaterStratified.hpp"
13 #include "WaterHeaterStratified_Impl.hpp"
14 #include "FanOnOff.hpp"
15 #include "FanOnOff_Impl.hpp"
16 // #include "FanSystemModel.hpp"
17 #include "CoilWaterHeatingAirToWaterHeatPump.hpp"
18 #include "CoilWaterHeatingAirToWaterHeatPump_Impl.hpp"
19 #include "Schedule.hpp"
20 #include "Schedule_Impl.hpp"
21 #include "ScheduleDay.hpp"
22 #include "ScheduleDay_Impl.hpp"
23 #include "ThermalZone.hpp"
24 #include "ThermalZone_Impl.hpp"
25 #include "HVACComponent.hpp"
26 #include "HVACComponent_Impl.hpp"
27 #include "ScheduleRuleset.hpp"
28 #include "ScheduleRuleset_Impl.hpp"
29 #include "ScheduleTypeLimits.hpp"
30 #include "ScheduleTypeRegistry.hpp"
31
32 #include "../utilities/core/Assert.hpp"
33 #include "../utilities/data/DataEnums.hpp"
34
35 #include <utilities/idd/IddFactory.hxx>
36 #include <utilities/idd/OS_WaterHeater_HeatPump_FieldEnums.hxx>
37
38 namespace openstudio {
39 namespace model {
40
41 namespace detail {
42
43 16 WaterHeaterHeatPump_Impl::WaterHeaterHeatPump_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
44 16 : ZoneHVACComponent_Impl(idfObject, model, keepHandle) {
45
4/6
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 16 times.
✗ Branch 13 not taken.
16 OS_ASSERT(idfObject.iddObject().type() == WaterHeaterHeatPump::iddObjectType());
46 16 }
47
48 2 WaterHeaterHeatPump_Impl::WaterHeaterHeatPump_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
49 2 : ZoneHVACComponent_Impl(other, model, keepHandle) {
50
4/6
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✗ Branch 13 not taken.
2 OS_ASSERT(other.iddObject().type() == WaterHeaterHeatPump::iddObjectType());
51 2 }
52
53 3 WaterHeaterHeatPump_Impl::WaterHeaterHeatPump_Impl(const WaterHeaterHeatPump_Impl& other, Model_Impl* model, bool keepHandle)
54 3 : ZoneHVACComponent_Impl(other, model, keepHandle) {}
55
56 ✗ const std::vector<std::string>& WaterHeaterHeatPump_Impl::outputVariableNames() const {
57 static const std::vector<std::string> result{// WaterHeater:HeatPump:PumpedCondenser
58 "Water Heater Compressor Part Load Ratio", "Water Heater On Cycle Ancillary Electricity Rate",
59 "Water Heater On Cycle Ancillary Electricity Energy",
60 "Water Heater Off Cycle Ancillary Electricity Rate",
61 ✗ "Water Heater Off Cycle Ancillary Electricity Energy"};
62 ✗ return result;
63 ✗ }
64
65 14 IddObjectType WaterHeaterHeatPump_Impl::iddObjectType() const {
66 14 return WaterHeaterHeatPump::iddObjectType();
67 }
68
69 ✗ std::vector<ScheduleTypeKey> WaterHeaterHeatPump_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
70 // TODO: Check schedule display names.
71 ✗ std::vector<ScheduleTypeKey> result;
72 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
73 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
74 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
75 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::AvailabilitySchedule) != e) {
76 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Availability Schedule"));
77 }
78 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::CompressorSetpointTemperatureSchedule) != e) {
79 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Compressor Setpoint Temperature Schedule"));
80 }
81 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::InletAirTemperatureSchedule) != e) {
82 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Inlet Air Temperature Schedule"));
83 }
84 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::InletAirHumiditySchedule) != e) {
85 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Inlet Air Humidity Schedule"));
86 }
87 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::CompressorAmbientTemperatureSchedule) != e) {
88 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Compressor Ambient Temperature Schedule"));
89 }
90 ✗ if (std::find(b, e, OS_WaterHeater_HeatPumpFields::InletAirMixerSchedule) != e) {
91 ✗ result.push_back(ScheduleTypeKey("WaterHeaterHeatPump", "Inlet Air Mixer Schedule"));
92 }
93 ✗ return result;
94 ✗ }
95
96 5 boost::optional<Schedule> WaterHeaterHeatPump_Impl::availabilitySchedule() const {
97
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::AvailabilitySchedule);
98 }
99
100 4 Schedule WaterHeaterHeatPump_Impl::compressorSetpointTemperatureSchedule() const {
101
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<Schedule> value = optionalCompressorSetpointTemperatureSchedule();
102
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (!value) {
103 ✗ LOG_AND_THROW(briefDescription() << " does not have an Compressor Setpoint Temperature Schedule attached.");
104 }
105
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 return value.get();
106 4 }
107
108 5 double WaterHeaterHeatPump_Impl::deadBandTemperatureDifference() const {
109
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_WaterHeater_HeatPumpFields::DeadBandTemperatureDifference, true);
110
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
111
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
112 }
113
114 4 boost::optional<double> WaterHeaterHeatPump_Impl::condenserWaterFlowRate() const {
115 4 return getDouble(OS_WaterHeater_HeatPumpFields::CondenserWaterFlowRate, true);
116 }
117
118 5 bool WaterHeaterHeatPump_Impl::isCondenserWaterFlowRateAutosized() const {
119 5 bool result = false;
120
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::CondenserWaterFlowRate, true);
121
1/2
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
5 if (value) {
122
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
10 result = openstudio::istringEqual(value.get(), "autosize");
123 }
124 5 return result;
125 5 }
126
127 4 boost::optional<double> WaterHeaterHeatPump_Impl::evaporatorAirFlowRate() const {
128 4 return getDouble(OS_WaterHeater_HeatPumpFields::EvaporatorAirFlowRate, true);
129 }
130
131 5 bool WaterHeaterHeatPump_Impl::isEvaporatorAirFlowRateAutosized() const {
132 5 bool result = false;
133
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::EvaporatorAirFlowRate, true);
134
1/2
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
5 if (value) {
135
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
10 result = openstudio::istringEqual(value.get(), "autosize");
136 }
137 5 return result;
138 5 }
139
140 8 std::string WaterHeaterHeatPump_Impl::inletAirConfiguration() const {
141
1/1
✓ Branch 1 taken 8 times.
8 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::InletAirConfiguration, true);
142
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
8 OS_ASSERT(value);
143
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 return value.get();
144 8 }
145
146 2 boost::optional<Schedule> WaterHeaterHeatPump_Impl::inletAirTemperatureSchedule() const {
147
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::InletAirTemperatureSchedule);
148 }
149
150 2 boost::optional<Schedule> WaterHeaterHeatPump_Impl::inletAirHumiditySchedule() const {
151
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::InletAirHumiditySchedule);
152 }
153
154 36 HVACComponent WaterHeaterHeatPump_Impl::tank() const {
155
1/1
✓ Branch 1 taken 36 times.
36 auto value = optionalTank();
156
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
36 if (!value) {
157 ✗ LOG_AND_THROW(briefDescription() << " does not have an Tank attached.");
158 }
159
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
72 return value.get();
160 36 }
161
162 19 ModelObject WaterHeaterHeatPump_Impl::dXCoil() const {
163
1/1
✓ Branch 1 taken 19 times.
19 auto value = optionalDXCoil();
164
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
19 if (!value) {
165 ✗ LOG_AND_THROW(briefDescription() << " does not have an DXCoil attached.");
166 }
167
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
38 return value.get();
168 19 }
169
170 6 double WaterHeaterHeatPump_Impl::minimumInletAirTemperatureforCompressorOperation() const {
171
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_WaterHeater_HeatPumpFields::MinimumInletAirTemperatureforCompressorOperation, true);
172
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
173
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
174 }
175
176 6 double WaterHeaterHeatPump_Impl::maximumInletAirTemperatureforCompressorOperation() const {
177
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_WaterHeater_HeatPumpFields::MaximumInletAirTemperatureforCompressorOperation, true);
178
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
179
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
180 }
181
182 5 std::string WaterHeaterHeatPump_Impl::compressorLocation() const {
183
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::CompressorLocation, true);
184
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
185
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 return value.get();
186 5 }
187
188 2 boost::optional<Schedule> WaterHeaterHeatPump_Impl::compressorAmbientTemperatureSchedule() const {
189
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::CompressorAmbientTemperatureSchedule);
190 }
191
192 13 HVACComponent WaterHeaterHeatPump_Impl::fan() const {
193
1/1
✓ Branch 1 taken 13 times.
13 auto value = optionalFan();
194
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
13 if (!value) {
195 ✗ LOG_AND_THROW(briefDescription() << " does not have an Fan attached.");
196 }
197
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
26 return value.get();
198 13 }
199
200 8 std::string WaterHeaterHeatPump_Impl::fanPlacement() const {
201
1/1
✓ Branch 1 taken 8 times.
8 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::FanPlacement, true);
202
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
8 OS_ASSERT(value);
203
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 return value.get();
204 8 }
205
206 5 double WaterHeaterHeatPump_Impl::onCycleParasiticElectricLoad() const {
207
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_WaterHeater_HeatPumpFields::OnCycleParasiticElectricLoad, true);
208
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
209
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
210 }
211
212 5 double WaterHeaterHeatPump_Impl::offCycleParasiticElectricLoad() const {
213
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_WaterHeater_HeatPumpFields::OffCycleParasiticElectricLoad, true);
214
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
215
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
216 }
217
218 5 std::string WaterHeaterHeatPump_Impl::parasiticHeatRejectionLocation() const {
219
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::ParasiticHeatRejectionLocation, true);
220
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
221
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 return value.get();
222 5 }
223
224 1 Schedule WaterHeaterHeatPump_Impl::inletAirMixerSchedule() const {
225
1/1
✓ Branch 1 taken 1 time.
1 boost::optional<Schedule> value = optionalInletAirMixerSchedule();
226
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (!value) {
227 ✗ LOG_AND_THROW(briefDescription() << " does not have an Inlet Air Mixer Schedule attached.");
228 }
229
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 return value.get();
230 1 }
231
232 6 std::string WaterHeaterHeatPump_Impl::tankElementControlLogic() const {
233
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::TankElementControlLogic, true);
234
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
235
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
12 return value.get();
236 6 }
237
238 2 std::string WaterHeaterHeatPump_Impl::controlSensorLocationInStratifiedTank() const {
239
1/1
✓ Branch 1 taken 2 times.
2 boost::optional<std::string> value = getString(OS_WaterHeater_HeatPumpFields::ControlSensorLocationInStratifiedTank, true);
240
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
241
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 return value.get();
242 2 }
243
244 1 bool WaterHeaterHeatPump_Impl::setAvailabilitySchedule(Schedule& schedule) {
245
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
4 bool result = setSchedule(OS_WaterHeater_HeatPumpFields::AvailabilitySchedule, "WaterHeaterHeatPump", "Availability Schedule", schedule);
246 1 return result;
247 }
248
249 ✗ void WaterHeaterHeatPump_Impl::resetAvailabilitySchedule() {
250 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::AvailabilitySchedule, "");
251 ✗ OS_ASSERT(result);
252 ✗ }
253
254 15 bool WaterHeaterHeatPump_Impl::setCompressorSetpointTemperatureSchedule(Schedule& schedule) {
255
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
60 bool result = setSchedule(OS_WaterHeater_HeatPumpFields::CompressorSetpointTemperatureSchedule, "WaterHeaterHeatPump",
256 "Compressor Setpoint Temperature Schedule", schedule);
257 15 return result;
258 }
259
260 16 bool WaterHeaterHeatPump_Impl::setDeadBandTemperatureDifference(double deadBandTemperatureDifference) {
261 16 bool result = setDouble(OS_WaterHeater_HeatPumpFields::DeadBandTemperatureDifference, deadBandTemperatureDifference);
262 16 return result;
263 }
264
265 2 bool WaterHeaterHeatPump_Impl::setCondenserWaterFlowRate(boost::optional<double> condenserWaterFlowRate) {
266 2 bool result(false);
267
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (condenserWaterFlowRate) {
268 2 result = setDouble(OS_WaterHeater_HeatPumpFields::CondenserWaterFlowRate, condenserWaterFlowRate.get());
269 } else {
270 ✗ resetCondenserWaterFlowRate();
271 ✗ result = true;
272 }
273 2 return result;
274 }
275
276 ✗ void WaterHeaterHeatPump_Impl::resetCondenserWaterFlowRate() {
277 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::CondenserWaterFlowRate, "");
278 ✗ OS_ASSERT(result);
279 ✗ }
280
281 15 void WaterHeaterHeatPump_Impl::autosizeCondenserWaterFlowRate() {
282
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
30 bool result = setString(OS_WaterHeater_HeatPumpFields::CondenserWaterFlowRate, "autosize");
283
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
15 OS_ASSERT(result);
284 15 }
285
286 2 bool WaterHeaterHeatPump_Impl::setEvaporatorAirFlowRate(boost::optional<double> evaporatorAirFlowRate) {
287 2 bool result(false);
288
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (evaporatorAirFlowRate) {
289 2 result = setDouble(OS_WaterHeater_HeatPumpFields::EvaporatorAirFlowRate, evaporatorAirFlowRate.get());
290 } else {
291 ✗ resetEvaporatorAirFlowRate();
292 ✗ result = true;
293 }
294 2 return result;
295 }
296
297 ✗ void WaterHeaterHeatPump_Impl::resetEvaporatorAirFlowRate() {
298 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::EvaporatorAirFlowRate, "");
299 ✗ OS_ASSERT(result);
300 ✗ }
301
302 15 void WaterHeaterHeatPump_Impl::autosizeEvaporatorAirFlowRate() {
303
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
30 bool result = setString(OS_WaterHeater_HeatPumpFields::EvaporatorAirFlowRate, "autosize");
304
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
15 OS_ASSERT(result);
305 15 }
306
307 21 bool WaterHeaterHeatPump_Impl::setInletAirConfiguration(const std::string& inletAirConfiguration) {
308 21 bool result = setString(OS_WaterHeater_HeatPumpFields::InletAirConfiguration, inletAirConfiguration);
309 21 return result;
310 }
311
312 15 bool WaterHeaterHeatPump_Impl::setInletAirTemperatureSchedule(Schedule& schedule) {
313 bool result =
314
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
60 setSchedule(OS_WaterHeater_HeatPumpFields::InletAirTemperatureSchedule, "WaterHeaterHeatPump", "Inlet Air Temperature Schedule", schedule);
315 15 return result;
316 }
317
318 ✗ void WaterHeaterHeatPump_Impl::resetInletAirTemperatureSchedule() {
319 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::InletAirTemperatureSchedule, "");
320 ✗ OS_ASSERT(result);
321 ✗ }
322
323 15 bool WaterHeaterHeatPump_Impl::setInletAirHumiditySchedule(Schedule& schedule) {
324 bool result =
325
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
60 setSchedule(OS_WaterHeater_HeatPumpFields::InletAirHumiditySchedule, "WaterHeaterHeatPump", "Inlet Air Humidity Schedule", schedule);
326 15 return result;
327 }
328
329 ✗ void WaterHeaterHeatPump_Impl::resetInletAirHumiditySchedule() {
330 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::InletAirHumiditySchedule, "");
331 ✗ OS_ASSERT(result);
332 ✗ }
333
334 15 bool WaterHeaterHeatPump_Impl::setTank(const HVACComponent& waterHeater) {
335
2/2
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
15 bool result = setPointer(OS_WaterHeater_HeatPumpFields::Tank, waterHeater.handle());
336 15 return result;
337 }
338
339 20 bool WaterHeaterHeatPump_Impl::setDXCoil(const ModelObject& heatPumpWaterHeaterDXCoils) {
340
2/2
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
20 bool result = setPointer(OS_WaterHeater_HeatPumpFields::DXCoil, heatPumpWaterHeaterDXCoils.handle());
341 20 return result;
342 }
343
344 17 bool WaterHeaterHeatPump_Impl::setMinimumInletAirTemperatureforCompressorOperation(double minimumInletAirTemperatureforCompressorOperation) {
345 bool result =
346 17 setDouble(OS_WaterHeater_HeatPumpFields::MinimumInletAirTemperatureforCompressorOperation, minimumInletAirTemperatureforCompressorOperation);
347 17 return result;
348 }
349
350 17 bool WaterHeaterHeatPump_Impl::setMaximumInletAirTemperatureforCompressorOperation(double maximumInletAirTemperatureforCompressorOperation) {
351 bool result =
352 17 setDouble(OS_WaterHeater_HeatPumpFields::MaximumInletAirTemperatureforCompressorOperation, maximumInletAirTemperatureforCompressorOperation);
353 17 return result;
354 }
355
356 21 bool WaterHeaterHeatPump_Impl::setCompressorLocation(const std::string& compressorLocation) {
357 21 bool result = setString(OS_WaterHeater_HeatPumpFields::CompressorLocation, compressorLocation);
358 21 return result;
359 }
360
361 15 bool WaterHeaterHeatPump_Impl::setCompressorAmbientTemperatureSchedule(Schedule& schedule) {
362
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
60 bool result = setSchedule(OS_WaterHeater_HeatPumpFields::CompressorAmbientTemperatureSchedule, "WaterHeaterHeatPump",
363 "Compressor Ambient Temperature Schedule", schedule);
364 15 return result;
365 }
366
367 ✗ void WaterHeaterHeatPump_Impl::resetCompressorAmbientTemperatureSchedule() {
368 ✗ bool result = setString(OS_WaterHeater_HeatPumpFields::CompressorAmbientTemperatureSchedule, "");
369 ✗ OS_ASSERT(result);
370 ✗ }
371
372 16 bool WaterHeaterHeatPump_Impl::setFan(const HVACComponent& fansOnOff) {
373
2/2
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
16 bool result = setPointer(OS_WaterHeater_HeatPumpFields::Fan, fansOnOff.handle());
374 16 return result;
375 }
376
377 16 bool WaterHeaterHeatPump_Impl::setFanPlacement(const std::string& fanPlacement) {
378 16 bool result = setString(OS_WaterHeater_HeatPumpFields::FanPlacement, fanPlacement);
379 16 return result;
380 }
381
382 16 bool WaterHeaterHeatPump_Impl::setOnCycleParasiticElectricLoad(double onCycleParasiticElectricLoad) {
383 16 bool result = setDouble(OS_WaterHeater_HeatPumpFields::OnCycleParasiticElectricLoad, onCycleParasiticElectricLoad);
384 16 return result;
385 }
386
387 16 bool WaterHeaterHeatPump_Impl::setOffCycleParasiticElectricLoad(double offCycleParasiticElectricLoad) {
388 16 bool result = setDouble(OS_WaterHeater_HeatPumpFields::OffCycleParasiticElectricLoad, offCycleParasiticElectricLoad);
389 16 return result;
390 }
391
392 16 bool WaterHeaterHeatPump_Impl::setParasiticHeatRejectionLocation(const std::string& parasiticHeatRejectionLocation) {
393 16 bool result = setString(OS_WaterHeater_HeatPumpFields::ParasiticHeatRejectionLocation, parasiticHeatRejectionLocation);
394 16 return result;
395 }
396
397 15 bool WaterHeaterHeatPump_Impl::setInletAirMixerSchedule(Schedule& schedule) {
398
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
60 bool result = setSchedule(OS_WaterHeater_HeatPumpFields::InletAirMixerSchedule, "WaterHeaterHeatPump", "Inlet Air Mixer Schedule", schedule);
399 15 return result;
400 }
401
402 16 bool WaterHeaterHeatPump_Impl::setTankElementControlLogic(const std::string& tankElementControlLogic) {
403 16 bool result = setString(OS_WaterHeater_HeatPumpFields::TankElementControlLogic, tankElementControlLogic);
404 16 return result;
405 }
406
407 16 bool WaterHeaterHeatPump_Impl::setControlSensorLocationInStratifiedTank(const std::string& controlSensorLocationInStratifiedTank) {
408 16 bool result = setString(OS_WaterHeater_HeatPumpFields::ControlSensorLocationInStratifiedTank, controlSensorLocationInStratifiedTank);
409 16 return result;
410 }
411
412 4 boost::optional<Schedule> WaterHeaterHeatPump_Impl::optionalCompressorSetpointTemperatureSchedule() const {
413
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::CompressorSetpointTemperatureSchedule);
414 }
415
416 36 boost::optional<HVACComponent> WaterHeaterHeatPump_Impl::optionalTank() const {
417
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_WaterHeater_HeatPumpFields::Tank);
418 }
419
420 19 boost::optional<ModelObject> WaterHeaterHeatPump_Impl::optionalDXCoil() const {
421
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 return getObject<ModelObject>().getModelObjectTarget<ModelObject>(OS_WaterHeater_HeatPumpFields::DXCoil);
422 }
423
424 13 boost::optional<HVACComponent> WaterHeaterHeatPump_Impl::optionalFan() const {
425
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 return getObject<ModelObject>().getModelObjectTarget<HVACComponent>(OS_WaterHeater_HeatPumpFields::Fan);
426 }
427
428 1 boost::optional<Schedule> WaterHeaterHeatPump_Impl::optionalInletAirMixerSchedule() const {
429
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_HeatPumpFields::InletAirMixerSchedule);
430 }
431
432 31 unsigned WaterHeaterHeatPump_Impl::inletPort() const {
433 31 return OS_WaterHeater_HeatPumpFields::AirInletNode;
434 }
435
436 14 unsigned WaterHeaterHeatPump_Impl::outletPort() const {
437 14 return OS_WaterHeater_HeatPumpFields::AirOutletNode;
438 }
439
440 ✗ ModelObject WaterHeaterHeatPump_Impl::clone(Model model) const {
441 ✗ auto newWaterHeater = ZoneHVACComponent_Impl::clone(model).cast<WaterHeaterHeatPump>();
442
443 {
444 ✗ auto mo = tank().clone(model).cast<HVACComponent>();
445 ✗ newWaterHeater.setTank(mo);
446 ✗ }
447
448 {
449 ✗ auto mo = dXCoil().clone(model).cast<ModelObject>();
450 ✗ newWaterHeater.setDXCoil(mo);
451 ✗ }
452
453 {
454 ✗ auto mo = fan().clone(model).cast<HVACComponent>();
455 ✗ newWaterHeater.setFan(mo);
456 ✗ }
457
458 ✗ return std::move(newWaterHeater);
459 ✗ }
460
461 3 std::vector<IdfObject> WaterHeaterHeatPump_Impl::remove() {
462
1/1
✓ Branch 1 taken 3 times.
3 auto t_tank = tank();
463
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto waterToWaterTank = t_tank.optionalCast<WaterToWaterComponent>()) {
464
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 waterToWaterTank->removeFromPlantLoop();
465
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 waterToWaterTank->removeFromSecondaryPlantLoop();
466 } else {
467 // All tanks are WaterToWaterComponent at this time, but the api says they could be any HVACComponent,
468 // so this is a little dangerous. Consider enhanced APIs to remove HVACComponent from system.
469 // Something we currently don't have.
470 // Ideally remove would just take care of all of this, but the way ParentObject::remove works out children remove methods
471 // aren't being called cleanly.
472 ✗ LOG_AND_THROW("Unsupported tank " << t_tank.briefDescription() << " attached to WaterHeaterHeatPump " << briefDescription());
473 3 }
474
475
1/1
✓ Branch 1 taken 3 times.
6 return ZoneHVACComponent_Impl::remove();
476 3 }
477
478 6 std::vector<ModelObject> WaterHeaterHeatPump_Impl::children() const {
479 6 std::vector<ModelObject> result;
480
481
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 result.push_back(tank());
482
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 result.push_back(dXCoil());
483
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 result.push_back(fan());
484
485 6 return result;
486 ✗ }
487
488 5 bool WaterHeaterHeatPump_Impl::addToThermalZone(ThermalZone& thermalZone) {
489 5 bool result = false;
490
1/1
✓ Branch 1 taken 5 times.
5 auto thisObject = getObject<WaterHeaterHeatPump>();
491
492
2/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
5 if ((result = ZoneHVACComponent_Impl::addToThermalZone(thermalZone))) {
493
1/1
✓ Branch 1 taken 5 times.
5 thermalZone.setHeatingPriority(thisObject, 1);
494
1/1
✓ Branch 1 taken 5 times.
5 thermalZone.setCoolingPriority(thisObject, 1);
495
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 setCompressorLocation("Zone");
496
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 setInletAirConfiguration("ZoneAirOnly");
497
1/1
✓ Branch 1 taken 5 times.
5 auto t_tank = tank();
498
2/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
10 if (auto waterHeaterMixed = t_tank.optionalCast<WaterHeaterMixed>()) {
499
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
10 waterHeaterMixed->setAmbientTemperatureIndicator("ThermalZone");
500
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 waterHeaterMixed->setAmbientTemperatureThermalZone(thermalZone);
501 ✗ } else if (auto waterHeaterStratified = t_tank.optionalCast<WaterHeaterStratified>()) {
502 ✗ waterHeaterStratified->setAmbientTemperatureIndicator("ThermalZone");
503 ✗ waterHeaterStratified->setAmbientTemperatureThermalZone(thermalZone);
504 5 }
505 5 }
506
507 5 return result;
508 5 }
509
510 ✗ boost::optional<double> WaterHeaterHeatPump_Impl::autosizedCondenserWaterFlowRate() const {
511 ✗ return getAutosizedValue("Design Size Condenser Water Flow Rate", "m3/s");
512 }
513
514 ✗ boost::optional<double> WaterHeaterHeatPump_Impl::autosizedEvaporatorAirFlowRate() const {
515 ✗ return getAutosizedValue("Design Size Evaporator Air Flow Rate", "m3/s");
516 }
517
518 ✗ void WaterHeaterHeatPump_Impl::autosize() {
519 ✗ autosizeCondenserWaterFlowRate();
520 ✗ autosizeEvaporatorAirFlowRate();
521 ✗ }
522
523 ✗ void WaterHeaterHeatPump_Impl::applySizingValues() {
524 ✗ boost::optional<double> val;
525 ✗ val = autosizedCondenserWaterFlowRate();
526 ✗ if (val) {
527 ✗ setCondenserWaterFlowRate(val.get());
528 }
529
530 ✗ val = autosizedEvaporatorAirFlowRate();
531 ✗ if (val) {
532 ✗ setEvaporatorAirFlowRate(val.get());
533 }
534 ✗ }
535
536 // NOTE: The WaterHeaterHeatPump is listed as a ThermalZone equipment, but it's not a zone load.
537 // So we set everything to None/Empty here. It has a child Tank (WaterHeater:Mixed for eg), which WILL check if it's part of a HPWH
538 // so the PlantLoop's methods are affected accordingly though.
539 2 ComponentType WaterHeaterHeatPump_Impl::componentType() const {
540
1/1
✓ Branch 1 taken 2 times.
2 return ComponentType::None;
541 }
542
543 2 std::vector<FuelType> WaterHeaterHeatPump_Impl::coolingFuelTypes() const {
544 2 return {};
545 }
546
547 2 std::vector<FuelType> WaterHeaterHeatPump_Impl::heatingFuelTypes() const {
548 2 return {};
549 }
550
551 2 std::vector<AppGFuelType> WaterHeaterHeatPump_Impl::appGHeatingFuelTypes() const {
552 2 return {};
553 }
554
555 } // namespace detail
556
557 ✗ WaterHeaterHeatPump::WaterHeaterHeatPump(const Model& model, const ModelObject& dxCoil, const HVACComponent& tank, const HVACComponent& fan,
558 ✗ Schedule& compressorSetpointTemperatureSchedule, Schedule& inletAirMixerSchedule)
559 ✗ : ZoneHVACComponent(WaterHeaterHeatPump::iddObjectType(), model) {
560 ✗ OS_ASSERT(getImpl<detail::WaterHeaterHeatPump_Impl>());
561
562 ✗ setDXCoil(dxCoil);
563 ✗ setTank(tank);
564 ✗ setFan(fan);
565 ✗ setCompressorSetpointTemperatureSchedule(compressorSetpointTemperatureSchedule);
566 ✗ setInletAirMixerSchedule(inletAirMixerSchedule);
567
568 ✗ setDeadBandTemperatureDifference(5.0);
569 ✗ autosizeCondenserWaterFlowRate();
570 ✗ autosizeEvaporatorAirFlowRate();
571 ✗ setInletAirConfiguration("Schedule");
572 ✗ setMinimumInletAirTemperatureforCompressorOperation(10.0);
573 ✗ setMaximumInletAirTemperatureforCompressorOperation(48.89);
574 ✗ setCompressorLocation("Schedule");
575 ✗ setFanPlacement("DrawThrough");
576 ✗ setOnCycleParasiticElectricLoad(0.0);
577 ✗ setOffCycleParasiticElectricLoad(0.0);
578 ✗ setParasiticHeatRejectionLocation("Outdoors");
579 ✗ setTankElementControlLogic("Simultaneous");
580 ✗ setControlSensorLocationInStratifiedTank("Heater1");
581 ✗ }
582
583 14 WaterHeaterHeatPump::WaterHeaterHeatPump(const Model& model) : ZoneHVACComponent(WaterHeaterHeatPump::iddObjectType(), model) {
584
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 14 times.
✗ Branch 5 not taken.
14 OS_ASSERT(getImpl<detail::WaterHeaterHeatPump_Impl>());
585
586
1/1
✓ Branch 1 taken 14 times.
14 CoilWaterHeatingAirToWaterHeatPump coil(model);
587
1/1
✓ Branch 1 taken 14 times.
14 setDXCoil(coil);
588
589
1/1
✓ Branch 1 taken 14 times.
14 WaterHeaterMixed waterHeater(model);
590
1/1
✓ Branch 1 taken 14 times.
14 setTank(waterHeater);
591
592
1/1
✓ Branch 1 taken 14 times.
14 FanOnOff fan(model);
593
1/1
✓ Branch 1 taken 14 times.
14 setFan(fan);
594
595 {
596
1/1
✓ Branch 1 taken 14 times.
14 ScheduleRuleset schedule(model);
597
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
14 schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 60.0);
598
1/1
✓ Branch 1 taken 14 times.
14 setCompressorSetpointTemperatureSchedule(schedule);
599 14 }
600
601 {
602
1/1
✓ Branch 1 taken 14 times.
14 ScheduleRuleset schedule(model);
603
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
14 schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 0.2);
604
1/1
✓ Branch 1 taken 14 times.
14 setInletAirMixerSchedule(schedule);
605 14 }
606
607 {
608
1/1
✓ Branch 1 taken 14 times.
14 ScheduleRuleset schedule(model);
609
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
14 schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 19.7);
610
1/1
✓ Branch 1 taken 14 times.
14 setInletAirTemperatureSchedule(schedule);
611 14 }
612
613 {
614
1/1
✓ Branch 1 taken 14 times.
14 ScheduleRuleset schedule(model);
615
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
14 schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 0.5);
616
1/1
✓ Branch 1 taken 14 times.
14 setInletAirHumiditySchedule(schedule);
617 14 }
618
619 {
620
1/1
✓ Branch 1 taken 14 times.
14 ScheduleRuleset schedule(model);
621
3/3
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
14 schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 21.0);
622
1/1
✓ Branch 1 taken 14 times.
14 setCompressorAmbientTemperatureSchedule(schedule);
623 14 }
624
625
1/1
✓ Branch 1 taken 14 times.
14 setDeadBandTemperatureDifference(5.0);
626
1/1
✓ Branch 1 taken 14 times.
14 autosizeCondenserWaterFlowRate();
627
1/1
✓ Branch 1 taken 14 times.
14 autosizeEvaporatorAirFlowRate();
628
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 setInletAirConfiguration("Schedule");
629
1/1
✓ Branch 1 taken 14 times.
14 setMinimumInletAirTemperatureforCompressorOperation(10.0);
630
1/1
✓ Branch 1 taken 14 times.
14 setMaximumInletAirTemperatureforCompressorOperation(48.89);
631
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
28 setCompressorLocation("Schedule");
632
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 setFanPlacement("DrawThrough");
633
1/1
✓ Branch 1 taken 14 times.
14 setOnCycleParasiticElectricLoad(0.0);
634
1/1
✓ Branch 1 taken 14 times.
14 setOffCycleParasiticElectricLoad(0.0);
635
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
28 setParasiticHeatRejectionLocation("Outdoors");
636
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
28 setTankElementControlLogic("Simultaneous");
637
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 setControlSensorLocationInStratifiedTank("Heater1");
638 14 }
639
640 7774 IddObjectType WaterHeaterHeatPump::iddObjectType() {
641
1/1
✓ Branch 1 taken 7774 times.
7774 return {IddObjectType::OS_WaterHeater_HeatPump};
642 }
643
644 ✗ std::vector<std::string> WaterHeaterHeatPump::inletAirConfigurationValues() {
645 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_HeatPumpFields::InletAirConfiguration);
646 }
647
648 ✗ std::vector<std::string> WaterHeaterHeatPump::compressorLocationValues() {
649 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_HeatPumpFields::CompressorLocation);
650 }
651
652 ✗ std::vector<std::string> WaterHeaterHeatPump::fanPlacementValues() {
653 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_HeatPumpFields::FanPlacement);
654 }
655
656 ✗ std::vector<std::string> WaterHeaterHeatPump::parasiticHeatRejectionLocationValues() {
657 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_HeatPumpFields::ParasiticHeatRejectionLocation);
658 }
659
660 ✗ std::vector<std::string> WaterHeaterHeatPump::controlSensorLocationInStratifiedTankValues() {
661 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(),
662 ✗ OS_WaterHeater_HeatPumpFields::ControlSensorLocationInStratifiedTank);
663 }
664
665 ✗ std::vector<std::string> WaterHeaterHeatPump::tankElementControlLogicValues() {
666 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_HeatPumpFields::TankElementControlLogic);
667 }
668
669 5 boost::optional<Schedule> WaterHeaterHeatPump::availabilitySchedule() const {
670
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->availabilitySchedule();
671 }
672
673 4 Schedule WaterHeaterHeatPump::compressorSetpointTemperatureSchedule() const {
674
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::WaterHeaterHeatPump_Impl>()->compressorSetpointTemperatureSchedule();
675 }
676
677 5 double WaterHeaterHeatPump::deadBandTemperatureDifference() const {
678
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->deadBandTemperatureDifference();
679 }
680
681 4 boost::optional<double> WaterHeaterHeatPump::condenserWaterFlowRate() const {
682
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::WaterHeaterHeatPump_Impl>()->condenserWaterFlowRate();
683 }
684
685 5 bool WaterHeaterHeatPump::isCondenserWaterFlowRateAutosized() const {
686
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->isCondenserWaterFlowRateAutosized();
687 }
688
689 4 boost::optional<double> WaterHeaterHeatPump::evaporatorAirFlowRate() const {
690
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::WaterHeaterHeatPump_Impl>()->evaporatorAirFlowRate();
691 }
692
693 5 bool WaterHeaterHeatPump::isEvaporatorAirFlowRateAutosized() const {
694
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->isEvaporatorAirFlowRateAutosized();
695 }
696
697 8 std::string WaterHeaterHeatPump::inletAirConfiguration() const {
698
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::WaterHeaterHeatPump_Impl>()->inletAirConfiguration();
699 }
700
701 2 boost::optional<Schedule> WaterHeaterHeatPump::inletAirTemperatureSchedule() const {
702
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->inletAirTemperatureSchedule();
703 }
704
705 2 boost::optional<Schedule> WaterHeaterHeatPump::inletAirHumiditySchedule() const {
706
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->inletAirHumiditySchedule();
707 }
708
709 22 HVACComponent WaterHeaterHeatPump::tank() const {
710
1/1
✓ Branch 3 taken 22 times.
22 return getImpl<detail::WaterHeaterHeatPump_Impl>()->tank();
711 }
712
713 13 ModelObject WaterHeaterHeatPump::dXCoil() const {
714
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::WaterHeaterHeatPump_Impl>()->dXCoil();
715 }
716
717 6 double WaterHeaterHeatPump::minimumInletAirTemperatureforCompressorOperation() const {
718
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::WaterHeaterHeatPump_Impl>()->minimumInletAirTemperatureforCompressorOperation();
719 }
720
721 6 double WaterHeaterHeatPump::maximumInletAirTemperatureforCompressorOperation() const {
722
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::WaterHeaterHeatPump_Impl>()->maximumInletAirTemperatureforCompressorOperation();
723 }
724
725 5 std::string WaterHeaterHeatPump::compressorLocation() const {
726
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->compressorLocation();
727 }
728
729 2 boost::optional<Schedule> WaterHeaterHeatPump::compressorAmbientTemperatureSchedule() const {
730
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->compressorAmbientTemperatureSchedule();
731 }
732
733 7 HVACComponent WaterHeaterHeatPump::fan() const {
734
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::WaterHeaterHeatPump_Impl>()->fan();
735 }
736
737 8 std::string WaterHeaterHeatPump::fanPlacement() const {
738
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::WaterHeaterHeatPump_Impl>()->fanPlacement();
739 }
740
741 5 double WaterHeaterHeatPump::onCycleParasiticElectricLoad() const {
742
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->onCycleParasiticElectricLoad();
743 }
744
745 5 double WaterHeaterHeatPump::offCycleParasiticElectricLoad() const {
746
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->offCycleParasiticElectricLoad();
747 }
748
749 5 std::string WaterHeaterHeatPump::parasiticHeatRejectionLocation() const {
750
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::WaterHeaterHeatPump_Impl>()->parasiticHeatRejectionLocation();
751 }
752
753 1 Schedule WaterHeaterHeatPump::inletAirMixerSchedule() const {
754
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::WaterHeaterHeatPump_Impl>()->inletAirMixerSchedule();
755 }
756
757 6 std::string WaterHeaterHeatPump::tankElementControlLogic() const {
758
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::WaterHeaterHeatPump_Impl>()->tankElementControlLogic();
759 }
760
761 2 std::string WaterHeaterHeatPump::controlSensorLocationInStratifiedTank() const {
762
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->controlSensorLocationInStratifiedTank();
763 }
764
765 1 bool WaterHeaterHeatPump::setAvailabilitySchedule(Schedule& schedule) {
766
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setAvailabilitySchedule(schedule);
767 }
768
769 ✗ void WaterHeaterHeatPump::resetAvailabilitySchedule() {
770 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetAvailabilitySchedule();
771 ✗ }
772
773 15 bool WaterHeaterHeatPump::setCompressorSetpointTemperatureSchedule(Schedule& schedule) {
774
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setCompressorSetpointTemperatureSchedule(schedule);
775 }
776
777 16 bool WaterHeaterHeatPump::setDeadBandTemperatureDifference(double deadBandTemperatureDifference) {
778
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setDeadBandTemperatureDifference(deadBandTemperatureDifference);
779 }
780
781 2 bool WaterHeaterHeatPump::setCondenserWaterFlowRate(double condenserWaterFlowRate) {
782
2/2
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setCondenserWaterFlowRate(condenserWaterFlowRate);
783 }
784
785 ✗ void WaterHeaterHeatPump::resetCondenserWaterFlowRate() {
786 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetCondenserWaterFlowRate();
787 ✗ }
788
789 15 void WaterHeaterHeatPump::autosizeCondenserWaterFlowRate() {
790
1/1
✓ Branch 3 taken 15 times.
15 getImpl<detail::WaterHeaterHeatPump_Impl>()->autosizeCondenserWaterFlowRate();
791 15 }
792
793 2 bool WaterHeaterHeatPump::setEvaporatorAirFlowRate(double evaporatorAirFlowRate) {
794
2/2
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
2 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setEvaporatorAirFlowRate(evaporatorAirFlowRate);
795 }
796
797 ✗ void WaterHeaterHeatPump::resetEvaporatorAirFlowRate() {
798 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetEvaporatorAirFlowRate();
799 ✗ }
800
801 15 void WaterHeaterHeatPump::autosizeEvaporatorAirFlowRate() {
802
1/1
✓ Branch 3 taken 15 times.
15 getImpl<detail::WaterHeaterHeatPump_Impl>()->autosizeEvaporatorAirFlowRate();
803 15 }
804
805 16 bool WaterHeaterHeatPump::setInletAirConfiguration(const std::string& inletAirConfiguration) {
806
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setInletAirConfiguration(inletAirConfiguration);
807 }
808
809 15 bool WaterHeaterHeatPump::setInletAirTemperatureSchedule(Schedule& schedule) {
810
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setInletAirTemperatureSchedule(schedule);
811 }
812
813 ✗ void WaterHeaterHeatPump::resetInletAirTemperatureSchedule() {
814 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetInletAirTemperatureSchedule();
815 ✗ }
816
817 15 bool WaterHeaterHeatPump::setInletAirHumiditySchedule(Schedule& schedule) {
818
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setInletAirHumiditySchedule(schedule);
819 }
820
821 ✗ void WaterHeaterHeatPump::resetInletAirHumiditySchedule() {
822 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetInletAirHumiditySchedule();
823 ✗ }
824
825 15 bool WaterHeaterHeatPump::setTank(const HVACComponent& waterHeater) {
826
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setTank(waterHeater);
827 }
828
829 20 bool WaterHeaterHeatPump::setDXCoil(const ModelObject& coil) {
830
1/1
✓ Branch 3 taken 20 times.
20 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setDXCoil(coil);
831 }
832
833 17 bool WaterHeaterHeatPump::setMinimumInletAirTemperatureforCompressorOperation(double minimumInletAirTemperatureforCompressorOperation) {
834
1/1
✓ Branch 3 taken 17 times.
34 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setMinimumInletAirTemperatureforCompressorOperation(
835 34 minimumInletAirTemperatureforCompressorOperation);
836 }
837
838 17 bool WaterHeaterHeatPump::setMaximumInletAirTemperatureforCompressorOperation(double maximumInletAirTemperatureforCompressorOperation) {
839
1/1
✓ Branch 3 taken 17 times.
34 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setMaximumInletAirTemperatureforCompressorOperation(
840 34 maximumInletAirTemperatureforCompressorOperation);
841 }
842
843 16 bool WaterHeaterHeatPump::setCompressorLocation(const std::string& compressorLocation) {
844
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setCompressorLocation(compressorLocation);
845 }
846
847 15 bool WaterHeaterHeatPump::setCompressorAmbientTemperatureSchedule(Schedule& schedule) {
848
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setCompressorAmbientTemperatureSchedule(schedule);
849 }
850
851 ✗ void WaterHeaterHeatPump::resetCompressorAmbientTemperatureSchedule() {
852 ✗ getImpl<detail::WaterHeaterHeatPump_Impl>()->resetCompressorAmbientTemperatureSchedule();
853 ✗ }
854
855 16 bool WaterHeaterHeatPump::setFan(const HVACComponent& fan) {
856
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setFan(fan);
857 }
858
859 16 bool WaterHeaterHeatPump::setFanPlacement(const std::string& fanPlacement) {
860
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setFanPlacement(fanPlacement);
861 }
862
863 16 bool WaterHeaterHeatPump::setOnCycleParasiticElectricLoad(double onCycleParasiticElectricLoad) {
864
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setOnCycleParasiticElectricLoad(onCycleParasiticElectricLoad);
865 }
866
867 16 bool WaterHeaterHeatPump::setOffCycleParasiticElectricLoad(double offCycleParasiticElectricLoad) {
868
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setOffCycleParasiticElectricLoad(offCycleParasiticElectricLoad);
869 }
870
871 16 bool WaterHeaterHeatPump::setParasiticHeatRejectionLocation(const std::string& parasiticHeatRejectionLocation) {
872
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setParasiticHeatRejectionLocation(parasiticHeatRejectionLocation);
873 }
874
875 15 bool WaterHeaterHeatPump::setInletAirMixerSchedule(Schedule& schedule) {
876
1/1
✓ Branch 3 taken 15 times.
15 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setInletAirMixerSchedule(schedule);
877 }
878
879 16 bool WaterHeaterHeatPump::setTankElementControlLogic(const std::string& tankElementControlLogic) {
880
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setTankElementControlLogic(tankElementControlLogic);
881 }
882
883 16 bool WaterHeaterHeatPump::setControlSensorLocationInStratifiedTank(const std::string& controlSensorLocationInStratifiedTank) {
884
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::WaterHeaterHeatPump_Impl>()->setControlSensorLocationInStratifiedTank(controlSensorLocationInStratifiedTank);
885 }
886
887 /// @cond
888
1/1
✓ Branch 3 taken 24 times.
24 WaterHeaterHeatPump::WaterHeaterHeatPump(std::shared_ptr<detail::WaterHeaterHeatPump_Impl> impl) : ZoneHVACComponent(std::move(impl)) {}
889 /// @endcond
890
891 ✗ boost::optional<double> WaterHeaterHeatPump::autosizedCondenserWaterFlowRate() const {
892 ✗ return getImpl<detail::WaterHeaterHeatPump_Impl>()->autosizedCondenserWaterFlowRate();
893 }
894
895 ✗ boost::optional<double> WaterHeaterHeatPump::autosizedEvaporatorAirFlowRate() const {
896 ✗ return getImpl<detail::WaterHeaterHeatPump_Impl>()->autosizedEvaporatorAirFlowRate();
897 }
898
899 } // namespace model
900 } // namespace openstudio
901