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/ChillerElectricEIR_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_CHILLERELECTRICEIR_IMPL_HPP
7 #define MODEL_CHILLERELECTRICEIR_IMPL_HPP
8
9 #include "WaterToWaterComponent_Impl.hpp"
10
11 namespace openstudio {
12
13 namespace model {
14
15 class ChillerElectricEIR;
16 class Curve;
17 class Schedule;
18 class Node;
19
20 namespace detail {
21
22 class MODEL_API ChillerElectricEIR_Impl : public WaterToWaterComponent_Impl
23 {
24
25 public:
26 ChillerElectricEIR_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
27
28 ChillerElectricEIR_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
29
30 ChillerElectricEIR_Impl(const ChillerElectricEIR_Impl& other, Model_Impl* model, bool keepHandle);
31
32 37 virtual ~ChillerElectricEIR_Impl() override = default;
33
34 /** @name Virtual Methods */
35 //@{
36
37 virtual ModelObject clone(Model model) const override;
38
39 virtual std::vector<ModelObject> children() const override;
40
41 virtual IddObjectType iddObjectType() const override;
42
43 virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override;
44
45 virtual const std::vector<std::string>& outputVariableNames() const override;
46
47 // chilledWaterLoop
48 virtual unsigned supplyInletPort() const override;
49 virtual unsigned supplyOutletPort() const override;
50
51 // condenserWaterLoop
52 virtual unsigned demandInletPort() const override;
53 virtual unsigned demandOutletPort() const override;
54
55 // heatRecoveryLoop
56 virtual unsigned tertiaryInletPort() const override;
57 virtual unsigned tertiaryOutletPort() const override;
58
59 /* This function will perform a check if trying to add it to a node that is on the demand side of a plant loop.
60 * If:
61 * - the node is on the demand side of a loop
62 * - the node isn't on the current condenser water loop itself
63 * - the chiller doesn't already have a heat recovery (tertiary) loop,
64 * then it tries to add it to the Tertiary loop.
65 * In all other cases, it will call the base class' method WaterToWaterComponent_Impl::addToNode()
66 * If this is connecting to the demand side of a loop (not tertiary), will set the chiller condenserType to WaterCooled
67 */
68 virtual bool addToNode(Node& node) override;
69
70 /* Restricts addToTertiaryNode to a node that is on the demand side of a plant loop (tertiary = Heat Recovery Loop) */
71 virtual bool addToTertiaryNode(Node& node) override;
72
73 /** Override to switch the condenser type to 'AirCooled' **/
74 virtual bool removeFromSecondaryPlantLoop() override;
75
76 virtual void autosize() override;
77
78 virtual void applySizingValues() 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> referenceCapacity() const;
90
91 bool isReferenceCapacityAutosized() const;
92
93 double referenceCOP() const;
94
95 double referenceLeavingChilledWaterTemperature() const;
96
97 bool isReferenceLeavingChilledWaterTemperatureDefaulted() const;
98
99 double referenceEnteringCondenserFluidTemperature() const;
100
101 bool isReferenceEnteringCondenserFluidTemperatureDefaulted() const;
102
103 boost::optional<double> referenceChilledWaterFlowRate() const;
104
105 bool isReferenceChilledWaterFlowRateAutosized() const;
106
107 boost::optional<double> referenceCondenserFluidFlowRate() const;
108
109 bool isReferenceCondenserFluidFlowRateAutosized() const;
110
111 Curve coolingCapacityFunctionOfTemperature() const;
112
113 Curve electricInputToCoolingOutputRatioFunctionOfTemperature() const;
114
115 Curve electricInputToCoolingOutputRatioFunctionOfPLR() const;
116
117 double minimumPartLoadRatio() const;
118
119 bool isMinimumPartLoadRatioDefaulted() const;
120
121 double maximumPartLoadRatio() const;
122
123 bool isMaximumPartLoadRatioDefaulted() const;
124
125 double optimumPartLoadRatio() const;
126
127 bool isOptimumPartLoadRatioDefaulted() const;
128
129 double minimumUnloadingRatio() const;
130
131 bool isMinimumUnloadingRatioDefaulted() const;
132
133 std::string condenserType() const;
134
135 bool isCondenserTypeDefaulted() const;
136
137 double condenserFanPowerRatio() const;
138
139 bool isCondenserFanPowerRatioDefaulted() const;
140
141 double fractionofCompressorElectricConsumptionRejectedbyCondenser() const;
142
143 bool isFractionofCompressorElectricConsumptionRejectedbyCondenserDefaulted() const;
144
145 double leavingChilledWaterLowerTemperatureLimit() const;
146
147 bool isLeavingChilledWaterLowerTemperatureLimitDefaulted() const;
148
149 std::string chillerFlowMode() const;
150
151 bool isChillerFlowModeDefaulted() const;
152
153 boost::optional<double> designHeatRecoveryWaterFlowRate() const;
154
155 bool isDesignHeatRecoveryWaterFlowRateAutosized() const;
156
157 double sizingFactor() const;
158
159 bool isSizingFactorDefaulted() const;
160
161 double basinHeaterCapacity() const;
162
163 bool isBasinHeaterCapacityDefaulted() const;
164
165 double basinHeaterSetpointTemperature() const;
166
167 bool isBasinHeaterSetpointTemperatureDefaulted() const;
168
169 boost::optional<Schedule> basinHeaterSchedule() const;
170
171 double condenserHeatRecoveryRelativeCapacityFraction() const;
172
173 boost::optional<Schedule> heatRecoveryInletHighTemperatureLimitSchedule() const;
174
175 boost::optional<Node> heatRecoveryLeavingTemperatureSetpointNode() const;
176
177 std::string endUseSubcategory() const;
178
179 std::string condenserFlowControl() const;
180
181 boost::optional<Curve> condenserLoopFlowRateFractionFunctionofLoopPartLoadRatioCurve() const;
182
183 boost::optional<Schedule> temperatureDifferenceAcrossCondenserSchedule() const;
184
185 double condenserMinimumFlowFraction() const;
186
187 boost::optional<Curve> thermosiphonCapacityFractionCurve() const;
188
189 double thermosiphonMinimumTemperatureDifference() const;
190
191 //@}
192 /** @name Setters */
193 //@{
194
195 bool setReferenceCapacity(boost::optional<double> referenceCapacity);
196
197 bool setReferenceCapacity(double referenceCapacity);
198
199 void autosizeReferenceCapacity();
200
201 bool setReferenceCOP(double referenceCOP);
202
203 bool setReferenceLeavingChilledWaterTemperature(double referenceLeavingChilledWaterTemperature);
204
205 void resetReferenceLeavingChilledWaterTemperature();
206
207 bool setReferenceEnteringCondenserFluidTemperature(double referenceEnteringCondenserFluidTemperature);
208
209 void resetReferenceEnteringCondenserFluidTemperature();
210
211 bool setReferenceChilledWaterFlowRate(boost::optional<double> referenceChilledWaterFlowRate);
212
213 bool setReferenceChilledWaterFlowRate(double referenceChilledWaterFlowRate);
214
215 void resetReferenceChilledWaterFlowRate();
216
217 void autosizeReferenceChilledWaterFlowRate();
218
219 bool setReferenceCondenserFluidFlowRate(boost::optional<double> referenceCondenserFluidFlowRate);
220
221 bool setReferenceCondenserFluidFlowRate(double referenceCondenserFluidFlowRate);
222
223 void resetReferenceCondenserFluidFlowRate();
224
225 void autosizeReferenceCondenserFluidFlowRate();
226
227 bool setCoolingCapacityFunctionOfTemperature(const Curve&);
228
229 bool setElectricInputToCoolingOutputRatioFunctionOfTemperature(const Curve&);
230
231 bool setElectricInputToCoolingOutputRatioFunctionOfPLR(const Curve&);
232
233 bool setMinimumPartLoadRatio(double minimumPartLoadRatio);
234
235 void resetMinimumPartLoadRatio();
236
237 bool setMaximumPartLoadRatio(double maximumPartLoadRatio);
238
239 void resetMaximumPartLoadRatio();
240
241 bool setOptimumPartLoadRatio(double optimumPartLoadRatio);
242
243 void resetOptimumPartLoadRatio();
244
245 bool setMinimumUnloadingRatio(double minimumUnloadingRatio);
246
247 void resetMinimumUnloadingRatio();
248
249 bool setCondenserType(const std::string& condenserType);
250
251 void resetCondenserType();
252
253 bool setCondenserFanPowerRatio(double condenserFanPowerRatio);
254
255 void resetCondenserFanPowerRatio();
256
257 bool setFractionofCompressorElectricConsumptionRejectedbyCondenser(double fractionofCompressorElectricConsumptionRejectedbyCondenser);
258
259 void resetFractionofCompressorElectricConsumptionRejectedbyCondenser();
260
261 bool setLeavingChilledWaterLowerTemperatureLimit(double leavingChilledWaterLowerTemperatureLimit);
262
263 void resetLeavingChilledWaterLowerTemperatureLimit();
264
265 bool setChillerFlowMode(const std::string& chillerFlowMode);
266
267 void resetChillerFlowMode();
268
269 bool setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate);
270
271 void autosizeDesignHeatRecoveryWaterFlowRate();
272
273 bool setSizingFactor(double sizingFactor);
274
275 void resetSizingFactor();
276
277 bool setBasinHeaterCapacity(double basinHeaterCapacity);
278
279 void resetBasinHeaterCapacity();
280
281 bool setBasinHeaterSetpointTemperature(double basinHeaterSetpointTemperature);
282
283 void resetBasinHeaterSetpointTemperature();
284
285 bool setBasinHeaterSchedule(Schedule& schedule);
286
287 void resetBasinHeaterSchedule();
288
289 bool setCondenserHeatRecoveryRelativeCapacityFraction(double condenserHeatRecoveryRelativeCapacityFraction);
290
291 bool setHeatRecoveryInletHighTemperatureLimitSchedule(Schedule& s);
292 void resetHeatRecoveryInletHighTemperatureLimitSchedule();
293
294 bool setHeatRecoveryLeavingTemperatureSetpointNode(const Node& node);
295 void resetHeatRecoveryLeavingTemperatureSetpointNode();
296
297 bool setEndUseSubcategory(const std::string& endUseSubcategory);
298
299 bool setCondenserFlowControl(const std::string& condenserFlowControl);
300
301 bool
302 setCondenserLoopFlowRateFractionFunctionofLoopPartLoadRatioCurve(const Curve& condenserLoopFlowRateFractionFunctionofLoopPartLoadRatioCurve);
303 void resetCondenserLoopFlowRateFractionFunctionofLoopPartLoadRatioCurve();
304
305 bool setTemperatureDifferenceAcrossCondenserSchedule(Schedule& temperatureDifferenceAcrossCondenserSchedule);
306 void resetTemperatureDifferenceAcrossCondenserSchedule();
307
308 bool setCondenserMinimumFlowFraction(double condenserMinimumFlowFraction);
309
310 bool setThermosiphonCapacityFractionCurve(const Curve& thermosiphonCapacityFractionCurve);
311 void resetThermosiphonCapacityFractionCurve();
312
313 bool setThermosiphonMinimumTemperatureDifference(double thermosiphonMinimumTemperatureDifference);
314
315 //@}
316 /** @name Other */
317 //@{
318
319 boost::optional<double> autosizedReferenceCapacity() const;
320
321 boost::optional<double> autosizedReferenceChilledWaterFlowRate() const;
322
323 boost::optional<double> autosizedReferenceCondenserFluidFlowRate() const;
324
325 boost::optional<double> autosizedDesignHeatRecoveryWaterFlowRate() const;
326
327 /** Convenience Function to return the Chilled Water Loop (chiller on supply) **/
328 boost::optional<PlantLoop> chilledWaterLoop() const;
329 // Same as supplyInletModelObject, but cast to a Node
330 boost::optional<Node> chilledWaterInletNode() const;
331 boost::optional<Node> chilledWaterOutletNode() const;
332
333 /** Convenience Function to return the Condenser Water Loop (chiller on demand side) **/
334 boost::optional<PlantLoop> condenserWaterLoop() const;
335 boost::optional<Node> condenserInletNode() const;
336 boost::optional<Node> condenserOutletNode() const;
337
338 /** Convenience Function to return the Heat Recovery Loop (chiller on demand side - tertiary) **/
339 boost::optional<PlantLoop> heatRecoveryLoop() const;
340 boost::optional<Node> heatRecoveryInletNode() const;
341 boost::optional<Node> heatRecoveryOutletNode() const;
342
343 //@}
344 protected:
345 private:
346 − REGISTER_LOGGER("openstudio.model.ChillerElectricEIR");
347
348 boost::optional<ModelObject> basinHeaterScheduleAsModelObject() const;
349
350 bool setBasinHeaterScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
351 };
352
353 } // namespace detail
354
355 } // namespace model
356
357 } // namespace openstudio
358
359 #endif // MODEL_CHILLERELECTRICEIR_IMPL_HPP
360