GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 40.7% 155 / 0 / 381
Functions: 39.5% 47 / 0 / 119
Branches: 25.0% 76 / 0 / 304

src/model/HeaderedPumpsVariableSpeed.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 "HeaderedPumpsVariableSpeed.hpp"
7 #include "HeaderedPumpsVariableSpeed_Impl.hpp"
8 #include "Schedule.hpp"
9 #include "Schedule_Impl.hpp"
10 #include "ThermalZone.hpp"
11 #include "ThermalZone_Impl.hpp"
12 #include "Node.hpp"
13 #include "Node_Impl.hpp"
14 #include "PlantLoop.hpp"
15 #include "PlantLoop_Impl.hpp"
16 #include "ScheduleTypeLimits.hpp"
17 #include "ScheduleTypeRegistry.hpp"
18 #include <utilities/idd/IddFactory.hxx>
19 #include <utilities/idd/OS_HeaderedPumps_VariableSpeed_FieldEnums.hxx>
20 #include "../utilities/core/Assert.hpp"
21 #include "../utilities/data/DataEnums.hpp"
22 #include "../utilities/data/DataEnums.hpp"
23
24 namespace openstudio {
25 namespace model {
26
27 namespace detail {
28
29 2 HeaderedPumpsVariableSpeed_Impl::HeaderedPumpsVariableSpeed_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
30 2 : StraightComponent_Impl(idfObject, model, keepHandle) {
31
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(idfObject.iddObject().type() == HeaderedPumpsVariableSpeed::iddObjectType());
32 2 }
33
34 ✗ HeaderedPumpsVariableSpeed_Impl::HeaderedPumpsVariableSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
35 ✗ bool keepHandle)
36 ✗ : StraightComponent_Impl(other, model, keepHandle) {
37 ✗ OS_ASSERT(other.iddObject().type() == HeaderedPumpsVariableSpeed::iddObjectType());
38 ✗ }
39
40 ✗ HeaderedPumpsVariableSpeed_Impl::HeaderedPumpsVariableSpeed_Impl(const HeaderedPumpsVariableSpeed_Impl& other, Model_Impl* model, bool keepHandle)
41 ✗ : StraightComponent_Impl(other, model, keepHandle) {}
42
43 ✗ const std::vector<std::string>& HeaderedPumpsVariableSpeed_Impl::outputVariableNames() const {
44 static const std::vector<std::string> result{
45 "Pump Electricity Rate", "Pump Electricity Energy", "Pump Shaft Power", "Pump Fluid Heat Gain Rate", "Pump Fluid Heat Gain Energy",
46 "Pump Outlet Temperature", "Pump Mass Flow Rate", "Number of pumps operating",
47
48 // The Key is the Pump, not the zone, so it's right to report here
49 // EnergyPlus/Pumps.cc::GetPumpInput()
50 // TODO: Implement this check and make not static above once ModelObject return type has changed
51 //if (! p.zone().empty() ) {
52 "Pump Zone Total Heating Rate", "Pump Zone Total Heating Energy", "Pump Zone Convective Heating Rate", "Pump Zone Radiative Heating Rate"
53 // }
54 ✗ };
55 ✗ return result;
56 ✗ }
57
58 ✗ IddObjectType HeaderedPumpsVariableSpeed_Impl::iddObjectType() const {
59 ✗ return HeaderedPumpsVariableSpeed::iddObjectType();
60 }
61
62 ✗ std::vector<ScheduleTypeKey> HeaderedPumpsVariableSpeed_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
63 ✗ std::vector<ScheduleTypeKey> result;
64 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
65 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
66 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
67 ✗ if (std::find(b, e, OS_HeaderedPumps_VariableSpeedFields::PumpFlowRateSchedule) != e) {
68 ✗ result.push_back(ScheduleTypeKey("HeaderedPumpsVariableSpeed", "Pump Flow Rate Schedule"));
69 }
70 ✗ return result;
71 ✗ }
72
73 ✗ boost::optional<double> HeaderedPumpsVariableSpeed_Impl::totalRatedFlowRate() const {
74 ✗ return getDouble(OS_HeaderedPumps_VariableSpeedFields::TotalRatedFlowRate, true);
75 }
76
77 ✗ bool HeaderedPumpsVariableSpeed_Impl::isTotalRatedFlowRateAutosized() const {
78 ✗ bool result = false;
79 ✗ boost::optional<std::string> value = getString(OS_HeaderedPumps_VariableSpeedFields::TotalRatedFlowRate, true);
80 ✗ if (value) {
81 ✗ result = openstudio::istringEqual(value.get(), "autosize");
82 }
83 ✗ return result;
84 ✗ }
85
86 ✗ int HeaderedPumpsVariableSpeed_Impl::numberofPumpsinBank() const {
87 ✗ boost::optional<int> value = getInt(OS_HeaderedPumps_VariableSpeedFields::NumberofPumpsinBank, true);
88 ✗ OS_ASSERT(value);
89 ✗ return value.get();
90 }
91
92 ✗ std::string HeaderedPumpsVariableSpeed_Impl::flowSequencingControlScheme() const {
93 ✗ boost::optional<std::string> value = getString(OS_HeaderedPumps_VariableSpeedFields::FlowSequencingControlScheme, true);
94 ✗ OS_ASSERT(value);
95 ✗ return value.get();
96 ✗ }
97
98 ✗ double HeaderedPumpsVariableSpeed_Impl::ratedPumpHead() const {
99 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::RatedPumpHead, true);
100 ✗ OS_ASSERT(value);
101 ✗ return value.get();
102 }
103
104 ✗ boost::optional<double> HeaderedPumpsVariableSpeed_Impl::ratedPowerConsumption() const {
105 ✗ return getDouble(OS_HeaderedPumps_VariableSpeedFields::RatedPowerConsumption, true);
106 }
107
108 ✗ bool HeaderedPumpsVariableSpeed_Impl::isRatedPowerConsumptionAutosized() const {
109 ✗ bool result = false;
110 ✗ boost::optional<std::string> value = getString(OS_HeaderedPumps_VariableSpeedFields::RatedPowerConsumption, true);
111 ✗ if (value) {
112 ✗ result = openstudio::istringEqual(value.get(), "autosize");
113 }
114 ✗ return result;
115 ✗ }
116
117 ✗ double HeaderedPumpsVariableSpeed_Impl::motorEfficiency() const {
118 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::MotorEfficiency, true);
119 ✗ OS_ASSERT(value);
120 ✗ return value.get();
121 }
122
123 ✗ double HeaderedPumpsVariableSpeed_Impl::fractionofMotorInefficienciestoFluidStream() const {
124 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::FractionofMotorInefficienciestoFluidStream, true);
125 ✗ OS_ASSERT(value);
126 ✗ return value.get();
127 }
128
129 ✗ double HeaderedPumpsVariableSpeed_Impl::coefficient1ofthePartLoadPerformanceCurve() const {
130 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient1ofthePartLoadPerformanceCurve, true);
131 ✗ OS_ASSERT(value);
132 ✗ return value.get();
133 }
134
135 ✗ double HeaderedPumpsVariableSpeed_Impl::coefficient2ofthePartLoadPerformanceCurve() const {
136 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient2ofthePartLoadPerformanceCurve, true);
137 ✗ OS_ASSERT(value);
138 ✗ return value.get();
139 }
140
141 ✗ double HeaderedPumpsVariableSpeed_Impl::coefficient3ofthePartLoadPerformanceCurve() const {
142 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient3ofthePartLoadPerformanceCurve, true);
143 ✗ OS_ASSERT(value);
144 ✗ return value.get();
145 }
146
147 ✗ double HeaderedPumpsVariableSpeed_Impl::coefficient4ofthePartLoadPerformanceCurve() const {
148 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient4ofthePartLoadPerformanceCurve, true);
149 ✗ OS_ASSERT(value);
150 ✗ return value.get();
151 }
152
153 ✗ double HeaderedPumpsVariableSpeed_Impl::minimumFlowRateFraction() const {
154 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::MinimumFlowRateFraction, true);
155 ✗ OS_ASSERT(value);
156 ✗ return value.get();
157 }
158
159 ✗ std::string HeaderedPumpsVariableSpeed_Impl::pumpControlType() const {
160 ✗ boost::optional<std::string> value = getString(OS_HeaderedPumps_VariableSpeedFields::PumpControlType, true);
161 ✗ OS_ASSERT(value);
162 ✗ return value.get();
163 ✗ }
164
165 ✗ boost::optional<Schedule> HeaderedPumpsVariableSpeed_Impl::pumpFlowRateSchedule() const {
166 ✗ return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_HeaderedPumps_VariableSpeedFields::PumpFlowRateSchedule);
167 }
168
169 ✗ boost::optional<ThermalZone> HeaderedPumpsVariableSpeed_Impl::thermalZone() const {
170 ✗ return getObject<ModelObject>().getModelObjectTarget<ThermalZone>(OS_HeaderedPumps_VariableSpeedFields::ThermalZone);
171 }
172
173 ✗ double HeaderedPumpsVariableSpeed_Impl::skinLossRadiativeFraction() const {
174 ✗ boost::optional<double> value = getDouble(OS_HeaderedPumps_VariableSpeedFields::SkinLossRadiativeFraction, true);
175 ✗ OS_ASSERT(value);
176 ✗ return value.get();
177 }
178
179 ✗ bool HeaderedPumpsVariableSpeed_Impl::setTotalRatedFlowRate(boost::optional<double> totalRatedFlowRate) {
180 ✗ bool result(false);
181 ✗ if (totalRatedFlowRate) {
182 ✗ result = setDouble(OS_HeaderedPumps_VariableSpeedFields::TotalRatedFlowRate, totalRatedFlowRate.get());
183 }
184 ✗ return result;
185 }
186
187 2 void HeaderedPumpsVariableSpeed_Impl::autosizeTotalRatedFlowRate() {
188
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_HeaderedPumps_VariableSpeedFields::TotalRatedFlowRate, "autosize");
189
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
190 2 }
191
192 2 bool HeaderedPumpsVariableSpeed_Impl::setNumberofPumpsinBank(int numberofPumpsinBank) {
193 2 bool result = setInt(OS_HeaderedPumps_VariableSpeedFields::NumberofPumpsinBank, numberofPumpsinBank);
194
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
195 2 return result;
196 }
197
198 2 bool HeaderedPumpsVariableSpeed_Impl::setFlowSequencingControlScheme(const std::string& flowSequencingControlScheme) {
199 2 bool result = setString(OS_HeaderedPumps_VariableSpeedFields::FlowSequencingControlScheme, flowSequencingControlScheme);
200 2 return result;
201 }
202
203 2 bool HeaderedPumpsVariableSpeed_Impl::setRatedPumpHead(double ratedPumpHead) {
204 2 bool result = setDouble(OS_HeaderedPumps_VariableSpeedFields::RatedPumpHead, ratedPumpHead);
205
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
206 2 return result;
207 }
208
209 ✗ bool HeaderedPumpsVariableSpeed_Impl::setRatedPowerConsumption(boost::optional<double> ratedPowerConsumption) {
210 ✗ bool result(false);
211 ✗ if (ratedPowerConsumption) {
212 ✗ result = setDouble(OS_HeaderedPumps_VariableSpeedFields::RatedPowerConsumption, ratedPowerConsumption.get());
213 }
214 ✗ OS_ASSERT(result);
215 ✗ return result;
216 }
217
218 2 void HeaderedPumpsVariableSpeed_Impl::autosizeRatedPowerConsumption() {
219
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_HeaderedPumps_VariableSpeedFields::RatedPowerConsumption, "autosize");
220
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
221 2 }
222
223 2 bool HeaderedPumpsVariableSpeed_Impl::setMotorEfficiency(double motorEfficiency) {
224 2 bool result = setDouble(OS_HeaderedPumps_VariableSpeedFields::MotorEfficiency, motorEfficiency);
225 2 return result;
226 }
227
228 2 bool HeaderedPumpsVariableSpeed_Impl::setFractionofMotorInefficienciestoFluidStream(double fractionofMotorInefficienciestoFluidStream) {
229 bool result =
230 2 setDouble(OS_HeaderedPumps_VariableSpeedFields::FractionofMotorInefficienciestoFluidStream, fractionofMotorInefficienciestoFluidStream);
231 2 return result;
232 }
233
234 2 bool HeaderedPumpsVariableSpeed_Impl::setCoefficient1ofthePartLoadPerformanceCurve(double coefficient1ofthePartLoadPerformanceCurve) {
235 bool result =
236 2 setDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient1ofthePartLoadPerformanceCurve, coefficient1ofthePartLoadPerformanceCurve);
237
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
238 2 return result;
239 }
240
241 2 bool HeaderedPumpsVariableSpeed_Impl::setCoefficient2ofthePartLoadPerformanceCurve(double coefficient2ofthePartLoadPerformanceCurve) {
242 bool result =
243 2 setDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient2ofthePartLoadPerformanceCurve, coefficient2ofthePartLoadPerformanceCurve);
244
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
245 2 return result;
246 }
247
248 2 bool HeaderedPumpsVariableSpeed_Impl::setCoefficient3ofthePartLoadPerformanceCurve(double coefficient3ofthePartLoadPerformanceCurve) {
249 bool result =
250 2 setDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient3ofthePartLoadPerformanceCurve, coefficient3ofthePartLoadPerformanceCurve);
251
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
252 2 return result;
253 }
254
255 2 bool HeaderedPumpsVariableSpeed_Impl::setCoefficient4ofthePartLoadPerformanceCurve(double coefficient4ofthePartLoadPerformanceCurve) {
256 bool result =
257 2 setDouble(OS_HeaderedPumps_VariableSpeedFields::Coefficient4ofthePartLoadPerformanceCurve, coefficient4ofthePartLoadPerformanceCurve);
258
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
259 2 return result;
260 }
261
262 2 bool HeaderedPumpsVariableSpeed_Impl::setMinimumFlowRateFraction(double minimumFlowRateFraction) {
263 2 bool result = setDouble(OS_HeaderedPumps_VariableSpeedFields::MinimumFlowRateFraction, minimumFlowRateFraction);
264 2 return result;
265 }
266
267 2 bool HeaderedPumpsVariableSpeed_Impl::setPumpControlType(const std::string& pumpControlType) {
268 2 bool result = setString(OS_HeaderedPumps_VariableSpeedFields::PumpControlType, pumpControlType);
269 2 return result;
270 }
271
272 ✗ bool HeaderedPumpsVariableSpeed_Impl::setPumpFlowRateSchedule(Schedule& schedule) {
273 bool result =
274 ✗ setSchedule(OS_HeaderedPumps_VariableSpeedFields::PumpFlowRateSchedule, "HeaderedPumpsVariableSpeed", "Pump Flow Rate Schedule", schedule);
275 ✗ return result;
276 }
277
278 ✗ void HeaderedPumpsVariableSpeed_Impl::resetPumpFlowRateSchedule() {
279 ✗ bool result = setString(OS_HeaderedPumps_VariableSpeedFields::PumpFlowRateSchedule, "");
280 ✗ OS_ASSERT(result);
281 ✗ }
282
283 ✗ bool HeaderedPumpsVariableSpeed_Impl::setThermalZone(const boost::optional<ThermalZone>& thermalZone) {
284 ✗ bool result(false);
285 ✗ if (thermalZone) {
286 ✗ result = setPointer(OS_HeaderedPumps_VariableSpeedFields::ThermalZone, thermalZone.get().handle());
287 } else {
288 ✗ resetThermalZone();
289 ✗ result = true;
290 }
291 ✗ return result;
292 }
293
294 ✗ void HeaderedPumpsVariableSpeed_Impl::resetThermalZone() {
295 ✗ bool result = setString(OS_HeaderedPumps_VariableSpeedFields::ThermalZone, "");
296 ✗ OS_ASSERT(result);
297 ✗ }
298
299 2 bool HeaderedPumpsVariableSpeed_Impl::setSkinLossRadiativeFraction(double skinLossRadiativeFraction) {
300 2 bool result = setDouble(OS_HeaderedPumps_VariableSpeedFields::SkinLossRadiativeFraction, skinLossRadiativeFraction);
301 2 return result;
302 }
303
304 ✗ unsigned HeaderedPumpsVariableSpeed_Impl::inletPort() const {
305 ✗ return OS_HeaderedPumps_VariableSpeedFields::InletNodeName;
306 }
307
308 ✗ unsigned HeaderedPumpsVariableSpeed_Impl::outletPort() const {
309 ✗ return OS_HeaderedPumps_VariableSpeedFields::OutletNodeName;
310 }
311
312 ✗ bool HeaderedPumpsVariableSpeed_Impl::addToNode(Node& node) {
313 ✗ if (node.plantLoop()) {
314 ✗ return StraightComponent_Impl::addToNode(node);
315 }
316
317 ✗ return false;
318 }
319
320 ✗ boost::optional<double> HeaderedPumpsVariableSpeed_Impl::autosizedTotalRatedFlowRate() const {
321 ✗ return getAutosizedValue("Design Flow Rate", "m3/s");
322 }
323
324 ✗ boost::optional<double> HeaderedPumpsVariableSpeed_Impl::autosizedRatedPowerConsumption() const {
325 ✗ return getAutosizedValue("Design Power Consumption", "W");
326 }
327
328 ✗ void HeaderedPumpsVariableSpeed_Impl::autosize() {
329 ✗ autosizeTotalRatedFlowRate();
330 ✗ autosizeRatedPowerConsumption();
331 ✗ }
332
333 ✗ void HeaderedPumpsVariableSpeed_Impl::applySizingValues() {
334 ✗ boost::optional<double> val;
335 ✗ val = autosizedTotalRatedFlowRate();
336 ✗ if (val) {
337 ✗ setTotalRatedFlowRate(val.get());
338 }
339
340 ✗ val = autosizedRatedPowerConsumption();
341 ✗ if (val) {
342 ✗ setRatedPowerConsumption(val.get());
343 }
344 ✗ }
345
346 ✗ std::vector<EMSActuatorNames> HeaderedPumpsVariableSpeed_Impl::emsActuatorNames() const {
347 ✗ std::vector<EMSActuatorNames> actuators{{"Pump", "Pump Mass Flow Rate"}, {"Pump", "Pump Pressure Rise"}};
348 ✗ return actuators;
349 ✗ }
350
351 ✗ std::vector<std::string> HeaderedPumpsVariableSpeed_Impl::emsInternalVariableNames() const {
352 ✗ std::vector<std::string> types{"Pump Maximum Mass Flow Rate"};
353 ✗ return types;
354 ✗ }
355
356 3 std::string HeaderedPumpsVariableSpeed_Impl::designPowerSizingMethod() const {
357
1/1
✓ Branch 1 taken 3 times.
3 auto value = getString(OS_HeaderedPumps_VariableSpeedFields::DesignPowerSizingMethod, true);
358
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(value);
359
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 return value.get();
360 3 }
361
362 4 bool HeaderedPumpsVariableSpeed_Impl::setDesignPowerSizingMethod(const std::string& designPowerSizingMethod) {
363 4 return setString(OS_HeaderedPumps_VariableSpeedFields::DesignPowerSizingMethod, designPowerSizingMethod);
364 }
365
366 2 double HeaderedPumpsVariableSpeed_Impl::designElectricPowerPerUnitFlowRate() const {
367
1/1
✓ Branch 1 taken 2 times.
2 auto value = getDouble(OS_HeaderedPumps_VariableSpeedFields::DesignElectricPowerperUnitFlowRate, true);
368
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
369
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
370 }
371
372 3 bool HeaderedPumpsVariableSpeed_Impl::setDesignElectricPowerPerUnitFlowRate(double designElectricPowerPerUnitFlowRate) {
373 3 return setDouble(OS_HeaderedPumps_VariableSpeedFields::DesignElectricPowerperUnitFlowRate, designElectricPowerPerUnitFlowRate);
374 }
375
376 2 double HeaderedPumpsVariableSpeed_Impl::designShaftPowerPerUnitFlowRatePerUnitHead() const {
377
1/1
✓ Branch 1 taken 2 times.
2 auto value = getDouble(OS_HeaderedPumps_VariableSpeedFields::DesignShaftPowerperUnitFlowRateperUnitHead, true);
378
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
379
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
380 }
381
382 3 bool HeaderedPumpsVariableSpeed_Impl::setDesignShaftPowerPerUnitFlowRatePerUnitHead(double designShaftPowerPerUnitFlowRatePerUnitHead) {
383 3 return setDouble(OS_HeaderedPumps_VariableSpeedFields::DesignShaftPowerperUnitFlowRateperUnitHead, designShaftPowerPerUnitFlowRatePerUnitHead);
384 }
385
386 2 std::string HeaderedPumpsVariableSpeed_Impl::endUseSubcategory() const {
387
1/1
✓ Branch 1 taken 2 times.
2 auto value = getString(OS_HeaderedPumps_VariableSpeedFields::EndUseSubcategory, true);
388
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
389
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 return value.get();
390 2 }
391
392 3 bool HeaderedPumpsVariableSpeed_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) {
393 3 return setString(OS_HeaderedPumps_VariableSpeedFields::EndUseSubcategory, endUseSubcategory);
394 }
395
396 ✗ ComponentType HeaderedPumpsVariableSpeed_Impl::componentType() const {
397 ✗ return ComponentType::None;
398 }
399
400 ✗ std::vector<FuelType> HeaderedPumpsVariableSpeed_Impl::coolingFuelTypes() const {
401 ✗ return {};
402 }
403
404 ✗ std::vector<FuelType> HeaderedPumpsVariableSpeed_Impl::heatingFuelTypes() const {
405 ✗ return {};
406 }
407
408 ✗ std::vector<AppGFuelType> HeaderedPumpsVariableSpeed_Impl::appGHeatingFuelTypes() const {
409 ✗ return {};
410 }
411
412 } // namespace detail
413
414 2 HeaderedPumpsVariableSpeed::HeaderedPumpsVariableSpeed(const Model& model) : StraightComponent(HeaderedPumpsVariableSpeed::iddObjectType(), model) {
415
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
2 OS_ASSERT(getImpl<detail::HeaderedPumpsVariableSpeed_Impl>());
416
417
1/1
✓ Branch 1 taken 2 times.
2 autosizeTotalRatedFlowRate();
418
1/1
✓ Branch 1 taken 2 times.
2 setNumberofPumpsinBank(2);
419
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 setFlowSequencingControlScheme("Sequential");
420
1/1
✓ Branch 1 taken 2 times.
2 setRatedPumpHead(179352);
421
1/1
✓ Branch 1 taken 2 times.
2 autosizeRatedPowerConsumption();
422
1/1
✓ Branch 1 taken 2 times.
2 setMotorEfficiency(0.9);
423
1/1
✓ Branch 1 taken 2 times.
2 setFractionofMotorInefficienciestoFluidStream(0.0);
424
1/1
✓ Branch 1 taken 2 times.
2 setCoefficient1ofthePartLoadPerformanceCurve(0.0);
425
1/1
✓ Branch 1 taken 2 times.
2 setCoefficient2ofthePartLoadPerformanceCurve(1.0);
426
1/1
✓ Branch 1 taken 2 times.
2 setCoefficient3ofthePartLoadPerformanceCurve(0.0);
427
1/1
✓ Branch 1 taken 2 times.
2 setCoefficient4ofthePartLoadPerformanceCurve(0.0);
428
1/1
✓ Branch 1 taken 2 times.
2 setMinimumFlowRateFraction(0.0);
429
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 setPumpControlType("Continuous");
430
1/1
✓ Branch 1 taken 2 times.
2 setSkinLossRadiativeFraction(0.1);
431
432
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 setDesignPowerSizingMethod("PowerPerFlowPerPressure");
433
1/1
✓ Branch 1 taken 2 times.
2 setDesignElectricPowerPerUnitFlowRate(348701.1);
434
1/1
✓ Branch 1 taken 2 times.
2 setDesignShaftPowerPerUnitFlowRatePerUnitHead(1.282051282);
435
436
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 setEndUseSubcategory("General");
437 2 }
438
439 7732 IddObjectType HeaderedPumpsVariableSpeed::iddObjectType() {
440
1/1
✓ Branch 1 taken 7732 times.
7732 return {IddObjectType::OS_HeaderedPumps_VariableSpeed};
441 }
442
443 ✗ std::vector<std::string> HeaderedPumpsVariableSpeed::flowSequencingControlSchemeValues() {
444 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeaderedPumps_VariableSpeedFields::FlowSequencingControlScheme);
445 }
446
447 ✗ std::vector<std::string> HeaderedPumpsVariableSpeed::pumpControlTypeValues() {
448 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeaderedPumps_VariableSpeedFields::PumpControlType);
449 }
450
451 ✗ std::vector<std::string> HeaderedPumpsVariableSpeed::designPowerSizingMethodValues() {
452 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeaderedPumps_VariableSpeedFields::DesignPowerSizingMethod);
453 }
454
455 ✗ boost::optional<double> HeaderedPumpsVariableSpeed::totalRatedFlowRate() const {
456 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->totalRatedFlowRate();
457 }
458
459 ✗ bool HeaderedPumpsVariableSpeed::isTotalRatedFlowRateAutosized() const {
460 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->isTotalRatedFlowRateAutosized();
461 }
462
463 ✗ int HeaderedPumpsVariableSpeed::numberofPumpsinBank() const {
464 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->numberofPumpsinBank();
465 }
466
467 ✗ std::string HeaderedPumpsVariableSpeed::flowSequencingControlScheme() const {
468 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->flowSequencingControlScheme();
469 }
470
471 ✗ double HeaderedPumpsVariableSpeed::ratedPumpHead() const {
472 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->ratedPumpHead();
473 }
474
475 ✗ boost::optional<double> HeaderedPumpsVariableSpeed::ratedPowerConsumption() const {
476 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->ratedPowerConsumption();
477 }
478
479 ✗ bool HeaderedPumpsVariableSpeed::isRatedPowerConsumptionAutosized() const {
480 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->isRatedPowerConsumptionAutosized();
481 }
482
483 ✗ double HeaderedPumpsVariableSpeed::motorEfficiency() const {
484 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->motorEfficiency();
485 }
486
487 ✗ double HeaderedPumpsVariableSpeed::fractionofMotorInefficienciestoFluidStream() const {
488 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->fractionofMotorInefficienciestoFluidStream();
489 }
490
491 ✗ double HeaderedPumpsVariableSpeed::coefficient1ofthePartLoadPerformanceCurve() const {
492 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->coefficient1ofthePartLoadPerformanceCurve();
493 }
494
495 ✗ double HeaderedPumpsVariableSpeed::coefficient2ofthePartLoadPerformanceCurve() const {
496 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->coefficient2ofthePartLoadPerformanceCurve();
497 }
498
499 ✗ double HeaderedPumpsVariableSpeed::coefficient3ofthePartLoadPerformanceCurve() const {
500 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->coefficient3ofthePartLoadPerformanceCurve();
501 }
502
503 ✗ double HeaderedPumpsVariableSpeed::coefficient4ofthePartLoadPerformanceCurve() const {
504 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->coefficient4ofthePartLoadPerformanceCurve();
505 }
506
507 ✗ double HeaderedPumpsVariableSpeed::minimumFlowRateFraction() const {
508 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->minimumFlowRateFraction();
509 }
510
511 ✗ std::string HeaderedPumpsVariableSpeed::pumpControlType() const {
512 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->pumpControlType();
513 }
514
515 ✗ boost::optional<Schedule> HeaderedPumpsVariableSpeed::pumpFlowRateSchedule() const {
516 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->pumpFlowRateSchedule();
517 }
518
519 ✗ boost::optional<ThermalZone> HeaderedPumpsVariableSpeed::thermalZone() const {
520 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->thermalZone();
521 }
522
523 ✗ double HeaderedPumpsVariableSpeed::skinLossRadiativeFraction() const {
524 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->skinLossRadiativeFraction();
525 }
526
527 ✗ bool HeaderedPumpsVariableSpeed::setTotalRatedFlowRate(double totalRatedFlowRate) {
528 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setTotalRatedFlowRate(totalRatedFlowRate);
529 }
530
531 2 void HeaderedPumpsVariableSpeed::autosizeTotalRatedFlowRate() {
532
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->autosizeTotalRatedFlowRate();
533 2 }
534
535 2 bool HeaderedPumpsVariableSpeed::setNumberofPumpsinBank(int numberofPumpsinBank) {
536
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setNumberofPumpsinBank(numberofPumpsinBank);
537 }
538
539 2 bool HeaderedPumpsVariableSpeed::setFlowSequencingControlScheme(const std::string& flowSequencingControlScheme) {
540
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setFlowSequencingControlScheme(flowSequencingControlScheme);
541 }
542
543 2 bool HeaderedPumpsVariableSpeed::setRatedPumpHead(double ratedPumpHead) {
544
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setRatedPumpHead(ratedPumpHead);
545 }
546
547 ✗ bool HeaderedPumpsVariableSpeed::setRatedPowerConsumption(double ratedPowerConsumption) {
548 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setRatedPowerConsumption(ratedPowerConsumption);
549 }
550
551 2 void HeaderedPumpsVariableSpeed::autosizeRatedPowerConsumption() {
552
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->autosizeRatedPowerConsumption();
553 2 }
554
555 2 bool HeaderedPumpsVariableSpeed::setMotorEfficiency(double motorEfficiency) {
556
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setMotorEfficiency(motorEfficiency);
557 }
558
559 2 bool HeaderedPumpsVariableSpeed::setFractionofMotorInefficienciestoFluidStream(double fractionofMotorInefficienciestoFluidStream) {
560
1/1
✓ Branch 3 taken 2 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setFractionofMotorInefficienciestoFluidStream(
561 4 fractionofMotorInefficienciestoFluidStream);
562 }
563
564 2 bool HeaderedPumpsVariableSpeed::setCoefficient1ofthePartLoadPerformanceCurve(double coefficient1ofthePartLoadPerformanceCurve) {
565
1/1
✓ Branch 3 taken 2 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setCoefficient1ofthePartLoadPerformanceCurve(
566 4 coefficient1ofthePartLoadPerformanceCurve);
567 }
568
569 2 bool HeaderedPumpsVariableSpeed::setCoefficient2ofthePartLoadPerformanceCurve(double coefficient2ofthePartLoadPerformanceCurve) {
570
1/1
✓ Branch 3 taken 2 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setCoefficient2ofthePartLoadPerformanceCurve(
571 4 coefficient2ofthePartLoadPerformanceCurve);
572 }
573
574 2 bool HeaderedPumpsVariableSpeed::setCoefficient3ofthePartLoadPerformanceCurve(double coefficient3ofthePartLoadPerformanceCurve) {
575
1/1
✓ Branch 3 taken 2 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setCoefficient3ofthePartLoadPerformanceCurve(
576 4 coefficient3ofthePartLoadPerformanceCurve);
577 }
578
579 2 bool HeaderedPumpsVariableSpeed::setCoefficient4ofthePartLoadPerformanceCurve(double coefficient4ofthePartLoadPerformanceCurve) {
580
1/1
✓ Branch 3 taken 2 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setCoefficient4ofthePartLoadPerformanceCurve(
581 4 coefficient4ofthePartLoadPerformanceCurve);
582 }
583
584 2 bool HeaderedPumpsVariableSpeed::setMinimumFlowRateFraction(double minimumFlowRateFraction) {
585
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setMinimumFlowRateFraction(minimumFlowRateFraction);
586 }
587
588 2 bool HeaderedPumpsVariableSpeed::setPumpControlType(const std::string& pumpControlType) {
589
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setPumpControlType(pumpControlType);
590 }
591
592 ✗ bool HeaderedPumpsVariableSpeed::setPumpFlowRateSchedule(Schedule& schedule) {
593 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setPumpFlowRateSchedule(schedule);
594 }
595
596 ✗ void HeaderedPumpsVariableSpeed::resetPumpFlowRateSchedule() {
597 ✗ getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->resetPumpFlowRateSchedule();
598 ✗ }
599
600 ✗ bool HeaderedPumpsVariableSpeed::setThermalZone(const ThermalZone& thermalZone) {
601 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setThermalZone(thermalZone);
602 }
603
604 ✗ void HeaderedPumpsVariableSpeed::resetThermalZone() {
605 ✗ getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->resetThermalZone();
606 ✗ }
607
608 2 bool HeaderedPumpsVariableSpeed::setSkinLossRadiativeFraction(double skinLossRadiativeFraction) {
609
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setSkinLossRadiativeFraction(skinLossRadiativeFraction);
610 }
611
612 3 std::string HeaderedPumpsVariableSpeed::designPowerSizingMethod() const {
613
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->designPowerSizingMethod();
614 }
615
616 4 bool HeaderedPumpsVariableSpeed::setDesignPowerSizingMethod(const std::string& designPowerSizingMethod) {
617
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setDesignPowerSizingMethod(designPowerSizingMethod);
618 }
619
620 2 double HeaderedPumpsVariableSpeed::designElectricPowerPerUnitFlowRate() const {
621
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->designElectricPowerPerUnitFlowRate();
622 }
623
624 3 bool HeaderedPumpsVariableSpeed::setDesignElectricPowerPerUnitFlowRate(double designElectricPowerPerUnitFlowRate) {
625
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setDesignElectricPowerPerUnitFlowRate(designElectricPowerPerUnitFlowRate);
626 }
627
628 2 double HeaderedPumpsVariableSpeed::designShaftPowerPerUnitFlowRatePerUnitHead() const {
629
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->designShaftPowerPerUnitFlowRatePerUnitHead();
630 }
631
632 3 bool HeaderedPumpsVariableSpeed::setDesignShaftPowerPerUnitFlowRatePerUnitHead(double designShaftPowerPerUnitFlowRatePerUnitHead) {
633
1/1
✓ Branch 3 taken 3 times.
6 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setDesignShaftPowerPerUnitFlowRatePerUnitHead(
634 6 designShaftPowerPerUnitFlowRatePerUnitHead);
635 }
636
637 2 std::string HeaderedPumpsVariableSpeed::endUseSubcategory() const {
638
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->endUseSubcategory();
639 }
640
641 3 bool HeaderedPumpsVariableSpeed::setEndUseSubcategory(const std::string& endUseSubcategory) {
642
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->setEndUseSubcategory(endUseSubcategory);
643 }
644
645 /// @cond
646 ✗ HeaderedPumpsVariableSpeed::HeaderedPumpsVariableSpeed(std::shared_ptr<detail::HeaderedPumpsVariableSpeed_Impl> impl)
647 ✗ : StraightComponent(std::move(impl)) {}
648 /// @endcond
649
650 ✗ boost::optional<double> HeaderedPumpsVariableSpeed::autosizedTotalRatedFlowRate() const {
651 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->autosizedTotalRatedFlowRate();
652 }
653
654 ✗ boost::optional<double> HeaderedPumpsVariableSpeed::autosizedRatedPowerConsumption() const {
655 ✗ return getImpl<detail::HeaderedPumpsVariableSpeed_Impl>()->autosizedRatedPowerConsumption();
656 }
657
658 } // namespace model
659 } // namespace openstudio
660