Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : #include <EnergyPlus/Autosizing/All_Simple_Sizing.hh>
49 : #include <EnergyPlus/Data/EnergyPlusData.hh>
50 : #include <EnergyPlus/DataEnvironment.hh>
51 : #include <EnergyPlus/DesiccantDehumidifiers.hh>
52 : #include <EnergyPlus/General.hh>
53 : #include <EnergyPlus/Psychrometrics.hh>
54 :
55 : namespace EnergyPlus {
56 :
57 631 : Real64 AutoCalculateSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
58 : {
59 631 : if (!this->checkInitialized(state, errorsFound)) {
60 0 : return 0.0;
61 : }
62 631 : this->preSize(state, _originalValue);
63 631 : if (this->dataEMSOverrideON) {
64 0 : this->autoSizedValue = this->dataEMSOverride;
65 : } else {
66 631 : this->autoSizedValue = this->dataConstantUsedForSizing * this->dataFractionUsedForSizing;
67 : }
68 631 : this->selectSizerOutput(state, errorsFound);
69 631 : return this->autoSizedValue;
70 : }
71 :
72 311 : Real64 MaxHeaterOutletTempSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
73 : {
74 311 : if (!this->checkInitialized(state, errorsFound)) {
75 0 : return 0.0;
76 : }
77 311 : this->preSize(state, _originalValue);
78 311 : if (this->curZoneEqNum > 0) {
79 208 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
80 0 : this->autoSizedValue = _originalValue;
81 : } else {
82 208 : this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).HeatDesTemp;
83 : }
84 103 : } else if (this->curSysNum > 0) {
85 103 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
86 11 : this->autoSizedValue = _originalValue;
87 : } else {
88 92 : this->autoSizedValue = this->finalSysSizing(this->curSysNum).HeatSupTemp;
89 : }
90 : }
91 311 : this->selectSizerOutput(state, errorsFound);
92 311 : return this->autoSizedValue;
93 : }
94 :
95 3 : Real64 ZoneCoolingLoadSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
96 : {
97 3 : if (!this->checkInitialized(state, errorsFound)) {
98 0 : return 0.0;
99 : }
100 3 : this->preSize(state, _originalValue);
101 3 : if (this->curZoneEqNum > 0) {
102 3 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
103 0 : this->autoSizedValue = _originalValue;
104 : } else {
105 3 : this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesCoolLoad;
106 : }
107 0 : } else if (this->curSysNum > 0) {
108 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
109 0 : this->autoSizedValue = _originalValue;
110 : } else {
111 : // not implemented
112 0 : this->errorType = AutoSizingResultType::ErrorType1;
113 0 : this->autoSizedValue = 0.0;
114 0 : std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName + ", Airloop equipment not implemented.";
115 0 : this->addErrorMessage(msg);
116 : }
117 : }
118 3 : this->selectSizerOutput(state, errorsFound);
119 3 : return this->autoSizedValue;
120 : }
121 :
122 3 : Real64 ZoneHeatingLoadSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
123 : {
124 3 : if (!this->checkInitialized(state, errorsFound)) {
125 0 : return 0.0;
126 : }
127 3 : this->preSize(state, _originalValue);
128 3 : if (this->curZoneEqNum > 0) {
129 3 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
130 0 : this->autoSizedValue = _originalValue;
131 : } else {
132 3 : this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatLoad;
133 : }
134 0 : } else if (this->curSysNum > 0) {
135 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
136 0 : this->autoSizedValue = _originalValue;
137 : } else {
138 : // not implemented
139 0 : this->errorType = AutoSizingResultType::ErrorType1;
140 0 : this->autoSizedValue = 0.0;
141 0 : std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName + ", Airloop equipment not implemented.";
142 0 : this->addErrorMessage(msg);
143 : }
144 : }
145 3 : this->selectSizerOutput(state, errorsFound);
146 3 : return this->autoSizedValue;
147 : }
148 :
149 0 : Real64 ASHRAEMinSATCoolingSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
150 : {
151 0 : if (!this->checkInitialized(state, errorsFound)) {
152 0 : return 0.0;
153 : }
154 0 : this->preSize(state, _originalValue);
155 0 : if (this->curZoneEqNum > 0) {
156 0 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
157 0 : this->autoSizedValue = _originalValue;
158 : } else {
159 0 : if (this->dataCapacityUsedForSizing > 0.0 && this->dataFlowUsedForSizing > 0.0) {
160 0 : this->autoSizedValue =
161 0 : this->finalZoneSizing(this->curZoneEqNum).ZoneTempAtCoolPeak -
162 0 : (this->dataCapacityUsedForSizing / (this->dataFlowUsedForSizing * state.dataEnvrn->StdRhoAir *
163 0 : Psychrometrics::PsyCpAirFnW(this->finalZoneSizing(this->curZoneEqNum).ZoneHumRatAtCoolPeak)));
164 : } else {
165 0 : this->errorType = AutoSizingResultType::ErrorType1;
166 : std::string msg =
167 0 : this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
168 0 : this->addErrorMessage(msg);
169 0 : ShowSevereError(state, msg);
170 0 : msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing);
171 0 : this->addErrorMessage(msg);
172 0 : ShowContinueError(state, msg);
173 0 : msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing);
174 0 : this->addErrorMessage(msg);
175 0 : ShowContinueError(state, msg);
176 : }
177 : }
178 0 : } else if (this->curSysNum > 0) {
179 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
180 0 : this->autoSizedValue = _originalValue;
181 : } else {
182 0 : if (this->dataCapacityUsedForSizing > 0.0 && this->dataFlowUsedForSizing > 0.0 && this->dataZoneUsedForSizing > 0) {
183 0 : this->autoSizedValue = this->finalZoneSizing(this->dataZoneUsedForSizing).ZoneTempAtCoolPeak -
184 0 : (this->dataCapacityUsedForSizing /
185 0 : (this->dataFlowUsedForSizing * state.dataEnvrn->StdRhoAir *
186 0 : Psychrometrics::PsyCpAirFnW(this->finalZoneSizing(this->dataZoneUsedForSizing).ZoneHumRatAtCoolPeak)));
187 : } else {
188 0 : this->errorType = AutoSizingResultType::ErrorType1;
189 : std::string msg =
190 0 : this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
191 0 : this->addErrorMessage(msg);
192 0 : ShowSevereError(state, msg);
193 0 : msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing);
194 0 : this->addErrorMessage(msg);
195 0 : ShowContinueError(state, msg);
196 0 : msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing);
197 0 : this->addErrorMessage(msg);
198 0 : ShowContinueError(state, msg);
199 0 : msg = format("SizingString = {}, DataZoneUsedForSizing = {:.0T}", this->sizingString, Real64(this->dataZoneUsedForSizing));
200 0 : ShowContinueError(state, msg);
201 : }
202 : }
203 : }
204 0 : this->selectSizerOutput(state, errorsFound);
205 0 : return this->autoSizedValue;
206 : }
207 :
208 0 : Real64 ASHRAEMaxSATHeatingSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
209 : {
210 0 : if (!this->checkInitialized(state, errorsFound)) {
211 0 : return 0.0;
212 : }
213 0 : this->preSize(state, _originalValue);
214 0 : if (this->curZoneEqNum > 0) {
215 0 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
216 0 : this->autoSizedValue = _originalValue;
217 : } else {
218 0 : if (this->dataCapacityUsedForSizing > 0.0 && this->dataFlowUsedForSizing > 0.0) {
219 0 : this->autoSizedValue =
220 0 : this->finalZoneSizing(this->curZoneEqNum).ZoneTempAtHeatPeak +
221 0 : (this->dataCapacityUsedForSizing / (this->dataFlowUsedForSizing * state.dataEnvrn->StdRhoAir *
222 0 : Psychrometrics::PsyCpAirFnW(this->finalZoneSizing(this->curZoneEqNum).ZoneHumRatAtHeatPeak)));
223 : } else {
224 0 : this->errorType = AutoSizingResultType::ErrorType1;
225 : std::string msg =
226 0 : this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
227 0 : this->addErrorMessage(msg);
228 0 : ShowSevereError(state, msg);
229 0 : msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing);
230 0 : this->addErrorMessage(msg);
231 0 : ShowContinueError(state, msg);
232 0 : msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing);
233 0 : this->addErrorMessage(msg);
234 0 : ShowContinueError(state, msg);
235 : }
236 : }
237 0 : } else if (this->curSysNum > 0) {
238 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
239 0 : this->autoSizedValue = _originalValue;
240 : } else {
241 0 : if (this->dataCapacityUsedForSizing > 0.0 && this->dataFlowUsedForSizing > 0.0 && this->dataZoneUsedForSizing > 0) {
242 0 : this->autoSizedValue = this->finalZoneSizing(this->dataZoneUsedForSizing).ZoneTempAtHeatPeak +
243 0 : (this->dataCapacityUsedForSizing /
244 0 : (this->dataFlowUsedForSizing * state.dataEnvrn->StdRhoAir *
245 0 : Psychrometrics::PsyCpAirFnW(this->finalZoneSizing(this->dataZoneUsedForSizing).ZoneHumRatAtHeatPeak)));
246 : } else {
247 0 : this->errorType = AutoSizingResultType::ErrorType1;
248 : std::string msg =
249 0 : this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
250 0 : this->addErrorMessage(msg);
251 0 : ShowSevereError(state, msg);
252 0 : msg = format("SizingString = {}, DataCapacityUsedForSizing = {:.1T}", this->sizingString, this->dataCapacityUsedForSizing);
253 0 : this->addErrorMessage(msg);
254 0 : ShowContinueError(state, msg);
255 0 : msg = format("SizingString = {}, DataFlowUsedForSizing = {:.1T}", this->sizingString, this->dataFlowUsedForSizing);
256 0 : this->addErrorMessage(msg);
257 0 : ShowContinueError(state, msg);
258 0 : msg = format("SizingString = {}, DataZoneUsedForSizing = {:.0T}", this->sizingString, Real64(this->dataZoneUsedForSizing));
259 0 : ShowContinueError(state, msg);
260 : }
261 : }
262 : }
263 0 : this->selectSizerOutput(state, errorsFound);
264 0 : return this->autoSizedValue;
265 : }
266 :
267 7 : Real64 DesiccantDehumidifierBFPerfDataFaceVelocitySizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
268 : {
269 7 : if (!this->checkInitialized(state, errorsFound)) {
270 0 : return 0.0;
271 : }
272 7 : this->preSize(state, _originalValue);
273 7 : if (this->dataEMSOverrideON) {
274 0 : this->autoSizedValue = this->dataEMSOverride;
275 : } else {
276 7 : this->autoSizedValue = 4.30551 + 0.01969 * this->dataAirFlowUsedForSizing;
277 7 : this->autoSizedValue = min(6.0, this->autoSizedValue);
278 : }
279 7 : if (this->isEpJSON) this->sizingString = "nominal_air_face_velocity [m/s]";
280 7 : this->selectSizerOutput(state, errorsFound);
281 7 : return this->autoSizedValue;
282 : }
283 :
284 0 : Real64 HeatingCoilDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
285 : {
286 0 : if (!this->checkInitialized(state, errorsFound)) {
287 0 : return 0.0;
288 : }
289 0 : this->preSize(state, _originalValue);
290 0 : if (this->curZoneEqNum > 0) {
291 0 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
292 0 : this->autoSizedValue = _originalValue;
293 : } else {
294 : // not implemented
295 0 : this->errorType = AutoSizingResultType::ErrorType1;
296 0 : this->autoSizedValue = 0.0;
297 0 : std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName + ", Zone equipment not implemented.";
298 0 : this->addErrorMessage(msg);
299 : }
300 0 : } else if (this->curSysNum > 0) {
301 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
302 0 : this->autoSizedValue = _originalValue;
303 : } else {
304 0 : if (this->dataDesicRegCoil && this->dataDesicDehumNum > 0) {
305 : // change to Data* global
306 0 : if (state.dataDesiccantDehumidifiers->DesicDehum(this->dataDesicDehumNum).RegenInletIsOutsideAirNode) {
307 0 : this->autoSizedValue = this->finalSysSizing(this->curSysNum).HeatOutTemp;
308 : } else {
309 0 : this->autoSizedValue = this->finalSysSizing(this->curSysNum).HeatRetTemp;
310 : }
311 : }
312 : }
313 : }
314 0 : this->selectSizerOutput(state, errorsFound);
315 0 : if (this->isCoilReportObject)
316 0 : state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(
317 : state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum);
318 0 : return this->autoSizedValue;
319 : }
320 :
321 0 : Real64 HeatingCoilDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
322 : {
323 0 : if (!this->checkInitialized(state, errorsFound)) {
324 0 : return 0.0;
325 : }
326 0 : this->preSize(state, _originalValue);
327 0 : if (this->curZoneEqNum > 0) {
328 0 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
329 0 : this->autoSizedValue = _originalValue;
330 : } else {
331 : // not implemented
332 0 : this->errorType = AutoSizingResultType::ErrorType1;
333 0 : this->autoSizedValue = 0.0;
334 0 : std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName + ", Zone equipment not implemented.";
335 0 : this->addErrorMessage(msg);
336 : }
337 0 : } else if (this->curSysNum > 0) {
338 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
339 0 : this->autoSizedValue = _originalValue;
340 : } else {
341 0 : if (this->dataDesicRegCoil && this->dataDesicDehumNum > 0) {
342 : // change to Data* global
343 0 : this->autoSizedValue = state.dataDesiccantDehumidifiers->DesicDehum(this->dataDesicDehumNum).RegenSetPointTemp;
344 : }
345 : }
346 : }
347 0 : this->selectSizerOutput(state, errorsFound);
348 0 : if (this->isCoilReportObject)
349 0 : state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, this->autoSizedValue);
350 0 : return this->autoSizedValue;
351 : }
352 :
353 0 : Real64 HeatingCoilDesAirInletHumRatSizer::size(EnergyPlusData &state, Real64 _originalValue, bool &errorsFound)
354 : {
355 0 : if (!this->checkInitialized(state, errorsFound)) {
356 0 : return 0.0;
357 : }
358 0 : this->preSize(state, _originalValue);
359 0 : if (this->curZoneEqNum > 0) {
360 0 : if (!this->wasAutoSized && !this->sizingDesRunThisZone) {
361 0 : this->autoSizedValue = _originalValue;
362 : } else {
363 : // not implemented
364 0 : this->errorType = AutoSizingResultType::ErrorType1;
365 0 : this->autoSizedValue = 0.0;
366 0 : std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName + ", Zone equipment not implemented.";
367 0 : this->addErrorMessage(msg);
368 : }
369 0 : } else if (this->curSysNum > 0) {
370 0 : if (!this->wasAutoSized && !this->sizingDesRunThisAirSys) {
371 0 : this->autoSizedValue = _originalValue;
372 : } else {
373 0 : if (this->dataDesicRegCoil) {
374 : // change to Data* global
375 0 : if (state.dataDesiccantDehumidifiers->DesicDehum(this->dataDesicDehumNum).RegenInletIsOutsideAirNode) {
376 0 : this->autoSizedValue = this->finalSysSizing(this->curSysNum).HeatOutHumRat;
377 : } else {
378 0 : this->autoSizedValue = this->finalSysSizing(this->curSysNum).HeatRetHumRat;
379 : }
380 : }
381 : }
382 : }
383 0 : this->selectSizerOutput(state, errorsFound);
384 0 : if (this->isCoilReportObject)
385 0 : state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, this->autoSizedValue);
386 0 : return this->autoSizedValue;
387 : }
388 :
389 2313 : } // namespace EnergyPlus
|