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/WaterHeaterMixed_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_WATERHEATERMIXED_IMPL_HPP
7 #define MODEL_WATERHEATERMIXED_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 CurveCubic;
20 class ThermalZone;
21 class WaterHeaterSizing;
22 class Node;
23 class PlantLoop;
24
25 namespace detail {
26
27 class MODEL_API WaterHeaterMixed_Impl : public WaterToWaterComponent_Impl
28 {
29
30 public:
31 /** @name Constructors and Destructors */
32 //@{
33
34 WaterHeaterMixed_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
35
36 WaterHeaterMixed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
37
38 WaterHeaterMixed_Impl(const WaterHeaterMixed_Impl& other, Model_Impl* model, bool keepHandle);
39
40 150 virtual ~WaterHeaterMixed_Impl() override = default;
41
42 //@}
43 /** @name Virtual Methods */
44 //@{
45
46 virtual const std::vector<std::string>& outputVariableNames() const override;
47
48 virtual IddObjectType iddObjectType() const override;
49
50 virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override;
51
52 // Correspond to the Use Side Nodes
53 virtual unsigned supplyInletPort() const override;
54 virtual unsigned supplyOutletPort() const override;
55
56 // Correspond to the Source Side Nodes
57 virtual unsigned demandInletPort() const override;
58 virtual unsigned demandOutletPort() const override;
59
60 virtual void autosize() override;
61
62 virtual void applySizingValues() override;
63
64 boost::optional<ZoneHVACComponent> containingZoneHVACComponent() const override;
65
66 virtual std::vector<ModelObject> children() const override;
67
68 virtual ModelObject clone(Model model) const override;
69
70 // We have to override to avoid returning the source side plant loop if it is also on the supply side of this one
71 virtual boost::optional<PlantLoop> plantLoop() const override;
72
73 // Override to return the PlantLoop connected to the Source Side Inlet/Outlet Nodes whether that is on the demand or supply side
74 virtual boost::optional<PlantLoop> secondaryPlantLoop() const override;
75
76 virtual bool removeFromSecondaryPlantLoop() override;
77
78 virtual bool addToNode(Node& node) override;
79
80 virtual ComponentType componentType() const override;
81 virtual std::vector<FuelType> coolingFuelTypes() const override;
82 virtual std::vector<FuelType> heatingFuelTypes() const override;
83 virtual std::vector<AppGFuelType> appGHeatingFuelTypes() const override;
84
85 //@}
86 /** @name Getters */
87 //@{
88
89 boost::optional<double> tankVolume() const;
90
91 bool isTankVolumeDefaulted() const;
92
93 bool isTankVolumeAutosized() const;
94
95 boost::optional<Schedule> setpointTemperatureSchedule() const;
96
97 double deadbandTemperatureDifference() const;
98
99 bool isDeadbandTemperatureDifferenceDefaulted() const;
100
101 boost::optional<double> maximumTemperatureLimit() const;
102
103 std::string heaterControlType() const;
104
105 bool isHeaterControlTypeDefaulted() const;
106
107 boost::optional<double> heaterMaximumCapacity() const;
108
109 bool isHeaterMaximumCapacityAutosized() const;
110
111 boost::optional<double> heaterMinimumCapacity() const;
112
113 double heaterIgnitionMinimumFlowRate() const;
114
115 bool isHeaterIgnitionMinimumFlowRateDefaulted() const;
116
117 double heaterIgnitionDelay() const;
118
119 bool isHeaterIgnitionDelayDefaulted() const;
120
121 std::string heaterFuelType() const;
122
123 boost::optional<double> heaterThermalEfficiency() const;
124
125 boost::optional<CurveCubic> partLoadFactorCurve() const;
126
127 double offCycleParasiticFuelConsumptionRate() const;
128
129 bool isOffCycleParasiticFuelConsumptionRateDefaulted() const;
130
131 boost::optional<std::string> offCycleParasiticFuelType() const;
132
133 double offCycleParasiticHeatFractiontoTank() const;
134
135 bool isOffCycleParasiticHeatFractiontoTankDefaulted() const;
136
137 double onCycleParasiticFuelConsumptionRate() const;
138
139 bool isOnCycleParasiticFuelConsumptionRateDefaulted() const;
140
141 boost::optional<std::string> onCycleParasiticFuelType() const;
142
143 double onCycleParasiticHeatFractiontoTank() const;
144
145 bool isOnCycleParasiticHeatFractiontoTankDefaulted() const;
146
147 std::string ambientTemperatureIndicator() const;
148
149 boost::optional<Schedule> ambientTemperatureSchedule() const;
150
151 boost::optional<ThermalZone> ambientTemperatureThermalZone() const;
152
153 boost::optional<std::string> ambientTemperatureOutdoorAirNodeName() const;
154
155 boost::optional<double> offCycleLossCoefficienttoAmbientTemperature() const;
156
157 double offCycleLossFractiontoThermalZone() const;
158
159 bool isOffCycleLossFractiontoThermalZoneDefaulted() const;
160
161 boost::optional<double> onCycleLossCoefficienttoAmbientTemperature() const;
162
163 double onCycleLossFractiontoThermalZone() const;
164
165 bool isOnCycleLossFractiontoThermalZoneDefaulted() const;
166
167 boost::optional<double> peakUseFlowRate() const;
168
169 boost::optional<Schedule> useFlowRateFractionSchedule() const;
170
171 boost::optional<Schedule> coldWaterSupplyTemperatureSchedule() const;
172
173 double useSideEffectiveness() const;
174
175 bool isUseSideEffectivenessDefaulted() const;
176
177 double sourceSideEffectiveness() const;
178
179 bool isSourceSideEffectivenessDefaulted() const;
180
181 boost::optional<double> useSideDesignFlowRate() const;
182
183 bool isUseSideDesignFlowRateDefaulted() const;
184
185 bool isUseSideDesignFlowRateAutosized() const;
186
187 boost::optional<double> sourceSideDesignFlowRate() const;
188
189 bool isSourceSideDesignFlowRateDefaulted() const;
190
191 bool isSourceSideDesignFlowRateAutosized() const;
192
193 double indirectWaterHeatingRecoveryTime() const;
194
195 bool isIndirectWaterHeatingRecoveryTimeDefaulted() const;
196
197 boost::optional<double> autosizedTankVolume() const;
198
199 boost::optional<double> autosizedHeaterMaximumCapacity() const;
200
201 boost::optional<double> autosizedUseSideDesignFlowRate() const;
202
203 boost::optional<double> autosizedSourceSideDesignFlowRate() const;
204
205 std::string sourceSideFlowControlMode() const;
206
207 boost::optional<Schedule> indirectAlternateSetpointTemperatureSchedule() const;
208
209 std::string endUseSubcategory() const;
210
211 //@}
212 /** @name Setters */
213 //@{
214
215 bool setTankVolume(boost::optional<double> tankVolume);
216
217 void resetTankVolume();
218
219 void autosizeTankVolume();
220
221 bool setSetpointTemperatureSchedule(Schedule& setpointTemperatureSchedule);
222
223 void resetSetpointTemperatureSchedule();
224
225 bool setDeadbandTemperatureDifference(double deadbandTemperatureDifference);
226
227 void resetDeadbandTemperatureDifference();
228
229 bool setMaximumTemperatureLimit(boost::optional<double> maximumTemperatureLimit);
230
231 void resetMaximumTemperatureLimit();
232
233 bool setHeaterControlType(const std::string& heaterControlType);
234
235 void resetHeaterControlType();
236
237 bool setHeaterMaximumCapacity(boost::optional<double> heaterMaximumCapacity);
238
239 void resetHeaterMaximumCapacity();
240
241 void autosizeHeaterMaximumCapacity();
242
243 bool setHeaterMinimumCapacity(boost::optional<double> heaterMinimumCapacity);
244
245 void resetHeaterMinimumCapacity();
246
247 bool setHeaterIgnitionMinimumFlowRate(double heaterIgnitionMinimumFlowRate);
248
249 void resetHeaterIgnitionMinimumFlowRate();
250
251 bool setHeaterIgnitionDelay(double heaterIgnitionDelay);
252
253 void resetHeaterIgnitionDelay();
254
255 bool setHeaterFuelType(const FuelType& heaterFuelType);
256
257 bool setHeaterThermalEfficiency(boost::optional<double> heaterThermalEfficiency);
258
259 void resetHeaterThermalEfficiency();
260
261 bool setPartLoadFactorCurve(const boost::optional<CurveCubic>& partLoadFactorCurve);
262
263 void resetPartLoadFactorCurve();
264
265 bool setOffCycleParasiticFuelConsumptionRate(double offCycleParasiticFuelConsumptionRate);
266
267 void resetOffCycleParasiticFuelConsumptionRate();
268
269 bool setOffCycleParasiticFuelType(const FuelType& offCycleParasiticFuelType);
270
271 void resetOffCycleParasiticFuelType();
272
273 bool setOffCycleParasiticHeatFractiontoTank(double offCycleParasiticHeatFractiontoTank);
274
275 void resetOffCycleParasiticHeatFractiontoTank();
276
277 bool setOnCycleParasiticFuelConsumptionRate(double onCycleParasiticFuelConsumptionRate);
278
279 void resetOnCycleParasiticFuelConsumptionRate();
280
281 bool setOnCycleParasiticFuelType(const FuelType& onCycleParasiticFuelType);
282
283 void resetOnCycleParasiticFuelType();
284
285 bool setOnCycleParasiticHeatFractiontoTank(double onCycleParasiticHeatFractiontoTank);
286
287 void resetOnCycleParasiticHeatFractiontoTank();
288
289 bool setAmbientTemperatureIndicator(const std::string& ambientTemperatureIndicator);
290
291 bool setAmbientTemperatureSchedule(Schedule& ambientTemperatureSchedule);
292
293 void resetAmbientTemperatureSchedule();
294
295 bool setAmbientTemperatureThermalZone(const boost::optional<ThermalZone>& ambientTemperatureThermalZone);
296
297 void resetAmbientTemperatureThermalZone();
298
299 bool setAmbientTemperatureOutdoorAirNodeName(boost::optional<std::string> ambientTemperatureOutdoorAirNodeName);
300
301 void resetAmbientTemperatureOutdoorAirNodeName();
302
303 bool setOffCycleLossCoefficienttoAmbientTemperature(boost::optional<double> offCycleLossCoefficienttoAmbientTemperature);
304
305 void resetOffCycleLossCoefficienttoAmbientTemperature();
306
307 bool setOffCycleLossFractiontoThermalZone(double offCycleLossFractiontoThermalZone);
308
309 void resetOffCycleLossFractiontoThermalZone();
310
311 bool setOnCycleLossCoefficienttoAmbientTemperature(boost::optional<double> onCycleLossCoefficienttoAmbientTemperature);
312
313 void resetOnCycleLossCoefficienttoAmbientTemperature();
314
315 bool setOnCycleLossFractiontoThermalZone(double onCycleLossFractiontoThermalZone);
316
317 void resetOnCycleLossFractiontoThermalZone();
318
319 bool setPeakUseFlowRate(boost::optional<double> peakUseFlowRate);
320
321 void resetPeakUseFlowRate();
322
323 bool setUseFlowRateFractionSchedule(Schedule& useFlowRateFractionSchedule);
324
325 void resetUseFlowRateFractionSchedule();
326
327 bool setColdWaterSupplyTemperatureSchedule(Schedule& coldWaterSupplyTemperatureSchedule);
328
329 void resetColdWaterSupplyTemperatureSchedule();
330
331 bool setUseSideEffectiveness(double useSideEffectiveness);
332
333 void resetUseSideEffectiveness();
334
335 bool setSourceSideEffectiveness(double sourceSideEffectiveness);
336
337 void resetSourceSideEffectiveness();
338
339 bool setUseSideDesignFlowRate(boost::optional<double> useSideDesignFlowRate);
340
341 void resetUseSideDesignFlowRate();
342
343 void autosizeUseSideDesignFlowRate();
344
345 bool setSourceSideDesignFlowRate(boost::optional<double> sourceSideDesignFlowRate);
346
347 void resetSourceSideDesignFlowRate();
348
349 void autosizeSourceSideDesignFlowRate();
350
351 bool setIndirectWaterHeatingRecoveryTime(double indirectWaterHeatingRecoveryTime);
352
353 void resetIndirectWaterHeatingRecoveryTime();
354
355 bool setSourceSideFlowControlMode(const std::string& sourceSideFlowControlMode);
356
357 bool setIndirectAlternateSetpointTemperatureSchedule(Schedule& indirectAlternateSetpointTemperatureSchedule);
358 void resetIndirectAlternateSetpointTemperatureSchedule();
359
360 bool setEndUseSubcategory(const std::string& endUseSubcategory);
361
362 //@}
363 /** @name Other */
364 //@{
365
366 WaterHeaterSizing waterHeaterSizing() const;
367
368 bool addToSourceSideNode(Node& node);
369
370 // Name aliases
371 boost::optional<ModelObject> useSideInletModelObject() const;
372 boost::optional<ModelObject> useSideOutletModelObject() const;
373 boost::optional<ModelObject> sourceSideInletModelObject() const;
374 boost::optional<ModelObject> sourceSideOutletModelObject() const;
375 boost::optional<PlantLoop> sourceSidePlantLoop() const;
376 boost::optional<PlantLoop> useSidePlantLoop() const;
377 bool removeFromSourceSidePlantLoop();
378
379 //@}
380 protected:
381 private:
382 − REGISTER_LOGGER("openstudio.model.WaterHeaterMixed");
383
384 std::vector<std::string> heaterControlTypeValues() const;
385 std::vector<std::string> heaterFuelTypeValues() const;
386 std::vector<std::string> offCycleParasiticFuelTypeValues() const;
387 std::vector<std::string> onCycleParasiticFuelTypeValues() const;
388 std::vector<std::string> ambientTemperatureIndicatorValues() const;
389 std::vector<std::string> sourceSideFlowControlModeValues() const;
390
391 boost::optional<ModelObject> setpointTemperatureScheduleAsModelObject() const;
392 boost::optional<ModelObject> partLoadFactorCurveAsModelObject() const;
393 boost::optional<ModelObject> ambientTemperatureScheduleAsModelObject() const;
394 boost::optional<ModelObject> ambientTemperatureThermalZoneAsModelObject() const;
395 boost::optional<ModelObject> useFlowRateFractionScheduleAsModelObject() const;
396 boost::optional<ModelObject> coldWaterSupplyTemperatureScheduleAsModelObject() const;
397
398 boost::optional<ModelObject> indirectAlternateSetpointTemperatureScheduleAsModelObject() const;
399
400 bool setSetpointTemperatureScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
401 bool setPartLoadFactorCurveAsModelObject(const boost::optional<ModelObject>& modelObject);
402 bool setAmbientTemperatureScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
403 bool setAmbientTemperatureThermalZoneAsModelObject(const boost::optional<ModelObject>& modelObject);
404 bool setUseFlowRateFractionScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
405 bool setColdWaterSupplyTemperatureScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
406
407 bool setIndirectAlternateSetpointTemperatureScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
408 };
409
410 } // namespace detail
411
412 } // namespace model
413 } // namespace openstudio
414
415 #endif // MODEL_WATERHEATERMIXED_IMPL_HPP
416