GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 77.0% 997 / 0 / 1294
Functions: 79.2% 289 / 0 / 365
Branches: 53.2% 692 / 0 / 1300

src/model/WaterHeaterStratified.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 "WaterHeaterStratified.hpp"
7 #include "WaterHeaterStratified_Impl.hpp"
8 #include "WaterHeaterHeatPump.hpp"
9 #include "WaterHeaterHeatPump_Impl.hpp"
10 #include "WaterHeaterHeatPumpWrappedCondenser.hpp"
11 #include "WaterHeaterHeatPumpWrappedCondenser_Impl.hpp"
12 #include "Schedule.hpp"
13 #include "Schedule_Impl.hpp"
14 #include "ThermalZone.hpp"
15 #include "ThermalZone_Impl.hpp"
16 #include "ScheduleTypeLimits.hpp"
17 #include "ScheduleTypeRegistry.hpp"
18 #include "ScheduleDay.hpp"
19 #include "ScheduleDay_Impl.hpp"
20 #include "ScheduleRuleset.hpp"
21 #include "ScheduleRuleset_Impl.hpp"
22 #include "Model.hpp"
23 #include "Model_Impl.hpp"
24 #include "WaterHeaterSizing.hpp"
25 #include "WaterHeaterSizing_Impl.hpp"
26 #include "PlantLoop.hpp"
27 #include "PlantLoop_Impl.hpp"
28 #include "Node.hpp"
29 #include "Node_Impl.hpp"
30
31 #include "../utilities/core/Assert.hpp"
32 #include "../utilities/data/DataEnums.hpp"
33
34 #include <utilities/idd/IddFactory.hxx>
35 #include <utilities/idd/OS_WaterHeater_Stratified_FieldEnums.hxx>
36
37 #include <algorithm>
38
39 namespace openstudio {
40 namespace model {
41
42 namespace detail {
43
44 27 WaterHeaterStratified_Impl::WaterHeaterStratified_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
45 27 : WaterToWaterComponent_Impl(idfObject, model, keepHandle) {
46
4/6
✓ Branch 1 taken 27 times.
✓ Branch 4 taken 27 times.
✓ Branch 7 taken 27 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 27 times.
✗ Branch 13 not taken.
27 OS_ASSERT(idfObject.iddObject().type() == WaterHeaterStratified::iddObjectType());
47 27 }
48
49 3 WaterHeaterStratified_Impl::WaterHeaterStratified_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
50 3 : WaterToWaterComponent_Impl(other, model, keepHandle) {
51
4/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 3 times.
✗ Branch 13 not taken.
3 OS_ASSERT(other.iddObject().type() == WaterHeaterStratified::iddObjectType());
52 3 }
53
54 18 WaterHeaterStratified_Impl::WaterHeaterStratified_Impl(const WaterHeaterStratified_Impl& other, Model_Impl* model, bool keepHandle)
55 18 : WaterToWaterComponent_Impl(other, model, keepHandle) {}
56
57 ✗ const std::vector<std::string>& WaterHeaterStratified_Impl::outputVariableNames() const {
58 ✗ static const std::vector<std::string> result = [] {
59 // initialize with an immediately invoked lambda so that the `result` can be const
60 // and safely thread-safe initialized
61 std::vector<std::string> val{
62 // In common with WaterHeater:Mixed
63 "Water Heater Tank Temperature", "Water Heater Final Tank Temperature", "Water Heater Heat Loss Rate", "Water Heater Heat Loss Energy",
64 "Water Heater Use Side Mass Flow Rate", "Water Heater Use Side Inlet Temperature", "Water Heater Use Side Outlet Temperature",
65 "Water Heater Use Side Heat Transfer Rate", "Water Heater Use Side Heat Transfer Energy", "Water Heater Source Side Mass Flow Rate",
66 "Water Heater Source Side Inlet Temperature", "Water Heater Source Side Outlet Temperature", "Water Heater Source Side Heat Transfer Rate",
67 "Water Heater Source Side Heat Transfer Energy", "Water Heater Off Cycle Parasitic Tank Heat Transfer Rate",
68 "Water Heater Off Cycle Parasitic Tank Heat Transfer Energy", "Water Heater On Cycle Parasitic Tank Heat Transfer Rate",
69 "Water Heater On Cycle Parasitic Tank Heat Transfer Energy", "Water Heater Total Demand Heat Transfer Rate",
70 "Water Heater Total Demand Energy", "Water Heater Heating Rate", "Water Heater Heating Energy",
71 "Water Heater Unmet Demand Heat Transfer Rate", "Water Heater Unmet Demand Heat Transfer Energy", "Water Heater Venting Heat Transfer Rate",
72 "Water Heater Venting Heat Transfer Energy", "Water Heater Net Heat Transfer Rate", "Water Heater Net Heat Transfer Energy",
73 "Water Heater Cycle On Count", "Water Heater Runtime Fraction", "Water Heater Part Load Ratio", "Water Heater Electricity Rate",
74
75 // This should be based on fuel type
76
77 //"Water Heater <Fuel Type> Rate",
78 //"Water Heater <Fuel Type> Energy",
79 // Fuel type specific
80 // TODO: DLM: the return type of this method needs to change to std::vector<std::string> in ModelObject
81 // until then, make this include all possible outputVariableNames for class regardless of fuelType
82 // std::string fuelType = this->fuelType();
83 // if (fuelType == "Electricity") {
84 "Water Heater Electricity Rate", "Water Heater Electricity Energy",
85 // } else if (fuelType == "NaturalGas") {
86 "Water Heater NaturalGas Rate", "Water Heater NaturalGas Energy",
87 // } else if (fuelType == "Propane") {
88 "Water Heater Propane Rate", "Water Heater Propane Energy",
89 // } else if (fuelType == "FuelOilNo1") {
90 "Water Heater FuelOilNo1 Rate", "Water Heater FuelOilNo1 Energy",
91 // } else if (fuelType == "FuelOilNo2") {
92 "Water Heater FuelOilNo2 Rate", "Water Heater FuelOilNo2 Energy",
93 // } else if (fuelType == "Coal") {
94 "Water Heater Coal Rate", "Water Heater Coal Energy",
95 // } else if (fuelType == "Diesel") {
96 "Water Heater Diesel Rate", "Water Heater Diesel Energy",
97 // } else if (fuelType == "Gasoline") {
98 "Water Heater Gasoline Rate", "Water Heater Gasoline Energy",
99 // } else if (fuelType == "OtherFuel1") {
100 "Water Heater OtherFuel1 Rate", "Water Heater OtherFuel1 Energy",
101 // } else if (fuelType == "OtherFuel2") {
102 "Water Heater OtherFuel2 Rate", "Water Heater OtherFuel2 Energy",
103 // }
104
105 // TODO: implement these too...
106 //"Water Heater Off Cycle Parasitic <Fuel Type> Rate",
107 //"Water Heater Off Cycle Parasitic <Fuel Type> Energy",
108 //"Water Heater On Cycle Parasitic <Fuel Type> Rate",
109 // "Water Heater On Cycle Parasitic <Fuel Type> Energy",
110 //
111 "Water Heater Water Volume Flow Rate", "Water Heater Water Volume",
112
113 // Specific to Stratified
114 "Water Heater Heater 1 Heating Rate", "Water Heater Heater 2 Heating Rate", "Water Heater Heater 1 Heating Energy",
115 "Water Heater Heater 2 Heating Energy", "Water Heater Heater 1 Cycle On Count", "Water Heater Heater 2 Cycle On Count",
116 ✗ "Water Heater Heater 1 Runtime Fraction", "Water Heater Heater 2 Runtime Fraction"};
117 // TODO: his should really be a check on whether the node is defined...
118 ✗ for (int i = 1; i <= 12; ++i) {
119 ✗ val.push_back("Water Heater Temperature Node " + std::to_string(i));
120 ✗ val.push_back("Water Heater Final Temperature Node " + std::to_string(i));
121 }
122 ✗ return val;
123 ✗ }();
124
125 ✗ return result;
126 }
127
128 17 IddObjectType WaterHeaterStratified_Impl::iddObjectType() const {
129 17 return WaterHeaterStratified::iddObjectType();
130 }
131
132 19 std::vector<ModelObject> WaterHeaterStratified_Impl::children() const {
133
3/5
✓ Branch 1 taken 19 times.
✓ Branch 3 taken 19 times.
✓ Branch 4 taken 19 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
57 return std::vector<ModelObject>{waterHeaterSizing()};
134 19 }
135
136 1 ModelObject WaterHeaterStratified_Impl::clone(Model model) const {
137
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 auto whClone = WaterToWaterComponent_Impl::clone(model).cast<WaterHeaterStratified>();
138
139
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 auto sizingClone = waterHeaterSizing().clone(model).cast<WaterHeaterSizing>();
140
1/1
✓ Branch 3 taken 1 time.
1 sizingClone.getImpl<WaterHeaterSizing_Impl>()->setWaterHeater(whClone);
141 2 return std::move(whClone);
142 1 }
143
144 ✗ std::vector<ScheduleTypeKey> WaterHeaterStratified_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
145 ✗ std::vector<ScheduleTypeKey> result;
146 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
147 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
148 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
149 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::Heater1SetpointTemperatureScheduleName) != e) {
150 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Heater 1 Setpoint Temperature"));
151 }
152 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::Heater2SetpointTemperatureScheduleName) != e) {
153 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Heater 2 Setpoint Temperature"));
154 }
155 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::AmbientTemperatureScheduleName) != e) {
156 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Ambient Temperature"));
157 }
158 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::UseFlowRateFractionScheduleName) != e) {
159 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Use Flow Rate Fraction"));
160 }
161 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::ColdWaterSupplyTemperatureScheduleName) != e) {
162 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Cold Water Supply Temperature"));
163 }
164 ✗ if (std::find(b, e, OS_WaterHeater_StratifiedFields::IndirectAlternateSetpointTemperatureScheduleName) != e) {
165 ✗ result.push_back(ScheduleTypeKey("WaterHeaterStratified", "Indirect Alternate Setpoint Temperature"));
166 }
167 ✗ return result;
168 ✗ }
169
170 9 std::string WaterHeaterStratified_Impl::endUseSubcategory() const {
171
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::EndUseSubcategory, true);
172
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
173
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
174 9 }
175
176 9 boost::optional<double> WaterHeaterStratified_Impl::tankVolume() const {
177 9 return getDouble(OS_WaterHeater_StratifiedFields::TankVolume, true);
178 }
179
180 9 bool WaterHeaterStratified_Impl::isTankVolumeAutosized() const {
181 9 bool result = false;
182
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::TankVolume, true);
183
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
184
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autosize");
185 }
186 9 return result;
187 9 }
188
189 9 boost::optional<double> WaterHeaterStratified_Impl::tankHeight() const {
190 9 return getDouble(OS_WaterHeater_StratifiedFields::TankHeight, true);
191 }
192
193 9 bool WaterHeaterStratified_Impl::isTankHeightAutosized() const {
194 9 bool result = false;
195
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::TankHeight, true);
196
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
197
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autosize");
198 }
199 9 return result;
200 9 }
201
202 9 std::string WaterHeaterStratified_Impl::tankShape() const {
203
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::TankShape, true);
204
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
205
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
206 9 }
207
208 9 boost::optional<double> WaterHeaterStratified_Impl::tankPerimeter() const {
209 9 return getDouble(OS_WaterHeater_StratifiedFields::TankPerimeter, true);
210 }
211
212 9 double WaterHeaterStratified_Impl::maximumTemperatureLimit() const {
213
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::MaximumTemperatureLimit, true);
214
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
215
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
216 }
217
218 9 std::string WaterHeaterStratified_Impl::heaterPriorityControl() const {
219
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::HeaterPriorityControl, true);
220
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
221
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
222 9 }
223
224 9 Schedule WaterHeaterStratified_Impl::heater1SetpointTemperatureSchedule() const {
225
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<Schedule> value = optionalHeater1SetpointTemperatureSchedule();
226
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
9 if (!value) {
227 ✗ LOG_AND_THROW(briefDescription() << " does not have an Heater1Setpoint Temperature Schedule attached.");
228 }
229
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
230 9 }
231
232 9 double WaterHeaterStratified_Impl::heater1DeadbandTemperatureDifference() const {
233
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Heater1DeadbandTemperatureDifference, true);
234
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
235
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
236 }
237
238 46 boost::optional<double> WaterHeaterStratified_Impl::heater1Capacity() const {
239 46 return getDouble(OS_WaterHeater_StratifiedFields::Heater1Capacity, true);
240 }
241
242 50 bool WaterHeaterStratified_Impl::isHeater1CapacityAutosized() const {
243 50 bool result = false;
244
1/1
✓ Branch 1 taken 50 times.
50 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::Heater1Capacity, true);
245
1/2
✓ Branch 0 taken 50 times.
✗ Branch 1 not taken.
50 if (value) {
246
3/3
✓ Branch 1 taken 50 times.
✓ Branch 4 taken 50 times.
✓ Branch 7 taken 50 times.
100 result = openstudio::istringEqual(value.get(), "autosize");
247 }
248 50 return result;
249 50 }
250
251 9 double WaterHeaterStratified_Impl::heater1Height() const {
252
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Heater1Height, true);
253
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
254
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
255 }
256
257 9 Schedule WaterHeaterStratified_Impl::heater2SetpointTemperatureSchedule() const {
258
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<Schedule> value = optionalHeater2SetpointTemperatureSchedule();
259
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
9 if (!value) {
260 ✗ LOG_AND_THROW(briefDescription() << " does not have an Heater2Setpoint Temperature Schedule attached.");
261 }
262
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
263 9 }
264
265 9 double WaterHeaterStratified_Impl::heater2DeadbandTemperatureDifference() const {
266
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Heater2DeadbandTemperatureDifference, true);
267
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
268
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
269 }
270
271 47 double WaterHeaterStratified_Impl::heater2Capacity() const {
272
1/1
✓ Branch 1 taken 47 times.
47 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Heater2Capacity, true);
273
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 47 times.
✗ Branch 4 not taken.
47 OS_ASSERT(value);
274
1/1
✓ Branch 1 taken 47 times.
94 return value.get();
275 }
276
277 9 double WaterHeaterStratified_Impl::heater2Height() const {
278
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Heater2Height, true);
279
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
280
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
281 }
282
283 9 std::string WaterHeaterStratified_Impl::heaterFuelType() const {
284
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::HeaterFuelType, true);
285
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
286
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
287 9 }
288
289 11 double WaterHeaterStratified_Impl::heaterThermalEfficiency() const {
290
1/1
✓ Branch 1 taken 11 times.
11 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::HeaterThermalEfficiency, true);
291
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 11 times.
✗ Branch 4 not taken.
11 OS_ASSERT(value);
292
1/1
✓ Branch 1 taken 11 times.
22 return value.get();
293 }
294
295 9 double WaterHeaterStratified_Impl::offCycleParasiticFuelConsumptionRate() const {
296
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticFuelConsumptionRate, true);
297
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
298
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
299 }
300
301 9 std::string WaterHeaterStratified_Impl::offCycleParasiticFuelType() const {
302
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::OffCycleParasiticFuelType, true);
303
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
304
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
305 9 }
306
307 9 double WaterHeaterStratified_Impl::offCycleParasiticHeatFractiontoTank() const {
308
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticHeatFractiontoTank, true);
309
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
310
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
311 }
312
313 9 double WaterHeaterStratified_Impl::offCycleParasiticHeight() const {
314
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticHeight, true);
315
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
316
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
317 }
318
319 9 double WaterHeaterStratified_Impl::onCycleParasiticFuelConsumptionRate() const {
320
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticFuelConsumptionRate, true);
321
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
322
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
323 }
324
325 9 std::string WaterHeaterStratified_Impl::onCycleParasiticFuelType() const {
326
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::OnCycleParasiticFuelType, true);
327
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
328
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
329 9 }
330
331 9 double WaterHeaterStratified_Impl::onCycleParasiticHeatFractiontoTank() const {
332
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticHeatFractiontoTank, true);
333
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
334
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
335 }
336
337 9 double WaterHeaterStratified_Impl::onCycleParasiticHeight() const {
338
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticHeight, true);
339
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
340
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
341 }
342
343 9 std::string WaterHeaterStratified_Impl::ambientTemperatureIndicator() const {
344
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::AmbientTemperatureIndicator, true);
345
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
346
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
347 9 }
348
349 9 boost::optional<Schedule> WaterHeaterStratified_Impl::ambientTemperatureSchedule() const {
350
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_StratifiedFields::AmbientTemperatureScheduleName);
351 }
352
353 9 boost::optional<ThermalZone> WaterHeaterStratified_Impl::ambientTemperatureThermalZone() const {
354
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<ThermalZone>(OS_WaterHeater_StratifiedFields::AmbientTemperatureThermalZoneName);
355 }
356
357 9 boost::optional<std::string> WaterHeaterStratified_Impl::ambientTemperatureOutdoorAirNodeName() const {
358 9 return getString(OS_WaterHeater_StratifiedFields::AmbientTemperatureOutdoorAirNodeName, true);
359 }
360
361 9 boost::optional<double> WaterHeaterStratified_Impl::uniformSkinLossCoefficientperUnitAreatoAmbientTemperature() const {
362 9 return getDouble(OS_WaterHeater_StratifiedFields::UniformSkinLossCoefficientperUnitAreatoAmbientTemperature, true);
363 }
364
365 9 double WaterHeaterStratified_Impl::skinLossFractiontoZone() const {
366
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::SkinLossFractiontoZone, true);
367
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
368
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
369 }
370
371 9 boost::optional<double> WaterHeaterStratified_Impl::offCycleFlueLossCoefficienttoAmbientTemperature() const {
372 9 return getDouble(OS_WaterHeater_StratifiedFields::OffCycleFlueLossCoefficienttoAmbientTemperature, true);
373 }
374
375 9 double WaterHeaterStratified_Impl::offCycleFlueLossFractiontoZone() const {
376
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::OffCycleFlueLossFractiontoZone, true);
377
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
378
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
379 }
380
381 22 boost::optional<double> WaterHeaterStratified_Impl::peakUseFlowRate() const {
382 22 return getDouble(OS_WaterHeater_StratifiedFields::PeakUseFlowRate, true);
383 }
384
385 14 boost::optional<Schedule> WaterHeaterStratified_Impl::useFlowRateFractionSchedule() const {
386
2/2
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
14 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_StratifiedFields::UseFlowRateFractionScheduleName);
387 }
388
389 9 boost::optional<Schedule> WaterHeaterStratified_Impl::coldWaterSupplyTemperatureSchedule() const {
390
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_StratifiedFields::ColdWaterSupplyTemperatureScheduleName);
391 }
392
393 9 double WaterHeaterStratified_Impl::useSideEffectiveness() const {
394
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::UseSideEffectiveness, true);
395
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
396
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
397 }
398
399 9 double WaterHeaterStratified_Impl::useSideInletHeight() const {
400
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::UseSideInletHeight, true);
401
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
402
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
403 }
404
405 ✗ boost::optional<double> WaterHeaterStratified_Impl::useSideOutletHeight() const {
406 ✗ return getDouble(OS_WaterHeater_StratifiedFields::UseSideOutletHeight, true);
407 }
408
409 9 bool WaterHeaterStratified_Impl::isUseSideOutletHeightAutocalculated() const {
410 9 bool result = false;
411
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::UseSideOutletHeight, true);
412
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
413
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autocalculate");
414 }
415 9 return result;
416 9 }
417
418 9 double WaterHeaterStratified_Impl::sourceSideEffectiveness() const {
419
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::SourceSideEffectiveness, true);
420
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
421
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
422 }
423
424 ✗ boost::optional<double> WaterHeaterStratified_Impl::sourceSideInletHeight() const {
425 ✗ return getDouble(OS_WaterHeater_StratifiedFields::SourceSideInletHeight, true);
426 }
427
428 9 bool WaterHeaterStratified_Impl::isSourceSideInletHeightAutocalculated() const {
429 9 bool result = false;
430
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::SourceSideInletHeight, true);
431
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
432
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autocalculate");
433 }
434 9 return result;
435 9 }
436
437 9 double WaterHeaterStratified_Impl::sourceSideOutletHeight() const {
438
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::SourceSideOutletHeight, true);
439
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
440
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
441 }
442
443 9 std::string WaterHeaterStratified_Impl::inletMode() const {
444
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::InletMode, true);
445
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
446
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
447 9 }
448
449 ✗ boost::optional<double> WaterHeaterStratified_Impl::useSideDesignFlowRate() const {
450 ✗ return getDouble(OS_WaterHeater_StratifiedFields::UseSideDesignFlowRate, true);
451 }
452
453 9 bool WaterHeaterStratified_Impl::isUseSideDesignFlowRateAutosized() const {
454 9 bool result = false;
455
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::UseSideDesignFlowRate, true);
456
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
457
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autosize");
458 }
459 9 return result;
460 9 }
461
462 ✗ boost::optional<double> WaterHeaterStratified_Impl::sourceSideDesignFlowRate() const {
463 ✗ return getDouble(OS_WaterHeater_StratifiedFields::SourceSideDesignFlowRate, true);
464 }
465
466 9 bool WaterHeaterStratified_Impl::isSourceSideDesignFlowRateAutosized() const {
467 9 bool result = false;
468
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::SourceSideDesignFlowRate, true);
469
1/2
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
9 if (value) {
470
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
18 result = openstudio::istringEqual(value.get(), "autosize");
471 }
472 9 return result;
473 9 }
474
475 9 double WaterHeaterStratified_Impl::indirectWaterHeatingRecoveryTime() const {
476
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::IndirectWaterHeatingRecoveryTime, true);
477
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
478
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
479 }
480
481 9 int WaterHeaterStratified_Impl::numberofNodes() const {
482
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<int> value = getInt(OS_WaterHeater_StratifiedFields::NumberofNodes, true);
483
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
484
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
485 }
486
487 9 double WaterHeaterStratified_Impl::additionalDestratificationConductivity() const {
488
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::AdditionalDestratificationConductivity, true);
489
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
490
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
491 }
492
493 9 double WaterHeaterStratified_Impl::node1AdditionalLossCoefficient() const {
494
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node1AdditionalLossCoefficient, true);
495
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
496
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
497 }
498
499 9 double WaterHeaterStratified_Impl::node2AdditionalLossCoefficient() const {
500
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node2AdditionalLossCoefficient, true);
501
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
502
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
503 }
504
505 9 double WaterHeaterStratified_Impl::node3AdditionalLossCoefficient() const {
506
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node3AdditionalLossCoefficient, true);
507
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
508
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
509 }
510
511 9 double WaterHeaterStratified_Impl::node4AdditionalLossCoefficient() const {
512
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node4AdditionalLossCoefficient, true);
513
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
514
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
515 }
516
517 9 double WaterHeaterStratified_Impl::node5AdditionalLossCoefficient() const {
518
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node5AdditionalLossCoefficient, true);
519
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
520
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
521 }
522
523 9 double WaterHeaterStratified_Impl::node6AdditionalLossCoefficient() const {
524
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node6AdditionalLossCoefficient, true);
525
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
526
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
527 }
528
529 9 double WaterHeaterStratified_Impl::node7AdditionalLossCoefficient() const {
530
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node7AdditionalLossCoefficient, true);
531
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
532
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
533 }
534
535 9 double WaterHeaterStratified_Impl::node8AdditionalLossCoefficient() const {
536
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node8AdditionalLossCoefficient, true);
537
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
538
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
539 }
540
541 9 double WaterHeaterStratified_Impl::node9AdditionalLossCoefficient() const {
542
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node9AdditionalLossCoefficient, true);
543
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
544
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
545 }
546
547 9 double WaterHeaterStratified_Impl::node10AdditionalLossCoefficient() const {
548
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node10AdditionalLossCoefficient, true);
549
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
550
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
551 }
552
553 9 double WaterHeaterStratified_Impl::node11AdditionalLossCoefficient() const {
554
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node11AdditionalLossCoefficient, true);
555
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
556
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
557 }
558
559 9 double WaterHeaterStratified_Impl::node12AdditionalLossCoefficient() const {
560
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_WaterHeater_StratifiedFields::Node12AdditionalLossCoefficient, true);
561
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
562
1/1
✓ Branch 1 taken 9 times.
18 return value.get();
563 }
564
565 9 std::string WaterHeaterStratified_Impl::sourceSideFlowControlMode() const {
566
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<std::string> value = getString(OS_WaterHeater_StratifiedFields::SourceSideFlowControlMode, true);
567
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 9 times.
✗ Branch 4 not taken.
9 OS_ASSERT(value);
568
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 return value.get();
569 9 }
570
571 9 boost::optional<Schedule> WaterHeaterStratified_Impl::indirectAlternateSetpointTemperatureSchedule() const {
572
1/1
✓ Branch 1 taken 9 times.
18 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
573
1/1
✓ Branch 1 taken 9 times.
18 OS_WaterHeater_StratifiedFields::IndirectAlternateSetpointTemperatureScheduleName);
574 }
575
576 24 bool WaterHeaterStratified_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) {
577 24 bool result = setString(OS_WaterHeater_StratifiedFields::EndUseSubcategory, endUseSubcategory);
578
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
579 24 return result;
580 }
581
582 24 bool WaterHeaterStratified_Impl::setTankVolume(boost::optional<double> tankVolume) {
583 24 bool result(false);
584
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (tankVolume) {
585 24 result = setDouble(OS_WaterHeater_StratifiedFields::TankVolume, tankVolume.get());
586 }
587 24 return result;
588 }
589
590 ✗ void WaterHeaterStratified_Impl::autosizeTankVolume() {
591 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::TankVolume, "autosize");
592 ✗ OS_ASSERT(result);
593 ✗ }
594
595 24 bool WaterHeaterStratified_Impl::setTankHeight(boost::optional<double> tankHeight) {
596 24 bool result(false);
597
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (tankHeight) {
598 24 result = setDouble(OS_WaterHeater_StratifiedFields::TankHeight, tankHeight.get());
599 }
600 24 return result;
601 }
602
603 ✗ void WaterHeaterStratified_Impl::autosizeTankHeight() {
604 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::TankHeight, "autosize");
605 ✗ OS_ASSERT(result);
606 ✗ }
607
608 24 bool WaterHeaterStratified_Impl::setTankShape(const std::string& tankShape) {
609 24 bool result = setString(OS_WaterHeater_StratifiedFields::TankShape, tankShape);
610 24 return result;
611 }
612
613 ✗ bool WaterHeaterStratified_Impl::setTankPerimeter(boost::optional<double> tankPerimeter) {
614 ✗ bool result(false);
615 ✗ if (tankPerimeter) {
616 ✗ result = setDouble(OS_WaterHeater_StratifiedFields::TankPerimeter, tankPerimeter.get());
617 } else {
618 ✗ resetTankPerimeter();
619 ✗ result = true;
620 }
621 ✗ return result;
622 }
623
624 ✗ void WaterHeaterStratified_Impl::resetTankPerimeter() {
625 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::TankPerimeter, "");
626 ✗ OS_ASSERT(result);
627 ✗ }
628
629 24 bool WaterHeaterStratified_Impl::setMaximumTemperatureLimit(double maximumTemperatureLimit) {
630 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::MaximumTemperatureLimit, maximumTemperatureLimit);
631
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
632 24 return result;
633 }
634
635 24 bool WaterHeaterStratified_Impl::setHeaterPriorityControl(const std::string& heaterPriorityControl) {
636 24 bool result = setString(OS_WaterHeater_StratifiedFields::HeaterPriorityControl, heaterPriorityControl);
637 24 return result;
638 }
639
640 24 bool WaterHeaterStratified_Impl::setHeater1SetpointTemperatureSchedule(Schedule& schedule) {
641
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
96 bool result = setSchedule(OS_WaterHeater_StratifiedFields::Heater1SetpointTemperatureScheduleName, "WaterHeaterStratified",
642 "Heater 1 Setpoint Temperature", schedule);
643 24 return result;
644 }
645
646 24 bool WaterHeaterStratified_Impl::setHeater1DeadbandTemperatureDifference(double heater1DeadbandTemperatureDifference) {
647 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Heater1DeadbandTemperatureDifference, heater1DeadbandTemperatureDifference);
648 24 return result;
649 }
650
651 30 bool WaterHeaterStratified_Impl::setHeater1Capacity(boost::optional<double> heater1Capacity) {
652 30 bool result(false);
653
1/2
✓ Branch 0 taken 30 times.
✗ Branch 1 not taken.
30 if (heater1Capacity) {
654 30 result = setDouble(OS_WaterHeater_StratifiedFields::Heater1Capacity, heater1Capacity.get());
655 }
656 30 return result;
657 }
658
659 1 void WaterHeaterStratified_Impl::autosizeHeater1Capacity() {
660
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_WaterHeater_StratifiedFields::Heater1Capacity, "autosize");
661
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
662 1 }
663
664 24 bool WaterHeaterStratified_Impl::setHeater1Height(double heater1Height) {
665 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Heater1Height, heater1Height);
666 24 return result;
667 }
668
669 24 bool WaterHeaterStratified_Impl::setHeater2SetpointTemperatureSchedule(Schedule& schedule) {
670
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
96 bool result = setSchedule(OS_WaterHeater_StratifiedFields::Heater2SetpointTemperatureScheduleName, "WaterHeaterStratified",
671 "Heater 2 Setpoint Temperature", schedule);
672 24 return result;
673 }
674
675 24 bool WaterHeaterStratified_Impl::setHeater2DeadbandTemperatureDifference(double heater2DeadbandTemperatureDifference) {
676 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Heater2DeadbandTemperatureDifference, heater2DeadbandTemperatureDifference);
677 24 return result;
678 }
679
680 28 bool WaterHeaterStratified_Impl::setHeater2Capacity(double heater2Capacity) {
681 28 bool result = setDouble(OS_WaterHeater_StratifiedFields::Heater2Capacity, heater2Capacity);
682 28 return result;
683 }
684
685 24 bool WaterHeaterStratified_Impl::setHeater2Height(double heater2Height) {
686 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Heater2Height, heater2Height);
687 24 return result;
688 }
689
690 25 bool WaterHeaterStratified_Impl::setHeaterFuelType(const FuelType& heaterFuelType) {
691
2/2
✓ Branch 1 taken 25 times.
✓ Branch 4 taken 25 times.
25 const bool result = setString(OS_WaterHeater_StratifiedFields::HeaterFuelType, heaterFuelType.valueDescription());
692 25 return result;
693 }
694
695 25 bool WaterHeaterStratified_Impl::setHeaterThermalEfficiency(double heaterThermalEfficiency) {
696 25 bool result = setDouble(OS_WaterHeater_StratifiedFields::HeaterThermalEfficiency, heaterThermalEfficiency);
697 25 return result;
698 }
699
700 24 bool WaterHeaterStratified_Impl::setOffCycleParasiticFuelConsumptionRate(double offCycleParasiticFuelConsumptionRate) {
701 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticFuelConsumptionRate, offCycleParasiticFuelConsumptionRate);
702 24 return result;
703 }
704
705 24 bool WaterHeaterStratified_Impl::setOffCycleParasiticFuelType(const FuelType& offCycleParasiticFuelType) {
706
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 bool result = setString(OS_WaterHeater_StratifiedFields::OffCycleParasiticFuelType, offCycleParasiticFuelType.valueDescription());
707 24 return result;
708 }
709
710 24 bool WaterHeaterStratified_Impl::setOffCycleParasiticHeatFractiontoTank(double offCycleParasiticHeatFractiontoTank) {
711 24 const bool result = setDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticHeatFractiontoTank, offCycleParasiticHeatFractiontoTank);
712 24 return result;
713 }
714
715 24 bool WaterHeaterStratified_Impl::setOffCycleParasiticHeight(double offCycleParasiticHeight) {
716 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OffCycleParasiticHeight, offCycleParasiticHeight);
717 24 return result;
718 }
719
720 24 bool WaterHeaterStratified_Impl::setOnCycleParasiticFuelConsumptionRate(double onCycleParasiticFuelConsumptionRate) {
721 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticFuelConsumptionRate, onCycleParasiticFuelConsumptionRate);
722 24 return result;
723 }
724
725 24 bool WaterHeaterStratified_Impl::setOnCycleParasiticFuelType(const FuelType& onCycleParasiticFuelType) {
726
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 const bool result = setString(OS_WaterHeater_StratifiedFields::OnCycleParasiticFuelType, onCycleParasiticFuelType.valueDescription());
727 24 return result;
728 }
729
730 24 bool WaterHeaterStratified_Impl::setOnCycleParasiticHeatFractiontoTank(double onCycleParasiticHeatFractiontoTank) {
731 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticHeatFractiontoTank, onCycleParasiticHeatFractiontoTank);
732 24 return result;
733 }
734
735 24 bool WaterHeaterStratified_Impl::setOnCycleParasiticHeight(double onCycleParasiticHeight) {
736 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OnCycleParasiticHeight, onCycleParasiticHeight);
737 24 return result;
738 }
739
740 27 bool WaterHeaterStratified_Impl::setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator) {
741 27 bool result = setString(OS_WaterHeater_StratifiedFields::AmbientTemperatureIndicator, ambientTemperatureIndicator);
742 27 return result;
743 }
744
745 24 bool WaterHeaterStratified_Impl::setAmbientTemperatureSchedule(Schedule& schedule) {
746 bool result =
747
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
96 setSchedule(OS_WaterHeater_StratifiedFields::AmbientTemperatureScheduleName, "WaterHeaterStratified", "Ambient Temperature", schedule);
748 24 return result;
749 }
750
751 ✗ void WaterHeaterStratified_Impl::resetAmbientTemperatureSchedule() {
752 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::AmbientTemperatureScheduleName, "");
753 ✗ OS_ASSERT(result);
754 ✗ }
755
756 3 bool WaterHeaterStratified_Impl::setAmbientTemperatureThermalZone(const boost::optional<ThermalZone>& thermalZone) {
757 3 bool result(false);
758
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (thermalZone) {
759
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 result = setPointer(OS_WaterHeater_StratifiedFields::AmbientTemperatureThermalZoneName, thermalZone.get().handle());
760 } else {
761 ✗ resetAmbientTemperatureThermalZone();
762 ✗ result = true;
763 }
764 3 return result;
765 }
766
767 ✗ void WaterHeaterStratified_Impl::resetAmbientTemperatureThermalZone() {
768 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::AmbientTemperatureThermalZoneName, "");
769 ✗ OS_ASSERT(result);
770 ✗ }
771
772 ✗ bool WaterHeaterStratified_Impl::setAmbientTemperatureOutdoorAirNodeName(boost::optional<std::string> ambientTemperatureOutdoorAirNodeName) {
773 ✗ bool result(false);
774 ✗ if (ambientTemperatureOutdoorAirNodeName) {
775 ✗ result = setString(OS_WaterHeater_StratifiedFields::AmbientTemperatureOutdoorAirNodeName, ambientTemperatureOutdoorAirNodeName.get());
776 } else {
777 ✗ resetAmbientTemperatureOutdoorAirNodeName();
778 ✗ result = true;
779 }
780 ✗ OS_ASSERT(result);
781 ✗ return result;
782 }
783
784 ✗ void WaterHeaterStratified_Impl::resetAmbientTemperatureOutdoorAirNodeName() {
785 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::AmbientTemperatureOutdoorAirNodeName, "");
786 ✗ OS_ASSERT(result);
787 ✗ }
788
789 24 bool WaterHeaterStratified_Impl::setUniformSkinLossCoefficientperUnitAreatoAmbientTemperature(
790 boost::optional<double> uniformSkinLossCoefficientperUnitAreatoAmbientTemperature) {
791 24 bool result(false);
792
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (uniformSkinLossCoefficientperUnitAreatoAmbientTemperature) {
793 24 result = setDouble(OS_WaterHeater_StratifiedFields::UniformSkinLossCoefficientperUnitAreatoAmbientTemperature,
794 24 uniformSkinLossCoefficientperUnitAreatoAmbientTemperature.get());
795 } else {
796 ✗ resetUniformSkinLossCoefficientperUnitAreatoAmbientTemperature();
797 ✗ result = true;
798 }
799 24 return result;
800 }
801
802 ✗ void WaterHeaterStratified_Impl::resetUniformSkinLossCoefficientperUnitAreatoAmbientTemperature() {
803 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::UniformSkinLossCoefficientperUnitAreatoAmbientTemperature, "");
804 ✗ OS_ASSERT(result);
805 ✗ }
806
807 24 bool WaterHeaterStratified_Impl::setSkinLossFractiontoZone(double skinLossFractiontoZone) {
808 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::SkinLossFractiontoZone, skinLossFractiontoZone);
809 24 return result;
810 }
811
812 24 bool WaterHeaterStratified_Impl::setOffCycleFlueLossCoefficienttoAmbientTemperature(
813 boost::optional<double> offCycleFlueLossCoefficienttoAmbientTemperature) {
814 24 bool result(false);
815
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
24 if (offCycleFlueLossCoefficienttoAmbientTemperature) {
816 24 result = setDouble(OS_WaterHeater_StratifiedFields::OffCycleFlueLossCoefficienttoAmbientTemperature,
817 24 offCycleFlueLossCoefficienttoAmbientTemperature.get());
818 } else {
819 ✗ resetOffCycleFlueLossCoefficienttoAmbientTemperature();
820 ✗ result = true;
821 }
822 24 return result;
823 }
824
825 ✗ void WaterHeaterStratified_Impl::resetOffCycleFlueLossCoefficienttoAmbientTemperature() {
826 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::OffCycleFlueLossCoefficienttoAmbientTemperature, "");
827 ✗ OS_ASSERT(result);
828 ✗ }
829
830 24 bool WaterHeaterStratified_Impl::setOffCycleFlueLossFractiontoZone(double offCycleFlueLossFractiontoZone) {
831 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::OffCycleFlueLossFractiontoZone, offCycleFlueLossFractiontoZone);
832 24 return result;
833 }
834
835 1 bool WaterHeaterStratified_Impl::setPeakUseFlowRate(boost::optional<double> peakUseFlowRate) {
836 1 bool result(false);
837
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (peakUseFlowRate) {
838 1 result = setDouble(OS_WaterHeater_StratifiedFields::PeakUseFlowRate, peakUseFlowRate.get());
839 } else {
840 ✗ resetPeakUseFlowRate();
841 ✗ result = true;
842 }
843 1 return result;
844 }
845
846 1 void WaterHeaterStratified_Impl::resetPeakUseFlowRate() {
847
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_WaterHeater_StratifiedFields::PeakUseFlowRate, "");
848
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
849 1 }
850
851 1 bool WaterHeaterStratified_Impl::setUseFlowRateFractionSchedule(Schedule& schedule) {
852 bool result =
853
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
4 setSchedule(OS_WaterHeater_StratifiedFields::UseFlowRateFractionScheduleName, "WaterHeaterStratified", "Use Flow Rate Fraction", schedule);
854 1 return result;
855 }
856
857 1 void WaterHeaterStratified_Impl::resetUseFlowRateFractionSchedule() {
858
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_WaterHeater_StratifiedFields::UseFlowRateFractionScheduleName, "");
859
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
860 1 }
861
862 ✗ bool WaterHeaterStratified_Impl::setColdWaterSupplyTemperatureSchedule(Schedule& schedule) {
863 ✗ bool result = setSchedule(OS_WaterHeater_StratifiedFields::ColdWaterSupplyTemperatureScheduleName, "WaterHeaterStratified",
864 "Cold Water Supply Temperature", schedule);
865 ✗ return result;
866 }
867
868 ✗ void WaterHeaterStratified_Impl::resetColdWaterSupplyTemperatureSchedule() {
869 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::ColdWaterSupplyTemperatureScheduleName, "");
870 ✗ OS_ASSERT(result);
871 ✗ }
872
873 24 bool WaterHeaterStratified_Impl::setUseSideEffectiveness(double useSideEffectiveness) {
874 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::UseSideEffectiveness, useSideEffectiveness);
875 24 return result;
876 }
877
878 24 bool WaterHeaterStratified_Impl::setUseSideInletHeight(double useSideInletHeight) {
879 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::UseSideInletHeight, useSideInletHeight);
880 24 return result;
881 }
882
883 ✗ bool WaterHeaterStratified_Impl::setUseSideOutletHeight(boost::optional<double> useSideOutletHeight) {
884 ✗ bool result(false);
885 ✗ if (useSideOutletHeight) {
886 ✗ result = setDouble(OS_WaterHeater_StratifiedFields::UseSideOutletHeight, useSideOutletHeight.get());
887 }
888 ✗ return result;
889 }
890
891 24 void WaterHeaterStratified_Impl::autocalculateUseSideOutletHeight() {
892
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 bool result = setString(OS_WaterHeater_StratifiedFields::UseSideOutletHeight, "autocalculate");
893
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
894 24 }
895
896 24 bool WaterHeaterStratified_Impl::setSourceSideEffectiveness(double sourceSideEffectiveness) {
897 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::SourceSideEffectiveness, sourceSideEffectiveness);
898 24 return result;
899 }
900
901 ✗ bool WaterHeaterStratified_Impl::setSourceSideInletHeight(boost::optional<double> sourceSideInletHeight) {
902 ✗ bool result(false);
903 ✗ if (sourceSideInletHeight) {
904 ✗ result = setDouble(OS_WaterHeater_StratifiedFields::SourceSideInletHeight, sourceSideInletHeight.get());
905 }
906 ✗ return result;
907 }
908
909 24 void WaterHeaterStratified_Impl::autocalculateSourceSideInletHeight() {
910
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 bool result = setString(OS_WaterHeater_StratifiedFields::SourceSideInletHeight, "autocalculate");
911
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
912 24 }
913
914 24 bool WaterHeaterStratified_Impl::setSourceSideOutletHeight(double sourceSideOutletHeight) {
915 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::SourceSideOutletHeight, sourceSideOutletHeight);
916 24 return result;
917 }
918
919 24 bool WaterHeaterStratified_Impl::setInletMode(const std::string& inletMode) {
920 24 bool result = setString(OS_WaterHeater_StratifiedFields::InletMode, inletMode);
921 24 return result;
922 }
923
924 ✗ bool WaterHeaterStratified_Impl::setUseSideDesignFlowRate(boost::optional<double> useSideDesignFlowRate) {
925 ✗ bool result(false);
926 ✗ if (useSideDesignFlowRate) {
927 ✗ result = setDouble(OS_WaterHeater_StratifiedFields::UseSideDesignFlowRate, useSideDesignFlowRate.get());
928 }
929 ✗ return result;
930 }
931
932 24 void WaterHeaterStratified_Impl::autosizeUseSideDesignFlowRate() {
933
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 bool result = setString(OS_WaterHeater_StratifiedFields::UseSideDesignFlowRate, "autosize");
934
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
935 24 }
936
937 ✗ bool WaterHeaterStratified_Impl::setSourceSideDesignFlowRate(boost::optional<double> sourceSideDesignFlowRate) {
938 ✗ bool result(false);
939 ✗ if (sourceSideDesignFlowRate) {
940 ✗ result = setDouble(OS_WaterHeater_StratifiedFields::SourceSideDesignFlowRate, sourceSideDesignFlowRate.get());
941 }
942 ✗ return result;
943 }
944
945 24 void WaterHeaterStratified_Impl::autosizeSourceSideDesignFlowRate() {
946
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
48 bool result = setString(OS_WaterHeater_StratifiedFields::SourceSideDesignFlowRate, "autosize");
947
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
948 24 }
949
950 24 bool WaterHeaterStratified_Impl::setIndirectWaterHeatingRecoveryTime(double indirectWaterHeatingRecoveryTime) {
951 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::IndirectWaterHeatingRecoveryTime, indirectWaterHeatingRecoveryTime);
952 24 return result;
953 }
954
955 24 bool WaterHeaterStratified_Impl::setNumberofNodes(int numberofNodes) {
956 24 bool result = setInt(OS_WaterHeater_StratifiedFields::NumberofNodes, numberofNodes);
957 24 return result;
958 }
959
960 24 bool WaterHeaterStratified_Impl::setAdditionalDestratificationConductivity(double additionalDestratificationConductivity) {
961 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::AdditionalDestratificationConductivity, additionalDestratificationConductivity);
962 24 return result;
963 }
964
965 24 bool WaterHeaterStratified_Impl::setNode1AdditionalLossCoefficient(double node1AdditionalLossCoefficient) {
966 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node1AdditionalLossCoefficient, node1AdditionalLossCoefficient);
967
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
968 24 return result;
969 }
970
971 24 bool WaterHeaterStratified_Impl::setNode2AdditionalLossCoefficient(double node2AdditionalLossCoefficient) {
972 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node2AdditionalLossCoefficient, node2AdditionalLossCoefficient);
973
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
974 24 return result;
975 }
976
977 24 bool WaterHeaterStratified_Impl::setNode3AdditionalLossCoefficient(double node3AdditionalLossCoefficient) {
978 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node3AdditionalLossCoefficient, node3AdditionalLossCoefficient);
979
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
980 24 return result;
981 }
982
983 24 bool WaterHeaterStratified_Impl::setNode4AdditionalLossCoefficient(double node4AdditionalLossCoefficient) {
984 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node4AdditionalLossCoefficient, node4AdditionalLossCoefficient);
985
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
986 24 return result;
987 }
988
989 24 bool WaterHeaterStratified_Impl::setNode5AdditionalLossCoefficient(double node5AdditionalLossCoefficient) {
990 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node5AdditionalLossCoefficient, node5AdditionalLossCoefficient);
991
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
992 24 return result;
993 }
994
995 24 bool WaterHeaterStratified_Impl::setNode6AdditionalLossCoefficient(double node6AdditionalLossCoefficient) {
996 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node6AdditionalLossCoefficient, node6AdditionalLossCoefficient);
997
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
998 24 return result;
999 }
1000
1001 24 bool WaterHeaterStratified_Impl::setNode7AdditionalLossCoefficient(double node7AdditionalLossCoefficient) {
1002 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node7AdditionalLossCoefficient, node7AdditionalLossCoefficient);
1003
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1004 24 return result;
1005 }
1006
1007 24 bool WaterHeaterStratified_Impl::setNode8AdditionalLossCoefficient(double node8AdditionalLossCoefficient) {
1008 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node8AdditionalLossCoefficient, node8AdditionalLossCoefficient);
1009
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1010 24 return result;
1011 }
1012
1013 24 bool WaterHeaterStratified_Impl::setNode9AdditionalLossCoefficient(double node9AdditionalLossCoefficient) {
1014 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node9AdditionalLossCoefficient, node9AdditionalLossCoefficient);
1015
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1016 24 return result;
1017 }
1018
1019 24 bool WaterHeaterStratified_Impl::setNode10AdditionalLossCoefficient(double node10AdditionalLossCoefficient) {
1020 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node10AdditionalLossCoefficient, node10AdditionalLossCoefficient);
1021
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1022 24 return result;
1023 }
1024
1025 24 bool WaterHeaterStratified_Impl::setNode11AdditionalLossCoefficient(double node11AdditionalLossCoefficient) {
1026 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node11AdditionalLossCoefficient, node11AdditionalLossCoefficient);
1027
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1028 24 return result;
1029 }
1030
1031 24 bool WaterHeaterStratified_Impl::setNode12AdditionalLossCoefficient(double node12AdditionalLossCoefficient) {
1032 24 bool result = setDouble(OS_WaterHeater_StratifiedFields::Node12AdditionalLossCoefficient, node12AdditionalLossCoefficient);
1033
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
24 OS_ASSERT(result);
1034 24 return result;
1035 }
1036
1037 24 bool WaterHeaterStratified_Impl::setSourceSideFlowControlMode(const std::string& sourceSideFlowControlMode) {
1038 24 bool result = setString(OS_WaterHeater_StratifiedFields::SourceSideFlowControlMode, sourceSideFlowControlMode);
1039 24 return result;
1040 }
1041
1042 ✗ bool WaterHeaterStratified_Impl::setIndirectAlternateSetpointTemperatureSchedule(Schedule& schedule) {
1043 ✗ bool result = setSchedule(OS_WaterHeater_StratifiedFields::IndirectAlternateSetpointTemperatureScheduleName, "WaterHeaterStratified",
1044 "Indirect Alternate Setpoint Temperature", schedule);
1045 ✗ return result;
1046 }
1047
1048 ✗ void WaterHeaterStratified_Impl::resetIndirectAlternateSetpointTemperatureSchedule() {
1049 ✗ bool result = setString(OS_WaterHeater_StratifiedFields::IndirectAlternateSetpointTemperatureScheduleName, "");
1050 ✗ OS_ASSERT(result);
1051 ✗ }
1052
1053 9 boost::optional<Schedule> WaterHeaterStratified_Impl::optionalHeater1SetpointTemperatureSchedule() const {
1054
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_StratifiedFields::Heater1SetpointTemperatureScheduleName);
1055 }
1056
1057 9 boost::optional<Schedule> WaterHeaterStratified_Impl::optionalHeater2SetpointTemperatureSchedule() const {
1058
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
9 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_WaterHeater_StratifiedFields::Heater2SetpointTemperatureScheduleName);
1059 }
1060
1061 31 boost::optional<ZoneHVACComponent> WaterHeaterStratified_Impl::containingZoneHVACComponent() const {
1062 {
1063
2/2
✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
31 auto hpwhs = model().getConcreteModelObjects<model::WaterHeaterHeatPump>();
1064
1/1
✓ Branch 1 taken 31 times.
31 auto t_Handle = handle();
1065
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 31 times.
31 for (const auto& hpwh : hpwhs) {
1066 ✗ if (hpwh.tank().handle() == t_Handle) {
1067 ✗ return hpwh;
1068 }
1069 }
1070 31 }
1071
1072 {
1073
2/2
✓ Branch 1 taken 31 times.
✓ Branch 4 taken 31 times.
31 auto hpwhs = model().getConcreteModelObjects<model::WaterHeaterHeatPumpWrappedCondenser>();
1074
1/1
✓ Branch 1 taken 31 times.
31 auto t_Handle = handle();
1075
2/2
✓ Branch 5 taken 14 times.
✓ Branch 6 taken 17 times.
31 for (const auto& hpwh : hpwhs) {
1076
4/5
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
✓ Branch 10 taken 14 times.
✗ Branch 11 not taken.
14 if (hpwh.tank().handle() == t_Handle) {
1077
1/1
✓ Branch 1 taken 14 times.
14 return hpwh;
1078 }
1079 }
1080 31 }
1081
1082 17 return boost::none;
1083 }
1084
1085 ✗ boost::optional<double> WaterHeaterStratified_Impl::autosizedTankVolume() const {
1086 ✗ return getAutosizedValue("Design Size Tank Volume", "m3");
1087 }
1088
1089 ✗ boost::optional<double> WaterHeaterStratified_Impl::autosizedTankHeight() const {
1090 ✗ return getAutosizedValue("Design Size Tank Height", "m");
1091 }
1092
1093 ✗ boost::optional<double> WaterHeaterStratified_Impl::autosizedHeater1Capacity() const {
1094 ✗ return getAutosizedValue("Design Size Heater 1 Capacity", "W");
1095 }
1096
1097 ✗ boost::optional<double> WaterHeaterStratified_Impl::autosizedUseSideDesignFlowRate() const {
1098 ✗ return getAutosizedValue("Design Size Use Side Design Flow Rate", "m3/s");
1099 }
1100
1101 ✗ boost::optional<double> WaterHeaterStratified_Impl::autosizedSourceSideDesignFlowRate() const {
1102 ✗ return getAutosizedValue("Design Size Source Side Design Flow Rate", "m3/s");
1103 }
1104
1105 ✗ void WaterHeaterStratified_Impl::autosize() {
1106 ✗ autosizeTankVolume();
1107 ✗ autosizeTankHeight();
1108 ✗ autosizeHeater1Capacity();
1109 ✗ autosizeUseSideDesignFlowRate();
1110 ✗ autosizeSourceSideDesignFlowRate();
1111 ✗ }
1112
1113 ✗ void WaterHeaterStratified_Impl::applySizingValues() {
1114 ✗ boost::optional<double> val;
1115 ✗ val = autosizedTankVolume();
1116 ✗ if (val) {
1117 ✗ setTankVolume(val.get());
1118 }
1119
1120 ✗ val = autosizedTankHeight();
1121 ✗ if (val) {
1122 ✗ setTankHeight(val.get());
1123 }
1124
1125 ✗ val = autosizedHeater1Capacity();
1126 ✗ if (val) {
1127 ✗ setHeater1Capacity(val.get());
1128 }
1129
1130 ✗ val = autosizedUseSideDesignFlowRate();
1131 ✗ if (val) {
1132 ✗ setUseSideDesignFlowRate(val.get());
1133 }
1134
1135 ✗ val = autosizedSourceSideDesignFlowRate();
1136 ✗ if (val) {
1137 ✗ setSourceSideDesignFlowRate(val.get());
1138 }
1139 ✗ }
1140
1141 34 WaterHeaterSizing WaterHeaterStratified_Impl::waterHeaterSizing() const {
1142 34 boost::optional<WaterHeaterSizing> waterHeaterSizing_;
1143
1144
2/2
✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
34 auto sizingObjects = getObject<WaterHeaterStratified>().getModelObjectSources<WaterHeaterSizing>();
1145
1/1
✓ Branch 1 taken 34 times.
34 auto predicate = [thisHandle = this->handle()](const auto& siz) {
1146 try {
1147
3/3
✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
✓ Branch 7 taken 34 times.
34 return siz.waterHeater().handle() == thisHandle;
1148 ✗ } catch (...) {
1149 ✗ LOG(Debug, siz.briefDescription() << " is not attached to a WaterHeater object.");
1150 ✗ return false;
1151 }
1152 };
1153
1154
1/1
✓ Branch 3 taken 34 times.
34 auto it = std::find_if(sizingObjects.cbegin(), sizingObjects.cend(), predicate);
1155
1/2
✓ Branch 2 taken 34 times.
✗ Branch 3 not taken.
34 if (it != sizingObjects.cend()) {
1156
1/1
✓ Branch 2 taken 34 times.
68 return *it;
1157 } else {
1158 ✗ LOG_AND_THROW(briefDescription() << " missing WaterHeater:Sizing object.");
1159 }
1160 34 }
1161
1162 // Loop connections
1163
1164 173 unsigned WaterHeaterStratified_Impl::supplyInletPort() const {
1165 173 return OS_WaterHeater_StratifiedFields::UseSideInletNodeName;
1166 }
1167
1168 158 unsigned WaterHeaterStratified_Impl::supplyOutletPort() const {
1169 158 return OS_WaterHeater_StratifiedFields::UseSideOutletNodeName;
1170 }
1171
1172 58 unsigned WaterHeaterStratified_Impl::demandInletPort() const {
1173 58 return OS_WaterHeater_StratifiedFields::SourceSideInletNodeName;
1174 }
1175
1176 151 unsigned WaterHeaterStratified_Impl::demandOutletPort() const {
1177 151 return OS_WaterHeater_StratifiedFields::SourceSideOutletNodeName;
1178 }
1179
1180 72 boost::optional<PlantLoop> WaterHeaterStratified_Impl::plantLoop() const {
1181
2/2
✓ Branch 1 taken 24 times.
✓ Branch 2 taken 48 times.
144 if (m_plantLoop) {
1182 24 return m_plantLoop;
1183 } else {
1184 // Note: checking for supply side only isn't sufficient for this object, as it can be on the supply of two plant loops
1185 // Here we only want to return the Use Side one, so we need to filter out the source Side one
1186
1/1
✓ Branch 1 taken 48 times.
48 boost::optional<PlantLoop> sourceSidePlantLoop = this->sourceSidePlantLoop();
1187
1188
2/2
✓ Branch 1 taken 48 times.
✓ Branch 4 taken 48 times.
48 std::vector<PlantLoop> plantLoops = this->model().getConcreteModelObjects<PlantLoop>();
1189
1190
2/2
✓ Branch 5 taken 52 times.
✓ Branch 6 taken 33 times.
85 for (const auto& elem : plantLoops) {
1191
1/1
✓ Branch 1 taken 52 times.
52 OptionalPlantLoop plantLoop = elem.optionalCast<PlantLoop>();
1192
1/2
✓ Branch 0 taken 52 times.
✗ Branch 1 not taken.
52 if (plantLoop) {
1193 // Check that the component is on the supply side of the PlantLoop
1194
5/5
✓ Branch 1 taken 52 times.
✓ Branch 4 taken 52 times.
✓ Branch 7 taken 52 times.
✓ Branch 10 taken 18 times.
✓ Branch 11 taken 34 times.
104 if (plantLoop->supplyComponent(this->handle())) {
1195 // Skip the sourceSide one
1196
2/2
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 11 times.
18 if (sourceSidePlantLoop) {
1197
7/7
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 7 times.
✓ Branch 13 taken 7 times.
✓ Branch 15 taken 3 times.
✓ Branch 16 taken 4 times.
7 if (plantLoop->handle() == sourceSidePlantLoop->handle()) {
1198 3 continue;
1199 }
1200 }
1201
1/1
✓ Branch 1 taken 15 times.
15 m_plantLoop = plantLoop;
1202
1203 15 return plantLoop;
1204 }
1205 }
1206 52 }
1207 63 }
1208
1209 33 return boost::none;
1210 }
1211
1212 97 boost::optional<PlantLoop> WaterHeaterStratified_Impl::secondaryPlantLoop() const {
1213
2/2
✓ Branch 1 taken 17 times.
✓ Branch 2 taken 80 times.
194 if (m_secondaryPlantLoop) {
1214 17 return m_secondaryPlantLoop;
1215 } else {
1216
1217 // Regular case, it's on the demand side: use the base class implementation
1218
1/1
✓ Branch 1 taken 80 times.
80 m_secondaryPlantLoop = WaterToWaterComponent_Impl::secondaryPlantLoop();
1219
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 80 times.
160 if (m_secondaryPlantLoop) {
1220 ✗ return m_secondaryPlantLoop;
1221 }
1222
1223 // Less common case: it's also on the supply side (like for the PlantLoop one)
1224 // so we explicitly ensure this is connected to the **Source** Side Nodes
1225
3/3
✓ Branch 1 taken 80 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 76 times.
160 if (auto sourceSideOutletModelObject_ = sourceSideOutletModelObject()) {
1226
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
8 if (auto sourceSideOutletHVACComponent_ = sourceSideOutletModelObject_->optionalCast<HVACComponent>()) {
1227
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 auto plantLoops = this->model().getConcreteModelObjects<PlantLoop>();
1228
1229
1/2
✓ Branch 5 taken 5 times.
✗ Branch 6 not taken.
5 for (const auto& plantLoop : plantLoops) {
1230
7/7
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 13 taken 5 times.
✓ Branch 19 taken 4 times.
✓ Branch 20 taken 1 time.
15 if (!plantLoop.supplyComponents(plantLoop.supplyInletNode(), sourceSideOutletHVACComponent_.get()).empty()) {
1231
1/1
✓ Branch 1 taken 4 times.
4 m_secondaryPlantLoop = plantLoop;
1232
1/1
✓ Branch 1 taken 4 times.
4 return plantLoop;
1233 }
1234 }
1235 8 }
1236 80 }
1237 }
1238
1239 76 return boost::none;
1240 }
1241
1242 8 bool WaterHeaterStratified_Impl::removeFromSecondaryPlantLoop() {
1243
1244
3/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 5 times.
16 if (auto plant_ = secondaryPlantLoop()) {
1245 3 m_secondaryPlantLoop = boost::none;
1246
1247
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 auto outletNode = sourceSideOutletModelObject()->cast<HVACComponent>();
1248
1249
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto supplyNode = plant_->supplyInletNode();
1250
5/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 15 taken 3 times.
✗ Branch 16 not taken.
9 if (!plant_->supplyComponents(supplyNode, outletNode).empty()) {
1251
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
3 return HVACComponent_Impl::removeFromLoop(supplyNode, plant_->supplyOutletNode(), demandInletPort(), demandOutletPort());
1252 } else {
1253 ✗ return HVACComponent_Impl::removeFromLoop(plant_->demandInletNode(), plant_->demandOutletNode(), demandInletPort(), demandOutletPort());
1254 }
1255 11 }
1256
1257 5 return false;
1258 }
1259
1260 14 bool WaterHeaterStratified_Impl::addToNode(Node& node) {
1261
1/1
✓ Branch 1 taken 14 times.
14 boost::optional<PlantLoop> t_plantLoop = node.plantLoop();
1262
1263
1/2
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
14 if (t_plantLoop) {
1264
4/5
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
✓ Branch 10 taken 14 times.
✗ Branch 11 not taken.
28 if (t_plantLoop->supplyComponent(node.handle())) {
1265 // If these is already a use side Plant Loop
1266
1/1
✓ Branch 1 taken 14 times.
14 boost::optional<PlantLoop> useSidePlant = this->useSidePlantLoop();
1267
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 11 times.
14 if (useSidePlant) {
1268 // And it's not the same as the node's loop
1269
4/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
3 if (t_plantLoop.get() != useSidePlant.get()) {
1270 // Then try to add it to the source side one
1271
7/7
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 14 taken 3 times.
✓ Branch 17 taken 3 times.
✓ Branch 20 taken 3 times.
3 LOG(Warn, "Calling addToSecondaryNode to connect it to the source side loop for " << briefDescription());
1272
1/1
✓ Branch 1 taken 3 times.
3 return this->addToSourceSideNode(node);
1273 }
1274 }
1275 14 }
1276 }
1277
1278 // All other cases, call the base class implementation
1279
1/1
✓ Branch 1 taken 11 times.
11 return WaterToWaterComponent_Impl::addToNode(node);
1280 14 }
1281
1282 4 bool WaterHeaterStratified_Impl::addToSourceSideNode(Node& node) {
1283
1/1
✓ Branch 1 taken 4 times.
4 auto thisModelObject = getObject<ModelObject>();
1284
1/1
✓ Branch 1 taken 4 times.
4 auto t_plantLoop = node.plantLoop();
1285
1286
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<unsigned> componentInletPort = demandInletPort();
1287
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<unsigned> componentOutletPort = demandOutletPort();
1288
1289 4 boost::optional<HVACComponent> systemStartComponent;
1290 4 boost::optional<HVACComponent> systemEndComponent;
1291
1292
2/3
✓ Branch 3 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 4 times.
4 if (node.getImpl<Node_Impl>()->isConnected(thisModelObject)) {
1293 ✗ return false;
1294 }
1295
1296
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (t_plantLoop) {
1297
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
8 if (t_plantLoop->supplyComponent(node.handle())) {
1298
1299
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 systemStartComponent = t_plantLoop->supplyInletNode();
1300
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 systemEndComponent = t_plantLoop->supplyOutletNode();
1301
1302
1/1
✓ Branch 1 taken 4 times.
4 removeFromSourceSidePlantLoop();
1303 ✗ } else if (t_plantLoop->demandComponent(node.handle())) {
1304 ✗ systemStartComponent = t_plantLoop->demandInletNode();
1305 ✗ systemEndComponent = t_plantLoop->demandOutletNode();
1306
1307 ✗ removeFromSourceSidePlantLoop();
1308 }
1309 }
1310
1311
5/10
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
16 if (systemStartComponent && systemEndComponent && componentOutletPort && componentInletPort) {
1312
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 return HVACComponent_Impl::addToNode(node, systemStartComponent.get(), systemEndComponent.get(), componentInletPort.get(),
1313
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 componentOutletPort.get());
1314 }
1315
1316 ✗ return false;
1317 4 }
1318
1319 // Name aliases
1320
1321 72 boost::optional<PlantLoop> WaterHeaterStratified_Impl::sourceSidePlantLoop() const {
1322 72 return secondaryPlantLoop();
1323 }
1324
1325 26 boost::optional<PlantLoop> WaterHeaterStratified_Impl::useSidePlantLoop() const {
1326 26 return plantLoop();
1327 }
1328
1329 7 bool WaterHeaterStratified_Impl::removeFromSourceSidePlantLoop() {
1330 7 return removeFromSecondaryPlantLoop();
1331 }
1332
1333 ✗ boost::optional<ModelObject> WaterHeaterStratified_Impl::useSideInletModelObject() const {
1334 ✗ return supplyInletModelObject();
1335 }
1336
1337 ✗ boost::optional<ModelObject> WaterHeaterStratified_Impl::useSideOutletModelObject() const {
1338 ✗ return supplyOutletModelObject();
1339 }
1340
1341 ✗ boost::optional<ModelObject> WaterHeaterStratified_Impl::sourceSideInletModelObject() const {
1342 ✗ return demandInletModelObject();
1343 }
1344
1345 83 boost::optional<ModelObject> WaterHeaterStratified_Impl::sourceSideOutletModelObject() const {
1346 83 return demandOutletModelObject();
1347 }
1348
1349 33 ComponentType WaterHeaterStratified_Impl::componentType() const {
1350
1351
10/10
✓ Branch 1 taken 33 times.
✓ Branch 3 taken 30 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 30 times.
✓ Branch 9 taken 30 times.
✓ Branch 12 taken 30 times.
✓ Branch 14 taken 26 times.
✓ Branch 15 taken 4 times.
✓ Branch 16 taken 29 times.
✓ Branch 17 taken 4 times.
33 if (isHeater1CapacityAutosized() || ((heater1Capacity().get() + heater2Capacity()) > 0.01)) {
1352 // If there is a capacity, and it's not zero, it's heating
1353
1/1
✓ Branch 1 taken 29 times.
29 return ComponentType::Heating;
1354 }
1355
1356 // Capacity is zero: it's a storage tank! get the Source loop
1357
2/3
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
8 if (boost::optional<PlantLoop> p_ = secondaryPlantLoop()) {
1358 ✗ return p_->componentType();
1359
1360 // We also need to check if the tank isn't attached to a HPWH, in which case we return Heating
1361 // There's some magic later that'll put the HPWH itself and not the tank on the PlantEquipmentOperation,
1362 // see function operationSchemeComponent()
1363
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
8 } else if (boost::optional<ZoneHVACComponent> zoneComp_ = containingZoneHVACComponent()) {
1364 // We don't have to explicitly check if it's a WaterHeaterHeatPump or WaterHeaterHeatPumpWrappedCondenser since
1365 // these are the only two types of zoneHVACComponent that could have a WaterHeater object, but this might change in the future
1366
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 IddObjectType zoneCompIdd = zoneComp_->iddObjectType();
1367
1/1
✓ Branch 1 taken 2 times.
2 if ((zoneCompIdd == openstudio::IddObjectType::OS_WaterHeater_HeatPump)
1368
4/7
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
2 || (zoneCompIdd == openstudio::IddObjectType::OS_WaterHeater_HeatPump_WrappedCondenser)) {
1369
1/1
✓ Branch 1 taken 2 times.
2 return ComponentType::Heating;
1370 } else {
1371 ✗ OS_ASSERT(false);
1372 ✗ return ComponentType::None;
1373 }
1374 8 }
1375
1376 // It isn't connected to a source side, and has zero capacity, and not part of HPWH => it's a buffer tank => NONE
1377
1/1
✓ Branch 1 taken 2 times.
2 return ComponentType::None;
1378 }
1379
1380 2 std::vector<FuelType> WaterHeaterStratified_Impl::coolingFuelTypes() const {
1381 2 std::set<FuelType> result;
1382
1383 // TODO: only if cap == 0?
1384
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
4 if (boost::optional<PlantLoop> p_ = secondaryPlantLoop()) {
1385 ✗ auto plantFuelTypes = p_->coolingFuelTypes();
1386 ✗ result.insert(plantFuelTypes.begin(), plantFuelTypes.end());
1387 2 }
1388
1389
1/1
✓ Branch 3 taken 2 times.
6 return {result.begin(), result.end()};
1390 2 }
1391
1392 4 std::vector<FuelType> WaterHeaterStratified_Impl::heatingFuelTypes() const {
1393
1394 4 std::set<FuelType> result;
1395
1396
7/10
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 4 times.
✓ Branch 9 taken 4 times.
✓ Branch 12 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 4 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 4 times.
4 if (isHeater1CapacityAutosized() || ((heater1Capacity().get() + heater2Capacity()) > 0.01)) {
1397 // If there is a capacity, and it's not zero, it's heating
1398 ✗ result.insert(FuelType(heaterFuelType()));
1399 }
1400
2/3
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
8 if (boost::optional<PlantLoop> p_ = secondaryPlantLoop()) {
1401 ✗ auto plantFuelTypes = p_->heatingFuelTypes();
1402 ✗ result.insert(plantFuelTypes.begin(), plantFuelTypes.end());
1403 4 }
1404
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (auto zoneComp_ = containingZoneHVACComponent()) {
1405 // The only accepted types are the WaterHeaterHeatPump or WaterHeaterHeatPumpWrappedCondenser so skip the checks
1406
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 result.insert(FuelType::Electricity);
1407 4 }
1408
1409
1/1
✓ Branch 3 taken 4 times.
12 return {result.begin(), result.end()};
1410 4 }
1411
1412 4 std::vector<AppGFuelType> WaterHeaterStratified_Impl::appGHeatingFuelTypes() const {
1413
1414 4 std::set<AppGFuelType> result;
1415
1416
7/10
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 4 times.
✓ Branch 9 taken 4 times.
✓ Branch 12 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 4 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 4 times.
4 if (isHeater1CapacityAutosized() || ((heater1Capacity().get() + heater2Capacity()) > 0.01)) {
1417 // If there is a capacity, and it's not zero, it's heating
1418 ✗ result.insert(convertFuelTypeToAppG(FuelType(heaterFuelType())));
1419 }
1420
2/3
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
8 if (boost::optional<PlantLoop> p_ = secondaryPlantLoop()) {
1421 ✗ auto plantFuelTypes = p_->appGHeatingFuelTypes();
1422 ✗ result.insert(plantFuelTypes.begin(), plantFuelTypes.end());
1423 4 }
1424
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (auto zoneComp_ = containingZoneHVACComponent()) {
1425 // The only accepted types are the WaterHeaterHeatPump or WaterHeaterHeatPumpWrappedCondenser so skip the checks
1426
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 result.insert(AppGFuelType::HeatPump);
1427 4 }
1428
1429
1/1
✓ Branch 3 taken 4 times.
12 return {result.begin(), result.end()};
1430 4 }
1431
1432 } // namespace detail
1433
1434 24 WaterHeaterStratified::WaterHeaterStratified(const Model& model) : WaterToWaterComponent(WaterHeaterStratified::iddObjectType(), model) {
1435
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
✗ Branch 5 not taken.
24 OS_ASSERT(getImpl<detail::WaterHeaterStratified_Impl>());
1436
1437
1/1
✓ Branch 1 taken 24 times.
24 setTankVolume(0.1893); // autosizable
1438
1/1
✓ Branch 1 taken 24 times.
24 setTankHeight(1.4); // autosizable
1439
1440
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setTankShape("VerticalCylinder");
1441
1/1
✓ Branch 1 taken 24 times.
24 setMaximumTemperatureLimit(82.22);
1442
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setHeaterPriorityControl("MasterSlave");
1443
1444
1/1
✓ Branch 1 taken 24 times.
24 ScheduleRuleset setpoint_schedule_1(model);
1445
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
24 setpoint_schedule_1.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 48.89);
1446
1447
1/1
✓ Branch 1 taken 24 times.
24 ScheduleRuleset setpoint_schedule_2(model);
1448
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
24 setpoint_schedule_2.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 48.89);
1449
1450
1/1
✓ Branch 1 taken 24 times.
24 setHeater1SetpointTemperatureSchedule(setpoint_schedule_1);
1451
1/1
✓ Branch 1 taken 24 times.
24 setHeater1DeadbandTemperatureDifference(2);
1452
1/1
✓ Branch 1 taken 24 times.
24 setHeater1Capacity(4500);
1453
1/1
✓ Branch 1 taken 24 times.
24 setHeater1Height(1);
1454
1455
1/1
✓ Branch 1 taken 24 times.
24 setHeater2SetpointTemperatureSchedule(setpoint_schedule_2);
1456
1/1
✓ Branch 1 taken 24 times.
24 setHeater2DeadbandTemperatureDifference(5);
1457
1/1
✓ Branch 1 taken 24 times.
24 setHeater2Capacity(4500);
1458
1/1
✓ Branch 1 taken 24 times.
24 setHeater2Height(0);
1459
1460
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setHeaterFuelType(FuelType::Electricity);
1461
1/1
✓ Branch 1 taken 24 times.
24 setHeaterThermalEfficiency(0.98);
1462
1463
1/1
✓ Branch 1 taken 24 times.
24 setOffCycleParasiticFuelConsumptionRate(10.0);
1464
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setOffCycleParasiticFuelType(FuelType::Electricity);
1465
1/1
✓ Branch 1 taken 24 times.
24 setOffCycleParasiticHeatFractiontoTank(0);
1466
1/1
✓ Branch 1 taken 24 times.
24 setOffCycleParasiticHeight(0);
1467
1468
1/1
✓ Branch 1 taken 24 times.
24 setOnCycleParasiticFuelConsumptionRate(10.0);
1469
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setOnCycleParasiticFuelType(FuelType::Electricity);
1470
1/1
✓ Branch 1 taken 24 times.
24 setOnCycleParasiticHeatFractiontoTank(0);
1471
1/1
✓ Branch 1 taken 24 times.
24 setOnCycleParasiticHeight(0);
1472
1473
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setAmbientTemperatureIndicator("Schedule");
1474
1/1
✓ Branch 1 taken 24 times.
24 ScheduleRuleset amb_schedule(model);
1475
3/3
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
24 amb_schedule.defaultDaySchedule().addValue(Time(0, 24, 0, 0), 22.0);
1476
1/1
✓ Branch 1 taken 24 times.
24 setAmbientTemperatureSchedule(amb_schedule);
1477
1478
1/1
✓ Branch 1 taken 24 times.
24 setSkinLossFractiontoZone(1);
1479
1480
1/1
✓ Branch 1 taken 24 times.
24 setUniformSkinLossCoefficientperUnitAreatoAmbientTemperature(0.846);
1481
1482
1/1
✓ Branch 1 taken 24 times.
24 setOffCycleFlueLossCoefficienttoAmbientTemperature(0);
1483
1/1
✓ Branch 1 taken 24 times.
24 setOffCycleFlueLossFractiontoZone(1);
1484
1485
1/1
✓ Branch 1 taken 24 times.
24 setUseSideEffectiveness(1.0);
1486
1/1
✓ Branch 1 taken 24 times.
24 setUseSideInletHeight(0);
1487
1/1
✓ Branch 1 taken 24 times.
24 autocalculateUseSideOutletHeight();
1488
1/1
✓ Branch 1 taken 24 times.
24 setSourceSideEffectiveness(1.0);
1489
1/1
✓ Branch 1 taken 24 times.
24 autocalculateSourceSideInletHeight();
1490
1/1
✓ Branch 1 taken 24 times.
24 setSourceSideOutletHeight(0);
1491
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setInletMode("Fixed");
1492
1/1
✓ Branch 1 taken 24 times.
24 autosizeUseSideDesignFlowRate();
1493
1/1
✓ Branch 1 taken 24 times.
24 autosizeSourceSideDesignFlowRate();
1494
1/1
✓ Branch 1 taken 24 times.
24 setIndirectWaterHeatingRecoveryTime(1.5);
1495
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setEndUseSubcategory("General");
1496
1497
1/1
✓ Branch 1 taken 24 times.
24 setNumberofNodes(6);
1498
1/1
✓ Branch 1 taken 24 times.
24 setAdditionalDestratificationConductivity(0.1);
1499
1/1
✓ Branch 1 taken 24 times.
24 setNode1AdditionalLossCoefficient(0.15);
1500
1/1
✓ Branch 1 taken 24 times.
24 setNode2AdditionalLossCoefficient(0);
1501
1/1
✓ Branch 1 taken 24 times.
24 setNode3AdditionalLossCoefficient(0);
1502
1/1
✓ Branch 1 taken 24 times.
24 setNode4AdditionalLossCoefficient(0);
1503
1/1
✓ Branch 1 taken 24 times.
24 setNode5AdditionalLossCoefficient(0);
1504
1/1
✓ Branch 1 taken 24 times.
24 setNode6AdditionalLossCoefficient(0.1);
1505
1/1
✓ Branch 1 taken 24 times.
24 setNode7AdditionalLossCoefficient(0);
1506
1/1
✓ Branch 1 taken 24 times.
24 setNode8AdditionalLossCoefficient(0);
1507
1/1
✓ Branch 1 taken 24 times.
24 setNode9AdditionalLossCoefficient(0);
1508
1/1
✓ Branch 1 taken 24 times.
24 setNode10AdditionalLossCoefficient(0);
1509
1/1
✓ Branch 1 taken 24 times.
24 setNode11AdditionalLossCoefficient(0);
1510
1/1
✓ Branch 1 taken 24 times.
24 setNode12AdditionalLossCoefficient(0);
1511
1512
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 setSourceSideFlowControlMode("IndirectHeatPrimarySetpoint");
1513
1514
1/1
✓ Branch 1 taken 24 times.
24 WaterHeaterSizing waterHeaterSizing(*this);
1515 24 }
1516
1517 7687 IddObjectType WaterHeaterStratified::iddObjectType() {
1518
1/1
✓ Branch 1 taken 7687 times.
7687 return {IddObjectType::OS_WaterHeater_Stratified};
1519 }
1520
1521 ✗ std::vector<std::string> WaterHeaterStratified::tankShapeValues() {
1522 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::TankShape);
1523 }
1524
1525 ✗ std::vector<std::string> WaterHeaterStratified::heaterPriorityControlValues() {
1526 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::HeaterPriorityControl);
1527 }
1528
1529 ✗ std::vector<std::string> WaterHeaterStratified::heaterFuelTypeValues() {
1530 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::HeaterFuelType);
1531 }
1532
1533 ✗ std::vector<std::string> WaterHeaterStratified::offCycleParasiticFuelTypeValues() {
1534 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::OffCycleParasiticFuelType);
1535 }
1536
1537 ✗ std::vector<std::string> WaterHeaterStratified::onCycleParasiticFuelTypeValues() {
1538 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::OnCycleParasiticFuelType);
1539 }
1540
1541 ✗ std::vector<std::string> WaterHeaterStratified::ambientTemperatureIndicatorValues() {
1542 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::AmbientTemperatureIndicator);
1543 }
1544
1545 ✗ std::vector<std::string> WaterHeaterStratified::inletModeValues() {
1546 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::InletMode);
1547 }
1548
1549 ✗ std::vector<std::string> WaterHeaterStratified::sourceSideFlowControlModeValues() {
1550 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_WaterHeater_StratifiedFields::SourceSideFlowControlMode);
1551 }
1552
1553 9 std::string WaterHeaterStratified::endUseSubcategory() const {
1554
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->endUseSubcategory();
1555 }
1556
1557 9 boost::optional<double> WaterHeaterStratified::tankVolume() const {
1558
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->tankVolume();
1559 }
1560
1561 9 bool WaterHeaterStratified::isTankVolumeAutosized() const {
1562
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isTankVolumeAutosized();
1563 }
1564
1565 9 boost::optional<double> WaterHeaterStratified::tankHeight() const {
1566
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->tankHeight();
1567 }
1568
1569 9 bool WaterHeaterStratified::isTankHeightAutosized() const {
1570
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isTankHeightAutosized();
1571 }
1572
1573 9 std::string WaterHeaterStratified::tankShape() const {
1574
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->tankShape();
1575 }
1576
1577 9 boost::optional<double> WaterHeaterStratified::tankPerimeter() const {
1578
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->tankPerimeter();
1579 }
1580
1581 9 double WaterHeaterStratified::maximumTemperatureLimit() const {
1582
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->maximumTemperatureLimit();
1583 }
1584
1585 9 std::string WaterHeaterStratified::heaterPriorityControl() const {
1586
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heaterPriorityControl();
1587 }
1588
1589 9 Schedule WaterHeaterStratified::heater1SetpointTemperatureSchedule() const {
1590
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater1SetpointTemperatureSchedule();
1591 }
1592
1593 9 double WaterHeaterStratified::heater1DeadbandTemperatureDifference() const {
1594
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater1DeadbandTemperatureDifference();
1595 }
1596
1597 8 boost::optional<double> WaterHeaterStratified::heater1Capacity() const {
1598
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::WaterHeaterStratified_Impl>()->heater1Capacity();
1599 }
1600
1601 9 bool WaterHeaterStratified::isHeater1CapacityAutosized() const {
1602
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isHeater1CapacityAutosized();
1603 }
1604
1605 9 double WaterHeaterStratified::heater1Height() const {
1606
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater1Height();
1607 }
1608
1609 9 Schedule WaterHeaterStratified::heater2SetpointTemperatureSchedule() const {
1610
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater2SetpointTemperatureSchedule();
1611 }
1612
1613 9 double WaterHeaterStratified::heater2DeadbandTemperatureDifference() const {
1614
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater2DeadbandTemperatureDifference();
1615 }
1616
1617 9 double WaterHeaterStratified::heater2Capacity() const {
1618
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater2Capacity();
1619 }
1620
1621 9 double WaterHeaterStratified::heater2Height() const {
1622
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heater2Height();
1623 }
1624
1625 9 std::string WaterHeaterStratified::heaterFuelType() const {
1626
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->heaterFuelType();
1627 }
1628
1629 11 double WaterHeaterStratified::heaterThermalEfficiency() const {
1630
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::WaterHeaterStratified_Impl>()->heaterThermalEfficiency();
1631 }
1632
1633 9 double WaterHeaterStratified::offCycleParasiticFuelConsumptionRate() const {
1634
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleParasiticFuelConsumptionRate();
1635 }
1636
1637 9 std::string WaterHeaterStratified::offCycleParasiticFuelType() const {
1638
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleParasiticFuelType();
1639 }
1640
1641 9 double WaterHeaterStratified::offCycleParasiticHeatFractiontoTank() const {
1642
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleParasiticHeatFractiontoTank();
1643 }
1644
1645 9 double WaterHeaterStratified::offCycleParasiticHeight() const {
1646
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleParasiticHeight();
1647 }
1648
1649 9 double WaterHeaterStratified::onCycleParasiticFuelConsumptionRate() const {
1650
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->onCycleParasiticFuelConsumptionRate();
1651 }
1652
1653 9 std::string WaterHeaterStratified::onCycleParasiticFuelType() const {
1654
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->onCycleParasiticFuelType();
1655 }
1656
1657 9 double WaterHeaterStratified::onCycleParasiticHeatFractiontoTank() const {
1658
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->onCycleParasiticHeatFractiontoTank();
1659 }
1660
1661 9 double WaterHeaterStratified::onCycleParasiticHeight() const {
1662
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->onCycleParasiticHeight();
1663 }
1664
1665 9 std::string WaterHeaterStratified::ambientTemperatureIndicator() const {
1666
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->ambientTemperatureIndicator();
1667 }
1668
1669 9 boost::optional<Schedule> WaterHeaterStratified::ambientTemperatureSchedule() const {
1670
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->ambientTemperatureSchedule();
1671 }
1672
1673 9 boost::optional<ThermalZone> WaterHeaterStratified::ambientTemperatureThermalZone() const {
1674
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->ambientTemperatureThermalZone();
1675 }
1676
1677 9 boost::optional<std::string> WaterHeaterStratified::ambientTemperatureOutdoorAirNodeName() const {
1678
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->ambientTemperatureOutdoorAirNodeName();
1679 }
1680
1681 9 boost::optional<double> WaterHeaterStratified::uniformSkinLossCoefficientperUnitAreatoAmbientTemperature() const {
1682
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->uniformSkinLossCoefficientperUnitAreatoAmbientTemperature();
1683 }
1684
1685 9 double WaterHeaterStratified::skinLossFractiontoZone() const {
1686
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->skinLossFractiontoZone();
1687 }
1688
1689 9 boost::optional<double> WaterHeaterStratified::offCycleFlueLossCoefficienttoAmbientTemperature() const {
1690
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleFlueLossCoefficienttoAmbientTemperature();
1691 }
1692
1693 9 double WaterHeaterStratified::offCycleFlueLossFractiontoZone() const {
1694
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->offCycleFlueLossFractiontoZone();
1695 }
1696
1697 22 boost::optional<double> WaterHeaterStratified::peakUseFlowRate() const {
1698
1/1
✓ Branch 3 taken 22 times.
22 return getImpl<detail::WaterHeaterStratified_Impl>()->peakUseFlowRate();
1699 }
1700
1701 14 boost::optional<Schedule> WaterHeaterStratified::useFlowRateFractionSchedule() const {
1702
1/1
✓ Branch 3 taken 14 times.
14 return getImpl<detail::WaterHeaterStratified_Impl>()->useFlowRateFractionSchedule();
1703 }
1704
1705 9 boost::optional<Schedule> WaterHeaterStratified::coldWaterSupplyTemperatureSchedule() const {
1706
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->coldWaterSupplyTemperatureSchedule();
1707 }
1708
1709 9 double WaterHeaterStratified::useSideEffectiveness() const {
1710
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->useSideEffectiveness();
1711 }
1712
1713 9 double WaterHeaterStratified::useSideInletHeight() const {
1714
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->useSideInletHeight();
1715 }
1716
1717 ✗ boost::optional<double> WaterHeaterStratified::useSideOutletHeight() const {
1718 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->useSideOutletHeight();
1719 }
1720
1721 9 bool WaterHeaterStratified::isUseSideOutletHeightAutocalculated() const {
1722
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isUseSideOutletHeightAutocalculated();
1723 }
1724
1725 9 double WaterHeaterStratified::sourceSideEffectiveness() const {
1726
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideEffectiveness();
1727 }
1728
1729 ✗ boost::optional<double> WaterHeaterStratified::sourceSideInletHeight() const {
1730 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideInletHeight();
1731 }
1732
1733 9 bool WaterHeaterStratified::isSourceSideInletHeightAutocalculated() const {
1734
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isSourceSideInletHeightAutocalculated();
1735 }
1736
1737 9 double WaterHeaterStratified::sourceSideOutletHeight() const {
1738
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideOutletHeight();
1739 }
1740
1741 9 std::string WaterHeaterStratified::inletMode() const {
1742
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->inletMode();
1743 }
1744
1745 ✗ boost::optional<double> WaterHeaterStratified::useSideDesignFlowRate() const {
1746 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->useSideDesignFlowRate();
1747 }
1748
1749 9 bool WaterHeaterStratified::isUseSideDesignFlowRateAutosized() const {
1750
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isUseSideDesignFlowRateAutosized();
1751 }
1752
1753 ✗ boost::optional<double> WaterHeaterStratified::sourceSideDesignFlowRate() const {
1754 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideDesignFlowRate();
1755 }
1756
1757 9 bool WaterHeaterStratified::isSourceSideDesignFlowRateAutosized() const {
1758
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->isSourceSideDesignFlowRateAutosized();
1759 }
1760
1761 9 double WaterHeaterStratified::indirectWaterHeatingRecoveryTime() const {
1762
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->indirectWaterHeatingRecoveryTime();
1763 }
1764
1765 9 int WaterHeaterStratified::numberofNodes() const {
1766
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->numberofNodes();
1767 }
1768
1769 9 double WaterHeaterStratified::additionalDestratificationConductivity() const {
1770
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->additionalDestratificationConductivity();
1771 }
1772
1773 9 double WaterHeaterStratified::node1AdditionalLossCoefficient() const {
1774
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node1AdditionalLossCoefficient();
1775 }
1776
1777 9 double WaterHeaterStratified::node2AdditionalLossCoefficient() const {
1778
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node2AdditionalLossCoefficient();
1779 }
1780
1781 9 double WaterHeaterStratified::node3AdditionalLossCoefficient() const {
1782
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node3AdditionalLossCoefficient();
1783 }
1784
1785 9 double WaterHeaterStratified::node4AdditionalLossCoefficient() const {
1786
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node4AdditionalLossCoefficient();
1787 }
1788
1789 9 double WaterHeaterStratified::node5AdditionalLossCoefficient() const {
1790
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node5AdditionalLossCoefficient();
1791 }
1792
1793 9 double WaterHeaterStratified::node6AdditionalLossCoefficient() const {
1794
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node6AdditionalLossCoefficient();
1795 }
1796
1797 9 double WaterHeaterStratified::node7AdditionalLossCoefficient() const {
1798
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node7AdditionalLossCoefficient();
1799 }
1800
1801 9 double WaterHeaterStratified::node8AdditionalLossCoefficient() const {
1802
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node8AdditionalLossCoefficient();
1803 }
1804
1805 9 double WaterHeaterStratified::node9AdditionalLossCoefficient() const {
1806
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node9AdditionalLossCoefficient();
1807 }
1808
1809 9 double WaterHeaterStratified::node10AdditionalLossCoefficient() const {
1810
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node10AdditionalLossCoefficient();
1811 }
1812
1813 9 double WaterHeaterStratified::node11AdditionalLossCoefficient() const {
1814
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node11AdditionalLossCoefficient();
1815 }
1816
1817 9 double WaterHeaterStratified::node12AdditionalLossCoefficient() const {
1818
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->node12AdditionalLossCoefficient();
1819 }
1820
1821 9 std::string WaterHeaterStratified::sourceSideFlowControlMode() const {
1822
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideFlowControlMode();
1823 }
1824
1825 9 boost::optional<Schedule> WaterHeaterStratified::indirectAlternateSetpointTemperatureSchedule() const {
1826
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::WaterHeaterStratified_Impl>()->indirectAlternateSetpointTemperatureSchedule();
1827 }
1828
1829 24 bool WaterHeaterStratified::setEndUseSubcategory(const std::string& endUseSubcategory) {
1830
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setEndUseSubcategory(endUseSubcategory);
1831 }
1832
1833 24 bool WaterHeaterStratified::setTankVolume(double tankVolume) {
1834
2/2
✓ Branch 3 taken 24 times.
✓ Branch 6 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setTankVolume(tankVolume);
1835 }
1836
1837 ✗ void WaterHeaterStratified::autosizeTankVolume() {
1838 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->autosizeTankVolume();
1839 ✗ }
1840
1841 24 bool WaterHeaterStratified::setTankHeight(double tankHeight) {
1842
2/2
✓ Branch 3 taken 24 times.
✓ Branch 6 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setTankHeight(tankHeight);
1843 }
1844
1845 ✗ void WaterHeaterStratified::autosizeTankHeight() {
1846 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->autosizeTankHeight();
1847 ✗ }
1848
1849 24 bool WaterHeaterStratified::setTankShape(const std::string& tankShape) {
1850
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setTankShape(tankShape);
1851 }
1852
1853 ✗ bool WaterHeaterStratified::setTankPerimeter(double tankPerimeter) {
1854 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setTankPerimeter(tankPerimeter);
1855 }
1856
1857 ✗ void WaterHeaterStratified::resetTankPerimeter() {
1858 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetTankPerimeter();
1859 ✗ }
1860
1861 24 bool WaterHeaterStratified::setMaximumTemperatureLimit(double maximumTemperatureLimit) {
1862
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setMaximumTemperatureLimit(maximumTemperatureLimit);
1863 }
1864
1865 24 bool WaterHeaterStratified::setHeaterPriorityControl(const std::string& heaterPriorityControl) {
1866
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeaterPriorityControl(heaterPriorityControl);
1867 }
1868
1869 24 bool WaterHeaterStratified::setHeater1SetpointTemperatureSchedule(Schedule& schedule) {
1870
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater1SetpointTemperatureSchedule(schedule);
1871 }
1872
1873 24 bool WaterHeaterStratified::setHeater1DeadbandTemperatureDifference(double heater1DeadbandTemperatureDifference) {
1874
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater1DeadbandTemperatureDifference(heater1DeadbandTemperatureDifference);
1875 }
1876
1877 30 bool WaterHeaterStratified::setHeater1Capacity(double heater1Capacity) {
1878
2/2
✓ Branch 3 taken 30 times.
✓ Branch 6 taken 30 times.
30 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater1Capacity(heater1Capacity);
1879 }
1880
1881 1 void WaterHeaterStratified::autosizeHeater1Capacity() {
1882
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::WaterHeaterStratified_Impl>()->autosizeHeater1Capacity();
1883 1 }
1884
1885 24 bool WaterHeaterStratified::setHeater1Height(double heater1Height) {
1886
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater1Height(heater1Height);
1887 }
1888
1889 24 bool WaterHeaterStratified::setHeater2SetpointTemperatureSchedule(Schedule& schedule) {
1890
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater2SetpointTemperatureSchedule(schedule);
1891 }
1892
1893 24 bool WaterHeaterStratified::setHeater2DeadbandTemperatureDifference(double heater2DeadbandTemperatureDifference) {
1894
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater2DeadbandTemperatureDifference(heater2DeadbandTemperatureDifference);
1895 }
1896
1897 28 bool WaterHeaterStratified::setHeater2Capacity(double heater2Capacity) {
1898
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater2Capacity(heater2Capacity);
1899 }
1900
1901 24 bool WaterHeaterStratified::setHeater2Height(double heater2Height) {
1902
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeater2Height(heater2Height);
1903 }
1904
1905 25 bool WaterHeaterStratified::setHeaterFuelType(const FuelType& heaterFuelType) {
1906
1/1
✓ Branch 3 taken 25 times.
25 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeaterFuelType(heaterFuelType);
1907 }
1908
1909 1 bool WaterHeaterStratified::setHeaterFuelType(const std::string& heaterFuelType) {
1910 try {
1911
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return setHeaterFuelType(FuelType{heaterFuelType});
1912 ✗ } catch (std::runtime_error& e) {
1913 ✗ LOG(Debug, e.what());
1914 ✗ return false;
1915 ✗ }
1916 }
1917
1918 25 bool WaterHeaterStratified::setHeaterThermalEfficiency(double heaterThermalEfficiency) {
1919
1/1
✓ Branch 3 taken 25 times.
25 return getImpl<detail::WaterHeaterStratified_Impl>()->setHeaterThermalEfficiency(heaterThermalEfficiency);
1920 }
1921
1922 24 bool WaterHeaterStratified::setOffCycleParasiticFuelConsumptionRate(double offCycleParasiticFuelConsumptionRate) {
1923
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleParasiticFuelConsumptionRate(offCycleParasiticFuelConsumptionRate);
1924 }
1925
1926 24 bool WaterHeaterStratified::setOffCycleParasiticFuelType(const FuelType& offCycleParasiticFuelType) {
1927
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleParasiticFuelType(offCycleParasiticFuelType);
1928 }
1929
1930 ✗ bool WaterHeaterStratified::setOffCycleParasiticFuelType(const std::string& offCycleParasiticFuelType) {
1931 try {
1932 ✗ return setOffCycleParasiticFuelType(FuelType{offCycleParasiticFuelType});
1933 ✗ } catch (std::runtime_error& e) {
1934 ✗ LOG(Debug, e.what());
1935 ✗ return false;
1936 ✗ }
1937 }
1938
1939 24 bool WaterHeaterStratified::setOffCycleParasiticHeatFractiontoTank(double offCycleParasiticHeatFractiontoTank) {
1940
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleParasiticHeatFractiontoTank(offCycleParasiticHeatFractiontoTank);
1941 }
1942
1943 24 bool WaterHeaterStratified::setOffCycleParasiticHeight(double offCycleParasiticHeight) {
1944
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleParasiticHeight(offCycleParasiticHeight);
1945 }
1946
1947 24 bool WaterHeaterStratified::setOnCycleParasiticFuelConsumptionRate(double onCycleParasiticFuelConsumptionRate) {
1948
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOnCycleParasiticFuelConsumptionRate(onCycleParasiticFuelConsumptionRate);
1949 }
1950
1951 24 bool WaterHeaterStratified::setOnCycleParasiticFuelType(const FuelType& onCycleParasiticFuelType) {
1952
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOnCycleParasiticFuelType(onCycleParasiticFuelType);
1953 }
1954
1955 ✗ bool WaterHeaterStratified::setOnCycleParasiticFuelType(const std::string& onCycleParasiticFuelType) {
1956 try {
1957 ✗ return setOnCycleParasiticFuelType(FuelType{onCycleParasiticFuelType});
1958 ✗ } catch (std::runtime_error& e) {
1959 ✗ LOG(Debug, e.what());
1960 ✗ return false;
1961 ✗ }
1962 }
1963
1964 24 bool WaterHeaterStratified::setOnCycleParasiticHeatFractiontoTank(double onCycleParasiticHeatFractiontoTank) {
1965
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOnCycleParasiticHeatFractiontoTank(onCycleParasiticHeatFractiontoTank);
1966 }
1967
1968 24 bool WaterHeaterStratified::setOnCycleParasiticHeight(double onCycleParasiticHeight) {
1969
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOnCycleParasiticHeight(onCycleParasiticHeight);
1970 }
1971
1972 27 bool WaterHeaterStratified::setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator) {
1973
1/1
✓ Branch 3 taken 27 times.
27 return getImpl<detail::WaterHeaterStratified_Impl>()->setAmbientTemperatureIndicator(ambientTemperatureIndicator);
1974 }
1975
1976 24 bool WaterHeaterStratified::setAmbientTemperatureSchedule(Schedule& schedule) {
1977
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setAmbientTemperatureSchedule(schedule);
1978 }
1979
1980 ✗ void WaterHeaterStratified::resetAmbientTemperatureSchedule() {
1981 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetAmbientTemperatureSchedule();
1982 ✗ }
1983
1984 3 bool WaterHeaterStratified::setAmbientTemperatureThermalZone(const ThermalZone& thermalZone) {
1985
2/2
✓ Branch 3 taken 3 times.
✓ Branch 6 taken 3 times.
3 return getImpl<detail::WaterHeaterStratified_Impl>()->setAmbientTemperatureThermalZone(thermalZone);
1986 }
1987
1988 ✗ void WaterHeaterStratified::resetAmbientTemperatureThermalZone() {
1989 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetAmbientTemperatureThermalZone();
1990 ✗ }
1991
1992 ✗ bool WaterHeaterStratified::setAmbientTemperatureOutdoorAirNodeName(const std::string& ambientTemperatureOutdoorAirNodeName) {
1993 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setAmbientTemperatureOutdoorAirNodeName(ambientTemperatureOutdoorAirNodeName);
1994 }
1995
1996 ✗ void WaterHeaterStratified::resetAmbientTemperatureOutdoorAirNodeName() {
1997 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetAmbientTemperatureOutdoorAirNodeName();
1998 ✗ }
1999
2000 24 bool WaterHeaterStratified::setUniformSkinLossCoefficientperUnitAreatoAmbientTemperature(
2001 double uniformSkinLossCoefficientperUnitAreatoAmbientTemperature) {
2002
2/2
✓ Branch 3 taken 24 times.
✓ Branch 6 taken 24 times.
48 return getImpl<detail::WaterHeaterStratified_Impl>()->setUniformSkinLossCoefficientperUnitAreatoAmbientTemperature(
2003 48 uniformSkinLossCoefficientperUnitAreatoAmbientTemperature);
2004 }
2005
2006 ✗ void WaterHeaterStratified::resetUniformSkinLossCoefficientperUnitAreatoAmbientTemperature() {
2007 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetUniformSkinLossCoefficientperUnitAreatoAmbientTemperature();
2008 ✗ }
2009
2010 24 bool WaterHeaterStratified::setSkinLossFractiontoZone(double skinLossFractiontoZone) {
2011
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setSkinLossFractiontoZone(skinLossFractiontoZone);
2012 }
2013
2014 24 bool WaterHeaterStratified::setOffCycleFlueLossCoefficienttoAmbientTemperature(double offCycleFlueLossCoefficienttoAmbientTemperature) {
2015
2/2
✓ Branch 3 taken 24 times.
✓ Branch 6 taken 24 times.
48 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleFlueLossCoefficienttoAmbientTemperature(
2016 48 offCycleFlueLossCoefficienttoAmbientTemperature);
2017 }
2018
2019 ✗ void WaterHeaterStratified::resetOffCycleFlueLossCoefficienttoAmbientTemperature() {
2020 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetOffCycleFlueLossCoefficienttoAmbientTemperature();
2021 ✗ }
2022
2023 24 bool WaterHeaterStratified::setOffCycleFlueLossFractiontoZone(double offCycleFlueLossFractiontoZone) {
2024
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setOffCycleFlueLossFractiontoZone(offCycleFlueLossFractiontoZone);
2025 }
2026
2027 1 bool WaterHeaterStratified::setPeakUseFlowRate(double peakUseFlowRate) {
2028
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::WaterHeaterStratified_Impl>()->setPeakUseFlowRate(peakUseFlowRate);
2029 }
2030
2031 1 void WaterHeaterStratified::resetPeakUseFlowRate() {
2032
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::WaterHeaterStratified_Impl>()->resetPeakUseFlowRate();
2033 1 }
2034
2035 1 bool WaterHeaterStratified::setUseFlowRateFractionSchedule(Schedule& schedule) {
2036
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::WaterHeaterStratified_Impl>()->setUseFlowRateFractionSchedule(schedule);
2037 }
2038
2039 1 void WaterHeaterStratified::resetUseFlowRateFractionSchedule() {
2040
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::WaterHeaterStratified_Impl>()->resetUseFlowRateFractionSchedule();
2041 1 }
2042
2043 ✗ bool WaterHeaterStratified::setColdWaterSupplyTemperatureSchedule(Schedule& schedule) {
2044 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setColdWaterSupplyTemperatureSchedule(schedule);
2045 }
2046
2047 ✗ void WaterHeaterStratified::resetColdWaterSupplyTemperatureSchedule() {
2048 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetColdWaterSupplyTemperatureSchedule();
2049 ✗ }
2050
2051 24 bool WaterHeaterStratified::setUseSideEffectiveness(double useSideEffectiveness) {
2052
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setUseSideEffectiveness(useSideEffectiveness);
2053 }
2054
2055 24 bool WaterHeaterStratified::setUseSideInletHeight(double useSideInletHeight) {
2056
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setUseSideInletHeight(useSideInletHeight);
2057 }
2058
2059 ✗ bool WaterHeaterStratified::setUseSideOutletHeight(double useSideOutletHeight) {
2060 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setUseSideOutletHeight(useSideOutletHeight);
2061 }
2062
2063 24 void WaterHeaterStratified::autocalculateUseSideOutletHeight() {
2064
1/1
✓ Branch 3 taken 24 times.
24 getImpl<detail::WaterHeaterStratified_Impl>()->autocalculateUseSideOutletHeight();
2065 24 }
2066
2067 24 bool WaterHeaterStratified::setSourceSideEffectiveness(double sourceSideEffectiveness) {
2068
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setSourceSideEffectiveness(sourceSideEffectiveness);
2069 }
2070
2071 ✗ bool WaterHeaterStratified::setSourceSideInletHeight(double sourceSideInletHeight) {
2072 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setSourceSideInletHeight(sourceSideInletHeight);
2073 }
2074
2075 24 void WaterHeaterStratified::autocalculateSourceSideInletHeight() {
2076
1/1
✓ Branch 3 taken 24 times.
24 getImpl<detail::WaterHeaterStratified_Impl>()->autocalculateSourceSideInletHeight();
2077 24 }
2078
2079 24 bool WaterHeaterStratified::setSourceSideOutletHeight(double sourceSideOutletHeight) {
2080
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setSourceSideOutletHeight(sourceSideOutletHeight);
2081 }
2082
2083 24 bool WaterHeaterStratified::setInletMode(const std::string& inletMode) {
2084
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setInletMode(inletMode);
2085 }
2086
2087 ✗ bool WaterHeaterStratified::setUseSideDesignFlowRate(double useSideDesignFlowRate) {
2088 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setUseSideDesignFlowRate(useSideDesignFlowRate);
2089 }
2090
2091 24 void WaterHeaterStratified::autosizeUseSideDesignFlowRate() {
2092
1/1
✓ Branch 3 taken 24 times.
24 getImpl<detail::WaterHeaterStratified_Impl>()->autosizeUseSideDesignFlowRate();
2093 24 }
2094
2095 ✗ bool WaterHeaterStratified::setSourceSideDesignFlowRate(double sourceSideDesignFlowRate) {
2096 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setSourceSideDesignFlowRate(sourceSideDesignFlowRate);
2097 }
2098
2099 24 void WaterHeaterStratified::autosizeSourceSideDesignFlowRate() {
2100
1/1
✓ Branch 3 taken 24 times.
24 getImpl<detail::WaterHeaterStratified_Impl>()->autosizeSourceSideDesignFlowRate();
2101 24 }
2102
2103 24 bool WaterHeaterStratified::setIndirectWaterHeatingRecoveryTime(double indirectWaterHeatingRecoveryTime) {
2104
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setIndirectWaterHeatingRecoveryTime(indirectWaterHeatingRecoveryTime);
2105 }
2106
2107 24 bool WaterHeaterStratified::setNumberofNodes(int numberofNodes) {
2108
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNumberofNodes(numberofNodes);
2109 }
2110
2111 24 bool WaterHeaterStratified::setAdditionalDestratificationConductivity(double additionalDestratificationConductivity) {
2112
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setAdditionalDestratificationConductivity(additionalDestratificationConductivity);
2113 }
2114
2115 24 bool WaterHeaterStratified::setNode1AdditionalLossCoefficient(double node1AdditionalLossCoefficient) {
2116
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode1AdditionalLossCoefficient(node1AdditionalLossCoefficient);
2117 }
2118
2119 24 bool WaterHeaterStratified::setNode2AdditionalLossCoefficient(double node2AdditionalLossCoefficient) {
2120
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode2AdditionalLossCoefficient(node2AdditionalLossCoefficient);
2121 }
2122
2123 24 bool WaterHeaterStratified::setNode3AdditionalLossCoefficient(double node3AdditionalLossCoefficient) {
2124
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode3AdditionalLossCoefficient(node3AdditionalLossCoefficient);
2125 }
2126
2127 24 bool WaterHeaterStratified::setNode4AdditionalLossCoefficient(double node4AdditionalLossCoefficient) {
2128
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode4AdditionalLossCoefficient(node4AdditionalLossCoefficient);
2129 }
2130
2131 24 bool WaterHeaterStratified::setNode5AdditionalLossCoefficient(double node5AdditionalLossCoefficient) {
2132
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode5AdditionalLossCoefficient(node5AdditionalLossCoefficient);
2133 }
2134
2135 24 bool WaterHeaterStratified::setNode6AdditionalLossCoefficient(double node6AdditionalLossCoefficient) {
2136
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode6AdditionalLossCoefficient(node6AdditionalLossCoefficient);
2137 }
2138
2139 24 bool WaterHeaterStratified::setNode7AdditionalLossCoefficient(double node7AdditionalLossCoefficient) {
2140
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode7AdditionalLossCoefficient(node7AdditionalLossCoefficient);
2141 }
2142
2143 24 bool WaterHeaterStratified::setNode8AdditionalLossCoefficient(double node8AdditionalLossCoefficient) {
2144
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode8AdditionalLossCoefficient(node8AdditionalLossCoefficient);
2145 }
2146
2147 24 bool WaterHeaterStratified::setNode9AdditionalLossCoefficient(double node9AdditionalLossCoefficient) {
2148
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode9AdditionalLossCoefficient(node9AdditionalLossCoefficient);
2149 }
2150
2151 24 bool WaterHeaterStratified::setNode10AdditionalLossCoefficient(double node10AdditionalLossCoefficient) {
2152
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode10AdditionalLossCoefficient(node10AdditionalLossCoefficient);
2153 }
2154
2155 24 bool WaterHeaterStratified::setNode11AdditionalLossCoefficient(double node11AdditionalLossCoefficient) {
2156
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode11AdditionalLossCoefficient(node11AdditionalLossCoefficient);
2157 }
2158
2159 24 bool WaterHeaterStratified::setNode12AdditionalLossCoefficient(double node12AdditionalLossCoefficient) {
2160
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setNode12AdditionalLossCoefficient(node12AdditionalLossCoefficient);
2161 }
2162
2163 24 bool WaterHeaterStratified::setSourceSideFlowControlMode(const std::string& sourceSideFlowControlMode) {
2164
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->setSourceSideFlowControlMode(sourceSideFlowControlMode);
2165 }
2166
2167 ✗ bool WaterHeaterStratified::setIndirectAlternateSetpointTemperatureSchedule(Schedule& schedule) {
2168 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->setIndirectAlternateSetpointTemperatureSchedule(schedule);
2169 }
2170
2171 ✗ void WaterHeaterStratified::resetIndirectAlternateSetpointTemperatureSchedule() {
2172 ✗ getImpl<detail::WaterHeaterStratified_Impl>()->resetIndirectAlternateSetpointTemperatureSchedule();
2173 ✗ }
2174
2175 /// @cond
2176
1/1
✓ Branch 3 taken 94 times.
94 WaterHeaterStratified::WaterHeaterStratified(std::shared_ptr<detail::WaterHeaterStratified_Impl> impl) : WaterToWaterComponent(std::move(impl)) {}
2177 /// @endcond
2178
2179 ✗ boost::optional<double> WaterHeaterStratified::autosizedTankVolume() const {
2180 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->autosizedTankVolume();
2181 }
2182
2183 ✗ boost::optional<double> WaterHeaterStratified::autosizedTankHeight() const {
2184 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->autosizedTankHeight();
2185 }
2186
2187 ✗ boost::optional<double> WaterHeaterStratified::autosizedHeater1Capacity() const {
2188 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->autosizedHeater1Capacity();
2189 }
2190
2191 ✗ boost::optional<double> WaterHeaterStratified::autosizedUseSideDesignFlowRate() const {
2192 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->autosizedUseSideDesignFlowRate();
2193 }
2194
2195 ✗ boost::optional<double> WaterHeaterStratified::autosizedSourceSideDesignFlowRate() const {
2196 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->autosizedSourceSideDesignFlowRate();
2197 }
2198
2199 14 WaterHeaterSizing WaterHeaterStratified::waterHeaterSizing() const {
2200
1/1
✓ Branch 3 taken 14 times.
14 return getImpl<detail::WaterHeaterStratified_Impl>()->waterHeaterSizing();
2201 }
2202
2203 // Helper
2204 1 bool WaterHeaterStratified::addToSourceSideNode(Node& node) {
2205
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::WaterHeaterStratified_Impl>()->addToSourceSideNode(node);
2206 }
2207
2208 // Name aliases
2209 24 boost::optional<PlantLoop> WaterHeaterStratified::sourceSidePlantLoop() const {
2210
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSidePlantLoop();
2211 }
2212
2213 12 boost::optional<PlantLoop> WaterHeaterStratified::useSidePlantLoop() const {
2214
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::WaterHeaterStratified_Impl>()->useSidePlantLoop();
2215 }
2216
2217 3 bool WaterHeaterStratified::removeFromSourceSidePlantLoop() {
2218
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::WaterHeaterStratified_Impl>()->removeFromSourceSidePlantLoop();
2219 }
2220
2221 ✗ boost::optional<ModelObject> WaterHeaterStratified::useSideInletModelObject() const {
2222 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->useSideInletModelObject();
2223 }
2224
2225 ✗ boost::optional<ModelObject> WaterHeaterStratified::useSideOutletModelObject() const {
2226 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->useSideOutletModelObject();
2227 }
2228
2229 ✗ boost::optional<ModelObject> WaterHeaterStratified::sourceSideInletModelObject() const {
2230 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideInletModelObject();
2231 }
2232
2233 ✗ boost::optional<ModelObject> WaterHeaterStratified::sourceSideOutletModelObject() const {
2234 ✗ return getImpl<detail::WaterHeaterStratified_Impl>()->sourceSideOutletModelObject();
2235 }
2236
2237 } // namespace model
2238 } // namespace openstudio
2239