GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 1 / 2
Functions: 100.0% 1 / 1 / 2
Branches: -% 0 / 1 / 1

src/model/WaterHeaterStratified_Impl.hpp
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 #ifndef MODEL_WATERHEATERSTRATIFIED_IMPL_HPP
7 #define MODEL_WATERHEATERSTRATIFIED_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "WaterToWaterComponent_Impl.hpp"
11
12 namespace openstudio {
13
14 class FuelType;
15
16 namespace model {
17
18 class Schedule;
19 class ThermalZone;
20 class WaterHeaterSizing;
21 class Node;
22 class PlantLoop;
23
24 namespace detail {
25
26 /** WaterHeaterStratified_Impl is a WaterToWaterComponent_Impl that is the implementation class for WaterHeater:Stratified.*/
27 class MODEL_API WaterHeaterStratified_Impl : public WaterToWaterComponent_Impl
28 {
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 WaterHeaterStratified_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
34
35 WaterHeaterStratified_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
36
37 WaterHeaterStratified_Impl(const WaterHeaterStratified_Impl& other, Model_Impl* model, bool keepHandle);
38
39 47 virtual ~WaterHeaterStratified_Impl() override = default;
40
41 //@}
42 /** @name Virtual Methods */
43 //@{
44
45 virtual const std::vector<std::string>& outputVariableNames() const override;
46
47 virtual IddObjectType iddObjectType() const override;
48
49 virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override;
50
51 // Correspond to the Use Side Nodes
52 virtual unsigned supplyInletPort() const override;
53 virtual unsigned supplyOutletPort() const override;
54
55 // Correspond to the Source Side Nodes
56 virtual unsigned demandInletPort() const override;
57 virtual unsigned demandOutletPort() const override;
58
59 virtual void autosize() override;
60
61 virtual void applySizingValues() override;
62
63 boost::optional<ZoneHVACComponent> containingZoneHVACComponent() const override;
64
65 virtual std::vector<ModelObject> children() const override;
66
67 virtual ModelObject clone(Model model) const override;
68
69 // We have to override to avoid returning the source side plant loop if it is also on the supply side of this one
70 virtual boost::optional<PlantLoop> plantLoop() const override;
71
72 // Override to return the PlantLoop connected to the Source Side Inlet/Outlet Nodes whether that is on the demand or supply side
73 virtual boost::optional<PlantLoop> secondaryPlantLoop() const override;
74
75 virtual bool removeFromSecondaryPlantLoop() override;
76
77 virtual bool addToNode(Node& node) override;
78
79 virtual ComponentType componentType() const override;
80 virtual std::vector<FuelType> coolingFuelTypes() const override;
81 virtual std::vector<FuelType> heatingFuelTypes() const override;
82 virtual std::vector<AppGFuelType> appGHeatingFuelTypes() const override;
83
84 //@}
85 /** @name Getters */
86 //@{
87
88 std::string endUseSubcategory() const;
89
90 boost::optional<double> tankVolume() const;
91
92 bool isTankVolumeAutosized() const;
93
94 boost::optional<double> tankHeight() const;
95
96 bool isTankHeightAutosized() const;
97
98 std::string tankShape() const;
99
100 boost::optional<double> tankPerimeter() const;
101
102 double maximumTemperatureLimit() const;
103
104 std::string heaterPriorityControl() const;
105
106 Schedule heater1SetpointTemperatureSchedule() const;
107
108 double heater1DeadbandTemperatureDifference() const;
109
110 boost::optional<double> heater1Capacity() const;
111
112 bool isHeater1CapacityAutosized() const;
113
114 double heater1Height() const;
115
116 Schedule heater2SetpointTemperatureSchedule() const;
117
118 double heater2DeadbandTemperatureDifference() const;
119
120 double heater2Capacity() const;
121
122 double heater2Height() const;
123
124 std::string heaterFuelType() const;
125
126 double heaterThermalEfficiency() const;
127
128 double offCycleParasiticFuelConsumptionRate() const;
129
130 std::string offCycleParasiticFuelType() const;
131
132 double offCycleParasiticHeatFractiontoTank() const;
133
134 double offCycleParasiticHeight() const;
135
136 double onCycleParasiticFuelConsumptionRate() const;
137
138 std::string onCycleParasiticFuelType() const;
139
140 double onCycleParasiticHeatFractiontoTank() const;
141
142 double onCycleParasiticHeight() const;
143
144 std::string ambientTemperatureIndicator() const;
145
146 boost::optional<Schedule> ambientTemperatureSchedule() const;
147
148 boost::optional<ThermalZone> ambientTemperatureThermalZone() const;
149
150 boost::optional<std::string> ambientTemperatureOutdoorAirNodeName() const;
151
152 boost::optional<double> uniformSkinLossCoefficientperUnitAreatoAmbientTemperature() const;
153
154 double skinLossFractiontoZone() const;
155
156 boost::optional<double> offCycleFlueLossCoefficienttoAmbientTemperature() const;
157
158 double offCycleFlueLossFractiontoZone() const;
159
160 boost::optional<double> peakUseFlowRate() const;
161
162 boost::optional<Schedule> useFlowRateFractionSchedule() const;
163
164 boost::optional<Schedule> coldWaterSupplyTemperatureSchedule() const;
165
166 double useSideEffectiveness() const;
167
168 double useSideInletHeight() const;
169
170 boost::optional<double> useSideOutletHeight() const;
171
172 bool isUseSideOutletHeightAutocalculated() const;
173
174 double sourceSideEffectiveness() const;
175
176 boost::optional<double> sourceSideInletHeight() const;
177
178 bool isSourceSideInletHeightAutocalculated() const;
179
180 double sourceSideOutletHeight() const;
181
182 std::string inletMode() const;
183
184 boost::optional<double> useSideDesignFlowRate() const;
185
186 bool isUseSideDesignFlowRateAutosized() const;
187
188 boost::optional<double> sourceSideDesignFlowRate() const;
189
190 bool isSourceSideDesignFlowRateAutosized() const;
191
192 double indirectWaterHeatingRecoveryTime() const;
193
194 int numberofNodes() const;
195
196 double additionalDestratificationConductivity() const;
197
198 double node1AdditionalLossCoefficient() const;
199
200 double node2AdditionalLossCoefficient() const;
201
202 double node3AdditionalLossCoefficient() const;
203
204 double node4AdditionalLossCoefficient() const;
205
206 double node5AdditionalLossCoefficient() const;
207
208 double node6AdditionalLossCoefficient() const;
209
210 double node7AdditionalLossCoefficient() const;
211
212 double node8AdditionalLossCoefficient() const;
213
214 double node9AdditionalLossCoefficient() const;
215
216 double node10AdditionalLossCoefficient() const;
217
218 double node11AdditionalLossCoefficient() const;
219
220 double node12AdditionalLossCoefficient() const;
221
222 std::string sourceSideFlowControlMode() const;
223
224 boost::optional<Schedule> indirectAlternateSetpointTemperatureSchedule() const;
225
226 boost::optional<double> autosizedTankVolume() const;
227
228 boost::optional<double> autosizedTankHeight() const;
229
230 boost::optional<double> autosizedHeater1Capacity() const;
231
232 boost::optional<double> autosizedUseSideDesignFlowRate() const;
233
234 boost::optional<double> autosizedSourceSideDesignFlowRate() const;
235
236 //@}
237 /** @name Setters */
238 //@{
239
240 bool setEndUseSubcategory(const std::string& endUseSubcategory);
241
242 bool setTankVolume(boost::optional<double> tankVolume);
243
244 void autosizeTankVolume();
245
246 bool setTankHeight(boost::optional<double> tankHeight);
247
248 void autosizeTankHeight();
249
250 bool setTankShape(const std::string& tankShape);
251
252 bool setTankPerimeter(boost::optional<double> tankPerimeter);
253
254 void resetTankPerimeter();
255
256 bool setMaximumTemperatureLimit(double maximumTemperatureLimit);
257
258 bool setHeaterPriorityControl(const std::string& heaterPriorityControl);
259
260 bool setHeater1SetpointTemperatureSchedule(Schedule& schedule);
261
262 bool setHeater1DeadbandTemperatureDifference(double heater1DeadbandTemperatureDifference);
263
264 bool setHeater1Capacity(boost::optional<double> heater1Capacity);
265
266 void autosizeHeater1Capacity();
267
268 bool setHeater1Height(double heater1Height);
269
270 bool setHeater2SetpointTemperatureSchedule(Schedule& schedule);
271
272 bool setHeater2DeadbandTemperatureDifference(double heater2DeadbandTemperatureDifference);
273
274 bool setHeater2Capacity(double heater2Capacity);
275
276 bool setHeater2Height(double heater2Height);
277
278 bool setHeaterFuelType(const FuelType& heaterFuelType);
279
280 bool setHeaterThermalEfficiency(double heaterThermalEfficiency);
281
282 bool setOffCycleParasiticFuelConsumptionRate(double offCycleParasiticFuelConsumptionRate);
283
284 bool setOffCycleParasiticFuelType(const FuelType& offCycleParasiticFuelType);
285
286 bool setOffCycleParasiticHeatFractiontoTank(double offCycleParasiticHeatFractiontoTank);
287
288 bool setOffCycleParasiticHeight(double offCycleParasiticHeight);
289
290 bool setOnCycleParasiticFuelConsumptionRate(double onCycleParasiticFuelConsumptionRate);
291
292 bool setOnCycleParasiticFuelType(const FuelType& onCycleParasiticFuelType);
293
294 bool setOnCycleParasiticHeatFractiontoTank(double onCycleParasiticHeatFractiontoTank);
295
296 bool setOnCycleParasiticHeight(double onCycleParasiticHeight);
297
298 bool setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator);
299
300 bool setAmbientTemperatureSchedule(Schedule& schedule);
301
302 void resetAmbientTemperatureSchedule();
303
304 bool setAmbientTemperatureThermalZone(const boost::optional<ThermalZone>& thermalZone);
305
306 void resetAmbientTemperatureThermalZone();
307
308 bool setAmbientTemperatureOutdoorAirNodeName(boost::optional<std::string> ambientTemperatureOutdoorAirNodeName);
309
310 void resetAmbientTemperatureOutdoorAirNodeName();
311
312 bool setUniformSkinLossCoefficientperUnitAreatoAmbientTemperature(
313 boost::optional<double> uniformSkinLossCoefficientperUnitAreatoAmbientTemperature);
314
315 void resetUniformSkinLossCoefficientperUnitAreatoAmbientTemperature();
316
317 bool setSkinLossFractiontoZone(double skinLossFractiontoZone);
318
319 bool setOffCycleFlueLossCoefficienttoAmbientTemperature(boost::optional<double> offCycleFlueLossCoefficienttoAmbientTemperature);
320
321 void resetOffCycleFlueLossCoefficienttoAmbientTemperature();
322
323 bool setOffCycleFlueLossFractiontoZone(double offCycleFlueLossFractiontoZone);
324
325 bool setPeakUseFlowRate(boost::optional<double> peakUseFlowRate);
326
327 void resetPeakUseFlowRate();
328
329 bool setUseFlowRateFractionSchedule(Schedule& schedule);
330
331 void resetUseFlowRateFractionSchedule();
332
333 bool setColdWaterSupplyTemperatureSchedule(Schedule& schedule);
334
335 void resetColdWaterSupplyTemperatureSchedule();
336
337 bool setUseSideEffectiveness(double useSideEffectiveness);
338
339 bool setUseSideInletHeight(double useSideInletHeight);
340
341 bool setUseSideOutletHeight(boost::optional<double> useSideOutletHeight);
342
343 void autocalculateUseSideOutletHeight();
344
345 bool setSourceSideEffectiveness(double sourceSideEffectiveness);
346
347 bool setSourceSideInletHeight(boost::optional<double> sourceSideInletHeight);
348
349 void autocalculateSourceSideInletHeight();
350
351 bool setSourceSideOutletHeight(double sourceSideOutletHeight);
352
353 bool setInletMode(const std::string& inletMode);
354
355 bool setUseSideDesignFlowRate(boost::optional<double> useSideDesignFlowRate);
356
357 void autosizeUseSideDesignFlowRate();
358
359 bool setSourceSideDesignFlowRate(boost::optional<double> sourceSideDesignFlowRate);
360
361 void autosizeSourceSideDesignFlowRate();
362
363 bool setIndirectWaterHeatingRecoveryTime(double indirectWaterHeatingRecoveryTime);
364
365 bool setNumberofNodes(int numberofNodes);
366
367 bool setAdditionalDestratificationConductivity(double additionalDestratificationConductivity);
368
369 bool setNode1AdditionalLossCoefficient(double node1AdditionalLossCoefficient);
370
371 bool setNode2AdditionalLossCoefficient(double node2AdditionalLossCoefficient);
372
373 bool setNode3AdditionalLossCoefficient(double node3AdditionalLossCoefficient);
374
375 bool setNode4AdditionalLossCoefficient(double node4AdditionalLossCoefficient);
376
377 bool setNode5AdditionalLossCoefficient(double node5AdditionalLossCoefficient);
378
379 bool setNode6AdditionalLossCoefficient(double node6AdditionalLossCoefficient);
380
381 bool setNode7AdditionalLossCoefficient(double node7AdditionalLossCoefficient);
382
383 bool setNode8AdditionalLossCoefficient(double node8AdditionalLossCoefficient);
384
385 bool setNode9AdditionalLossCoefficient(double node9AdditionalLossCoefficient);
386
387 bool setNode10AdditionalLossCoefficient(double node10AdditionalLossCoefficient);
388
389 bool setNode11AdditionalLossCoefficient(double node11AdditionalLossCoefficient);
390
391 bool setNode12AdditionalLossCoefficient(double node12AdditionalLossCoefficient);
392
393 bool setSourceSideFlowControlMode(const std::string& sourceSideFlowControlMode);
394
395 bool setIndirectAlternateSetpointTemperatureSchedule(Schedule& schedule);
396
397 void resetIndirectAlternateSetpointTemperatureSchedule();
398
399 //@}
400 /** @name Other */
401 //@{
402
403 WaterHeaterSizing waterHeaterSizing() const;
404
405 bool addToSourceSideNode(Node& node);
406
407 // Name aliases
408 boost::optional<ModelObject> useSideInletModelObject() const;
409 boost::optional<ModelObject> useSideOutletModelObject() const;
410 boost::optional<ModelObject> sourceSideInletModelObject() const;
411 boost::optional<ModelObject> sourceSideOutletModelObject() const;
412 boost::optional<PlantLoop> sourceSidePlantLoop() const;
413 boost::optional<PlantLoop> useSidePlantLoop() const;
414 bool removeFromSourceSidePlantLoop();
415
416 //@}
417 protected:
418 private:
419 − REGISTER_LOGGER("openstudio.model.WaterHeaterStratified");
420
421 // TODO: Check the return types of these methods.
422 // Optional getters for use by methods like children() so can remove() if the constructor fails.
423 // There are other ways for the public versions of these getters to fail--perhaps all required
424 // objects should be returned as boost::optionals
425 boost::optional<Schedule> optionalHeater1SetpointTemperatureSchedule() const;
426 boost::optional<Schedule> optionalHeater2SetpointTemperatureSchedule() const;
427 };
428
429 } // namespace detail
430
431 } // namespace model
432 } // namespace openstudio
433
434 #endif // MODEL_WATERHEATERSTRATIFIED_IMPL_HPP
435