GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 79.4% 354 / 0 / 446
Functions: 85.1% 97 / 0 / 114
Branches: 58.8% 270 / 0 / 459

src/model/HeatPumpAirToWaterHeating.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 "HeatPumpAirToWaterHeating.hpp"
7 #include "HeatPumpAirToWaterHeating_Impl.hpp"
8
9 #include "HeatPumpAirToWater.hpp"
10 #include "HeatPumpAirToWater_Impl.hpp"
11 #include "HeatPumpAirToWaterHeatingSpeedData.hpp"
12 #include "HeatPumpAirToWaterHeatingSpeedData_Impl.hpp"
13
14 #include "Schedule.hpp"
15 #include "Schedule_Impl.hpp"
16 #include "Curve.hpp"
17 #include "Curve_Impl.hpp"
18 #include "ModelObjectList.hpp"
19 #include "ModelObjectList_Impl.hpp"
20
21 #include "ScheduleTypeLimits.hpp"
22 #include "ScheduleTypeRegistry.hpp"
23
24 #include "PlantLoop.hpp"
25 #include "PlantLoop_Impl.hpp"
26 #include "Node.hpp"
27
28 // Need for clone override
29 #include "Model.hpp"
30 #include "Model_Impl.hpp"
31
32 #include "../utilities/core/Assert.hpp"
33 #include "../utilities/core/ContainersMove.hpp"
34 #include "../utilities/data/DataEnums.hpp"
35
36 #include <utilities/idd/IddEnums.hxx>
37 #include <utilities/idd/OS_HeatPump_AirToWater_Heating_FieldEnums.hxx>
38
39 namespace openstudio {
40 namespace model {
41
42 namespace detail {
43
44 15 HeatPumpAirToWaterHeating_Impl::HeatPumpAirToWaterHeating_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
45 15 : StraightComponent_Impl(idfObject, model, keepHandle) {
46
4/6
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 15 times.
✗ Branch 13 not taken.
15 OS_ASSERT(idfObject.iddObject().type() == HeatPumpAirToWaterHeating::iddObjectType());
47 15 }
48
49 ✗ HeatPumpAirToWaterHeating_Impl::HeatPumpAirToWaterHeating_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
50 ✗ bool keepHandle)
51 ✗ : StraightComponent_Impl(other, model, keepHandle) {
52 ✗ OS_ASSERT(other.iddObject().type() == HeatPumpAirToWaterHeating::iddObjectType());
53 ✗ }
54
55 12 HeatPumpAirToWaterHeating_Impl::HeatPumpAirToWaterHeating_Impl(const HeatPumpAirToWaterHeating_Impl& other, Model_Impl* model, bool keepHandle)
56 12 : StraightComponent_Impl(other, model, keepHandle) {}
57
58 ✗ const std::vector<std::string>& HeatPumpAirToWaterHeating_Impl::outputVariableNames() const {
59 ✗ static std::vector<std::string> result;
60 ✗ if (result.empty()) {
61 }
62 ✗ return result;
63 }
64
65 ✗ std::vector<ScheduleTypeKey> HeatPumpAirToWaterHeating_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
66 ✗ std::vector<ScheduleTypeKey> result;
67 ✗ const UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
68 ✗ if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_HeatPump_AirToWater_HeatingFields::AvailabilityScheduleName)
69 ✗ != fieldIndices.cend()) {
70 ✗ result.emplace_back("HeatPumpAirToWaterHeating", "Availability");
71 }
72 ✗ return result;
73 ✗ }
74
75 ✗ IddObjectType HeatPumpAirToWaterHeating_Impl::iddObjectType() const {
76 ✗ return HeatPumpAirToWaterHeating::iddObjectType();
77 }
78
79 27 unsigned HeatPumpAirToWaterHeating_Impl::inletPort() const {
80 27 return OS_HeatPump_AirToWater_HeatingFields::HotWaterInletNodeName;
81 }
82
83 67 unsigned HeatPumpAirToWaterHeating_Impl::outletPort() const {
84 67 return OS_HeatPump_AirToWater_HeatingFields::HotWaterOutletNodeName;
85 }
86
87 9 bool HeatPumpAirToWaterHeating_Impl::addToNode(Node& node) {
88
3/3
✓ Branch 1 taken 9 times.
✓ Branch 3 taken 7 times.
✓ Branch 4 taken 2 times.
18 if (boost::optional<PlantLoop> plant = node.plantLoop()) {
89
5/5
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 5 times.
✓ Branch 11 taken 2 times.
14 if (plant->supplyComponent(node.handle())) {
90
1/1
✓ Branch 1 taken 5 times.
5 return StraightComponent_Impl::addToNode(node);
91 }
92 9 }
93
94 4 return false;
95 }
96
97 21 boost::optional<HVACComponent> HeatPumpAirToWaterHeating_Impl::containingHVACComponent() const {
98
1/1
✓ Branch 1 taken 21 times.
21 auto awhp_ = heatPumpAirToWater();
99
2/2
✓ Branch 0 taken 15 times.
✓ Branch 1 taken 6 times.
21 if (awhp_) {
100
2/2
✓ Branch 1 taken 15 times.
✓ Branch 5 taken 15 times.
15 return std::move(*awhp_);
101 }
102 6 return boost::none;
103 21 }
104
105 38 boost::optional<HeatPumpAirToWater> HeatPumpAirToWaterHeating_Impl::heatPumpAirToWater() const {
106
3/3
✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
✓ Branch 7 taken 38 times.
38 auto awhps = getObject<ModelObject>().getModelObjectSources<HeatPumpAirToWater>(HeatPumpAirToWater::iddObjectType());
107
2/2
✓ Branch 1 taken 17 times.
✓ Branch 2 taken 21 times.
38 if (awhps.empty()) {
108 17 return boost::none;
109 }
110
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
21 if (awhps.size() > 1) {
111 ✗ LOG(Error, briefDescription() << " is referenced by more than one HeatPumpAirToWater, returning the first");
112 }
113
1/1
✓ Branch 2 taken 21 times.
21 return awhps[0];
114 38 }
115
116 4 ModelObject HeatPumpAirToWaterHeating_Impl::clone(Model model) const {
117
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 const bool same_model = this->model() == model;
118 // This handles resetting the ports, and bypassing ParentObject::clone so it doesn't clone children
119
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 auto t_clone = StraightComponent_Impl::clone(model).cast<HeatPumpAirToWaterHeating>();
120
121 // Make a clean list and repopulate it, without cloning the SpeedData objects
122
1/1
✓ Branch 1 taken 4 times.
4 auto newSpeedList = ModelObjectList(model);
123
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 newSpeedList.setName(t_clone.nameString() + " Speed Data List");
124
1/1
✓ Branch 3 taken 4 times.
4 bool ok = t_clone.getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setSpeedDataList(newSpeedList);
125
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
126
127
3/3
✓ Branch 1 taken 4 times.
✓ Branch 8 taken 15 times.
✓ Branch 9 taken 4 times.
19 for (const auto& speed : speeds()) {
128
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 5 times.
15 if (same_model) {
129
1/1
✓ Branch 1 taken 10 times.
10 ok = t_clone.addSpeed(speed);
130 } else {
131
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
5 auto speedClone = speed.clone(model).cast<HeatPumpAirToWaterHeatingSpeedData>();
132
1/1
✓ Branch 1 taken 5 times.
5 ok = t_clone.addSpeed(speedClone);
133 5 }
134
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
15 OS_ASSERT(ok);
135 4 }
136
137 8 return std::move(t_clone);
138 4 }
139
140 8 std::vector<ModelObject> HeatPumpAirToWaterHeating_Impl::children() const {
141 8 std::vector<ModelObject> children;
142
3/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 5 times.
16 if (auto c_ = minimumLeavingWaterTemperatureCurve()) {
143
2/2
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
3 children.emplace_back(std::move(*c_));
144 8 }
145
3/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 5 times.
16 if (auto c_ = maximumLeavingWaterTemperatureCurve()) {
146
2/2
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
3 children.emplace_back(std::move(*c_));
147 8 }
148
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if (auto const speedDataList_ = optionalSpeedDataList()) {
149
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 11 taken 31 times.
✓ Branch 12 taken 8 times.
39 for (const auto& mo : speedDataList_->modelObjects()) {
150
1/1
✓ Branch 1 taken 31 times.
31 children.push_back(mo);
151 8 }
152 8 }
153 8 return children;
154 ✗ }
155
156 // std::vector<IddObjectType> allowableChildTypes() const override;
157
158 7 std::vector<IdfObject> HeatPumpAirToWaterHeating_Impl::remove() {
159 // ModelObjectList is kinda dumb, it removes all the modelObjects it has, which we don't want
160 // We listed the SpeedData (ResourceObjects) in children, so it should be handled by ParentObject::remove
161
1/1
✓ Branch 1 taken 7 times.
7 auto speedList_ = optionalSpeedDataList();
162
1/1
✓ Branch 1 taken 7 times.
7 std::vector<IdfObject> result = StraightComponent_Impl::remove();
163
5/6
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
✓ Branch 6 taken 2 times.
12 if (!result.empty() && speedList_) {
164
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 speedList_->clearExtensibleGroups(); // Clearer than removeAllModelObjects (which does the same thing, but could mean delete all objects)
165
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
5 openstudio::detail::concat_helper(result, speedList_->remove());
166 }
167
168 14 return result;
169 7 }
170
171 5 Schedule HeatPumpAirToWaterHeating_Impl::availabilitySchedule() const {
172
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<Schedule> value = optionalAvailabilitySchedule();
173
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
5 if (!value) {
174 ✗ LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
175 }
176
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 return value.get();
177 5 }
178
179 5 double HeatPumpAirToWaterHeating_Impl::ratedInletAirTemperature() const {
180
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_HeatingFields::RatedInletAirTemperature, true);
181
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
182
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
183 }
184
185 7 boost::optional<double> HeatPumpAirToWaterHeating_Impl::ratedAirFlowRate() const {
186 7 return getDouble(OS_HeatPump_AirToWater_HeatingFields::RatedAirFlowRate, true);
187 }
188
189 6 bool HeatPumpAirToWaterHeating_Impl::isRatedAirFlowRateAutosized() const {
190 6 bool result = false;
191
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<std::string> value = getString(OS_HeatPump_AirToWater_HeatingFields::RatedAirFlowRate, true);
192
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (value) {
193
3/3
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
12 result = openstudio::istringEqual(value.get(), "autosize");
194 }
195 6 return result;
196 6 }
197
198 5 double HeatPumpAirToWaterHeating_Impl::ratedLeavingWaterTemperature() const {
199
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_HeatingFields::RatedLeavingWaterTemperature, true);
200
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
201
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
202 }
203
204 7 boost::optional<double> HeatPumpAirToWaterHeating_Impl::ratedWaterFlowRate() const {
205 7 return getDouble(OS_HeatPump_AirToWater_HeatingFields::RatedWaterFlowRate, true);
206 }
207
208 6 bool HeatPumpAirToWaterHeating_Impl::isRatedWaterFlowRateAutosized() const {
209 6 bool result = false;
210
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<std::string> value = getString(OS_HeatPump_AirToWater_HeatingFields::RatedWaterFlowRate, true);
211
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (value) {
212
3/3
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
12 result = openstudio::istringEqual(value.get(), "autosize");
213 }
214 6 return result;
215 6 }
216
217 5 double HeatPumpAirToWaterHeating_Impl::minimumOutdoorAirTemperature() const {
218
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_HeatingFields::MinimumOutdoorAirTemperature, true);
219
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
220
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
221 }
222
223 5 double HeatPumpAirToWaterHeating_Impl::maximumOutdoorAirTemperature() const {
224
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_HeatingFields::MaximumOutdoorAirTemperature, true);
225
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
226
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
227 }
228
229 14 boost::optional<Curve> HeatPumpAirToWaterHeating_Impl::minimumLeavingWaterTemperatureCurve() const {
230
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 return getObject<ModelObject>().getModelObjectTarget<Curve>(OS_HeatPump_AirToWater_HeatingFields::MinimumLeavingWaterTemperatureCurveName);
231 }
232
233 13 boost::optional<Curve> HeatPumpAirToWaterHeating_Impl::maximumLeavingWaterTemperatureCurve() const {
234
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 return getObject<ModelObject>().getModelObjectTarget<Curve>(OS_HeatPump_AirToWater_HeatingFields::MaximumLeavingWaterTemperatureCurveName);
235 }
236
237 6 double HeatPumpAirToWaterHeating_Impl::sizingFactor() const {
238
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_HeatingFields::SizingFactor, true);
239
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
240
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
241 }
242
243 28 boost::optional<HeatPumpAirToWaterHeatingSpeedData> HeatPumpAirToWaterHeating_Impl::boosterModeOnSpeed() const {
244
1/1
✓ Branch 1 taken 28 times.
56 return getObject<ModelObject>().getModelObjectTarget<HeatPumpAirToWaterHeatingSpeedData>(
245
1/1
✓ Branch 1 taken 28 times.
56 OS_HeatPump_AirToWater_HeatingFields::BoosterModeOnSpeed);
246 }
247
248 19 bool HeatPumpAirToWaterHeating_Impl::setAvailabilitySchedule(Schedule& availabilitySchedule) {
249
3/3
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 19 times.
76 const bool result = setSchedule(OS_HeatPump_AirToWater_HeatingFields::AvailabilityScheduleName, "HeatPumpAirToWaterHeating", "Availability",
250 availabilitySchedule);
251 19 return result;
252 }
253
254 19 bool HeatPumpAirToWaterHeating_Impl::setRatedInletAirTemperature(double ratedInletAirTemperature) {
255 19 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::RatedInletAirTemperature, ratedInletAirTemperature);
256
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
19 OS_ASSERT(result);
257 19 return result;
258 }
259
260 5 bool HeatPumpAirToWaterHeating_Impl::setRatedAirFlowRate(double ratedAirFlowRate) {
261 5 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::RatedAirFlowRate, ratedAirFlowRate);
262 5 return result;
263 }
264
265 16 void HeatPumpAirToWaterHeating_Impl::autosizeRatedAirFlowRate() {
266
2/2
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
32 const bool result = setString(OS_HeatPump_AirToWater_HeatingFields::RatedAirFlowRate, "autosize");
267
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
16 OS_ASSERT(result);
268 16 }
269
270 19 bool HeatPumpAirToWaterHeating_Impl::setRatedLeavingWaterTemperature(double ratedLeavingWaterTemperature) {
271 19 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::RatedLeavingWaterTemperature, ratedLeavingWaterTemperature);
272
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
19 OS_ASSERT(result);
273 19 return result;
274 }
275
276 5 bool HeatPumpAirToWaterHeating_Impl::setRatedWaterFlowRate(double ratedWaterFlowRate) {
277 5 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::RatedWaterFlowRate, ratedWaterFlowRate);
278 5 return result;
279 }
280
281 16 void HeatPumpAirToWaterHeating_Impl::autosizeRatedWaterFlowRate() {
282
2/2
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
32 const bool result = setString(OS_HeatPump_AirToWater_HeatingFields::RatedWaterFlowRate, "autosize");
283
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
16 OS_ASSERT(result);
284 16 }
285
286 19 bool HeatPumpAirToWaterHeating_Impl::setMinimumOutdoorAirTemperature(double minimumOutdoorAirTemperature) {
287 19 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::MinimumOutdoorAirTemperature, minimumOutdoorAirTemperature);
288
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
19 OS_ASSERT(result);
289 19 return result;
290 }
291
292 19 bool HeatPumpAirToWaterHeating_Impl::setMaximumOutdoorAirTemperature(double maximumOutdoorAirTemperature) {
293 19 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::MaximumOutdoorAirTemperature, maximumOutdoorAirTemperature);
294
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
19 OS_ASSERT(result);
295 19 return result;
296 }
297
298 4 bool HeatPumpAirToWaterHeating_Impl::setMinimumLeavingWaterTemperatureCurve(const Curve& minimumLeavingWaterTemperatureCurve) {
299 const bool result =
300
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 setPointer(OS_HeatPump_AirToWater_HeatingFields::MinimumLeavingWaterTemperatureCurveName, minimumLeavingWaterTemperatureCurve.handle());
301 4 return result;
302 }
303
304 1 void HeatPumpAirToWaterHeating_Impl::resetMinimumLeavingWaterTemperatureCurve() {
305
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 const bool result = setString(OS_HeatPump_AirToWater_HeatingFields::MinimumLeavingWaterTemperatureCurveName, "");
306
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
307 1 }
308
309 4 bool HeatPumpAirToWaterHeating_Impl::setMaximumLeavingWaterTemperatureCurve(const Curve& maximumLeavingWaterTemperatureCurve) {
310 const bool result =
311
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 setPointer(OS_HeatPump_AirToWater_HeatingFields::MaximumLeavingWaterTemperatureCurveName, maximumLeavingWaterTemperatureCurve.handle());
312 4 return result;
313 }
314
315 ✗ void HeatPumpAirToWaterHeating_Impl::resetMaximumLeavingWaterTemperatureCurve() {
316 ✗ const bool result = setString(OS_HeatPump_AirToWater_HeatingFields::MaximumLeavingWaterTemperatureCurveName, "");
317 ✗ OS_ASSERT(result);
318 ✗ }
319
320 20 bool HeatPumpAirToWaterHeating_Impl::setSizingFactor(double sizingFactor) {
321 20 const bool result = setDouble(OS_HeatPump_AirToWater_HeatingFields::SizingFactor, sizingFactor);
322 20 return result;
323 }
324
325 4 bool HeatPumpAirToWaterHeating_Impl::setBoosterModeOnSpeed(const HeatPumpAirToWaterHeatingSpeedData& boosterModeOnSpeed) {
326
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 const bool result = setPointer(OS_HeatPump_AirToWater_HeatingFields::BoosterModeOnSpeed, boosterModeOnSpeed.handle());
327 4 return result;
328 }
329
330 1 void HeatPumpAirToWaterHeating_Impl::resetBoosterModeOnSpeed() {
331
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 const bool result = setString(OS_HeatPump_AirToWater_HeatingFields::BoosterModeOnSpeed, "");
332
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
333 1 }
334
335 ✗ boost::optional<double> HeatPumpAirToWaterHeating_Impl::autosizedRatedAirFlowRate() const {
336 ✗ boost::optional<double> result;
337 ✗ if (auto awhp_ = heatPumpAirToWater()) {
338 ✗ result = awhp_->autosizedRatedAirFlowRateinHeatingMode();
339 ✗ }
340 ✗ return result;
341 }
342
343 ✗ boost::optional<double> HeatPumpAirToWaterHeating_Impl::autosizedRatedWaterFlowRate() const {
344 ✗ boost::optional<double> result;
345 ✗ if (auto awhp_ = heatPumpAirToWater()) {
346 ✗ result = awhp_->autosizedRatedWaterFlowRateinHeatingMode();
347 ✗ }
348 ✗ return result;
349 }
350
351 ✗ boost::optional<double> HeatPumpAirToWaterHeating_Impl::autosizedRatedHeatingCapacity() const {
352 ✗ boost::optional<double> result;
353 ✗ if (auto awhp_ = heatPumpAirToWater()) {
354 ✗ result = awhp_->autosizedRatedHeatingCapacity();
355 ✗ }
356 ✗ return result;
357 }
358
359 ✗ void HeatPumpAirToWaterHeating_Impl::autosize() {
360 ✗ autosizeRatedAirFlowRate();
361 ✗ autosizeRatedWaterFlowRate();
362 ✗ auto speeds = this->speeds();
363 ✗ if (!speeds.empty()) {
364 ✗ speeds.back().autosize(); // Only need/can autosize the last (highest) speed
365 }
366 ✗ }
367
368 ✗ void HeatPumpAirToWaterHeating_Impl::applySizingValues() {
369 ✗ if (boost::optional<double> val_ = autosizedRatedAirFlowRate()) {
370 ✗ setRatedAirFlowRate(*val_);
371 }
372
373 ✗ if (boost::optional<double> val_ = autosizedRatedWaterFlowRate()) {
374 ✗ setRatedWaterFlowRate(*val_);
375 }
376
377 ✗ if (boost::optional<double> val_ = autosizedRatedHeatingCapacity()) {
378 ✗ auto speeds = this->speeds();
379 ✗ if (!speeds.empty()) {
380 ✗ speeds.back().setRatedHeatingCapacity(*val_); // Only need/can autosize the last (highest) speed
381 }
382 ✗ }
383 ✗ }
384
385 10 ComponentType HeatPumpAirToWaterHeating_Impl::componentType() const {
386
1/1
✓ Branch 1 taken 10 times.
10 return ComponentType::Heating;
387 }
388
389 1 std::vector<FuelType> HeatPumpAirToWaterHeating_Impl::coolingFuelTypes() const {
390 1 return {};
391 }
392
393 3 std::vector<FuelType> HeatPumpAirToWaterHeating_Impl::heatingFuelTypes() const {
394
1/1
✓ Branch 1 taken 3 times.
9 return {FuelType::Electricity};
395 }
396
397 3 std::vector<AppGFuelType> HeatPumpAirToWaterHeating_Impl::appGHeatingFuelTypes() const {
398
1/1
✓ Branch 1 taken 3 times.
9 return {AppGFuelType::HeatPump};
399 }
400
401 5 boost::optional<Schedule> HeatPumpAirToWaterHeating_Impl::optionalAvailabilitySchedule() const {
402
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_HeatPump_AirToWater_HeatingFields::AvailabilityScheduleName);
403 }
404
405 // Speed API
406 318 boost::optional<ModelObjectList> HeatPumpAirToWaterHeating_Impl::optionalSpeedDataList() const {
407
2/2
✓ Branch 1 taken 318 times.
✓ Branch 4 taken 318 times.
318 return getObject<ModelObject>().getModelObjectTarget<ModelObjectList>(OS_HeatPump_AirToWater_HeatingFields::SpeedDataList);
408 }
409
410 303 ModelObjectList HeatPumpAirToWaterHeating_Impl::speedDataList() const {
411
1/1
✓ Branch 1 taken 303 times.
303 boost::optional<ModelObjectList> value = optionalSpeedDataList();
412
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 303 times.
303 if (!value) {
413 ✗ LOG_AND_THROW(briefDescription() << " does not have a Speed Data List attached.");
414 }
415
2/2
✓ Branch 1 taken 303 times.
✓ Branch 4 taken 303 times.
606 return value.get();
416 303 }
417
418 19 bool HeatPumpAirToWaterHeating_Impl::setSpeedDataList(const ModelObjectList& speedDataList) {
419
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 const bool result = setPointer(OS_HeatPump_AirToWater_HeatingFields::SpeedDataList, speedDataList.handle());
420 19 return result;
421 }
422
423 ✗ void HeatPumpAirToWaterHeating_Impl::resetSpeedDataList() {
424 ✗ bool result = setString(OS_HeatPump_AirToWater_HeatingFields::SpeedDataList, "");
425 ✗ OS_ASSERT(result);
426 ✗ }
427
428 227 std::vector<HeatPumpAirToWaterHeatingSpeedData> HeatPumpAirToWaterHeating_Impl::speeds() const {
429 227 std::vector<HeatPumpAirToWaterHeatingSpeedData> result;
430
2/2
✓ Branch 1 taken 227 times.
✓ Branch 4 taken 227 times.
227 auto const modelObjects = speedDataList().modelObjects();
431
432
2/2
✓ Branch 5 taken 512 times.
✓ Branch 6 taken 227 times.
739 for (auto&& elem : modelObjects) {
433
1/1
✓ Branch 1 taken 512 times.
512 auto modelObject = elem.optionalCast<HeatPumpAirToWaterHeatingSpeedData>();
434
1/2
✓ Branch 0 taken 512 times.
✗ Branch 1 not taken.
512 if (modelObject) {
435
2/2
✓ Branch 1 taken 512 times.
✓ Branch 5 taken 512 times.
512 result.push_back(std::move(*modelObject));
436 }
437 512 }
438 454 return result;
439 227 }
440
441 97 unsigned HeatPumpAirToWaterHeating_Impl::numberOfSpeeds() const {
442
1/1
✓ Branch 1 taken 97 times.
97 return speeds().size(); // This is right in all cases, but this is slow
443 // return speedDataList().size(); // This is fast, but could be wrong if the user put non-SpeedData objects in the list or if there are blanks
444 }
445
446 72 boost::optional<unsigned> HeatPumpAirToWaterHeating_Impl::speedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed) const {
447
1/1
✓ Branch 1 taken 72 times.
72 const auto speedVector = speeds();
448
1/1
✓ Branch 3 taken 72 times.
203 auto it = std::find_if(speedVector.cbegin(), speedVector.cend(), [&](const HeatPumpAirToWaterHeatingSpeedData& s) { return s == speed; });
449
2/2
✓ Branch 2 taken 5 times.
✓ Branch 3 taken 67 times.
72 if (it != speedVector.cend()) {
450
1/1
✓ Branch 2 taken 5 times.
10 return static_cast<unsigned>(std::distance(speedVector.cbegin(), it)) + 1; // 1-indexed
451 }
452 67 return boost::none;
453 72 }
454
455 69 bool HeatPumpAirToWaterHeating_Impl::addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed) {
456
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 67 times.
69 if (numberOfSpeeds() >= HeatPumpAirToWaterHeating::maximum_number_of_speeds) {
457
10/10
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 19 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
✓ Branch 29 taken 2 times.
2 LOG(Error, "You have reached the maximum number of speeds (=" << HeatPumpAirToWaterHeating::maximum_number_of_speeds << "), occurred for "
458 << briefDescription() << ".");
459 2 return false; // too many speeds
460 }
461
2/3
✓ Branch 1 taken 67 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 67 times.
134 if (speedIndex(speed)) {
462 ✗ return false; // already in the list
463 }
464
465
2/2
✓ Branch 1 taken 67 times.
✓ Branch 4 taken 67 times.
67 return speedDataList().addModelObject(speed);
466 }
467
468 1 bool HeatPumpAirToWaterHeating_Impl::setSpeedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index) {
469
1/1
✓ Branch 1 taken 1 time.
1 auto cur_idx_ = speedIndex(speed);
470
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 if (!cur_idx_) {
471 ✗ LOG(Warn, "For " << briefDescription() << " cannot set the index of speed " << speed.briefDescription() << " since it is not part of it.");
472 ✗ return false;
473 }
474
475
1/1
✓ Branch 1 taken 1 time.
1 auto speedVector = speeds();
476
477
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 if (index < 1) {
478 ✗ LOG(Debug, "Requested a speed index of " << index << " < 1 to be assigned to " << speed.briefDescription() << ", resetting to 1");
479 ✗ index = 1;
480
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
1 } else if (index > speedVector.size()) {
481 ✗ LOG(Debug, "Requested a speed index of " << index << " > number of speeds (" << speedVector.size() << ") to be assigned to "
482 << speed.briefDescription() << ", resetting to " << speedVector.size());
483 ✗ index = speedVector.size();
484 }
485
486
2/2
✓ Branch 1 taken 1 time.
✓ Branch 7 taken 1 time.
1 speedVector.erase(speedVector.begin() + (*cur_idx_ - 1)); // stageIndex is 1-indexed, and vector is 0-indexed
487
1/1
✓ Branch 4 taken 1 time.
1 speedVector.insert(speedVector.begin() + (index - 1), speed); // index is 1-indexed, and vector is 0-indexed
488
489
1/1
✓ Branch 1 taken 1 time.
1 return setSpeeds(speedVector);
490 1 }
491
492 ✗ bool HeatPumpAirToWaterHeating_Impl::addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index) {
493 ✗ bool ok = addSpeed(speed);
494 ✗ if (!ok) {
495 ✗ return false;
496 }
497 ✗ ok = setSpeedIndex(speed, index);
498 ✗ return ok;
499 }
500
501 3 bool HeatPumpAirToWaterHeating_Impl::setSpeeds(const std::vector<HeatPumpAirToWaterHeatingSpeedData>& speeds) {
502 // Clear the extensible groups, and redo them
503 3 bool ok = true;
504 3 removeAllSpeeds();
505
2/2
✓ Branch 4 taken 12 times.
✓ Branch 5 taken 3 times.
15 for (const auto& s : speeds) {
506
1/1
✓ Branch 1 taken 12 times.
12 ok &= addSpeed(s);
507 }
508 3 return ok;
509 }
510
511 3 bool HeatPumpAirToWaterHeating_Impl::removeSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed) { // NOLINT(readability-*)
512
1/1
✓ Branch 1 taken 3 times.
3 auto speedList = speedDataList();
513
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
3 if (!speedList.hasModelObject(speed)) {
514
11/11
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 27 taken 1 time.
✓ Branch 30 taken 1 time.
✓ Branch 33 taken 1 time.
1 LOG(Warn, "For " << briefDescription() << " cannot remove speed " << speed.briefDescription() << " since it is not part of it.");
515 1 return false;
516 }
517
1/1
✓ Branch 1 taken 2 times.
2 speedList.removeModelObject(speed);
518 2 return true;
519 3 }
520
521 1 bool HeatPumpAirToWaterHeating_Impl::removeSpeed(unsigned index) {
522 1 bool result = false;
523
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 if (index < 1) {
524 ✗ return false;
525 }
526
1/1
✓ Branch 1 taken 1 time.
1 auto speedVector = speeds();
527
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 if (index <= speedVector.size()) {
528
1/1
✓ Branch 2 taken 1 time.
1 result = removeSpeed(speedVector[index - 1]); // index is 1-indexed
529 }
530 1 return result;
531 1 }
532
533 6 void HeatPumpAirToWaterHeating_Impl::removeAllSpeeds() { // NOLINT(readability-make-member-function-const)
534 // TODO: same question, do we want to remove the underlying objects too?
535
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 speedDataList().removeAllModelObjects(); // This just clears the list, does not delete the underlying objects
536 6 }
537
538 } // namespace detail
539
540 15 HeatPumpAirToWaterHeating::HeatPumpAirToWaterHeating(const Model& model) : StraightComponent(HeatPumpAirToWaterHeating::iddObjectType(), model) {
541
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 15 times.
✗ Branch 5 not taken.
15 OS_ASSERT(getImpl<detail::HeatPumpAirToWaterHeating_Impl>());
542
543 15 bool ok = true;
544
545
1/1
✓ Branch 1 taken 15 times.
15 auto speedList = ModelObjectList(model);
546
3/3
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
15 speedList.setName(this->nameString() + " Speed Data List");
547
1/1
✓ Branch 3 taken 15 times.
15 ok = getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setSpeedDataList(speedList);
548
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
15 OS_ASSERT(ok);
549
550
1/1
✓ Branch 1 taken 15 times.
15 auto availabilitySchedule = model.alwaysOnDiscreteSchedule();
551
1/1
✓ Branch 1 taken 15 times.
15 ok = setAvailabilitySchedule(availabilitySchedule);
552
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
15 OS_ASSERT(ok);
553
554 // IDD Defaults
555
1/1
✓ Branch 1 taken 15 times.
15 setRatedInletAirTemperature(8.0);
556
1/1
✓ Branch 1 taken 15 times.
15 autosizeRatedAirFlowRate();
557
1/1
✓ Branch 1 taken 15 times.
15 setRatedLeavingWaterTemperature(40.0);
558
1/1
✓ Branch 1 taken 15 times.
15 autosizeRatedWaterFlowRate();
559
1/1
✓ Branch 1 taken 15 times.
15 setMinimumOutdoorAirTemperature(-30.0);
560
1/1
✓ Branch 1 taken 15 times.
15 setMaximumOutdoorAirTemperature(100.0);
561
1/1
✓ Branch 1 taken 15 times.
15 setSizingFactor(1.0);
562 15 }
563
564 7787 IddObjectType HeatPumpAirToWaterHeating::iddObjectType() {
565
1/1
✓ Branch 1 taken 7787 times.
7787 return {IddObjectType::OS_HeatPump_AirToWater_Heating};
566 }
567
568 5 Schedule HeatPumpAirToWaterHeating::availabilitySchedule() const {
569
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->availabilitySchedule();
570 }
571
572 5 double HeatPumpAirToWaterHeating::ratedInletAirTemperature() const {
573
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->ratedInletAirTemperature();
574 }
575
576 7 boost::optional<double> HeatPumpAirToWaterHeating::ratedAirFlowRate() const {
577
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->ratedAirFlowRate();
578 }
579
580 6 bool HeatPumpAirToWaterHeating::isRatedAirFlowRateAutosized() const {
581
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->isRatedAirFlowRateAutosized();
582 }
583
584 ✗ boost::optional<double> HeatPumpAirToWaterHeating::autosizedRatedAirFlowRate() const {
585 ✗ return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->autosizedRatedAirFlowRate();
586 }
587
588 5 double HeatPumpAirToWaterHeating::ratedLeavingWaterTemperature() const {
589
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->ratedLeavingWaterTemperature();
590 }
591
592 7 boost::optional<double> HeatPumpAirToWaterHeating::ratedWaterFlowRate() const {
593
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->ratedWaterFlowRate();
594 }
595
596 6 bool HeatPumpAirToWaterHeating::isRatedWaterFlowRateAutosized() const {
597
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->isRatedWaterFlowRateAutosized();
598 }
599
600 ✗ boost::optional<double> HeatPumpAirToWaterHeating::autosizedRatedWaterFlowRate() const {
601 ✗ return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->autosizedRatedWaterFlowRate();
602 }
603
604 5 double HeatPumpAirToWaterHeating::minimumOutdoorAirTemperature() const {
605
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->minimumOutdoorAirTemperature();
606 }
607
608 5 double HeatPumpAirToWaterHeating::maximumOutdoorAirTemperature() const {
609
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->maximumOutdoorAirTemperature();
610 }
611
612 6 boost::optional<Curve> HeatPumpAirToWaterHeating::minimumLeavingWaterTemperatureCurve() const {
613
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->minimumLeavingWaterTemperatureCurve();
614 }
615
616 5 boost::optional<Curve> HeatPumpAirToWaterHeating::maximumLeavingWaterTemperatureCurve() const {
617
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->maximumLeavingWaterTemperatureCurve();
618 }
619
620 6 double HeatPumpAirToWaterHeating::sizingFactor() const {
621
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->sizingFactor();
622 }
623
624 28 boost::optional<HeatPumpAirToWaterHeatingSpeedData> HeatPumpAirToWaterHeating::boosterModeOnSpeed() const {
625
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->boosterModeOnSpeed();
626 }
627
628 19 bool HeatPumpAirToWaterHeating::setAvailabilitySchedule(Schedule& availabilitySchedule) {
629
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setAvailabilitySchedule(availabilitySchedule);
630 }
631
632 19 bool HeatPumpAirToWaterHeating::setRatedInletAirTemperature(double ratedInletAirTemperature) {
633
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setRatedInletAirTemperature(ratedInletAirTemperature);
634 }
635
636 5 bool HeatPumpAirToWaterHeating::setRatedAirFlowRate(double ratedAirFlowRate) {
637
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setRatedAirFlowRate(ratedAirFlowRate);
638 }
639
640 16 void HeatPumpAirToWaterHeating::autosizeRatedAirFlowRate() {
641
1/1
✓ Branch 3 taken 16 times.
16 getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->autosizeRatedAirFlowRate();
642 16 }
643
644 19 bool HeatPumpAirToWaterHeating::setRatedLeavingWaterTemperature(double ratedLeavingWaterTemperature) {
645
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setRatedLeavingWaterTemperature(ratedLeavingWaterTemperature);
646 }
647
648 5 bool HeatPumpAirToWaterHeating::setRatedWaterFlowRate(double ratedWaterFlowRate) {
649
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setRatedWaterFlowRate(ratedWaterFlowRate);
650 }
651
652 16 void HeatPumpAirToWaterHeating::autosizeRatedWaterFlowRate() {
653
1/1
✓ Branch 3 taken 16 times.
16 getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->autosizeRatedWaterFlowRate();
654 16 }
655
656 19 bool HeatPumpAirToWaterHeating::setMinimumOutdoorAirTemperature(double minimumOutdoorAirTemperature) {
657
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setMinimumOutdoorAirTemperature(minimumOutdoorAirTemperature);
658 }
659
660 19 bool HeatPumpAirToWaterHeating::setMaximumOutdoorAirTemperature(double maximumOutdoorAirTemperature) {
661
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setMaximumOutdoorAirTemperature(maximumOutdoorAirTemperature);
662 }
663
664 4 bool HeatPumpAirToWaterHeating::setMinimumLeavingWaterTemperatureCurve(const Curve& minimumLeavingWaterTemperatureCurve) {
665
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setMinimumLeavingWaterTemperatureCurve(minimumLeavingWaterTemperatureCurve);
666 }
667
668 1 void HeatPumpAirToWaterHeating::resetMinimumLeavingWaterTemperatureCurve() {
669
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->resetMinimumLeavingWaterTemperatureCurve();
670 1 }
671
672 4 bool HeatPumpAirToWaterHeating::setMaximumLeavingWaterTemperatureCurve(const Curve& maximumLeavingWaterTemperatureCurve) {
673
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setMaximumLeavingWaterTemperatureCurve(maximumLeavingWaterTemperatureCurve);
674 }
675
676 ✗ void HeatPumpAirToWaterHeating::resetMaximumLeavingWaterTemperatureCurve() {
677 ✗ getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->resetMaximumLeavingWaterTemperatureCurve();
678 ✗ }
679
680 20 bool HeatPumpAirToWaterHeating::setSizingFactor(double sizingFactor) {
681
1/1
✓ Branch 3 taken 20 times.
20 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setSizingFactor(sizingFactor);
682 }
683
684 4 bool HeatPumpAirToWaterHeating::setBoosterModeOnSpeed(const HeatPumpAirToWaterHeatingSpeedData& boosterModeOnSpeed) {
685
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setBoosterModeOnSpeed(boosterModeOnSpeed);
686 }
687
688 1 void HeatPumpAirToWaterHeating::resetBoosterModeOnSpeed() {
689
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->resetBoosterModeOnSpeed();
690 1 }
691
692 // Speed Data API
693 28 unsigned HeatPumpAirToWaterHeating::numberOfSpeeds() const {
694
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->numberOfSpeeds();
695 }
696
697 4 boost::optional<unsigned> HeatPumpAirToWaterHeating::speedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed) const {
698
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->speedIndex(speed);
699 }
700
701 52 std::vector<HeatPumpAirToWaterHeatingSpeedData> HeatPumpAirToWaterHeating::speeds() const {
702
1/1
✓ Branch 3 taken 52 times.
52 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->speeds();
703 }
704
705 57 bool HeatPumpAirToWaterHeating::addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed) {
706
1/1
✓ Branch 3 taken 57 times.
57 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->addSpeed(speed);
707 }
708
709 ✗ bool HeatPumpAirToWaterHeating::addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index) {
710 ✗ return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->addSpeed(speed, index);
711 }
712
713 1 bool HeatPumpAirToWaterHeating::setSpeedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index) {
714
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setSpeedIndex(speed, index);
715 }
716
717 2 bool HeatPumpAirToWaterHeating::setSpeeds(const std::vector<HeatPumpAirToWaterHeatingSpeedData>& speeds) {
718
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->setSpeeds(speeds);
719 }
720
721 3 void HeatPumpAirToWaterHeating::removeAllSpeeds() {
722
1/1
✓ Branch 3 taken 3 times.
3 getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->removeAllSpeeds();
723 3 }
724
725 2 bool HeatPumpAirToWaterHeating::removeSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed) {
726
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->removeSpeed(speed);
727 }
728
729 1 bool HeatPumpAirToWaterHeating::removeSpeed(unsigned index) {
730
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->removeSpeed(index);
731 }
732
733 17 boost::optional<HeatPumpAirToWater> HeatPumpAirToWaterHeating::heatPumpAirToWater() const {
734
1/1
✓ Branch 3 taken 17 times.
17 return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->heatPumpAirToWater();
735 }
736
737 ✗ boost::optional<double> HeatPumpAirToWaterHeating::autosizedRatedHeatingCapacity() const {
738 ✗ return getImpl<detail::HeatPumpAirToWaterHeating_Impl>()->autosizedRatedHeatingCapacity();
739 }
740
741 /// @cond
742 78 HeatPumpAirToWaterHeating::HeatPumpAirToWaterHeating(std::shared_ptr<detail::HeatPumpAirToWaterHeating_Impl> impl)
743
1/1
✓ Branch 3 taken 78 times.
78 : StraightComponent(std::move(impl)) {}
744 /// @endcond
745
746 } // namespace model
747 } // namespace openstudio
748