GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 81.3% 204 / 0 / 251
Functions: 82.6% 38 / 0 / 46
Branches: 64.7% 240 / 0 / 371

src/model/HeatPumpAirToWaterCoolingSpeedData.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 "HeatPumpAirToWaterCoolingSpeedData.hpp"
7 #include "HeatPumpAirToWaterCoolingSpeedData_Impl.hpp"
8
9 #include "HeatPumpAirToWaterCooling.hpp"
10 #include "HeatPumpAirToWaterCooling_Impl.hpp"
11
12 #include "Model.hpp"
13 #include "Model_Impl.hpp"
14 #include "Curve.hpp"
15 #include "Curve_Impl.hpp"
16 #include "CurveBiquadratic.hpp"
17 #include "CurveQuadratic.hpp"
18
19 #include "../utilities/core/Assert.hpp"
20
21 #include <utilities/idd/IddEnums.hxx>
22 #include <utilities/idd/OS_HeatPump_AirToWater_Cooling_SpeedData_FieldEnums.hxx>
23
24 #include <fmt/format.h>
25
26 namespace openstudio {
27 namespace model {
28
29 namespace detail {
30
31 53 HeatPumpAirToWaterCoolingSpeedData_Impl::HeatPumpAirToWaterCoolingSpeedData_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
32 53 : ResourceObject_Impl(idfObject, model, keepHandle) {
33
4/6
✓ Branch 1 taken 53 times.
✓ Branch 4 taken 53 times.
✓ Branch 7 taken 53 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 53 times.
✗ Branch 13 not taken.
53 OS_ASSERT(idfObject.iddObject().type() == HeatPumpAirToWaterCoolingSpeedData::iddObjectType());
34 53 }
35
36 ✗ HeatPumpAirToWaterCoolingSpeedData_Impl::HeatPumpAirToWaterCoolingSpeedData_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
37 ✗ Model_Impl* model, bool keepHandle)
38 ✗ : ResourceObject_Impl(other, model, keepHandle) {
39 ✗ OS_ASSERT(other.iddObject().type() == HeatPumpAirToWaterCoolingSpeedData::iddObjectType());
40 ✗ }
41
42 38 HeatPumpAirToWaterCoolingSpeedData_Impl::HeatPumpAirToWaterCoolingSpeedData_Impl(const HeatPumpAirToWaterCoolingSpeedData_Impl& other,
43 38 Model_Impl* model, bool keepHandle)
44 38 : ResourceObject_Impl(other, model, keepHandle) {}
45
46 ✗ const std::vector<std::string>& HeatPumpAirToWaterCoolingSpeedData_Impl::outputVariableNames() const {
47 ✗ static std::vector<std::string> result;
48 ✗ if (result.empty()) {
49 }
50 ✗ return result;
51 }
52
53 ✗ IddObjectType HeatPumpAirToWaterCoolingSpeedData_Impl::iddObjectType() const {
54 ✗ return HeatPumpAirToWaterCoolingSpeedData::iddObjectType();
55 }
56
57 14 std::vector<ModelObject> HeatPumpAirToWaterCoolingSpeedData_Impl::children() const {
58 14 std::vector<ModelObject> children;
59
2/3
✓ Branch 1 taken 14 times.
✓ Branch 3 taken 14 times.
✗ Branch 4 not taken.
28 if (auto c_ = optionalNormalizedCoolingCapacityFunctionofTemperatureCurve()) {
60
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 children.push_back(*c_);
61 14 }
62
2/3
✓ Branch 1 taken 14 times.
✓ Branch 3 taken 14 times.
✗ Branch 4 not taken.
28 if (auto c_ = optionalCoolingEnergyInputRatioFunctionofTemperatureCurve()) {
63
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 children.push_back(*c_);
64 14 }
65
2/3
✓ Branch 1 taken 14 times.
✓ Branch 3 taken 14 times.
✗ Branch 4 not taken.
28 if (auto c_ = optionalCoolingEnergyInputRatioFunctionofPLRCurve()) {
66
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 children.push_back(*c_);
67 14 }
68
69 14 return children;
70 ✗ }
71
72 7 ModelObject HeatPumpAirToWaterCoolingSpeedData_Impl::clone(Model model) const {
73 // Don't clone the curves (listed as children)
74
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
7 return ModelObject_Impl::clone(model); // NOLINT(bugprone-parent-virtual-call)
75 }
76
77 17 boost::optional<double> HeatPumpAirToWaterCoolingSpeedData_Impl::ratedCoolingCapacity() const {
78 17 return getDouble(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCoolingCapacity, true);
79 }
80
81 16 bool HeatPumpAirToWaterCoolingSpeedData_Impl::isRatedCoolingCapacityAutosized() const {
82 16 bool result = false;
83
1/1
✓ Branch 1 taken 16 times.
16 boost::optional<std::string> value = getString(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCoolingCapacity, true);
84
1/2
✓ Branch 0 taken 16 times.
✗ Branch 1 not taken.
16 if (value) {
85
3/3
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
32 result = openstudio::istringEqual(value.get(), "autosize");
86 }
87 16 return result;
88 16 }
89
90 ✗ boost::optional<double> HeatPumpAirToWaterCoolingSpeedData_Impl::autosizedRatedCoolingCapacity() {
91 ✗ boost::optional<double> result;
92 ✗ auto awhp_ccs = heatPumpAirToWaterCoolings();
93 ✗ if (awhp_ccs.empty()) {
94 ✗ return result;
95 }
96 ✗ size_t n_found = 0;
97 ✗ for (const auto& awhp_cc : awhp_ccs) {
98 // Check needed because could be the booster speed
99 ✗ if (awhp_cc.speeds().empty()) {
100 ✗ continue;
101 }
102 // It has to be the last speed
103 ✗ if (awhp_cc.speeds().back().handle() != this->handle()) {
104 ✗ continue;
105 }
106 ✗ if (n_found == 0) {
107 // Setting the first one only
108 ✗ result = awhp_cc.autosizedRatedCoolingCapacity();
109 }
110 ✗ ++n_found;
111 }
112 ✗ if (n_found > 1) {
113 ✗ LOG(Warn, briefDescription() << " is used as the highest speed in multiple HeatPumpAirToWaterCooling objects, "
114 "returning the autosized value from the first one only.");
115 }
116
117 ✗ return result;
118 ✗ }
119
120 18 double HeatPumpAirToWaterCoolingSpeedData_Impl::ratedCOPforCooling() const {
121
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCOPforCooling, true);
122
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
123
1/1
✓ Branch 1 taken 18 times.
36 return value.get();
124 }
125
126 35 Curve HeatPumpAirToWaterCoolingSpeedData_Impl::normalizedCoolingCapacityFunctionofTemperatureCurve() const {
127
1/1
✓ Branch 1 taken 35 times.
35 boost::optional<Curve> value = optionalNormalizedCoolingCapacityFunctionofTemperatureCurve();
128
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
35 if (!value) {
129 ✗ LOG_AND_THROW(briefDescription() << " does not have an Normalized Cooling Capacity Functionof Temperature Curve attached.");
130 }
131
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
70 return value.get();
132 35 }
133
134 35 Curve HeatPumpAirToWaterCoolingSpeedData_Impl::coolingEnergyInputRatioFunctionofTemperatureCurve() const {
135
1/1
✓ Branch 1 taken 35 times.
35 boost::optional<Curve> value = optionalCoolingEnergyInputRatioFunctionofTemperatureCurve();
136
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
35 if (!value) {
137 ✗ LOG_AND_THROW(briefDescription() << " does not have an Cooling Energy Input Ratio Functionof Temperature Curve attached.");
138 }
139
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
70 return value.get();
140 35 }
141
142 35 Curve HeatPumpAirToWaterCoolingSpeedData_Impl::coolingEnergyInputRatioFunctionofPLRCurve() const {
143
1/1
✓ Branch 1 taken 35 times.
35 boost::optional<Curve> value = optionalCoolingEnergyInputRatioFunctionofPLRCurve();
144
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
35 if (!value) {
145 ✗ LOG_AND_THROW(briefDescription() << " does not have an Cooling Energy Input Ratio Functionof PLRCurve attached.");
146 }
147
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
70 return value.get();
148 35 }
149
150 18 bool HeatPumpAirToWaterCoolingSpeedData_Impl::setRatedCoolingCapacity(double ratedCoolingCapacity) {
151 18 const bool result = setDouble(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCoolingCapacity, ratedCoolingCapacity);
152 18 return result;
153 }
154
155 56 void HeatPumpAirToWaterCoolingSpeedData_Impl::autosizeRatedCoolingCapacity() {
156
2/2
✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
112 const bool result = setString(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCoolingCapacity, "autosize");
157
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
56 OS_ASSERT(result);
158 56 }
159
160 74 bool HeatPumpAirToWaterCoolingSpeedData_Impl::setRatedCOPforCooling(double ratedCOPforCooling) {
161 74 const bool result = setDouble(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::RatedCOPforCooling, ratedCOPforCooling);
162 74 return result;
163 }
164
165 60 bool HeatPumpAirToWaterCoolingSpeedData_Impl::setNormalizedCoolingCapacityFunctionofTemperatureCurve(const Curve& bivariateFunctions) {
166
1/1
✓ Branch 1 taken 60 times.
60 const bool result = setPointer(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::NormalizedCoolingCapacityFunctionofTemperatureCurveName,
167
1/1
✓ Branch 1 taken 60 times.
60 bivariateFunctions.handle());
168 60 return result;
169 }
170
171 59 bool HeatPumpAirToWaterCoolingSpeedData_Impl::setCoolingEnergyInputRatioFunctionofTemperatureCurve(const Curve& bivariateFunctions) {
172
1/1
✓ Branch 1 taken 59 times.
59 const bool result = setPointer(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::CoolingEnergyInputRatioFunctionofTemperatureCurveName,
173
1/1
✓ Branch 1 taken 59 times.
59 bivariateFunctions.handle());
174 59 return result;
175 }
176
177 57 bool HeatPumpAirToWaterCoolingSpeedData_Impl::setCoolingEnergyInputRatioFunctionofPLRCurve(const Curve& univariateFunctions) {
178 const bool result =
179
2/2
✓ Branch 1 taken 57 times.
✓ Branch 4 taken 57 times.
57 setPointer(OS_HeatPump_AirToWater_Cooling_SpeedDataFields::CoolingEnergyInputRatioFunctionofPLRCurveName, univariateFunctions.handle());
180 57 return result;
181 }
182
183 ✗ void HeatPumpAirToWaterCoolingSpeedData_Impl::autosize() {
184 ✗ autosizeRatedCoolingCapacity();
185 ✗ }
186
187 ✗ void HeatPumpAirToWaterCoolingSpeedData_Impl::applySizingValues() {
188 ✗ if (boost::optional<double> val_ = autosizedRatedCoolingCapacity()) {
189 ✗ setRatedCoolingCapacity(*val_);
190 }
191 ✗ }
192
193 49 boost::optional<Curve> HeatPumpAirToWaterCoolingSpeedData_Impl::optionalNormalizedCoolingCapacityFunctionofTemperatureCurve() const {
194
1/1
✓ Branch 1 taken 49 times.
98 return getObject<ModelObject>().getModelObjectTarget<Curve>(
195
1/1
✓ Branch 1 taken 49 times.
98 OS_HeatPump_AirToWater_Cooling_SpeedDataFields::NormalizedCoolingCapacityFunctionofTemperatureCurveName);
196 }
197
198 49 boost::optional<Curve> HeatPumpAirToWaterCoolingSpeedData_Impl::optionalCoolingEnergyInputRatioFunctionofTemperatureCurve() const {
199
1/1
✓ Branch 1 taken 49 times.
98 return getObject<ModelObject>().getModelObjectTarget<Curve>(
200
1/1
✓ Branch 1 taken 49 times.
98 OS_HeatPump_AirToWater_Cooling_SpeedDataFields::CoolingEnergyInputRatioFunctionofTemperatureCurveName);
201 }
202
203 49 boost::optional<Curve> HeatPumpAirToWaterCoolingSpeedData_Impl::optionalCoolingEnergyInputRatioFunctionofPLRCurve() const {
204
1/1
✓ Branch 1 taken 49 times.
98 return getObject<ModelObject>().getModelObjectTarget<Curve>(
205
1/1
✓ Branch 1 taken 49 times.
98 OS_HeatPump_AirToWater_Cooling_SpeedDataFields::CoolingEnergyInputRatioFunctionofPLRCurveName);
206 }
207
208 11 std::vector<HeatPumpAirToWaterCooling> HeatPumpAirToWaterCoolingSpeedData_Impl::heatPumpAirToWaterCoolings() const {
209 11 std::vector<HeatPumpAirToWaterCooling> result;
210
211
1/1
✓ Branch 1 taken 11 times.
11 const auto handle = this->handle();
212
213
4/4
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 12 taken 21 times.
✓ Branch 13 taken 11 times.
32 for (const auto& awhp : model().getConcreteModelObjects<HeatPumpAirToWaterCooling>()) {
214
5/19
✓ Branch 1 taken 21 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 21 times.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✗ Branch 13 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 21 times.
✓ Branch 23 taken 21 times.
✗ Branch 24 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 21 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
42 if (awhp.boosterModeOnSpeed() && awhp.boosterModeOnSpeed()->handle() == handle) {
215 ✗ result.push_back(awhp);
216 } else {
217
1/1
✓ Branch 1 taken 21 times.
21 const auto speeds = awhp.speeds();
218
1/1
✓ Branch 3 taken 21 times.
21 if (std::find_if(speeds.cbegin(), speeds.cend(),
219
2/2
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
18 [handle](const HeatPumpAirToWaterCoolingSpeedData& speed) { return speed.handle() == handle; })
220
2/2
✓ Branch 2 taken 11 times.
✓ Branch 3 taken 10 times.
42 != speeds.end()) {
221
1/1
✓ Branch 1 taken 11 times.
11 result.push_back(awhp);
222 }
223 21 }
224 11 }
225 22 return result;
226 ✗ }
227
228 } // namespace detail
229
230 47 HeatPumpAirToWaterCoolingSpeedData::HeatPumpAirToWaterCoolingSpeedData(const Model& model)
231 47 : ResourceObject(HeatPumpAirToWaterCoolingSpeedData::iddObjectType(), model) {
232
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 47 times.
✗ Branch 5 not taken.
47 OS_ASSERT(getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>());
233
234
1/1
✓ Branch 1 taken 47 times.
47 autosizeRatedCoolingCapacity();
235
1/1
✓ Branch 1 taken 47 times.
47 setRatedCOPforCooling(3.0);
236
237 47 bool ok = true;
238 {
239
1/1
✓ Branch 1 taken 47 times.
47 CurveBiquadratic capFT(model);
240
2/2
✓ Branch 1 taken 47 times.
✓ Branch 5 taken 47 times.
94 capFT.setName(fmt::format("{} CapCurveFuncTempHT", this->nameString()));
241
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient1Constant(0.885);
242
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient2x(-0.00040);
243
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient3xPOW2(0.00019);
244
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient4y(0.0202);
245
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient5yPOW2(-0.0096);
246
1/1
✓ Branch 1 taken 47 times.
47 capFT.setCoefficient6xTIMESY(0.000580);
247
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMinimumValueofx(30.0);
248
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMaximumValueofx(50.0);
249
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMinimumValueofy(-7.0);
250
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMaximumValueofy(20.0);
251
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMinimumCurveOutput(0.5);
252
1/1
✓ Branch 1 taken 47 times.
47 capFT.setMaximumCurveOutput(1.3);
253
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
94 capFT.setInputUnitTypeforX("Temperature");
254
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
94 capFT.setInputUnitTypeforY("Temperature");
255
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
47 capFT.setOutputUnitType("Dimensionless");
256
257
1/1
✓ Branch 1 taken 47 times.
47 ok = setNormalizedCoolingCapacityFunctionofTemperatureCurve(capFT);
258
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 47 times.
✗ Branch 3 not taken.
47 OS_ASSERT(ok);
259 47 }
260
261 {
262
1/1
✓ Branch 1 taken 47 times.
47 CurveBiquadratic eirFT(model);
263
2/2
✓ Branch 1 taken 47 times.
✓ Branch 5 taken 47 times.
94 eirFT.setName(fmt::format("{} EIRCurveFuncTempHT", this->nameString()));
264
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient1Constant(1.055);
265
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient2x(0.00035);
266
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient3xPOW2(-0.00027);
267
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient4y(-0.0108);
268
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient5yPOW2(0.0145);
269
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setCoefficient6xTIMESY(-0.000230);
270
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMinimumValueofx(30.0);
271
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMaximumValueofx(50.0);
272
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMinimumValueofy(-7.0);
273
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMaximumValueofy(20.0);
274
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMinimumCurveOutput(0.7);
275
1/1
✓ Branch 1 taken 47 times.
47 eirFT.setMaximumCurveOutput(1.5);
276
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
94 eirFT.setInputUnitTypeforX("Temperature");
277
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
94 eirFT.setInputUnitTypeforY("Temperature");
278
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
47 eirFT.setOutputUnitType("Dimensionless");
279
280
1/1
✓ Branch 1 taken 47 times.
47 ok = setCoolingEnergyInputRatioFunctionofTemperatureCurve(eirFT);
281
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 47 times.
✗ Branch 3 not taken.
47 OS_ASSERT(ok);
282 47 }
283
284 {
285
1/1
✓ Branch 1 taken 47 times.
47 CurveQuadratic eirfPLR(model);
286
2/2
✓ Branch 1 taken 47 times.
✓ Branch 5 taken 47 times.
94 eirfPLR.setName(fmt::format("{} EIRCurveFuncPLR", this->nameString()));
287
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setCoefficient1Constant(1.0);
288
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setCoefficient2x(0.0);
289
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setCoefficient3xPOW2(0.0);
290
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setMinimumValueofx(0.0);
291
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setMaximumValueofx(1.0);
292
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setMinimumCurveOutput(0.0);
293
1/1
✓ Branch 1 taken 47 times.
47 eirfPLR.setMaximumCurveOutput(1.0);
294
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
94 eirfPLR.setInputUnitTypeforX("Dimensionless");
295
2/2
✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
47 eirfPLR.setOutputUnitType("Dimensionless");
296
1/1
✓ Branch 1 taken 47 times.
47 ok = setCoolingEnergyInputRatioFunctionofPLRCurve(eirfPLR);
297
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 47 times.
✗ Branch 3 not taken.
47 OS_ASSERT(ok);
298 47 }
299 47 }
300
301 6 HeatPumpAirToWaterCoolingSpeedData::HeatPumpAirToWaterCoolingSpeedData(const Model& model,
302 const Curve& normalizedCoolingCapacityFunctionofTemperatureCurve,
303 const Curve& coolingEnergyInputRatioFunctionofTemperatureCurve,
304 6 const Curve& coolingEnergyInputRatioFunctionofPLRCurve)
305 6 : ResourceObject(HeatPumpAirToWaterCoolingSpeedData::iddObjectType(), model) {
306
307 6 auto impl = getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>();
308
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(impl);
309
310
1/1
✓ Branch 1 taken 6 times.
6 autosizeRatedCoolingCapacity();
311
1/1
✓ Branch 1 taken 6 times.
6 setRatedCOPforCooling(3.0);
312
313
1/1
✓ Branch 1 taken 6 times.
6 bool ok = setNormalizedCoolingCapacityFunctionofTemperatureCurve(normalizedCoolingCapacityFunctionofTemperatureCurve);
314
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 5 times.
6 if (!ok) {
315 // We don't call remove() (which would do ResourceObject::remove()) because that would try to remove the curves too if they aren't being used,
316 // so we call ModelObject::remove() directly
317
1/1
✓ Branch 2 taken 1 time.
1 impl->detail::ModelObject_Impl::remove();
318
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 Capacity Curve to "
319 << normalizedCoolingCapacityFunctionofTemperatureCurve.briefDescription() << ".");
320 }
321
1/1
✓ Branch 1 taken 5 times.
5 ok = setCoolingEnergyInputRatioFunctionofTemperatureCurve(coolingEnergyInputRatioFunctionofTemperatureCurve);
322
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 3 times.
5 if (!ok) {
323
1/1
✓ Branch 2 taken 2 times.
2 impl->detail::ModelObject_Impl::remove();
324
25/25
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 16 taken 2 times.
✓ Branch 19 taken 2 times.
✓ Branch 22 taken 2 times.
✓ Branch 27 taken 2 times.
✓ Branch 30 taken 2 times.
✓ Branch 33 taken 2 times.
✓ Branch 39 taken 2 times.
✓ Branch 42 taken 2 times.
✓ Branch 45 taken 2 times.
✓ Branch 48 taken 2 times.
✓ Branch 51 taken 2 times.
✓ Branch 54 taken 2 times.
✓ Branch 57 taken 2 times.
✓ Branch 60 taken 2 times.
✓ Branch 63 taken 2 times.
✓ Branch 66 taken 2 times.
✓ Branch 69 taken 2 times.
✓ Branch 72 taken 2 times.
✓ Branch 78 taken 2 times.
✓ Branch 81 taken 2 times.
2 LOG_AND_THROW("Unable to set " << briefDescription() << "'s EIRfT Curve to "
325 << coolingEnergyInputRatioFunctionofTemperatureCurve.briefDescription() << ".");
326 }
327
1/1
✓ Branch 1 taken 3 times.
3 ok = setCoolingEnergyInputRatioFunctionofPLRCurve(coolingEnergyInputRatioFunctionofPLRCurve);
328
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
3 if (!ok) {
329
1/1
✓ Branch 2 taken 1 time.
1 impl->detail::ModelObject_Impl::remove();
330
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 EIRfPLR Curve to " << coolingEnergyInputRatioFunctionofPLRCurve.briefDescription()
331 << ".");
332 }
333 10 }
334
335 7727 IddObjectType HeatPumpAirToWaterCoolingSpeedData::iddObjectType() {
336
1/1
✓ Branch 1 taken 7727 times.
7727 return {IddObjectType::OS_HeatPump_AirToWater_Cooling_SpeedData};
337 }
338
339 17 boost::optional<double> HeatPumpAirToWaterCoolingSpeedData::ratedCoolingCapacity() const {
340
1/1
✓ Branch 3 taken 17 times.
17 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->ratedCoolingCapacity();
341 }
342
343 16 bool HeatPumpAirToWaterCoolingSpeedData::isRatedCoolingCapacityAutosized() const {
344
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->isRatedCoolingCapacityAutosized();
345 }
346
347 ✗ boost::optional<double> HeatPumpAirToWaterCoolingSpeedData::autosizedRatedCoolingCapacity() {
348 ✗ return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->autosizedRatedCoolingCapacity();
349 }
350
351 18 double HeatPumpAirToWaterCoolingSpeedData::ratedCOPforCooling() const {
352
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->ratedCOPforCooling();
353 }
354
355 35 Curve HeatPumpAirToWaterCoolingSpeedData::normalizedCoolingCapacityFunctionofTemperatureCurve() const {
356
1/1
✓ Branch 3 taken 35 times.
35 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->normalizedCoolingCapacityFunctionofTemperatureCurve();
357 }
358
359 35 Curve HeatPumpAirToWaterCoolingSpeedData::coolingEnergyInputRatioFunctionofTemperatureCurve() const {
360
1/1
✓ Branch 3 taken 35 times.
35 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->coolingEnergyInputRatioFunctionofTemperatureCurve();
361 }
362
363 35 Curve HeatPumpAirToWaterCoolingSpeedData::coolingEnergyInputRatioFunctionofPLRCurve() const {
364
1/1
✓ Branch 3 taken 35 times.
35 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->coolingEnergyInputRatioFunctionofPLRCurve();
365 }
366
367 18 bool HeatPumpAirToWaterCoolingSpeedData::setRatedCoolingCapacity(double ratedCoolingCapacity) {
368
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->setRatedCoolingCapacity(ratedCoolingCapacity);
369 }
370
371 56 void HeatPumpAirToWaterCoolingSpeedData::autosizeRatedCoolingCapacity() {
372
1/1
✓ Branch 3 taken 56 times.
56 getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->autosizeRatedCoolingCapacity();
373 56 }
374
375 74 bool HeatPumpAirToWaterCoolingSpeedData::setRatedCOPforCooling(double ratedCOPforCooling) {
376
1/1
✓ Branch 3 taken 74 times.
74 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->setRatedCOPforCooling(ratedCOPforCooling);
377 }
378
379 60 bool HeatPumpAirToWaterCoolingSpeedData::setNormalizedCoolingCapacityFunctionofTemperatureCurve(const Curve& bivariateFunctions) {
380
1/1
✓ Branch 3 taken 60 times.
60 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->setNormalizedCoolingCapacityFunctionofTemperatureCurve(bivariateFunctions);
381 }
382
383 59 bool HeatPumpAirToWaterCoolingSpeedData::setCoolingEnergyInputRatioFunctionofTemperatureCurve(const Curve& bivariateFunctions) {
384
1/1
✓ Branch 3 taken 59 times.
59 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->setCoolingEnergyInputRatioFunctionofTemperatureCurve(bivariateFunctions);
385 }
386
387 57 bool HeatPumpAirToWaterCoolingSpeedData::setCoolingEnergyInputRatioFunctionofPLRCurve(const Curve& univariateFunctions) {
388
1/1
✓ Branch 3 taken 57 times.
57 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->setCoolingEnergyInputRatioFunctionofPLRCurve(univariateFunctions);
389 }
390
391 /// @cond
392 582 HeatPumpAirToWaterCoolingSpeedData::HeatPumpAirToWaterCoolingSpeedData(std::shared_ptr<detail::HeatPumpAirToWaterCoolingSpeedData_Impl> impl)
393
1/1
✓ Branch 3 taken 582 times.
582 : ResourceObject(std::move(impl)) {}
394 /// @endcond
395
396 ✗ void HeatPumpAirToWaterCoolingSpeedData::autosize() {
397 ✗ getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->autosize();
398 ✗ }
399
400 // TODO: needed?
401 // void HeatPumpAirToWaterCoolingSpeedData::applySizingValues() {
402 // getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->applySizingValues();
403 // }
404
405 11 std::vector<HeatPumpAirToWaterCooling> HeatPumpAirToWaterCoolingSpeedData::heatPumpAirToWaterCoolings() const {
406
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::HeatPumpAirToWaterCoolingSpeedData_Impl>()->heatPumpAirToWaterCoolings();
407 }
408
409 } // namespace model
410 } // namespace openstudio
411