Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2024, 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 : // C++ Headers
49 : #include <cmath>
50 : #include <string>
51 :
52 : // EnergyPlus Headers
53 : #include <EnergyPlus/Autosizing/Base.hh>
54 : #include <EnergyPlus/Data/EnergyPlusData.hh>
55 : #include <EnergyPlus/DataDefineEquip.hh>
56 : #include <EnergyPlus/DataEnvironment.hh>
57 : #include <EnergyPlus/DataGlobalConstants.hh>
58 : #include <EnergyPlus/DataHVACGlobals.hh>
59 : #include <EnergyPlus/DataHeatBalance.hh>
60 : #include <EnergyPlus/DataIPShortCuts.hh>
61 : #include <EnergyPlus/DataSizing.hh>
62 : #include <EnergyPlus/DataStringGlobals.hh>
63 : #include <EnergyPlus/DataZoneEquipment.hh>
64 : #include <EnergyPlus/DisplayRoutines.hh>
65 : #include <EnergyPlus/DualDuct.hh>
66 : #include <EnergyPlus/EMSManager.hh>
67 : #include <EnergyPlus/General.hh>
68 : #include <EnergyPlus/HVACCooledBeam.hh>
69 : #include <EnergyPlus/HVACSingleDuctInduc.hh>
70 : #include <EnergyPlus/HeatBalanceManager.hh>
71 : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
72 : #include <EnergyPlus/OutputReportPredefined.hh>
73 : #include <EnergyPlus/OutputReportTabular.hh>
74 : #include <EnergyPlus/PoweredInductionUnits.hh>
75 : #include <EnergyPlus/SQLiteProcedures.hh>
76 : #include <EnergyPlus/ScheduleManager.hh>
77 : #include <EnergyPlus/SimAirServingZones.hh>
78 : #include <EnergyPlus/SingleDuct.hh>
79 : #include <EnergyPlus/SizingManager.hh>
80 : #include <EnergyPlus/UtilityRoutines.hh>
81 : #include <EnergyPlus/WeatherManager.hh>
82 : #include <EnergyPlus/ZoneEquipmentManager.hh>
83 :
84 : namespace EnergyPlus::SizingManager {
85 :
86 : // MODULE INFORMATION:
87 : // AUTHOR Fred Buhl
88 : // DATE WRITTEN December 2000
89 : // MODIFIED na
90 : // RE-ENGINEERED na
91 :
92 : // PURPOSE OF THIS MODULE:
93 : // This module contains the data and routines relating to managing the sizing
94 : // simulations.
95 :
96 : // Using/Aliasing
97 : using namespace HeatBalanceManager;
98 : using namespace DataSizing;
99 : using DataStringGlobals::CharComma;
100 : using DataStringGlobals::CharSpace;
101 : using DataStringGlobals::CharTab;
102 :
103 : constexpr std::array<std::string_view, (int)DataSizing::OAFlowCalcMethod::Num> OAFlowCalcMethodNamesUC{"FLOW/PERSON",
104 : "FLOW/ZONE",
105 : "FLOW/AREA",
106 : "AIRCHANGES/HOUR",
107 : "SUM",
108 : "MAXIMUM",
109 : "INDOORAIRQUALITYPROCEDURE",
110 : "PROPORTIONALCONTROLBASEDONOCCUPANCYSCHEDULE",
111 : "PROPORTIONALCONTROLBASEDONDESIGNOCCUPANCY"};
112 :
113 796 : void ManageSizing(EnergyPlusData &state)
114 : {
115 :
116 : // SUBROUTINE INFORMATION:
117 : // AUTHOR Fred Buhl
118 : // DATE WRITTEN December 2000
119 :
120 : // PURPOSE OF THIS SUBROUTINE:
121 : // This subroutine manages the sizing simulations (using design day condiions)
122 : // for zones, central air systems, and central plants and zone heating and cooling
123 :
124 : // METHODOLOGY EMPLOYED:
125 : // Design day simulations are run with the zones supplied with "Ideal Loads",
126 : // yielding zone design supply air flow rates and zone heating and cooling capacities.
127 : // Design day simulations are run again with central air systems supplied by
128 : // purchased hot and cold water, yielding central heating and cooling capacities.
129 :
130 796 : auto &CalcSysSizing = state.dataSize->CalcSysSizing;
131 796 : auto &SysSizPeakDDNum = state.dataSize->SysSizPeakDDNum;
132 :
133 : // Using/Aliasing
134 : using SimAirServingZones::ManageAirLoops;
135 : using SimAirServingZones::UpdateSysSizing;
136 : using ZoneEquipmentManager::ManageZoneEquipment;
137 : using ZoneEquipmentManager::RezeroZoneSizingArrays;
138 : using ZoneEquipmentManager::UpdateZoneSizing;
139 : using namespace OutputReportPredefined;
140 :
141 : using OutputReportTabular::AllocateLoadComponentArrays;
142 : using OutputReportTabular::ComputeLoadComponentDecayCurve;
143 : using OutputReportTabular::DeallocateLoadComponentArrays;
144 : using OutputReportTabular::hasSizingPeriodsDays;
145 : using OutputReportTabular::isCompLoadRepReq;
146 :
147 : // SUBROUTINE PARAMETER DEFINITIONS:
148 : static constexpr std::string_view RoutineName("ManageSizing: ");
149 :
150 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
151 796 : bool Available(false); // an environment is available to process
152 796 : bool ErrorsFound(false);
153 796 : bool SimAir(false);
154 796 : bool SimZoneEquip(false);
155 796 : int TimeStepInDay(0); // time step number
156 796 : int LastMonth(0);
157 796 : int LastDayOfMonth(0);
158 796 : int AirLoopNum(0); // air loop index
159 796 : std::string curName;
160 : int NumSizingPeriodsPerformed;
161 : int numZoneSizeIter; // number of times to repeat zone sizing calcs. 1 normal, 2 load component reporting
162 : int iZoneCalcIter; // index for repeating the zone sizing calcs
163 : bool isUserReqCompLoadReport;
164 :
165 796 : auto &FinalSysSizing = state.dataSize->FinalSysSizing;
166 :
167 796 : TimeStepInDay = 0;
168 796 : state.dataSize->SysSizingRunDone = false;
169 796 : state.dataSize->ZoneSizingRunDone = false;
170 796 : curName = "Unknown";
171 796 : GetOARequirements(state); // get the OA requirements object
172 796 : GetZoneAirDistribution(state); // get zone air distribution objects
173 796 : GetZoneHVACSizing(state); // get zone HVAC sizing object
174 796 : GetAirTerminalSizing(state); // get air terminal sizing object
175 796 : GetSizingParams(state); // get the building level sizing paramets
176 796 : GetZoneSizingInput(state); // get the Zone Sizing input
177 796 : GetSystemSizingInput(state); // get the System Sizing input
178 796 : GetPlantSizingInput(state); // get the Plant Sizing input
179 :
180 : // okay, check sizing inputs vs desires vs requirements
181 796 : if (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing) {
182 850 : if ((state.dataSize->NumSysSizInput > 0 && state.dataSize->NumZoneSizingInput == 0) ||
183 425 : (!state.dataGlobal->DoZoneSizing && state.dataGlobal->DoSystemSizing && state.dataSize->NumSysSizInput > 0)) {
184 0 : ShowSevereError(state, format("{}Requested System Sizing but did not request Zone Sizing.", RoutineName));
185 0 : ShowContinueError(state, "System Sizing cannot be done without Zone Sizing");
186 0 : ShowFatalError(state, "Program terminates for preceding conditions.");
187 : }
188 : }
189 :
190 : // determine if the second set of zone sizing calculations should be performed
191 : // that include a pulse for the load component reporting
192 796 : isUserReqCompLoadReport = isCompLoadRepReq(state); // check getinput structure if load component report is requested
193 : bool fileHasSizingPeriodDays =
194 796 : hasSizingPeriodsDays(state); // check getinput if SizingPeriod:DesignDays or SizingPeriod:WeatherFileDays are present
195 796 : if (state.dataGlobal->DoZoneSizing && (state.dataSize->NumZoneSizingInput > 0) && fileHasSizingPeriodDays) {
196 422 : state.dataGlobal->CompLoadReportIsReq = isUserReqCompLoadReport;
197 : } else { // produce a warning if the user asked for the report but it will not be generated because sizing is not done
198 374 : if (isUserReqCompLoadReport) {
199 0 : if (fileHasSizingPeriodDays) {
200 0 : ShowWarningError(
201 : state,
202 0 : format("{}The ZoneComponentLoadSummary report was requested but no sizing objects were found so that report cannot be generated.",
203 : RoutineName));
204 : } else {
205 0 : ShowWarningError(state,
206 0 : format("{}The ZoneComponentLoadSummary report was requested but no SizingPeriod:DesignDay or "
207 : "SizingPeriod:WeatherFileDays objects were found so that report cannot be generated.",
208 : RoutineName));
209 : }
210 : }
211 : }
212 796 : if (state.dataGlobal->CompLoadReportIsReq) { // if that report is created then zone sizing calculations are repeated
213 27 : numZoneSizeIter = 2;
214 : } else {
215 769 : numZoneSizeIter = 1;
216 : }
217 :
218 796 : if ((state.dataGlobal->DoZoneSizing) && (state.dataSize->NumZoneSizingInput == 0)) {
219 4 : ShowWarningError(
220 : state,
221 4 : format("{}For a zone sizing run, there must be at least 1 Sizing:Zone input object. SimulationControl Zone Sizing option ignored.",
222 : RoutineName));
223 : }
224 :
225 1232 : if ((state.dataSize->NumZoneSizingInput > 0) &&
226 436 : (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
227 :
228 422 : if (state.dataGlobal->DoDesDaySim || state.dataGlobal->DoWeathSim) {
229 422 : state.dataGlobal->DoOutputReporting = false;
230 : }
231 422 : state.dataGlobal->DoOutputReporting = false;
232 422 : state.dataGlobal->ZoneSizingCalc = true;
233 422 : Available = true;
234 :
235 422 : if (state.dataSize->SizingFileColSep == CharComma) {
236 422 : state.files.zsz.filePath = state.files.outputZszCsvFilePath;
237 0 : } else if (state.dataSize->SizingFileColSep == CharTab) {
238 0 : state.files.zsz.filePath = state.files.outputZszTabFilePath;
239 : } else {
240 0 : state.files.zsz.filePath = state.files.outputZszTxtFilePath;
241 : }
242 :
243 422 : if (state.dataSize->SizingFileColSep == CharComma) {
244 422 : state.files.spsz.filePath = state.files.outputSpszCsvFilePath;
245 0 : } else if (state.dataSize->SizingFileColSep == CharTab) {
246 0 : state.files.spsz.filePath = state.files.outputSpszTabFilePath;
247 : } else {
248 0 : state.files.spsz.filePath = state.files.outputSpszTxtFilePath;
249 : }
250 :
251 422 : state.files.zsz.ensure_open(state, "ManageSizing", state.files.outputControl.zsz);
252 422 : state.files.spsz.ensure_open(state, "ManageSizing", state.files.outputControl.spsz);
253 :
254 422 : ShowMessage(state, "Beginning Zone Sizing Calculations");
255 :
256 422 : Weather::ResetEnvironmentCounter(state);
257 422 : state.dataGlobal->KickOffSizing = true;
258 422 : SetupZoneSizing(state, ErrorsFound); // Should only be done ONCE
259 422 : state.dataGlobal->KickOffSizing = false;
260 :
261 871 : for (iZoneCalcIter = 1; iZoneCalcIter <= numZoneSizeIter; ++iZoneCalcIter) { // normally this is performed once but if load component
262 : // report is requested, these are repeated with a pulse in
263 : // each zone.
264 :
265 : // set flag if performing a "pulse" set of sizing calcs
266 : // the pulse simulation needs to be done first (the 1 in the following line) otherwise
267 : // the difference seen in the loads in the epluspls and epluszsz files are not
268 : // simple decreasing curves but appear as amost random fluctuations.
269 449 : state.dataGlobal->isPulseZoneSizing = (state.dataGlobal->CompLoadReportIsReq && (iZoneCalcIter == 1));
270 449 : if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
271 0 : state.dataGlobal->DoOutputReporting = true;
272 : }
273 :
274 449 : Available = true;
275 :
276 449 : Weather::ResetEnvironmentCounter(state);
277 449 : state.dataSize->CurOverallSimDay = 0;
278 449 : NumSizingPeriodsPerformed = 0;
279 1376 : while (Available) { // loop over environments
280 :
281 1376 : Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
282 :
283 1376 : if (!Available) break;
284 927 : if (ErrorsFound) break;
285 :
286 : // check that environment is one of the design days
287 927 : if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
288 0 : continue;
289 : }
290 :
291 927 : ++NumSizingPeriodsPerformed;
292 :
293 927 : if (state.dataGlobal->DoPureLoadCalc && !state.dataGlobal->isPulseZoneSizing) {
294 0 : if (state.dataSQLiteProcedures->sqlite) {
295 0 : state.dataSQLiteProcedures->sqlite->sqliteBegin();
296 0 : state.dataSQLiteProcedures->sqlite->createSQLiteEnvironmentPeriodRecord(
297 0 : state.dataEnvrn->CurEnvirNum, state.dataEnvrn->EnvironmentName, state.dataGlobal->KindOfSim);
298 0 : state.dataSQLiteProcedures->sqlite->sqliteCommit();
299 : }
300 : }
301 :
302 927 : state.dataGlobal->BeginEnvrnFlag = true;
303 927 : state.dataGlobal->EndEnvrnFlag = false;
304 927 : state.dataEnvrn->EndMonthFlag = false;
305 927 : state.dataGlobal->WarmupFlag = true;
306 927 : state.dataGlobal->DayOfSim = 0;
307 927 : state.dataGlobal->DayOfSimChr = "0";
308 927 : state.dataSize->CurEnvirNumSimDay = 1;
309 927 : ++state.dataSize->CurOverallSimDay;
310 7530 : while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
311 :
312 6603 : ++state.dataGlobal->DayOfSim;
313 6603 : if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
314 33 : ++state.dataSize->CurEnvirNumSimDay;
315 : }
316 :
317 6603 : state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
318 6603 : state.dataGlobal->BeginDayFlag = true;
319 6603 : state.dataGlobal->EndDayFlag = false;
320 :
321 6603 : if (state.dataGlobal->WarmupFlag) {
322 5643 : DisplayString(state, "Warming up");
323 : } else { // (.NOT.WarmupFlag)
324 960 : if (state.dataGlobal->DayOfSim == 1) {
325 927 : if (!state.dataGlobal->isPulseZoneSizing) {
326 873 : DisplayString(state, "Performing Zone Sizing Simulation");
327 : } else {
328 54 : DisplayString(state, "Performing Zone Sizing Simulation for Load Component Report");
329 : }
330 927 : DisplayString(state,
331 1854 : fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
332 : }
333 960 : UpdateZoneSizing(state, Constant::CallIndicator::BeginDay);
334 960 : UpdateFacilitySizing(state, Constant::CallIndicator::BeginDay);
335 : }
336 :
337 165075 : for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= 24; ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
338 :
339 158472 : state.dataGlobal->BeginHourFlag = true;
340 158472 : state.dataGlobal->EndHourFlag = false;
341 :
342 974520 : for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->NumOfTimeStepInHour;
343 816048 : ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
344 :
345 816048 : state.dataGlobal->BeginTimeStepFlag = true;
346 :
347 : // Set the End__Flag variables to true if necessary. Note that
348 : // each flag builds on the previous level. EndDayFlag cannot be
349 : // .TRUE. unless EndHourFlag is also .TRUE., etc. Note that the
350 : // EndEnvrnFlag and the EndSimFlag cannot be set during warmup.
351 : // Note also that BeginTimeStepFlag, EndTimeStepFlag, and the
352 : // SubTimeStepFlags can/will be set/reset in the HVAC Manager.
353 :
354 816048 : if (state.dataGlobal->TimeStep == state.dataGlobal->NumOfTimeStepInHour) {
355 158472 : state.dataGlobal->EndHourFlag = true;
356 158472 : if (state.dataGlobal->HourOfDay == 24) {
357 6603 : state.dataGlobal->EndDayFlag = true;
358 6603 : if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
359 927 : state.dataGlobal->EndEnvrnFlag = true;
360 : }
361 : }
362 : }
363 :
364 : // set flag for pulse used in load component reporting
365 816048 : state.dataGlobal->doLoadComponentPulseNow = CalcdoLoadComponentPulseNow(state,
366 816048 : state.dataGlobal->isPulseZoneSizing,
367 816048 : state.dataGlobal->WarmupFlag,
368 816048 : state.dataGlobal->HourOfDay,
369 816048 : state.dataGlobal->TimeStep,
370 816048 : state.dataGlobal->KindOfSim);
371 :
372 816048 : Weather::ManageWeather(state);
373 :
374 816048 : if (!state.dataGlobal->WarmupFlag) {
375 119280 : TimeStepInDay =
376 119280 : (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep;
377 119280 : if (state.dataGlobal->HourOfDay == 1 && state.dataGlobal->TimeStep == 1) {
378 960 : state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).DateString =
379 2880 : fmt::format("{}/{}", state.dataEnvrn->Month, state.dataEnvrn->DayOfMonth);
380 : }
381 119280 : state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Temp(TimeStepInDay) = state.dataEnvrn->OutDryBulbTemp;
382 119280 : state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).HumRat(TimeStepInDay) = state.dataEnvrn->OutHumRat;
383 119280 : state.dataSize->DesDayWeath(state.dataSize->CurOverallSimDay).Press(TimeStepInDay) = state.dataEnvrn->OutBaroPress;
384 : }
385 :
386 816048 : ManageHeatBalance(state);
387 :
388 816048 : state.dataGlobal->BeginHourFlag = false;
389 816048 : state.dataGlobal->BeginDayFlag = false;
390 816048 : state.dataGlobal->BeginEnvrnFlag = false;
391 816048 : state.dataGlobal->BeginSimFlag = false;
392 :
393 : } // ... End time step (TINC) loop.
394 :
395 158472 : state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
396 :
397 : } // ... End hour loop.
398 :
399 6603 : if (state.dataGlobal->EndDayFlag && !state.dataGlobal->WarmupFlag) {
400 1887 : UpdateZoneSizing(state, Constant::CallIndicator::EndDay);
401 1887 : UpdateFacilitySizing(state, Constant::CallIndicator::EndDay);
402 : }
403 :
404 7563 : if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
405 960 : (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
406 33 : ++state.dataSize->CurOverallSimDay;
407 : }
408 :
409 : } // ... End day loop.
410 :
411 927 : LastMonth = state.dataEnvrn->Month;
412 927 : LastDayOfMonth = state.dataEnvrn->DayOfMonth;
413 :
414 : } // ... End environment loop
415 :
416 449 : if (NumSizingPeriodsPerformed > 0) {
417 449 : UpdateZoneSizing(state, Constant::CallIndicator::EndZoneSizingCalc);
418 449 : UpdateFacilitySizing(state, Constant::CallIndicator::EndZoneSizingCalc);
419 449 : state.dataSize->ZoneSizingRunDone = true;
420 : } else {
421 0 : ShowSevereError(state, format("{}No Sizing periods were performed for Zone Sizing. No Zone Sizing calculations saved.", RoutineName));
422 0 : ErrorsFound = true;
423 : }
424 :
425 449 : if (state.dataGlobal->isPulseZoneSizing && state.dataSizingManager->runZeroingOnce) {
426 27 : RezeroZoneSizingArrays(state); // zero all arrays related to zone sizing.
427 27 : state.dataSizingManager->runZeroingOnce = false;
428 : }
429 : } // loop that repeats the zone sizing calcs for the load component report, if requested
430 :
431 : // both the pulse and normal zone sizing is complete so now post processing of the results is performed
432 422 : if (state.dataGlobal->CompLoadReportIsReq) {
433 : // call the routine that computes the decay curve
434 27 : ComputeLoadComponentDecayCurve(state);
435 : // remove some of the arrays used to derive the decay curves
436 27 : DeallocateLoadComponentArrays(state);
437 : }
438 : }
439 :
440 796 : state.dataGlobal->ZoneSizingCalc = false;
441 796 : state.dataGlobal->DoOutputReporting = false;
442 796 : state.dataEnvrn->Month = LastMonth;
443 796 : state.dataEnvrn->DayOfMonth = LastDayOfMonth;
444 :
445 796 : if ((state.dataGlobal->DoSystemSizing) && (state.dataSize->NumSysSizInput == 0) && (state.dataSizingManager->NumAirLoops > 0)) {
446 4 : ShowWarningError(
447 : state,
448 4 : format("{}For a system sizing run, there must be at least 1 Sizing:System object input. SimulationControl System Sizing option ignored.",
449 : RoutineName));
450 : }
451 :
452 796 : if ((state.dataSize->NumSysSizInput > 0) && (state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
453 :
454 345 : ShowMessage(state, "Beginning System Sizing Calculations");
455 :
456 345 : state.dataGlobal->SysSizingCalc = true;
457 345 : Available = true;
458 345 : if (state.dataSize->SizingFileColSep == CharComma) {
459 345 : state.files.ssz.filePath = state.files.outputSszCsvFilePath;
460 0 : } else if (state.dataSize->SizingFileColSep == CharTab) {
461 0 : state.files.ssz.filePath = state.files.outputSszTabFilePath;
462 : } else {
463 0 : state.files.ssz.filePath = state.files.outputSszTxtFilePath;
464 : }
465 345 : state.files.ssz.ensure_open(state, "ManageSizing", state.files.outputControl.ssz);
466 :
467 345 : SimAir = true;
468 345 : SimZoneEquip = true;
469 :
470 345 : ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
471 345 : ManageAirLoops(state, true, SimAir, SimZoneEquip);
472 344 : SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
473 344 : SimAirServingZones::SizeSysOutdoorAir(state); // System OA can be sized now that TermUnitFinalZoneSizing is initialized
474 344 : Weather::ResetEnvironmentCounter(state);
475 344 : state.dataSize->CurEnvirNumSimDay = 0;
476 344 : state.dataSize->CurOverallSimDay = 0;
477 344 : NumSizingPeriodsPerformed = 0;
478 1401 : while (Available) { // loop over environments
479 :
480 1058 : Weather::GetNextEnvironment(state, Available, ErrorsFound); // get an environment
481 :
482 : // check that environment is one of the design days
483 1058 : if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
484 343 : continue;
485 : }
486 :
487 715 : if (!Available) break;
488 714 : if (ErrorsFound) break;
489 :
490 714 : ++NumSizingPeriodsPerformed;
491 :
492 714 : state.dataGlobal->BeginEnvrnFlag = true;
493 714 : state.dataGlobal->EndEnvrnFlag = false;
494 714 : state.dataGlobal->WarmupFlag = false;
495 714 : state.dataGlobal->DayOfSim = 0;
496 714 : state.dataGlobal->DayOfSimChr = "0";
497 714 : state.dataSize->CurEnvirNumSimDay = 1;
498 714 : ++state.dataSize->CurOverallSimDay;
499 :
500 1440 : while ((state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn) || (state.dataGlobal->WarmupFlag)) { // Begin day loop ...
501 :
502 726 : ++state.dataGlobal->DayOfSim;
503 726 : if (!state.dataGlobal->WarmupFlag && state.dataGlobal->DayOfSim > 1) {
504 12 : ++state.dataSize->CurEnvirNumSimDay;
505 : }
506 726 : state.dataGlobal->DayOfSimChr = fmt::to_string(state.dataGlobal->DayOfSim);
507 726 : state.dataGlobal->BeginDayFlag = true;
508 726 : state.dataGlobal->EndDayFlag = false;
509 :
510 726 : if (state.dataGlobal->WarmupFlag) {
511 0 : DisplayString(state, "Warming up");
512 : } else { // (.NOT.WarmupFlag)
513 726 : if (state.dataGlobal->DayOfSim == 1) {
514 714 : DisplayString(state, "Calculating System sizing");
515 714 : DisplayString(state,
516 1428 : fmt::format("...for Sizing Period: #{} {}", NumSizingPeriodsPerformed, state.dataEnvrn->EnvironmentName));
517 : }
518 726 : UpdateSysSizing(state, Constant::CallIndicator::BeginDay);
519 : }
520 :
521 18150 : for (state.dataGlobal->HourOfDay = 1; state.dataGlobal->HourOfDay <= 24; ++state.dataGlobal->HourOfDay) { // Begin hour loop ...
522 :
523 17424 : state.dataGlobal->BeginHourFlag = true;
524 17424 : state.dataGlobal->EndHourFlag = false;
525 :
526 105024 : for (state.dataGlobal->TimeStep = 1; state.dataGlobal->TimeStep <= state.dataGlobal->NumOfTimeStepInHour;
527 87600 : ++state.dataGlobal->TimeStep) { // Begin time step (TINC) loop ...
528 :
529 87600 : state.dataGlobal->BeginTimeStepFlag = true;
530 :
531 : // Set the End__Flag variables to true if necessary. Note that
532 : // each flag builds on the previous level. EndDayFlag cannot be
533 : // .TRUE. unless EndHourFlag is also .TRUE., etc. Note that the
534 : // EndEnvrnFlag and the EndSimFlag cannot be set during warmup.
535 :
536 87600 : if (state.dataGlobal->TimeStep == state.dataGlobal->NumOfTimeStepInHour) {
537 17424 : state.dataGlobal->EndHourFlag = true;
538 17424 : if (state.dataGlobal->HourOfDay == 24) {
539 726 : state.dataGlobal->EndDayFlag = true;
540 726 : if ((!state.dataGlobal->WarmupFlag) && (state.dataGlobal->DayOfSim == state.dataGlobal->NumOfDayInEnvrn)) {
541 714 : state.dataGlobal->EndEnvrnFlag = true;
542 : }
543 : }
544 : }
545 :
546 87600 : Weather::ManageWeather(state);
547 :
548 87600 : UpdateSysSizing(state, Constant::CallIndicator::DuringDay);
549 :
550 87600 : state.dataGlobal->BeginHourFlag = false;
551 87600 : state.dataGlobal->BeginDayFlag = false;
552 87600 : state.dataGlobal->BeginEnvrnFlag = false;
553 :
554 : } // ... End time step (TINC) loop.
555 :
556 17424 : state.dataGlobal->PreviousHour = state.dataGlobal->HourOfDay;
557 :
558 : } // ... End hour loop.
559 :
560 726 : if (state.dataGlobal->EndDayFlag) UpdateSysSizing(state, Constant::CallIndicator::EndDay);
561 :
562 1452 : if (!state.dataGlobal->WarmupFlag && (state.dataGlobal->DayOfSim > 0) &&
563 726 : (state.dataGlobal->DayOfSim < state.dataGlobal->NumOfDayInEnvrn)) {
564 12 : ++state.dataSize->CurOverallSimDay;
565 : }
566 :
567 : } // ... End day loop.
568 :
569 : } // ... End environment loop
570 :
571 344 : if (NumSizingPeriodsPerformed > 0) {
572 344 : UpdateSysSizing(state, Constant::CallIndicator::EndSysSizingCalc);
573 344 : state.dataSize->SysSizingRunDone = true;
574 : } else {
575 0 : ShowSevereError(state, format("{}No Sizing periods were performed for System Sizing. No System Sizing calculations saved.", RoutineName));
576 0 : ErrorsFound = true;
577 : }
578 542 : } else if ((state.dataSize->NumZoneSizingInput > 0) &&
579 91 : (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
580 : // If zone sizing but no system sizing - still need to set up system zone equipment and transfer zone sizing data to
581 : // TermUnitFinalZoneSizing
582 77 : state.dataGlobal->SysSizingCalc = true; // set true here so equipment does not try to size yet
583 77 : SimAir = true;
584 77 : SimZoneEquip = true;
585 :
586 77 : ManageZoneEquipment(state, true, SimZoneEquip, SimAir);
587 77 : SizingManager::UpdateTermUnitFinalZoneSizing(state); // AirDistUnits have been loaded now so TermUnitSizing values are all in place
588 : }
589 795 : state.dataGlobal->SysSizingCalc = false;
590 :
591 : // report sizing results to eio file
592 795 : if (state.dataSize->ZoneSizingRunDone) {
593 421 : bool isSpace = true;
594 421 : if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
595 18 : for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
596 16 : if (!state.dataZoneEquip->ZoneEquipConfig(state.dataHeatBal->space(spaceNum).zoneNum).IsControlled) continue;
597 28 : reportZoneSizing(state,
598 14 : state.dataHeatBal->space(spaceNum),
599 14 : state.dataSize->FinalSpaceSizing(spaceNum),
600 14 : state.dataSize->CalcFinalSpaceSizing(spaceNum),
601 14 : state.dataSize->CalcSpaceSizing,
602 14 : state.dataSize->SpaceSizing,
603 : isSpace);
604 : }
605 : }
606 421 : isSpace = false;
607 4426 : for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
608 4005 : if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue;
609 7032 : reportZoneSizing(state,
610 3516 : state.dataHeatBal->Zone(CtrlZoneNum),
611 3516 : state.dataSize->FinalZoneSizing(CtrlZoneNum),
612 3516 : state.dataSize->CalcFinalZoneSizing(CtrlZoneNum),
613 3516 : state.dataSize->CalcZoneSizing,
614 3516 : state.dataSize->ZoneSizing,
615 : isSpace);
616 : }
617 : }
618 : // Deallocate arrays no longer needed
619 795 : state.dataSize->ZoneSizing.deallocate();
620 : // CalcZoneSizing.deallocate();
621 795 : if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
622 2 : state.dataSize->SpaceSizing.deallocate();
623 : }
624 :
625 795 : if (state.dataSize->SysSizingRunDone) {
626 1301 : for (AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
627 957 : curName = FinalSysSizing(AirLoopNum).AirPriLoopName;
628 957 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcClAir, curName, CalcSysSizing(AirLoopNum).DesCoolVolFlow);
629 957 : if (std::abs(CalcSysSizing(AirLoopNum).DesCoolVolFlow) <= 1.e-8) {
630 0 : ShowWarningError(state,
631 0 : format("{}Calculated Cooling Design Air Flow Rate for System={} is zero.",
632 : RoutineName,
633 0 : FinalSysSizing(AirLoopNum).AirPriLoopName));
634 0 : ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
635 : }
636 957 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserClAir, curName, FinalSysSizing(AirLoopNum).DesCoolVolFlow);
637 957 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizCalcHtAir, curName, CalcSysSizing(AirLoopNum).DesHeatVolFlow);
638 957 : if (std::abs(CalcSysSizing(AirLoopNum).DesHeatVolFlow) <= 1.e-8) {
639 8 : ShowWarningError(state,
640 8 : format("{}Calculated Heating Design Air Flow Rate for System={} is zero.",
641 : RoutineName,
642 4 : FinalSysSizing(AirLoopNum).AirPriLoopName));
643 4 : ShowContinueError(state, "Check Sizing:Zone and ZoneControl:Thermostat inputs.");
644 : }
645 957 : std::string_view coolPeakLoadKind;
646 957 : std::string coolPeakDDDate;
647 957 : int coolPeakDD = 0;
648 957 : Real64 coolCap = 0.;
649 957 : int timeStepIndexAtPeakCoolLoad = 0;
650 957 : if (FinalSysSizing(AirLoopNum).coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) {
651 947 : coolPeakLoadKind = "Sensible";
652 947 : coolPeakDDDate = SysSizPeakDDNum(AirLoopNum).cSensCoolPeakDDDate;
653 947 : coolPeakDD = SysSizPeakDDNum(AirLoopNum).SensCoolPeakDD;
654 947 : coolCap = FinalSysSizing(AirLoopNum).SensCoolCap;
655 947 : if (coolPeakDD > 0) timeStepIndexAtPeakCoolLoad = SysSizPeakDDNum(AirLoopNum).TimeStepAtSensCoolPk(coolPeakDD);
656 10 : } else if (FinalSysSizing(AirLoopNum).coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) {
657 10 : if (FinalSysSizing(AirLoopNum).loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing) {
658 1 : coolPeakLoadKind = "Total Based on Latent";
659 : } else {
660 9 : coolPeakLoadKind = "Total";
661 : }
662 10 : coolPeakDDDate = SysSizPeakDDNum(AirLoopNum).cTotCoolPeakDDDate;
663 10 : coolPeakDD = SysSizPeakDDNum(AirLoopNum).TotCoolPeakDD;
664 10 : coolCap = FinalSysSizing(AirLoopNum).TotCoolCap;
665 10 : if (coolPeakDD > 0) timeStepIndexAtPeakCoolLoad = SysSizPeakDDNum(AirLoopNum).TimeStepAtTotCoolPk(coolPeakDD);
666 : }
667 957 : if (coolPeakDD > 0) {
668 957 : ReportSysSizing(state,
669 : curName,
670 : "Cooling",
671 : coolPeakLoadKind,
672 : coolCap,
673 957 : CalcSysSizing(AirLoopNum).DesCoolVolFlow,
674 957 : FinalSysSizing(AirLoopNum).DesCoolVolFlow,
675 957 : FinalSysSizing(AirLoopNum).CoolDesDay,
676 : coolPeakDDDate,
677 : timeStepIndexAtPeakCoolLoad);
678 : } else {
679 0 : ReportSysSizing(state,
680 : curName,
681 : "Cooling",
682 : coolPeakLoadKind,
683 : coolCap,
684 0 : CalcSysSizing(AirLoopNum).DesCoolVolFlow,
685 0 : FinalSysSizing(AirLoopNum).DesCoolVolFlow,
686 0 : FinalSysSizing(AirLoopNum).CoolDesDay,
687 : coolPeakDDDate,
688 : 0);
689 : }
690 957 : int heatPeakDD = SysSizPeakDDNum(AirLoopNum).HeatPeakDD;
691 957 : if (heatPeakDD > 0) {
692 945 : ReportSysSizing(state,
693 : curName,
694 : "Heating",
695 : "Sensible",
696 945 : FinalSysSizing(AirLoopNum).HeatCap,
697 945 : CalcSysSizing(AirLoopNum).DesHeatVolFlow,
698 945 : FinalSysSizing(AirLoopNum).DesHeatVolFlow,
699 945 : FinalSysSizing(AirLoopNum).HeatDesDay,
700 945 : SysSizPeakDDNum(AirLoopNum).cHeatPeakDDDate,
701 945 : SysSizPeakDDNum(AirLoopNum).TimeStepAtHeatPk(heatPeakDD));
702 : } else {
703 12 : ReportSysSizing(state,
704 : curName,
705 : "Heating",
706 : "Sensible",
707 12 : FinalSysSizing(AirLoopNum).HeatCap,
708 12 : CalcSysSizing(AirLoopNum).DesHeatVolFlow,
709 12 : FinalSysSizing(AirLoopNum).DesHeatVolFlow,
710 12 : FinalSysSizing(AirLoopNum).HeatDesDay,
711 12 : SysSizPeakDDNum(AirLoopNum).cHeatPeakDDDate,
712 : 0);
713 : }
714 957 : PreDefTableEntry(state, state.dataOutRptPredefined->pdchSysSizUserHtAir, curName, FinalSysSizing(AirLoopNum).DesHeatVolFlow);
715 957 : }
716 : // Deallocate arrays no longer needed
717 344 : state.dataSize->SysSizing.deallocate();
718 : }
719 :
720 : // Size SpaceHVAC fractions
721 795 : if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
722 3 : for (auto &thisSpaceHVACSplitter : state.dataZoneEquip->zoneEquipSplitter) {
723 1 : thisSpaceHVACSplitter.size(state);
724 2 : }
725 3 : for (auto &thisSpaceHVACMixer : state.dataZoneEquip->zoneEquipMixer) {
726 1 : thisSpaceHVACMixer.size(state);
727 2 : }
728 : }
729 :
730 795 : if ((state.dataGlobal->DoPlantSizing) && (state.dataSize->NumPltSizInput == 0)) {
731 34 : ShowWarningError(
732 : state,
733 34 : format("{}For a plant sizing run, there must be at least 1 Sizing:Plant object input. SimulationControl Plant Sizing option ignored.",
734 : RoutineName));
735 : }
736 :
737 795 : if ((state.dataSize->NumPltSizInput > 0) && (state.dataGlobal->DoPlantSizing) && !ErrorsFound) {
738 :
739 209 : ShowMessage(state, "Beginning Plant Sizing Calculations");
740 : }
741 :
742 795 : if (ErrorsFound) {
743 0 : ShowFatalError(state, "Program terminates due to preceding conditions.");
744 : }
745 796 : }
746 :
747 816048 : bool CalcdoLoadComponentPulseNow(EnergyPlusData &state,
748 : bool const isPulseZoneSizing,
749 : bool const WarmupFlag,
750 : int const HourOfDay,
751 : int const TimeStep,
752 : Constant::KindOfSim const KindOfSim)
753 : {
754 : // This routine decides whether or not to do a Load Component Pulse. True when yes it should, false when in shouldn't
755 : // This check looks to do the pulse at the first time step of the 10th hour of the day while not in warmup mode.
756 : // This needs to be done not just on the first day of a simulation because when the user picks a design day derived from
757 : // an attached weather file the design day is not necessarily the first day of the simulation.
758 :
759 816048 : int constexpr HourDayToPulse(10);
760 816048 : int constexpr TimeStepToPulse(1);
761 :
762 816102 : if ((isPulseZoneSizing) && (!WarmupFlag) && (HourOfDay == HourDayToPulse) && (TimeStep == TimeStepToPulse) &&
763 54 : ((KindOfSim == Constant::KindOfSim::RunPeriodDesign) || (state.dataGlobal->DayOfSim == 1))) {
764 54 : return true;
765 : } else {
766 815994 : return false;
767 : }
768 : }
769 :
770 795 : void ManageSystemSizingAdjustments(EnergyPlusData &state)
771 : {
772 : // This routine adjusts system sizing outcomes based on how the zone air terminals finish out their sizing.
773 : // The zone models are executed to trigger their sizing routines
774 : // Then the air terminal units are scanned to sum design flow rates. Every air terminal connected to a particular air loop is summed for
775 : // 1. minimum heating flow rate, 2. maximum heating flow rate, and 3. maximum flow rate.
776 : // the summed values are used to "Adjust" the system sizing results
777 : // the corrected values are used to autosize the central heating flow ratio, if set to autosize by the user.
778 :
779 : // Also store zone level flow information for Standard 62.1 calculations, Vpz, Vpz_min, Vdz, and Vdz_min for both cooling and heating
780 :
781 795 : auto &AirDistUnit = state.dataDefineEquipment->AirDistUnit;
782 795 : auto &FinalSysSizing = state.dataSize->FinalSysSizing;
783 795 : auto &sd_airterminal = state.dataSingleDuct->sd_airterminal;
784 :
785 795 : if ((state.dataSize->NumSysSizInput > 0) && (state.dataGlobal->DoSystemSizing)) { // only if there is system sizing
786 :
787 : // call zone component models to execute their component sizing routines
788 344 : bool t_SimZoneEquip(true);
789 344 : bool t_SimAir(false);
790 344 : state.dataGlobal->BeginEnvrnFlag = true; // trigger begin envrn blocks in zone equipment models
791 344 : ZoneEquipmentManager::ManageZoneEquipment(state, true, t_SimZoneEquip, t_SimAir);
792 344 : state.dataGlobal->BeginEnvrnFlag = false;
793 :
794 1301 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
795 : // Mine data from ATUs to find new design heating flow rates and new maximum flow rates
796 957 : Real64 airLoopMaxFlowRateSum(0.0);
797 957 : Real64 airLoopHeatingMinimumFlowRateSum(0.0);
798 957 : Real64 airLoopHeatingMaximumFlowRateSum(0.0);
799 :
800 : // sum up heating and max flows for any single duct systems, store 62.1 values by zone
801 957 : if (allocated(sd_airterminal) && state.dataSingleDuct->NumSDAirTerminal > 0) {
802 18973 : for (int singleDuctATUNum = 1; singleDuctATUNum <= state.dataSingleDuct->NumSDAirTerminal; ++singleDuctATUNum) {
803 18034 : if (AirLoopNum == sd_airterminal(singleDuctATUNum).AirLoopNum) {
804 2919 : int termUnitSizingIndex = AirDistUnit(sd_airterminal(singleDuctATUNum).ADUNum).TermUnitSizingNum;
805 2919 : airLoopMaxFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
806 :
807 2919 : state.dataSize->VpzClgByZone(termUnitSizingIndex) =
808 2919 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
809 :
810 5801 : if (sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolReheat ||
811 2882 : sd_airterminal(singleDuctATUNum).SysType_Num == SingleDuct::SysType::SingleDuctConstVolNoReheat) {
812 628 : airLoopHeatingMinimumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
813 628 : airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
814 :
815 628 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
816 628 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
817 628 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
818 628 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
819 628 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
820 628 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
821 :
822 : } else {
823 2291 : airLoopHeatingMinimumFlowRateSum +=
824 2291 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
825 2291 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
826 2291 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
827 2291 : sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
828 2291 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
829 2291 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
830 2291 : sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
831 2291 : if (sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate > 0.0) { // VS fan ATU has this non zero, so use it
832 8 : airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate;
833 8 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
834 8 : sd_airterminal(singleDuctATUNum).MaxHeatAirVolFlowRate; // store std 62.1 values
835 : } else {
836 2283 : if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::Reverse) {
837 61 : airLoopHeatingMaximumFlowRateSum += sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate;
838 61 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
839 61 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate; // store std 62.1 values
840 2222 : } else if (sd_airterminal(singleDuctATUNum).DamperHeatingAction == SingleDuct::Action::ReverseWithLimits) {
841 1090 : airLoopHeatingMaximumFlowRateSum +=
842 1090 : max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
843 1090 : (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac));
844 1090 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
845 1090 : max(sd_airterminal(singleDuctATUNum).MaxAirVolFlowRateDuringReheat,
846 1090 : (sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
847 1090 : sd_airterminal(singleDuctATUNum).ZoneMinAirFrac)); // store std 62.1 values
848 : } else {
849 1132 : airLoopHeatingMaximumFlowRateSum +=
850 1132 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate * sd_airterminal(singleDuctATUNum).ZoneMinAirFrac;
851 1132 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
852 1132 : sd_airterminal(singleDuctATUNum).MaxAirVolFlowRate *
853 1132 : sd_airterminal(singleDuctATUNum).ZoneMinAirFrac; // store std 62.1 values
854 : }
855 : }
856 : }
857 : // single-path air terminal so Vdz = Vpz
858 2919 : state.dataSize->VdzClgByZone(termUnitSizingIndex) =
859 2919 : state.dataSize->VpzClgByZone(termUnitSizingIndex); // store std 62.1 values
860 2919 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
861 2919 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex); // store std 62.1 values
862 2919 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
863 2919 : state.dataSize->VpzHtgByZone(termUnitSizingIndex); // store std 62.1 values
864 2919 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
865 2919 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex); // store std 62.1 values
866 : }
867 : }
868 : }
869 :
870 : // sum up heating and max flows for any dual duct air terminals
871 957 : if (allocated(state.dataDualDuct->dd_airterminal) && state.dataDualDuct->NumDDAirTerminal > 0) {
872 34 : for (int dualDuctATUNum = 1; dualDuctATUNum <= state.dataDualDuct->NumDDAirTerminal; ++dualDuctATUNum) {
873 30 : if (AirLoopNum == state.dataDualDuct->dd_airterminal(dualDuctATUNum).AirLoopNum) {
874 19 : int termUnitSizingIndex = AirDistUnit(state.dataDualDuct->dd_airterminal(dualDuctATUNum).ADUNum).TermUnitSizingNum;
875 19 : airLoopMaxFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
876 19 : state.dataSize->VpzClgByZone(termUnitSizingIndex) =
877 19 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
878 :
879 19 : if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::ConstantVolume) {
880 8 : airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
881 8 : airLoopHeatingMinimumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
882 8 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
883 8 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
884 8 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
885 8 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
886 8 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
887 8 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
888 8 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSize->VpzClgByZone(termUnitSizingIndex);
889 8 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
890 8 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
891 8 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
892 :
893 11 : } else if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::VariableVolume) {
894 0 : airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
895 0 : airLoopHeatingMinimumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
896 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac;
897 0 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) =
898 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
899 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac; // store std 62.1 value
900 0 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
901 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate; // store std 62.1 value
902 0 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
903 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate *
904 0 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).ZoneMinAirFrac; // store std 62.1 value
905 0 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSize->VpzClgByZone(termUnitSizingIndex);
906 0 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
907 0 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
908 0 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
909 11 : } else if (state.dataDualDuct->dd_airterminal(dualDuctATUNum).DamperType == DualDuct::DualDuctDamper::OutdoorAir) {
910 11 : airLoopHeatingMaximumFlowRateSum += state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
911 : // Calculate the design OA flow rate for this zone
912 11 : bool UseOccSchFlag = false;
913 11 : bool UseMinOASchFlag = false;
914 11 : Real64 designOAductFlow(0.0);
915 : designOAductFlow =
916 44 : DataSizing::calcDesignSpecificationOutdoorAir(state,
917 11 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).OARequirementsPtr,
918 11 : state.dataDualDuct->dd_airterminal(dualDuctATUNum).CtrlZoneNum,
919 : UseOccSchFlag,
920 : UseMinOASchFlag);
921 11 : airLoopHeatingMinimumFlowRateSum += designOAductFlow;
922 : // is this a dual duct is dual path for Std 62.1 ?? not sure, assume not because Vpz = Vdz
923 : // anyDualPathAirTerminals = true;
924 11 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = designOAductFlow; // not sure about this
925 11 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) = designOAductFlow; // no heating for this terminal
926 11 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
927 11 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataDualDuct->dd_airterminal(dualDuctATUNum).MaxAirVolFlowRate;
928 11 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = designOAductFlow;
929 11 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = designOAductFlow;
930 11 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = designOAductFlow;
931 : }
932 : }
933 : }
934 : }
935 :
936 : // sum up heating and max flows for any PIU air terminals
937 957 : if (allocated(state.dataPowerInductionUnits->PIU) && state.dataPowerInductionUnits->NumPIUs > 0) {
938 119 : for (int pIUATUNum = 1; pIUATUNum <= state.dataPowerInductionUnits->NumPIUs; ++pIUATUNum) {
939 102 : if (AirLoopNum == state.dataPowerInductionUnits->PIU(pIUATUNum).AirLoopNum) {
940 57 : int termUnitSizingIndex = AirDistUnit(state.dataPowerInductionUnits->PIU(pIUATUNum).ADUNum).TermUnitSizingNum;
941 57 : auto &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
942 57 : airLoopMaxFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
943 57 : if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
944 : DataDefineEquip::ZnAirLoopEquipType::SingleDuct_SeriesPIU_Reheat) {
945 51 : airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
946 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
947 51 : airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
948 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
949 :
950 : // dual path for std 62.1
951 51 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
952 102 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
953 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
954 51 : state.dataSize->VdzClgByZone(termUnitSizingIndex) =
955 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
956 51 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
957 51 : state.dataPowerInductionUnits->PIU(pIUATUNum)
958 51 : .MaxTotAirVolFlow; // min dz is the same as max because series PIU has constant discharge volume
959 :
960 51 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
961 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
962 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
963 51 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
964 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
965 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // runs at minimum primary for heating always
966 51 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
967 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
968 51 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
969 51 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxTotAirVolFlow; // which is constant for series PIU
970 :
971 : // store Ep for 62.1 calculations
972 51 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
973 51 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
974 51 : state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
975 51 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
976 51 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
977 :
978 6 : } else if (state.dataPowerInductionUnits->PIU(pIUATUNum).UnitType_Num ==
979 : DataDefineEquip::ZnAirLoopEquipType::SingleDuct_ParallelPIU_Reheat) {
980 6 : airLoopHeatingMaximumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
981 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
982 6 : airLoopHeatingMinimumFlowRateSum += state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
983 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
984 :
985 : // dual path for std 62.1
986 6 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
987 12 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
988 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow;
989 6 : state.dataSize->VdzClgByZone(termUnitSizingIndex) =
990 6 : state.dataPowerInductionUnits->PIU(pIUATUNum)
991 6 : .MaxPriAirVolFlow; // for Parallel PIU expect Fan off durign max cooling, so discharge is all primary
992 6 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) =
993 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
994 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
995 6 : state.dataPowerInductionUnits->PIU(pIUATUNum)
996 6 : .MaxSecAirVolFlow; // expect secondary fan to be running at min cooling, for reheat
997 :
998 6 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) =
999 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
1000 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
1001 6 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) =
1002 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
1003 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow; // primary at minimum
1004 6 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) =
1005 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
1006 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
1007 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
1008 6 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) =
1009 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MinPriAirFlowFrac *
1010 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxPriAirVolFlow +
1011 6 : state.dataPowerInductionUnits->PIU(pIUATUNum).MaxSecAirVolFlow; // expect min primary and CV fan running
1012 :
1013 6 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction =
1014 6 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) /
1015 6 : state.dataSize->VdzClgByZone(termUnitSizingIndex); // min primary divided by max total
1016 6 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg =
1017 6 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) / state.dataSize->VdzHtgByZone(termUnitSizingIndex);
1018 : }
1019 : }
1020 : }
1021 : }
1022 :
1023 957 : auto &IndUnit = state.dataHVACSingleDuctInduc->IndUnit;
1024 957 : int NumIndUnits = state.dataHVACSingleDuctInduc->NumIndUnits;
1025 :
1026 : // sum up heating and max flows for any four pipe induction units
1027 : // dual path for std 62.1
1028 957 : if (allocated(IndUnit) && (NumIndUnits > 0)) {
1029 5 : for (int indUnitNum = 1; indUnitNum <= NumIndUnits; ++indUnitNum) {
1030 4 : if (AirLoopNum == IndUnit(indUnitNum).AirLoopNum) {
1031 4 : int termUnitSizingIndex = AirDistUnit(IndUnit(indUnitNum).ADUNum).TermUnitSizingNum;
1032 4 : airLoopHeatingMaximumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1033 4 : airLoopHeatingMinimumFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1034 4 : airLoopMaxFlowRateSum += IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1035 : // store Std 62.1 values, CV system
1036 4 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1037 4 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1038 4 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
1039 4 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
1040 4 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1041 4 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxPriAirMassFlow / state.dataEnvrn->StdRhoAir;
1042 4 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
1043 4 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = IndUnit(indUnitNum).MaxTotAirVolFlow;
1044 : }
1045 : }
1046 : }
1047 :
1048 : // sum up heating and max flows for any two pipe constant volume cooled beam terminal units
1049 957 : if (allocated(state.dataHVACCooledBeam->CoolBeam) && (state.dataHVACCooledBeam->NumCB > 0)) {
1050 6 : for (int coolBeamNum = 1; coolBeamNum <= state.dataHVACCooledBeam->NumCB; ++coolBeamNum) {
1051 5 : if (AirLoopNum == state.dataHVACCooledBeam->CoolBeam(coolBeamNum).AirLoopNum) {
1052 5 : int termUnitSizingIndex = AirDistUnit(state.dataHVACCooledBeam->CoolBeam(coolBeamNum).ADUNum).TermUnitSizingNum;
1053 5 : airLoopHeatingMaximumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1054 5 : airLoopHeatingMinimumFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1055 5 : airLoopMaxFlowRateSum += state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1056 :
1057 : // store std 62.1 values, beam will actually have secondary flow but that is not part of the model since it uses non air
1058 : // system term, we have no secondary flow rate information to work with
1059 5 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1060 5 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1061 5 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1062 5 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1063 5 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1064 5 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1065 5 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1066 5 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataHVACCooledBeam->CoolBeam(coolBeamNum).MaxAirVolFlow;
1067 : }
1068 : }
1069 : }
1070 :
1071 : // sum up heating and max flows for any four pipe cooled beam terminal units (the only one using the airTerminalPtr at this point)
1072 957 : if (allocated(AirDistUnit) && (int)state.dataDefineEquipment->AirDistUnit.size() > 0) {
1073 19321 : for (int aDUNum = 1; aDUNum <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++aDUNum) {
1074 18364 : if (AirDistUnit(aDUNum).airTerminalPtr.get() != nullptr) {
1075 120 : if (AirLoopNum == AirDistUnit(aDUNum).airTerminalPtr->getAirLoopNum()) {
1076 30 : airLoopHeatingMaximumFlowRateSum += AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1077 30 : airLoopHeatingMinimumFlowRateSum += AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1078 30 : airLoopMaxFlowRateSum += AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1079 : // store Std 62.1 values, have no modeling of secondary flow rates for induced flow from beam
1080 30 : int termUnitSizingIndex = AirDistUnit(aDUNum).airTerminalPtr->getTermUnitSizingIndex();
1081 30 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1082 30 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1083 30 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1084 30 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1085 30 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1086 30 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1087 30 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1088 30 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = AirDistUnit(aDUNum).airTerminalPtr->getPrimAirDesignVolFlow();
1089 : }
1090 : }
1091 : }
1092 : }
1093 :
1094 : // sum up flows for any air terminal mixers
1095 957 : if (allocated(state.dataSingleDuct->SysATMixer) && (state.dataSingleDuct->NumATMixers > 0)) {
1096 71 : for (int aTMixerNum = 1; aTMixerNum <= state.dataSingleDuct->NumATMixers; ++aTMixerNum) {
1097 59 : if (AirLoopNum == state.dataSingleDuct->SysATMixer(aTMixerNum).AirLoopNum) {
1098 59 : int termUnitSizingIndex = AirDistUnit(state.dataSingleDuct->SysATMixer(aTMixerNum).ADUNum).TermUnitSizingNum;
1099 59 : airLoopHeatingMaximumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1100 59 : airLoopHeatingMinimumFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1101 59 : airLoopMaxFlowRateSum += state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1102 :
1103 59 : state.dataSize->VpzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1104 59 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1105 59 : state.dataSize->VpzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1106 59 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1107 : // the ZoneHVAC devices will have secondary flow but how to get it, future work
1108 59 : state.dataSize->VdzClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1109 59 : state.dataSize->VdzMinClgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1110 59 : state.dataSize->VdzHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1111 59 : state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) = state.dataSingleDuct->SysATMixer(aTMixerNum).DesignPrimaryAirVolRate;
1112 : }
1113 : }
1114 : }
1115 :
1116 957 : std::string curName = FinalSysSizing(AirLoopNum).AirPriLoopName;
1117 957 : BaseSizer::reportSizerOutput(
1118 : state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Heating Flow Rates [m3/s]", airLoopHeatingMaximumFlowRateSum);
1119 957 : BaseSizer::reportSizerOutput(
1120 : state, "AirLoopHVAC", curName, "Sum of Air Terminal Minimum Heating Flow Rates [m3/s]", airLoopHeatingMinimumFlowRateSum);
1121 957 : BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Sum of Air Terminal Maximum Flow Rates [m3/s]", airLoopMaxFlowRateSum);
1122 :
1123 : // Adjust system sizing info
1124 957 : if (allocated(FinalSysSizing)) {
1125 : // correct sizing design heating volume flow rate based on finalized air terminal unit operation
1126 :
1127 957 : if (FinalSysSizing(AirLoopNum).SizingOption ==
1128 : DataSizing::SizingConcurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's
1129 : // from
1130 : // air terminals directly
1131 862 : FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow);
1132 862 : FinalSysSizing(AirLoopNum).DesMainVolFlow = max(airLoopMaxFlowRateSum, FinalSysSizing(AirLoopNum).DesMainVolFlow);
1133 862 : if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) {
1134 754 : FinalSysSizing(AirLoopNum).DesCoolVolFlow = FinalSysSizing(AirLoopNum).DesMainVolFlow;
1135 754 : FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
1136 108 : } else if (FinalSysSizing(AirLoopNum).sysSizeHeatingDominant) { // make sure cooling is at least at minimum.
1137 88 : FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow);
1138 88 : FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
1139 : }
1140 95 : } else if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::SizingConcurrence::Coincident) {
1141 :
1142 95 : if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals
1143 : // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at
1144 : // least that high.
1145 95 : FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow);
1146 95 : FinalSysSizing(AirLoopNum).DesMainVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesMainVolFlow);
1147 95 : FinalSysSizing(AirLoopNum).DesCoolVolFlow = FinalSysSizing(AirLoopNum).DesMainVolFlow;
1148 95 : FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
1149 0 : } else if (FinalSysSizing(AirLoopNum).sysSizeHeatingDominant) { // use maximum heating flow sum from air terminals
1150 0 : FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow);
1151 0 : FinalSysSizing(AirLoopNum).DesMainVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesMainVolFlow);
1152 : // make sure cooling is at least at minimum.
1153 0 : FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow);
1154 0 : FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir;
1155 : }
1156 : }
1157 : // report out adjusted design flow rates
1158 1914 : BaseSizer::reportSizerOutput(
1159 957 : state, "AirLoopHVAC", curName, "Adjusted Heating Design Air Flow Rate [m3/s]", FinalSysSizing(AirLoopNum).DesHeatVolFlow);
1160 957 : OutputReportPredefined::PreDefTableEntry(
1161 957 : state, state.dataOutRptPredefined->pdchSysSizAdjustedHtAir, curName, FinalSysSizing(AirLoopNum).DesHeatVolFlow, 4);
1162 1914 : BaseSizer::reportSizerOutput(
1163 957 : state, "AirLoopHVAC", curName, "Adjusted Cooling Design Air Flow Rate [m3/s]", FinalSysSizing(AirLoopNum).DesCoolVolFlow);
1164 957 : OutputReportPredefined::PreDefTableEntry(
1165 957 : state, state.dataOutRptPredefined->pdchSysSizAdjustedClAir, curName, FinalSysSizing(AirLoopNum).DesCoolVolFlow, 4);
1166 1914 : BaseSizer::reportSizerOutput(
1167 957 : state, "AirLoopHVAC", curName, "Adjusted Main Design Air Flow Rate [m3/s]", FinalSysSizing(AirLoopNum).DesMainVolFlow);
1168 957 : OutputReportPredefined::PreDefTableEntry(
1169 957 : state, state.dataOutRptPredefined->pdchSysSizAdjustedMainAir, curName, FinalSysSizing(AirLoopNum).DesMainVolFlow, 4);
1170 :
1171 : // Autosize central heating min system air flow rate, using corrected design heating flow, using maximum heating flow summation
1172 957 : if (FinalSysSizing(AirLoopNum).SysAirMinFlowRatWasAutoSized) {
1173 3 : if (FinalSysSizing(AirLoopNum).DesMainVolFlow > 0.0) { // protect div by zero
1174 3 : FinalSysSizing(AirLoopNum).SysAirMinFlowRat =
1175 3 : FinalSysSizing(AirLoopNum).DesHeatVolFlow / FinalSysSizing(AirLoopNum).DesMainVolFlow;
1176 : } else { // big trouble anyway.
1177 0 : FinalSysSizing(AirLoopNum).SysAirMinFlowRat = 1.0;
1178 : }
1179 6 : BaseSizer::reportSizerOutput(
1180 3 : state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", FinalSysSizing(AirLoopNum).SysAirMinFlowRat);
1181 3 : OutputReportPredefined::PreDefTableEntry(
1182 3 : state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, FinalSysSizing(AirLoopNum).SysAirMinFlowRat, 4);
1183 6 : BaseSizer::reportSizerOutput(
1184 3 : state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", FinalSysSizing(AirLoopNum).SysAirMinFlowRat);
1185 3 : OutputReportPredefined::PreDefTableEntry(
1186 6 : state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, FinalSysSizing(AirLoopNum).SysAirMinFlowRat, 4);
1187 : } else {
1188 1908 : BaseSizer::reportSizerOutput(
1189 954 : state, "AirLoopHVAC", curName, "User Heating Air Flow Ratio []", FinalSysSizing(AirLoopNum).SysAirMinFlowRat);
1190 954 : OutputReportPredefined::PreDefTableEntry(
1191 954 : state, state.dataOutRptPredefined->pdchSysSizUserHeatFlowRatio, curName, FinalSysSizing(AirLoopNum).SysAirMinFlowRat, 4);
1192 954 : Real64 calcSysAirMinFlowRat(0.0);
1193 954 : if (FinalSysSizing(AirLoopNum).DesMainVolFlow > 0.0) { // protect div by zero
1194 954 : calcSysAirMinFlowRat = FinalSysSizing(AirLoopNum).DesHeatVolFlow / FinalSysSizing(AirLoopNum).DesMainVolFlow;
1195 : }
1196 954 : BaseSizer::reportSizerOutput(state, "AirLoopHVAC", curName, "Calculated Heating Air Flow Ratio []", calcSysAirMinFlowRat);
1197 1908 : OutputReportPredefined::PreDefTableEntry(
1198 2862 : state, state.dataOutRptPredefined->pdchSysSizCalcHeatFlowRatio, curName, calcSysAirMinFlowRat, 4);
1199 : }
1200 : }
1201 957 : }
1202 :
1203 : } // if doing any system sizing
1204 795 : }
1205 :
1206 795 : void ManageSystemVentilationAdjustments(EnergyPlusData &state)
1207 : {
1208 795 : auto &AirDistUnit = state.dataDefineEquipment->AirDistUnit;
1209 795 : auto &FinalSysSizing = state.dataSize->FinalSysSizing;
1210 795 : auto &VbzByZone = state.dataSize->VbzByZone;
1211 795 : auto &AirToZoneNodeInfo = state.dataAirLoop->AirToZoneNodeInfo;
1212 :
1213 : // redo std 62.1 calculations using latest information on zone flows and report to tables
1214 :
1215 : // redo 62.1 zone calculations with final (or user) zone terminal flow sizes, only redo calculations that might change with final flows
1216 1752 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
1217 : int SysSizNum =
1218 957 : Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
1219 957 : if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable
1220 957 : if (FinalSysSizing(AirLoopNum).OAAutoSized &&
1221 918 : (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP ||
1222 911 : state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) &&
1223 1884 : state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones > 1 &&
1224 9 : FinalSysSizing(AirLoopNum).loadSizingType != DataSizing::LoadSizing::Ventilation) {
1225 :
1226 : // Loop over all zones connected to air loop, redo both cooling and heating calcs for Zdz minimum discharge outdoor air fraction for
1227 : // each zone
1228 49 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
1229 40 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1230 40 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1231 40 : if (state.dataSize->VdzMinClgByZone(termUnitSizingIndex) > 0.0) {
1232 40 : state.dataSize->ZdzClgByZone(termUnitSizingIndex) =
1233 40 : min(1.0, thisTermUnitFinalZoneSizing.VozClgByZone / state.dataSize->VdzMinClgByZone(termUnitSizingIndex));
1234 : } else { // would divide by zero, so set to max ??
1235 0 : state.dataSize->ZdzClgByZone(termUnitSizingIndex) = 1.0;
1236 : }
1237 40 : if (state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) > 0.0) {
1238 40 : state.dataSize->ZdzHtgByZone(termUnitSizingIndex) =
1239 40 : min(1.0, thisTermUnitFinalZoneSizing.VozHtgByZone / state.dataSize->VdzMinHtgByZone(termUnitSizingIndex));
1240 : } else { // would divide by zero, so set to max
1241 0 : state.dataSize->ZdzHtgByZone(termUnitSizingIndex) = 1.0;
1242 : }
1243 : }
1244 9 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
1245 0 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1246 0 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1247 0 : if (state.dataSize->VdzMinClgByZone(termUnitSizingIndex) > 0.0) {
1248 0 : state.dataSize->ZdzClgByZone(termUnitSizingIndex) =
1249 0 : min(1.0, thisTermUnitFinalZoneSizing.VozClgByZone / state.dataSize->VdzMinClgByZone(termUnitSizingIndex));
1250 : } else { // would divide by zero, so set to max ??
1251 0 : state.dataSize->ZdzClgByZone(termUnitSizingIndex) = 1.0;
1252 : }
1253 0 : if (state.dataSize->VdzMinHtgByZone(termUnitSizingIndex) > 0.0) {
1254 0 : state.dataSize->ZdzHtgByZone(termUnitSizingIndex) =
1255 0 : min(1.0, thisTermUnitFinalZoneSizing.VozHtgByZone / state.dataSize->VdzMinHtgByZone(termUnitSizingIndex));
1256 : } else { // would divide by zero, so set to max
1257 0 : state.dataSize->ZdzHtgByZone(termUnitSizingIndex) = 1.0;
1258 : }
1259 : } // end loop over zones on air loop to calculate Zdz values
1260 :
1261 : // Sum Voz values for System Vou, in E+ the Vbz value has now been corrected to remove population Diversity, so we add the term back
1262 : // in here directly to get Vou, now corrected again to only apply D to the people part
1263 9 : state.dataSize->VouBySys(AirLoopNum) =
1264 9 : state.dataSize->DBySys(AirLoopNum) * state.dataSize->SumRpxPzBySys(AirLoopNum) + state.dataSize->SumRaxAzBySys(AirLoopNum);
1265 : // redo VpzClgSumBySys( AirLoopNum ) with latest values, for reporting
1266 9 : state.dataSize->VpzClgSumBySys(AirLoopNum) = 0.0;
1267 49 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
1268 40 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1269 40 : state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
1270 : }
1271 9 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
1272 0 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1273 0 : int MatchingCooledZoneNum = General::FindNumberInList(
1274 0 : termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
1275 0 : if (MatchingCooledZoneNum == 0) {
1276 0 : state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
1277 : }
1278 : }
1279 :
1280 : // Fill Vps for cooling VRP calculation, use cooling design flow rate as adjusted in ManageSystemSizingAdjustments ( to use
1281 : // conincident sizing result if available for block air flow
1282 9 : state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
1283 :
1284 : // Fill Vps for heating VRP calculation, use heating min by zone from air terminal scan in ManageSystemSizingAdjustments
1285 9 : state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
1286 9 : state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
1287 49 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
1288 40 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1289 40 : state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1290 40 : state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
1291 : }
1292 9 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
1293 0 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1294 0 : int MatchingCooledZoneNum = General::FindNumberInList(
1295 0 : termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
1296 0 : if (MatchingCooledZoneNum == 0) {
1297 0 : state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1298 0 : state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
1299 : }
1300 : }
1301 : // Fill Xs values
1302 9 : state.dataSize->XsBySysCool(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum);
1303 9 : state.dataSize->XsBySysHeat(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->VpsHtgBySys(AirLoopNum);
1304 :
1305 : // Loop over zones and calculate Evz for each for both cooling and heating, and find mins
1306 9 : state.dataSize->EvzMinBySysCool(AirLoopNum) = 1.0;
1307 9 : state.dataSize->EvzMinBySysHeat(AirLoopNum) = 1.0;
1308 :
1309 : // make two passes, one for cooled zone and one for heated zones, if some zones are duplicate, it's OK, it'll just redo the same calcs
1310 27 : for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
1311 18 : int numZones = 0;
1312 18 : if (coolHeatPass == 1) {
1313 9 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
1314 : } else {
1315 9 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
1316 : }
1317 58 : for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
1318 40 : int termUnitSizingIndex = 0;
1319 40 : if (coolHeatPass == 1) {
1320 40 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1321 : } else {
1322 0 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1323 : }
1324 40 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1325 40 : Real64 Er = thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation; // user input in Zone Air Distribution design spec object
1326 :
1327 40 : if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) { // 62.1 simplified procedure
1328 5 : if (state.dataSize->DBySys(AirLoopNum) < 0.60) {
1329 2 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.88 * state.dataSize->DBySys(AirLoopNum) + 0.22;
1330 : } else {
1331 3 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = 0.75;
1332 : }
1333 5 : state.dataSize->EvzByZoneCool(termUnitSizingIndex) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
1334 35 : } else if (Er > 0.0) { // 62.1 ventilation rate procedure - multi path zone
1335 : // Find Evz for cooling
1336 1 : Real64 Ep_Clg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction; // as adjusted in ManageSystemSizingAdjustments();
1337 1 : Real64 Fa_Clg = Ep_Clg + (1.0 - Ep_Clg) * Er;
1338 1 : state.dataSize->FaByZoneCool(termUnitSizingIndex) = Fa_Clg;
1339 1 : Real64 Fb_Clg = Ep_Clg;
1340 1 : state.dataSize->FbByZoneCool(termUnitSizingIndex) = Fb_Clg;
1341 1 : Real64 Ez_Clg = thisTermUnitFinalZoneSizing.ZoneADEffCooling; // user input in Zone Air Distribution design spec object
1342 1 : Real64 Fc_Clg = 1.0 - (1.0 - Ez_Clg) * (1.0 - Er) * (1 - Ep_Clg);
1343 1 : state.dataSize->FcByZoneCool(termUnitSizingIndex) = Fc_Clg;
1344 1 : state.dataSize->EvzByZoneCool(termUnitSizingIndex) =
1345 1 : (Fa_Clg + state.dataSize->XsBySysCool(AirLoopNum) * Fb_Clg - state.dataSize->ZdzClgByZone(termUnitSizingIndex) * Fc_Clg) /
1346 : Fa_Clg;
1347 : // note that SimAirServingZones::LimitZoneVentEff is intended only for single path per I/O ref
1348 :
1349 : // find Evz for heating
1350 1 : Real64 Ep_Htg = thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg; // as adjusted in ManageSystemSizingAdjustments();
1351 1 : Real64 Fa_Htg = Ep_Htg + (1.0 - Ep_Htg) * Er;
1352 1 : state.dataSize->FaByZoneHeat(termUnitSizingIndex) = Fa_Htg;
1353 1 : Real64 Fb_Htg = Ep_Htg;
1354 1 : state.dataSize->FbByZoneCool(termUnitSizingIndex) = Fb_Htg;
1355 1 : Real64 Ez_Htg = thisTermUnitFinalZoneSizing.ZoneADEffHeating; // user input in Zone Air Distribution design spec object
1356 1 : Real64 Fc_Htg = 1.0 - (1.0 - Ez_Htg) * (1.0 - Er) * (1 - Ep_Htg);
1357 1 : state.dataSize->FcByZoneHeat(termUnitSizingIndex) = Fc_Htg;
1358 1 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex) =
1359 1 : (Fa_Htg + state.dataSize->XsBySysHeat(AirLoopNum) * Fb_Htg - state.dataSize->ZdzHtgByZone(termUnitSizingIndex) * Fc_Htg) /
1360 : Fa_Htg;
1361 :
1362 : } else { // 62.1 ventilation rate procedure - single path zone
1363 34 : state.dataSize->EvzByZoneCool(termUnitSizingIndex) =
1364 34 : 1.0 + state.dataSize->XsBySysCool(AirLoopNum) - state.dataSize->ZdzClgByZone(termUnitSizingIndex);
1365 68 : SimAirServingZones::LimitZoneVentEff(state,
1366 34 : state.dataSize->XsBySysCool(AirLoopNum),
1367 34 : VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneCool(termUnitSizingIndex),
1368 : termUnitSizingIndex,
1369 34 : state.dataSize->EvzByZoneCool(termUnitSizingIndex));
1370 34 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex) =
1371 34 : 1.0 + state.dataSize->XsBySysHeat(AirLoopNum) - state.dataSize->ZdzHtgByZone(termUnitSizingIndex);
1372 68 : SimAirServingZones::LimitZoneVentEff(state,
1373 34 : state.dataSize->XsBySysHeat(AirLoopNum),
1374 34 : VbzByZone(termUnitSizingIndex) / state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
1375 : termUnitSizingIndex,
1376 34 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex));
1377 : }
1378 :
1379 40 : if (state.dataSize->EvzByZoneCool(termUnitSizingIndex) < state.dataSize->EvzMinBySysCool(AirLoopNum)) {
1380 13 : state.dataSize->EvzMinBySysCool(AirLoopNum) = state.dataSize->EvzByZoneCool(termUnitSizingIndex);
1381 : }
1382 40 : if (state.dataSize->EvzByZoneHeat(termUnitSizingIndex) < state.dataSize->EvzMinBySysHeat(AirLoopNum)) {
1383 12 : state.dataSize->EvzMinBySysHeat(AirLoopNum) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
1384 : }
1385 : } // end loop over zones on air loop to calculate Evz by zone and find mins
1386 :
1387 : // calculate Vot for both cooling and heating
1388 18 : state.dataSize->VotClgBySys(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->EvzMinBySysCool(AirLoopNum);
1389 18 : state.dataSize->VotHtgBySys(AirLoopNum) = state.dataSize->VouBySys(AirLoopNum) / state.dataSize->EvzMinBySysHeat(AirLoopNum);
1390 : // the design zone ventilation value is based on the larger of the system-level cooling Vot and/or heating Vot
1391 18 : FinalSysSizing(AirLoopNum).DesOutAirVolFlow = max(state.dataSize->VotClgBySys(AirLoopNum), state.dataSize->VotHtgBySys(AirLoopNum));
1392 : }
1393 : } // system OA is autosized and VRP
1394 948 : else if ((FinalSysSizing(AirLoopNum).OAAutoSized && state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP &&
1395 0 : state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones == 1)) { // single zone VRP
1396 0 : int termUnitSizingIndex = 0;
1397 0 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(1);
1398 0 : if (termUnitSizingIndex == 0) {
1399 0 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(1);
1400 : }
1401 0 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1402 : // single zone cooling
1403 0 : state.dataSize->VotClgBySys(AirLoopNum) = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
1404 0 : state.dataSize->EvzByZoneCool(termUnitSizingIndex) = thisTermUnitFinalZoneSizing.ZoneADEffCooling;
1405 0 : state.dataSize->EvzMinBySysCool(AirLoopNum) = state.dataSize->EvzByZoneCool(termUnitSizingIndex);
1406 0 : state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
1407 0 : state.dataSize->VpzClgSumBySys(AirLoopNum) = state.dataSize->VdzClgByZone(termUnitSizingIndex);
1408 : // single zone heating
1409 0 : state.dataSize->VotHtgBySys(AirLoopNum) = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
1410 0 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex) = thisTermUnitFinalZoneSizing.ZoneADEffHeating;
1411 0 : state.dataSize->EvzMinBySysHeat(AirLoopNum) = state.dataSize->EvzByZoneHeat(termUnitSizingIndex);
1412 0 : state.dataSize->VpsHtgBySys(AirLoopNum) = state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1413 0 : state.dataSize->VpzHtgSumBySys(AirLoopNum) = state.dataSize->VpzHtgByZone(termUnitSizingIndex);
1414 :
1415 : // the design zone ventilation value is based on the larger of the system-level cooling Vot and/or heating Vot
1416 0 : FinalSysSizing(AirLoopNum).DesOutAirVolFlow = max(state.dataSize->VotClgBySys(AirLoopNum), state.dataSize->VotHtgBySys(AirLoopNum));
1417 : // Fill Xs values for reporting
1418 0 : state.dataSize->XsBySysCool(AirLoopNum) = FinalSysSizing(AirLoopNum).DesOutAirVolFlow / state.dataSize->VpsClgBySys(AirLoopNum);
1419 0 : state.dataSize->XsBySysHeat(AirLoopNum) = FinalSysSizing(AirLoopNum).DesOutAirVolFlow / state.dataSize->VpsHtgBySys(AirLoopNum);
1420 :
1421 : } else { // not vrp, zone sum, fill out values that still apply
1422 : // redo VpzClgSumBySys( AirLoopNum ) with latest values, for reporting
1423 948 : state.dataSize->VpzClgSumBySys(AirLoopNum) = 0.0;
1424 : // Fill Vps for cooling VRP calculation, use cooling design flow rate as adjusted in ManageSystemSizingAdjustments ( to use
1425 : // conincident sizing result if available for block air flow
1426 948 : state.dataSize->VpsClgBySys(AirLoopNum) = FinalSysSizing(AirLoopNum).DesCoolVolFlow;
1427 : // Fill Vps for heating VRP calculation, use heating min by zone from air terminal scan in ManageSystemSizingAdjustments
1428 948 : state.dataSize->VpsHtgBySys(AirLoopNum) = 0.0;
1429 948 : state.dataSize->VpzHtgSumBySys(AirLoopNum) = 0.0; // for reporting only
1430 4011 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesCooled; ++zoneNum) {
1431 3063 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1432 3063 : state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
1433 3063 : state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1434 3063 : state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
1435 : }
1436 962 : for (int zoneNum = 1; zoneNum <= AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; ++zoneNum) {
1437 14 : int termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1438 14 : int MatchingCooledZoneNum = General::FindNumberInList(
1439 14 : termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
1440 14 : if (MatchingCooledZoneNum == 0) {
1441 0 : state.dataSize->VpzClgSumBySys(AirLoopNum) += state.dataSize->VdzClgByZone(termUnitSizingIndex);
1442 0 : state.dataSize->VpsHtgBySys(AirLoopNum) += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1443 0 : state.dataSize->VpzHtgSumBySys(AirLoopNum) += state.dataSize->VpzHtgByZone(termUnitSizingIndex);
1444 : }
1445 : }
1446 : }
1447 : } // airloop loop
1448 :
1449 : // write out predefined standard 62.1 report data, total of 8 tables
1450 1752 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
1451 :
1452 : // System Ventilation Requirements for Cooling (table 1)
1453 957 : OutputReportPredefined::PreDefTableEntry(state,
1454 957 : state.dataOutRptPredefined->pdchS62svrClSumVpz,
1455 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1456 957 : state.dataSize->VpzClgSumBySys(AirLoopNum),
1457 957 : 4); // Vpz-sum
1458 957 : OutputReportPredefined::PreDefTableEntry(state,
1459 957 : state.dataOutRptPredefined->pdchS62svrClPs,
1460 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1461 957 : state.dataSize->PsBySys(AirLoopNum),
1462 957 : 4); // Ps
1463 957 : OutputReportPredefined::PreDefTableEntry(state,
1464 957 : state.dataOutRptPredefined->pdchS62svrClSumPz,
1465 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1466 957 : state.dataSize->PzSumBySys(AirLoopNum),
1467 957 : 4); // Pz-sum
1468 957 : OutputReportPredefined::PreDefTableEntry(
1469 957 : state, state.dataOutRptPredefined->pdchS62svrClD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
1470 : // Origin of D
1471 : int SysSizNum =
1472 957 : Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
1473 957 : if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable
1474 957 : if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
1475 1910 : OutputReportPredefined::PreDefTableEntry(
1476 955 : state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
1477 : } else {
1478 4 : OutputReportPredefined::PreDefTableEntry(
1479 2 : state, state.dataOutRptPredefined->pdchS62svrClDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
1480 : }
1481 957 : OutputReportPredefined::PreDefTableEntry(state,
1482 957 : state.dataOutRptPredefined->pdchS62svrClVou,
1483 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1484 957 : state.dataSize->VouBySys(AirLoopNum),
1485 957 : 4); // Vou
1486 957 : OutputReportPredefined::PreDefTableEntry(state,
1487 957 : state.dataOutRptPredefined->pdchS62svrClVps,
1488 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1489 957 : state.dataSize->VpsClgBySys(AirLoopNum),
1490 957 : 4); // Vps
1491 957 : OutputReportPredefined::PreDefTableEntry(state,
1492 957 : state.dataOutRptPredefined->pdchS62svrClXs,
1493 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1494 957 : state.dataSize->XsBySysCool(AirLoopNum),
1495 957 : 4); // Xs
1496 957 : OutputReportPredefined::PreDefTableEntry(state,
1497 957 : state.dataOutRptPredefined->pdchS62svrClEv,
1498 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1499 957 : state.dataSize->EvzMinBySysCool(AirLoopNum),
1500 957 : 4); // Ev
1501 : // Ev Calculation Methodology
1502 957 : if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
1503 14 : OutputReportPredefined::PreDefTableEntry(state,
1504 7 : state.dataOutRptPredefined->pdchS62svrClEvMthd,
1505 7 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1506 : "Standard 62.1 Ventilation Rate Procedure");
1507 950 : } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
1508 6 : OutputReportPredefined::PreDefTableEntry(state,
1509 3 : state.dataOutRptPredefined->pdchS62svrClEvMthd,
1510 3 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1511 : "Standard 62.1 Simplified Procedure");
1512 : } else {
1513 1894 : OutputReportPredefined::PreDefTableEntry(
1514 947 : state, state.dataOutRptPredefined->pdchS62svrClEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
1515 : }
1516 957 : OutputReportPredefined::PreDefTableEntry(state,
1517 957 : state.dataOutRptPredefined->pdchS62svrClVot,
1518 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1519 957 : state.dataSize->VotClgBySys(AirLoopNum),
1520 957 : 4); // Vot
1521 957 : if (state.dataSize->VpsClgBySys(AirLoopNum) != 0.0) { // Move here
1522 957 : OutputReportPredefined::PreDefTableEntry(state,
1523 957 : state.dataOutRptPredefined->pdchS62svrClPercOA,
1524 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1525 957 : state.dataSize->VotClgBySys(AirLoopNum) / state.dataSize->VpsClgBySys(AirLoopNum),
1526 1914 : 4); //%OA
1527 : }
1528 957 : OutputReportPredefined::PreDefTableEntry(state,
1529 957 : state.dataOutRptPredefined->pdchS62svrClEnvironmentOfPs,
1530 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1531 957 : state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
1532 957 : OutputReportPredefined::PreDefTableEntry(state,
1533 957 : state.dataOutRptPredefined->pdchS62svrClTimeOfPs,
1534 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1535 957 : state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum));
1536 :
1537 : // system ventilation requirements for heating ( table 2 )
1538 957 : OutputReportPredefined::PreDefTableEntry(state,
1539 957 : state.dataOutRptPredefined->pdchS62svrHtSumVpz,
1540 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1541 957 : state.dataSize->VpzHtgSumBySys(AirLoopNum),
1542 957 : 4); // Vpz-sum
1543 957 : OutputReportPredefined::PreDefTableEntry(state,
1544 957 : state.dataOutRptPredefined->pdchS62svrHtPs,
1545 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1546 957 : state.dataSize->PsBySys(AirLoopNum),
1547 957 : 4); // Ps
1548 957 : OutputReportPredefined::PreDefTableEntry(state,
1549 957 : state.dataOutRptPredefined->pdchS62svrHtSumPz,
1550 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1551 957 : state.dataSize->PzSumBySys(AirLoopNum),
1552 957 : 4); // Pz-sum
1553 957 : OutputReportPredefined::PreDefTableEntry(
1554 957 : state, state.dataOutRptPredefined->pdchS62svrHtD, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->DBySys(AirLoopNum), 4); // D
1555 : // Origin of D
1556 957 : if (state.dataSize->SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
1557 1910 : OutputReportPredefined::PreDefTableEntry(
1558 955 : state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "Calculated from schedules");
1559 : } else {
1560 4 : OutputReportPredefined::PreDefTableEntry(
1561 2 : state, state.dataOutRptPredefined->pdchS62svrHtDorg, FinalSysSizing(AirLoopNum).AirPriLoopName, "User-specified");
1562 : }
1563 957 : OutputReportPredefined::PreDefTableEntry(state,
1564 957 : state.dataOutRptPredefined->pdchS62svrHtVou,
1565 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1566 957 : state.dataSize->VouBySys(AirLoopNum),
1567 957 : 4); // Vou
1568 957 : OutputReportPredefined::PreDefTableEntry(state,
1569 957 : state.dataOutRptPredefined->pdchS62svrHtVps,
1570 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1571 957 : state.dataSize->VpsHtgBySys(AirLoopNum),
1572 957 : 4); // Vps
1573 957 : OutputReportPredefined::PreDefTableEntry(state,
1574 957 : state.dataOutRptPredefined->pdchS62svrHtXs,
1575 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1576 957 : state.dataSize->XsBySysHeat(AirLoopNum),
1577 957 : 4); // Xs
1578 957 : OutputReportPredefined::PreDefTableEntry(state,
1579 957 : state.dataOutRptPredefined->pdchS62svrHtEv,
1580 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1581 957 : state.dataSize->EvzMinBySysHeat(AirLoopNum),
1582 957 : 4); // Ev
1583 : // Ev Calculation Methodology
1584 957 : if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::VRP) {
1585 14 : OutputReportPredefined::PreDefTableEntry(state,
1586 7 : state.dataOutRptPredefined->pdchS62svrHtEvMthd,
1587 7 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1588 : "Standard 62.1 Ventilation Rate Procedure");
1589 950 : } else if (state.dataSize->SysSizInput(SysSizNum).SystemOAMethod == SysOAMethod::SP) {
1590 6 : OutputReportPredefined::PreDefTableEntry(state,
1591 3 : state.dataOutRptPredefined->pdchS62svrHtEvMthd,
1592 3 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1593 : "Standard 62.1 Simplified Procedure");
1594 : } else {
1595 1894 : OutputReportPredefined::PreDefTableEntry(
1596 947 : state, state.dataOutRptPredefined->pdchS62svrHtEvMthd, FinalSysSizing(AirLoopNum).AirPriLoopName, "Not calculated");
1597 : }
1598 957 : OutputReportPredefined::PreDefTableEntry(state,
1599 957 : state.dataOutRptPredefined->pdchS62svrHtVot,
1600 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1601 957 : state.dataSize->VotHtgBySys(AirLoopNum),
1602 957 : 4); // Vot
1603 957 : if (state.dataSize->VpsHtgBySys(AirLoopNum) != 0.0) {
1604 956 : OutputReportPredefined::PreDefTableEntry(state,
1605 956 : state.dataOutRptPredefined->pdchS62svrHtPercOA,
1606 956 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1607 956 : state.dataSize->VotHtgBySys(AirLoopNum) / state.dataSize->VpsHtgBySys(AirLoopNum),
1608 1912 : 4); //%OA
1609 : }
1610 : // heating time of peak Ps is the same as for cooling (for now)
1611 957 : OutputReportPredefined::PreDefTableEntry(state,
1612 957 : state.dataOutRptPredefined->pdchS62svrHtEnvironmentOfPs,
1613 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1614 957 : state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum));
1615 957 : OutputReportPredefined::PreDefTableEntry(state,
1616 957 : state.dataOutRptPredefined->pdchS62svrHtTimeOfPs,
1617 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1618 957 : state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum));
1619 :
1620 : // Zone ventilation parameters, (table 3)
1621 : // make two passes, one for cooled zones and one for heated zones, if a zone is the same on the second pass, skip it
1622 2871 : for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
1623 1914 : int numZones = 0;
1624 1914 : if (coolHeatPass == 1) {
1625 957 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
1626 : } else {
1627 957 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
1628 : }
1629 5031 : for (int zoneNum = 1; zoneNum <= numZones; ++zoneNum) {
1630 3117 : int termUnitSizingIndex = 0;
1631 3117 : int MatchingCooledZoneNum = 0;
1632 3117 : if (coolHeatPass == 1) {
1633 3103 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(zoneNum);
1634 : } else {
1635 14 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(zoneNum);
1636 14 : MatchingCooledZoneNum = General::FindNumberInList(
1637 14 : termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
1638 : }
1639 3117 : if (MatchingCooledZoneNum == 0) {
1640 3103 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1641 6206 : OutputReportPredefined::PreDefTableEntry(state,
1642 3103 : state.dataOutRptPredefined->pdchS62zvpAlN,
1643 : thisTermUnitFinalZoneSizing.ZoneName,
1644 3103 : state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).Name); // Air loop name
1645 3103 : OutputReportPredefined::PreDefTableEntry(state,
1646 3103 : state.dataOutRptPredefined->pdchS62zvpRp,
1647 : thisTermUnitFinalZoneSizing.ZoneName,
1648 3103 : thisTermUnitFinalZoneSizing.DesOAFlowPPer,
1649 3103 : 6); // Rp
1650 3103 : OutputReportPredefined::PreDefTableEntry(state,
1651 3103 : state.dataOutRptPredefined->pdchS62zvpPz,
1652 : thisTermUnitFinalZoneSizing.ZoneName,
1653 3103 : thisTermUnitFinalZoneSizing.TotPeopleInZone,
1654 3103 : 4); // Pz
1655 3103 : OutputReportPredefined::PreDefTableEntry(state,
1656 3103 : state.dataOutRptPredefined->pdchS62zvpRa,
1657 : thisTermUnitFinalZoneSizing.ZoneName,
1658 3103 : thisTermUnitFinalZoneSizing.DesOAFlowPerArea,
1659 3103 : 6); // Ra
1660 6206 : OutputReportPredefined::PreDefTableEntry(state,
1661 3103 : state.dataOutRptPredefined->pdchS62zvpAz,
1662 : thisTermUnitFinalZoneSizing.ZoneName,
1663 3103 : thisTermUnitFinalZoneSizing.TotalZoneFloorArea); // Az
1664 3103 : OutputReportPredefined::PreDefTableEntry(
1665 : state,
1666 3103 : state.dataOutRptPredefined->pdchS62zvpVbz,
1667 : thisTermUnitFinalZoneSizing.ZoneName,
1668 3103 : VbzByZone(termUnitSizingIndex),
1669 3103 : 4); // Vbz, now corrected so that Vbz does not already have system population term multiplied into it
1670 3103 : OutputReportPredefined::PreDefTableEntry(state,
1671 3103 : state.dataOutRptPredefined->pdchS62zvpClEz,
1672 : thisTermUnitFinalZoneSizing.ZoneName,
1673 3103 : thisTermUnitFinalZoneSizing.ZoneADEffCooling,
1674 3103 : 4); // Ez-clg
1675 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
1676 3103 : OutputReportPredefined::PreDefTableEntry(state,
1677 3103 : state.dataOutRptPredefined->pdchS62zvpClVoz,
1678 : thisTermUnitFinalZoneSizing.ZoneName,
1679 3103 : VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling,
1680 6206 : 4); // Voz-clg
1681 : }
1682 3103 : OutputReportPredefined::PreDefTableEntry(state,
1683 3103 : state.dataOutRptPredefined->pdchS62zvpHtEz,
1684 : thisTermUnitFinalZoneSizing.ZoneName,
1685 3103 : thisTermUnitFinalZoneSizing.ZoneADEffHeating,
1686 3103 : 3); // Ez-htg
1687 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
1688 3103 : OutputReportPredefined::PreDefTableEntry(state,
1689 3103 : state.dataOutRptPredefined->pdchS62zvpHtVoz,
1690 : thisTermUnitFinalZoneSizing.ZoneName,
1691 3103 : VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating,
1692 6206 : 4); // Voz-htg
1693 : }
1694 : }
1695 : }
1696 : }
1697 :
1698 : // System Ventilation Parameters, (Table 4)
1699 :
1700 : // first do some summations needed
1701 957 : Real64 RpPzSum(0.0);
1702 957 : Real64 RaAzSum(0.0);
1703 957 : Real64 AzSum(0.0);
1704 957 : Real64 VbzSum(0.0);
1705 957 : Real64 VozClgSum(0.0);
1706 957 : Real64 VozHtgSum(0.0);
1707 957 : Real64 VdzClgSum(0.0);
1708 957 : Real64 VdzHtgSum(0.0);
1709 957 : Real64 VpzMinClgSum(0.0);
1710 957 : Real64 VpzMinHtgSum(0.0);
1711 : // make two passes, one for cooled zones and one for heated zones, if a zone is the same on the second pass, skip it
1712 2871 : for (int coolHeatPass = 1; coolHeatPass <= 2; ++coolHeatPass) {
1713 1914 : int numZones = 0;
1714 1914 : if (coolHeatPass == 1) {
1715 957 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesCooled;
1716 : } else {
1717 957 : numZones = AirToZoneNodeInfo(AirLoopNum).NumZonesHeated;
1718 : }
1719 5031 : for (int airLoopZoneNum = 1; airLoopZoneNum <= numZones; ++airLoopZoneNum) {
1720 3117 : int termUnitSizingIndex = 0;
1721 3117 : int MatchingCooledZoneNum = 0;
1722 3117 : if (coolHeatPass == 1) {
1723 3103 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(airLoopZoneNum);
1724 : } else {
1725 14 : termUnitSizingIndex = AirToZoneNodeInfo(AirLoopNum).TermUnitHeatSizingIndex(airLoopZoneNum);
1726 14 : MatchingCooledZoneNum = General::FindNumberInList(
1727 14 : termUnitSizingIndex, AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex, AirToZoneNodeInfo(AirLoopNum).NumZonesCooled);
1728 : }
1729 3117 : if (MatchingCooledZoneNum == 0) {
1730 3103 : auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
1731 : // Zone ventilation parameters, (table 3)
1732 3103 : RpPzSum += thisTermUnitFinalZoneSizing.DesOAFlowPPer * thisTermUnitFinalZoneSizing.TotPeopleInZone;
1733 3103 : RaAzSum += thisTermUnitFinalZoneSizing.DesOAFlowPerArea * thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
1734 3103 : AzSum += thisTermUnitFinalZoneSizing.TotalZoneFloorArea;
1735 3103 : VbzSum += VbzByZone(termUnitSizingIndex);
1736 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffCooling != 0.0) {
1737 3103 : VozClgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
1738 : }
1739 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
1740 3103 : VozHtgSum += VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
1741 : }
1742 :
1743 3103 : VpzMinClgSum += state.dataSize->VpzMinClgByZone(termUnitSizingIndex);
1744 3103 : VdzClgSum += state.dataSize->VdzClgByZone(termUnitSizingIndex);
1745 3103 : VpzMinHtgSum += state.dataSize->VpzMinHtgByZone(termUnitSizingIndex);
1746 3103 : VdzHtgSum += state.dataSize->VdzMinHtgByZone(termUnitSizingIndex);
1747 :
1748 : // Zone Ventilation Calculations for Cooling Design, (Table 5)
1749 6206 : OutputReportPredefined::PreDefTableEntry(state,
1750 3103 : state.dataOutRptPredefined->pdchS62zcdAlN,
1751 : thisTermUnitFinalZoneSizing.ZoneName,
1752 3103 : AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
1753 52618 : for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
1754 52618 : if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
1755 6206 : OutputReportPredefined::PreDefTableEntry(state,
1756 3103 : state.dataOutRptPredefined->pdchS62zcdBox,
1757 : thisTermUnitFinalZoneSizing.ZoneName,
1758 3103 : AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
1759 3103 : break; // if it has been found no more searching is needed
1760 : }
1761 : }
1762 3103 : OutputReportPredefined::PreDefTableEntry(state,
1763 3103 : state.dataOutRptPredefined->pdchS62zcdVpz,
1764 : thisTermUnitFinalZoneSizing.ZoneName,
1765 3103 : state.dataSize->VpzClgByZone(termUnitSizingIndex),
1766 3103 : 4); // Vpz LS:
1767 3103 : OutputReportPredefined::PreDefTableEntry(state,
1768 3103 : state.dataOutRptPredefined->pdchS62zcdVdz,
1769 : thisTermUnitFinalZoneSizing.ZoneName,
1770 3103 : state.dataSize->VdzClgByZone(termUnitSizingIndex),
1771 3103 : 4); // Vdz
1772 3103 : OutputReportPredefined::PreDefTableEntry(state,
1773 3103 : state.dataOutRptPredefined->pdchS62zcdVpzmin,
1774 : thisTermUnitFinalZoneSizing.ZoneName,
1775 3103 : state.dataSize->VpzMinClgByZone(termUnitSizingIndex),
1776 3103 : 4); // Vpz-min
1777 : // Vpz-min, simplified procedure?
1778 3103 : if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
1779 16 : OutputReportPredefined::PreDefTableEntry(
1780 8 : state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
1781 : } else {
1782 6190 : OutputReportPredefined::PreDefTableEntry(
1783 3095 : state, state.dataOutRptPredefined->pdchS62zcdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
1784 : }
1785 3103 : Real64 VozClg = 0.0;
1786 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffCooling > 0.0) {
1787 3103 : VozClg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffCooling;
1788 6206 : OutputReportPredefined::PreDefTableEntry(state,
1789 3103 : state.dataOutRptPredefined->pdchS62zcdVozclg,
1790 : thisTermUnitFinalZoneSizing.ZoneName,
1791 : VozClg,
1792 6206 : 4); // Voz-clg
1793 : }
1794 3103 : OutputReportPredefined::PreDefTableEntry(state,
1795 3103 : state.dataOutRptPredefined->pdchS62zcdZpz,
1796 : thisTermUnitFinalZoneSizing.ZoneName,
1797 3103 : state.dataSize->ZdzClgByZone(termUnitSizingIndex),
1798 3103 : 4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
1799 3103 : OutputReportPredefined::PreDefTableEntry(state,
1800 3103 : state.dataOutRptPredefined->pdchS62zcdEp,
1801 : thisTermUnitFinalZoneSizing.ZoneName,
1802 3103 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFraction,
1803 3103 : 4); // Ep
1804 3103 : OutputReportPredefined::PreDefTableEntry(state,
1805 3103 : state.dataOutRptPredefined->pdchS62zcdEr,
1806 : thisTermUnitFinalZoneSizing.ZoneName,
1807 3103 : thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
1808 3103 : 4); // Er
1809 3103 : OutputReportPredefined::PreDefTableEntry(state,
1810 3103 : state.dataOutRptPredefined->pdchS62zcdFa,
1811 : thisTermUnitFinalZoneSizing.ZoneName,
1812 3103 : state.dataSize->FaByZoneCool(termUnitSizingIndex),
1813 3103 : 4); // Fa
1814 3103 : OutputReportPredefined::PreDefTableEntry(state,
1815 3103 : state.dataOutRptPredefined->pdchS62zcdFb,
1816 : thisTermUnitFinalZoneSizing.ZoneName,
1817 3103 : state.dataSize->FbByZoneCool(termUnitSizingIndex),
1818 3103 : 4); // Fb
1819 3103 : OutputReportPredefined::PreDefTableEntry(state,
1820 3103 : state.dataOutRptPredefined->pdchS62zcdFc,
1821 : thisTermUnitFinalZoneSizing.ZoneName,
1822 3103 : state.dataSize->FcByZoneCool(termUnitSizingIndex),
1823 3103 : 4); // Fc
1824 3103 : OutputReportPredefined::PreDefTableEntry(state,
1825 3103 : state.dataOutRptPredefined->pdchS62zcdEvz,
1826 : thisTermUnitFinalZoneSizing.ZoneName,
1827 3103 : state.dataSize->EvzByZoneCool(termUnitSizingIndex),
1828 3103 : 4); // Evz
1829 :
1830 : // Zone Ventilation Calculations for Heating Design (Table 7)
1831 6206 : OutputReportPredefined::PreDefTableEntry(state,
1832 3103 : state.dataOutRptPredefined->pdchS62zhdAlN,
1833 : thisTermUnitFinalZoneSizing.ZoneName,
1834 3103 : AirToZoneNodeInfo(AirLoopNum).AirLoopName); // Air loop name
1835 52618 : for (int iAirDistUnit = 1; iAirDistUnit <= (int)state.dataDefineEquipment->AirDistUnit.size(); ++iAirDistUnit) {
1836 52618 : if (AirDistUnit(iAirDistUnit).TermUnitSizingNum == termUnitSizingIndex) {
1837 6206 : OutputReportPredefined::PreDefTableEntry(state,
1838 3103 : state.dataOutRptPredefined->pdchS62zhdBox,
1839 : thisTermUnitFinalZoneSizing.ZoneName,
1840 3103 : AirDistUnit(iAirDistUnit).EquipType(1)); // use first type of equipment listed
1841 3103 : break; // if it has been found no more searching is needed
1842 : }
1843 : }
1844 3103 : OutputReportPredefined::PreDefTableEntry(state,
1845 3103 : state.dataOutRptPredefined->pdchS62zhdVpz,
1846 : thisTermUnitFinalZoneSizing.ZoneName,
1847 3103 : state.dataSize->VpzHtgByZone(termUnitSizingIndex),
1848 3103 : 4); // Vpz
1849 3103 : OutputReportPredefined::PreDefTableEntry(state,
1850 3103 : state.dataOutRptPredefined->pdchS62zhdVdz,
1851 : thisTermUnitFinalZoneSizing.ZoneName,
1852 3103 : state.dataSize->VdzHtgByZone(termUnitSizingIndex),
1853 3103 : 4); // Vdz
1854 3103 : OutputReportPredefined::PreDefTableEntry(state,
1855 3103 : state.dataOutRptPredefined->pdchS62zhdVpzmin,
1856 : thisTermUnitFinalZoneSizing.ZoneName,
1857 3103 : state.dataSize->VpzMinHtgByZone(termUnitSizingIndex),
1858 3103 : 4); // Vpz-min
1859 : // Vpz-min, simplified procedure?
1860 3103 : if (thisTermUnitFinalZoneSizing.VpzMinByZoneSPSized) {
1861 16 : OutputReportPredefined::PreDefTableEntry(
1862 8 : state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "Yes");
1863 : } else {
1864 6190 : OutputReportPredefined::PreDefTableEntry(
1865 3095 : state, state.dataOutRptPredefined->pdchS62zhdVpzminSPSize, thisTermUnitFinalZoneSizing.ZoneName, "No");
1866 : }
1867 3103 : Real64 VozHtg = 0.0;
1868 3103 : if (thisTermUnitFinalZoneSizing.ZoneADEffHeating != 0.0) {
1869 3103 : VozHtg = VbzByZone(termUnitSizingIndex) / thisTermUnitFinalZoneSizing.ZoneADEffHeating;
1870 6206 : OutputReportPredefined::PreDefTableEntry(state,
1871 3103 : state.dataOutRptPredefined->pdchS62zhdVozhtg,
1872 : thisTermUnitFinalZoneSizing.ZoneName,
1873 : VozHtg,
1874 6206 : 4); // Voz-htg
1875 : }
1876 : // Outdoor Air Details Report - Design Zone Outdoor Airflow - Voz
1877 3103 : Real64 VozMax = std::max(VozHtg, VozClg); // take larger of the heating and cooling Voz values
1878 6206 : OutputReportPredefined::PreDefTableEntry(
1879 6206 : state, state.dataOutRptPredefined->pdchOaMvDesZnOa, thisTermUnitFinalZoneSizing.ZoneName, VozMax, 4);
1880 3103 : state.dataOutRptPredefined->TotalVozMax += VozMax * state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).Multiplier *
1881 3103 : state.dataHeatBal->Zone(thisTermUnitFinalZoneSizing.ZoneNum).ListMultiplier;
1882 3103 : OutputReportPredefined::PreDefTableEntry(state,
1883 3103 : state.dataOutRptPredefined->pdchS62zhdZpz,
1884 : thisTermUnitFinalZoneSizing.ZoneName,
1885 3103 : thisTermUnitFinalZoneSizing.ZpzHtgByZone,
1886 3103 : 4); // Zpz = Voz/Vpz (see eq 6-5 in 62.1-2010)
1887 3103 : OutputReportPredefined::PreDefTableEntry(state,
1888 3103 : state.dataOutRptPredefined->pdchS62zhdEp,
1889 : thisTermUnitFinalZoneSizing.ZoneName,
1890 3103 : thisTermUnitFinalZoneSizing.ZonePrimaryAirFractionHtg,
1891 3103 : 4); // Ep
1892 3103 : OutputReportPredefined::PreDefTableEntry(state,
1893 3103 : state.dataOutRptPredefined->pdchS62zhdEr,
1894 : thisTermUnitFinalZoneSizing.ZoneName,
1895 3103 : thisTermUnitFinalZoneSizing.ZoneSecondaryRecirculation,
1896 3103 : 4); // Er
1897 3103 : OutputReportPredefined::PreDefTableEntry(state,
1898 3103 : state.dataOutRptPredefined->pdchS62zhdFa,
1899 : thisTermUnitFinalZoneSizing.ZoneName,
1900 3103 : state.dataSize->FaByZoneHeat(termUnitSizingIndex),
1901 3103 : 4); // Fa
1902 3103 : OutputReportPredefined::PreDefTableEntry(state,
1903 3103 : state.dataOutRptPredefined->pdchS62zhdFb,
1904 : thisTermUnitFinalZoneSizing.ZoneName,
1905 3103 : state.dataSize->FbByZoneHeat(termUnitSizingIndex),
1906 3103 : 4); // Fb
1907 3103 : OutputReportPredefined::PreDefTableEntry(state,
1908 3103 : state.dataOutRptPredefined->pdchS62zhdFc,
1909 : thisTermUnitFinalZoneSizing.ZoneName,
1910 3103 : state.dataSize->FcByZoneHeat(termUnitSizingIndex),
1911 3103 : 4); // Fc
1912 3103 : OutputReportPredefined::PreDefTableEntry(state,
1913 3103 : state.dataOutRptPredefined->pdchS62zhdEvz,
1914 : thisTermUnitFinalZoneSizing.ZoneName,
1915 3103 : state.dataSize->EvzByZoneHeat(termUnitSizingIndex),
1916 6206 : 4); // Evz
1917 : }
1918 : }
1919 : }
1920 :
1921 : // System Ventilation Parameters, (Table 4)
1922 957 : if (state.dataSize->PzSumBySys(AirLoopNum) != 0.0) {
1923 885 : OutputReportPredefined::PreDefTableEntry(state,
1924 885 : state.dataOutRptPredefined->pdchS62svpRp,
1925 885 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1926 885 : RpPzSum / state.dataSize->PzSumBySys(AirLoopNum),
1927 1770 : 6); // Average Rp for system
1928 : }
1929 1914 : OutputReportPredefined::PreDefTableEntry(
1930 957 : state, state.dataOutRptPredefined->pdchS62svpPz, FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->PzSumBySys(AirLoopNum));
1931 957 : if (AzSum != 0.0) {
1932 957 : OutputReportPredefined::PreDefTableEntry(state,
1933 957 : state.dataOutRptPredefined->pdchS62svpRa,
1934 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1935 : RaAzSum / AzSum,
1936 1914 : 6); // average Ra for system
1937 : }
1938 957 : OutputReportPredefined::PreDefTableEntry(state,
1939 957 : state.dataOutRptPredefined->pdchS62svpAz,
1940 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1941 : AzSum,
1942 957 : 4); // Az sum
1943 957 : OutputReportPredefined::PreDefTableEntry(
1944 957 : state, state.dataOutRptPredefined->pdchS62svpVbz, FinalSysSizing(AirLoopNum).AirPriLoopName, VbzSum, 4);
1945 957 : OutputReportPredefined::PreDefTableEntry(state,
1946 957 : state.dataOutRptPredefined->pdchS62svpClVoz,
1947 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1948 : VozClgSum,
1949 957 : 4); // Voz-clg
1950 957 : OutputReportPredefined::PreDefTableEntry(state,
1951 957 : state.dataOutRptPredefined->pdchS62svpHtVoz,
1952 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1953 : VozHtgSum,
1954 957 : 4); // Voz-htg
1955 :
1956 : // System Ventilation Calculations for Cooling Design (Table 6)
1957 957 : OutputReportPredefined::PreDefTableEntry(state,
1958 957 : state.dataOutRptPredefined->pdchS62scdVpz,
1959 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1960 957 : state.dataSize->VpzClgSumBySys(AirLoopNum),
1961 957 : 4); // Vpz-sum
1962 957 : OutputReportPredefined::PreDefTableEntry(state,
1963 957 : state.dataOutRptPredefined->pdchS62scdVps,
1964 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1965 957 : state.dataSize->VpsClgBySys(AirLoopNum),
1966 957 : 4); // Vps
1967 957 : OutputReportPredefined::PreDefTableEntry(
1968 957 : state, state.dataOutRptPredefined->pdchS62scdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinClgSum, 4); // Vpz-min
1969 957 : OutputReportPredefined::PreDefTableEntry(state,
1970 957 : state.dataOutRptPredefined->pdchS62scdVdz,
1971 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1972 : VdzClgSum,
1973 957 : 4); // Vdz-sum
1974 957 : OutputReportPredefined::PreDefTableEntry(state,
1975 957 : state.dataOutRptPredefined->pdchS62scdVozclg,
1976 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1977 : VozClgSum,
1978 957 : 4); // Voz-clg
1979 957 : OutputReportPredefined::PreDefTableEntry(state,
1980 957 : state.dataOutRptPredefined->pdchS62scdEvz,
1981 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1982 957 : state.dataSize->EvzMinBySysCool(AirLoopNum),
1983 957 : 4); // Evz-min
1984 :
1985 : // System Ventilation Calculations for Heating Design (Table 8)
1986 957 : OutputReportPredefined::PreDefTableEntry(state,
1987 957 : state.dataOutRptPredefined->pdchS62shdVpz,
1988 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1989 957 : state.dataSize->VpzHtgSumBySys(AirLoopNum),
1990 957 : 4); // Vpz-sum
1991 957 : OutputReportPredefined::PreDefTableEntry(state,
1992 957 : state.dataOutRptPredefined->pdchS62shdVps,
1993 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1994 957 : state.dataSize->VpsHtgBySys(AirLoopNum),
1995 957 : 4); // Vps
1996 957 : OutputReportPredefined::PreDefTableEntry(state,
1997 957 : state.dataOutRptPredefined->pdchS62shdVdz,
1998 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
1999 : VdzHtgSum,
2000 957 : 4); // Vdz-sum
2001 957 : OutputReportPredefined::PreDefTableEntry(
2002 957 : state, state.dataOutRptPredefined->pdchS62shdVpzmin, FinalSysSizing(AirLoopNum).AirPriLoopName, VpzMinHtgSum, 4); // Vpz-min
2003 957 : OutputReportPredefined::PreDefTableEntry(state,
2004 957 : state.dataOutRptPredefined->pdchS62shdVozhtg,
2005 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
2006 : VozHtgSum,
2007 957 : 4); // Voz-htg
2008 957 : OutputReportPredefined::PreDefTableEntry(state,
2009 957 : state.dataOutRptPredefined->pdchS62shdEvz,
2010 957 : FinalSysSizing(AirLoopNum).AirPriLoopName,
2011 957 : state.dataSize->EvzMinBySysHeat(AirLoopNum),
2012 1914 : 4); // Evz-min
2013 :
2014 : } // loop over air loops for table writing
2015 795 : }
2016 :
2017 344 : void DetermineSystemPopulationDiversity(EnergyPlusData &state)
2018 : {
2019 :
2020 344 : auto &FinalSysSizing = state.dataSize->FinalSysSizing;
2021 344 : auto &SysSizInput = state.dataSize->SysSizInput;
2022 :
2023 : // determine Pz sum, Ps, and D for each air system for standard 62.1
2024 :
2025 : // first determine if any airloops use VRP, if not then don't need to march thru year of schedules for performance
2026 344 : bool anyVRPinModel(false);
2027 1291 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
2028 954 : if (FinalSysSizing(AirLoopNum).SystemOAMethod == SysOAMethod::VRP || FinalSysSizing(AirLoopNum).SystemOAMethod == SysOAMethod::SP) {
2029 7 : anyVRPinModel = true;
2030 7 : break;
2031 : }
2032 : }
2033 : // First get the design (max) level of people in all zones connected to air loop
2034 1301 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
2035 : int SysSizNum =
2036 957 : Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
2037 957 : if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable
2038 : // only retrieve data if the occupant density is set to be autosized
2039 957 : if (FinalSysSizing(AirLoopNum).OAAutoSized && SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
2040 917 : auto &pzSumBySys = state.dataSize->PzSumBySys(AirLoopNum);
2041 917 : pzSumBySys = 0.0;
2042 917 : state.dataSize->PsBySys(AirLoopNum) = 0.0;
2043 3705 : for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
2044 2788 : int zoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
2045 2788 : auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(zoneNum);
2046 80073 : for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
2047 77285 : if (state.dataHeatBal->People(PeopleNum).ZonePtr == finalZoneSizing.ZoneNum) {
2048 2702 : pzSumBySys +=
2049 2702 : (state.dataHeatBal->People(PeopleNum).NumberOfPeople * state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).Multiplier *
2050 2702 : state.dataHeatBal->Zone(finalZoneSizing.ZoneNum).ListMultiplier);
2051 : }
2052 : }
2053 : }
2054 : }
2055 : }
2056 :
2057 344 : if (!anyVRPinModel) {
2058 1284 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
2059 947 : state.dataSize->DBySys(AirLoopNum) = 1.0;
2060 : }
2061 337 : return; // early return to not march through schedules
2062 : }
2063 :
2064 7 : DisplayString(state, "Standard 62.1 Ventilation Rate Procedure: Determine System Occupant Diversity");
2065 : // now march through all zone timesteps for entire year to find the concurrent max
2066 7 : int DaysInYear(366); // assume leap year
2067 7 : int dayOfWeekType(1); // assume year starts on Sunday
2068 7 : Weather::CalcSpecialDayTypes(state);
2069 2569 : for (int DayLoop = 1; DayLoop <= DaysInYear; ++DayLoop) { // loop over all days in year
2070 2562 : state.dataEnvrn->HolidayIndex = state.dataWeather->SpecialDayTypes(DayLoop);
2071 2562 : state.dataEnvrn->DayOfYear_Schedule = DayLoop;
2072 2562 : state.dataEnvrn->DayOfWeek = dayOfWeekType;
2073 2562 : ++dayOfWeekType;
2074 2562 : if (dayOfWeekType > 7) dayOfWeekType = 1;
2075 64050 : for (int hrOfDay = 1; hrOfDay <= 24; ++hrOfDay) { // loop over all hours in day
2076 61488 : state.dataGlobal->HourOfDay = hrOfDay; // avoid crash in schedule manager
2077 325008 : for (int TS = 1; TS <= state.dataGlobal->NumOfTimeStepInHour; ++TS) { // loop over all timesteps in hour
2078 263520 : state.dataGlobal->TimeStep = TS; // avoid crash in schedule manager
2079 263520 : Real64 TSfraction(0.0);
2080 263520 : if (state.dataGlobal->NumOfTimeStepInHour > 0.0) TSfraction = 1.0 / double(state.dataGlobal->NumOfTimeStepInHour);
2081 667584 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) { // loop over all the air systems
2082 404064 : int SysSizNum = Util::FindItemInList(
2083 404064 : FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
2084 404064 : if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable
2085 404064 : if (FinalSysSizing(AirLoopNum).OAAutoSized && SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
2086 :
2087 : // Loop over all zones connected to air loop
2088 333792 : Real64 TotConcurrentPeopleOnSys = 0.0;
2089 1932480 : for (int zoneNumOnLoop = 1; zoneNumOnLoop <= state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones; ++zoneNumOnLoop) {
2090 1598688 : int CtrlZoneNum = state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).ActualZoneNumber(zoneNumOnLoop);
2091 :
2092 17497728 : for (int PeopleNum = 1; PeopleNum <= state.dataHeatBal->TotPeople; ++PeopleNum) {
2093 15899040 : if (state.dataHeatBal->People(PeopleNum).ZonePtr == state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum) {
2094 : Real64 PeopleInZone =
2095 1598688 : (state.dataHeatBal->People(PeopleNum).NumberOfPeople *
2096 1598688 : state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).Multiplier *
2097 1598688 : state.dataHeatBal->Zone(state.dataSize->FinalZoneSizing(CtrlZoneNum).ZoneNum).ListMultiplier);
2098 3197376 : Real64 schMultiplier = ScheduleManager::LookUpScheduleValue(
2099 1598688 : state, state.dataHeatBal->People(PeopleNum).NumberOfPeoplePtr, hrOfDay, TS);
2100 1598688 : PeopleInZone = PeopleInZone * schMultiplier;
2101 1598688 : TotConcurrentPeopleOnSys += PeopleInZone;
2102 : }
2103 : }
2104 : }
2105 333792 : if (TotConcurrentPeopleOnSys >= state.dataSize->PsBySys(AirLoopNum)) {
2106 76084 : state.dataSize->PsBySys(AirLoopNum) = TotConcurrentPeopleOnSys; // store max concurrent occupancy on system
2107 : // store timing description of Last occurrence of max
2108 76084 : int Month(0);
2109 76084 : int DayOfMonth(0);
2110 76084 : General::InvOrdinalDay(DayLoop, Month, DayOfMonth, 1);
2111 76084 : Real64 TimeHrsFraction = (double(hrOfDay) - 1.0) + double(TS) * TSfraction;
2112 76084 : int TimeHrsInt = int(TimeHrsFraction);
2113 76084 : int TimeMinsInt = nint((TimeHrsFraction - TimeHrsInt) * 60.0);
2114 76084 : if (TimeMinsInt == 60) {
2115 0 : ++TimeHrsInt;
2116 0 : TimeMinsInt = 0;
2117 : }
2118 76084 : state.dataSize->PeakPsOccurrenceDateTimeStringBySys(AirLoopNum) =
2119 152168 : format("{:02}/{:02} {:02}:{:02}", Month, DayOfMonth, TimeHrsInt, TimeMinsInt);
2120 76084 : state.dataSize->PeakPsOccurrenceEnvironmentStringBySys(AirLoopNum) = "Full Year Schedule";
2121 : }
2122 : } // if autosizied and VRP
2123 : } // air loops
2124 : }
2125 : }
2126 : }
2127 :
2128 : // compute D for standard 62.1 by system
2129 17 : for (int AirLoopNum = 1; AirLoopNum <= state.dataHVACGlobal->NumPrimaryAirSys; ++AirLoopNum) {
2130 : int SysSizNum =
2131 10 : Util::FindItemInList(FinalSysSizing(AirLoopNum).AirPriLoopName, state.dataSize->SysSizInput, &SystemSizingInputData::AirPriLoopName);
2132 10 : if (SysSizNum == 0) SysSizNum = 1; // use first when none applicable
2133 :
2134 : // compute D if set to autosize
2135 10 : if (SysSizInput(SysSizNum).OccupantDiversity == AutoSize) {
2136 8 : if (state.dataSize->PzSumBySys(AirLoopNum) > 0.0) {
2137 8 : state.dataSize->DBySys(AirLoopNum) = state.dataSize->PsBySys(AirLoopNum) / state.dataSize->PzSumBySys(AirLoopNum);
2138 : } else {
2139 0 : state.dataSize->DBySys(AirLoopNum) = 1.0;
2140 : }
2141 8 : state.dataSize->DBySys(AirLoopNum) = min(1.0, state.dataSize->DBySys(AirLoopNum));
2142 : } else {
2143 : // set the occupant diversity based on user-specified value
2144 2 : state.dataSize->DBySys(AirLoopNum) = SysSizInput(SysSizNum).OccupantDiversity;
2145 : }
2146 :
2147 : // For single zone systems, D should be 1.0.
2148 10 : if (state.dataAirLoop->AirLoopZoneInfo(AirLoopNum).NumZones == 1) {
2149 0 : state.dataSize->DBySys(AirLoopNum) = 1.0;
2150 0 : ShowWarningError(
2151 : state,
2152 0 : format("The {} air loop serves a single zone. The Occupant Diversity was calculated or set to a value less than 1.0. Single-zone air "
2153 : "loops should have an Occupant Diversity of 1.0. The Occupant Diversity value for that air loop has been reset to 1.0",
2154 0 : FinalSysSizing(AirLoopNum).AirPriLoopName));
2155 : }
2156 : }
2157 : }
2158 :
2159 796 : void GetOARequirements(EnergyPlusData &state)
2160 : {
2161 :
2162 : // SUBROUTINE INFORMATION:
2163 : // AUTHOR R. Raustad - FSEC
2164 : // DATE WRITTEN February 2010
2165 :
2166 : // PURPOSE OF THIS SUBROUTINE:
2167 : // Obtains input data for the OA Requirements object and stores it in
2168 : // appropriate data structure.
2169 :
2170 : // METHODOLOGY EMPLOYED:
2171 : // Uses InputProcessor "Get" routines to obtain data.
2172 : // This object requires only a name where the default values are assumed
2173 : // if subsequent fields are not entered.
2174 :
2175 : using ScheduleManager::CheckScheduleValueMinMax;
2176 : using ScheduleManager::GetScheduleIndex;
2177 : using ScheduleManager::GetScheduleMaxValue;
2178 :
2179 : static constexpr std::string_view RoutineName("GetOARequirements: "); // include trailing blank space
2180 :
2181 : int NumAlphas; // Number of Alphas for each GetObjectItem call
2182 : int NumNumbers; // Number of Numbers for each GetObjectItem call
2183 : int TotalArgs; // Total number of alpha and numeric arguments (max) for a
2184 : int IOStatus; // Used in GetObjectItem
2185 796 : bool ErrorsFound(false); // If errors detected in input
2186 :
2187 796 : std::string CurrentModuleObject; // for ease in getting objects
2188 796 : Array1D_string Alphas; // Alpha input items for object
2189 796 : Array1D_string cAlphaFields; // Alpha field names
2190 796 : Array1D_string cNumericFields; // Numeric field names
2191 796 : Array1D<Real64> Numbers; // Numeric input items for object
2192 796 : Array1D_bool lAlphaBlanks; // Logical array, alpha field input BLANK = .TRUE.
2193 796 : Array1D_bool lNumericBlanks; // Logical array, numeric field input BLANK = .TRUE.
2194 :
2195 796 : CurrentModuleObject = "DesignSpecification:OutdoorAir";
2196 796 : int numOARequirements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
2197 796 : state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
2198 796 : std::string cCurrentModuleObject2 = "DesignSpecification:OutdoorAir:SpaceList";
2199 796 : int numOARequirementsLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject2);
2200 796 : state.dataSize->NumOARequirements = numOARequirements + numOARequirementsLists;
2201 :
2202 796 : Alphas.allocate(NumAlphas);
2203 796 : cAlphaFields.allocate(NumAlphas);
2204 796 : cNumericFields.allocate(NumNumbers);
2205 796 : Numbers.dimension(NumNumbers, 0.0);
2206 796 : lAlphaBlanks.dimension(NumAlphas, true);
2207 796 : lNumericBlanks.dimension(NumNumbers, true);
2208 :
2209 796 : if (state.dataSize->NumOARequirements > 0) {
2210 433 : state.dataSize->OARequirements.allocate(state.dataSize->NumOARequirements);
2211 :
2212 : // Start Loading the System Input
2213 4408 : for (int OAIndex = 1; OAIndex <= numOARequirements; ++OAIndex) {
2214 :
2215 3975 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2216 : CurrentModuleObject,
2217 : OAIndex,
2218 : Alphas,
2219 : NumAlphas,
2220 : Numbers,
2221 : NumNumbers,
2222 : IOStatus,
2223 : lNumericBlanks,
2224 : lAlphaBlanks,
2225 : cAlphaFields,
2226 : cNumericFields);
2227 3975 : Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
2228 :
2229 3975 : state.dataSize->OARequirements(OAIndex).Name = Alphas(1);
2230 :
2231 3975 : ProcessInputOARequirements(
2232 : state, CurrentModuleObject, OAIndex, Alphas, NumAlphas, Numbers, NumNumbers, lAlphaBlanks, cAlphaFields, ErrorsFound);
2233 : }
2234 :
2235 433 : Alphas.deallocate();
2236 433 : cAlphaFields.deallocate();
2237 433 : cNumericFields.deallocate();
2238 433 : Numbers.deallocate();
2239 433 : lAlphaBlanks.deallocate();
2240 433 : lNumericBlanks.deallocate();
2241 :
2242 : // DesignSpecification:OutdoorAir:SpaceList
2243 433 : auto &ip = state.dataInputProcessing->inputProcessor;
2244 433 : auto const instances = ip->epJSON.find(cCurrentModuleObject2);
2245 433 : if (instances != ip->epJSON.end()) {
2246 3 : auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject2);
2247 3 : auto &instancesValue = instances.value();
2248 3 : int oaIndex = numOARequirements; // add lists to the end of the same array
2249 :
2250 6 : for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
2251 3 : ++oaIndex;
2252 3 : auto const &objectFields = instance.value();
2253 3 : auto &thisOAReq = state.dataSize->OARequirements(oaIndex);
2254 3 : ip->markObjectAsUsed(cCurrentModuleObject2, instance.key());
2255 3 : std::string thisOAReqName = Util::makeUPPER(instance.key());
2256 :
2257 3 : if (Util::FindItemInList(thisOAReqName, state.dataSize->OARequirements) > 0) {
2258 0 : ShowSevereError(
2259 : state,
2260 0 : format("{}{}=\"{}\" is a duplicate DesignSpecification:OutdoorAir name.", RoutineName, cCurrentModuleObject2, thisOAReqName));
2261 0 : ErrorsFound = true;
2262 : }
2263 3 : thisOAReq.Name = thisOAReqName;
2264 :
2265 : // List of spaces and DSOA names
2266 3 : thisOAReq.numDSOA = 0;
2267 3 : auto extensibles = objectFields.find("space_specs");
2268 3 : auto const &extensionSchemaProps = objectSchemaProps["space_specs"]["items"]["properties"];
2269 3 : if (extensibles != objectFields.end()) {
2270 3 : auto &extensiblesArray = extensibles.value();
2271 9 : for (auto &extensibleInstance : extensiblesArray) {
2272 : // Zones and spaces are not created yet, validate space names in ZoneEquipmentManager::SetupZoneSizingArrays
2273 12 : std::string thisSpaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name");
2274 6 : thisOAReq.dsoaSpaceNames.emplace_back(thisSpaceName);
2275 : std::string thisDsoaName =
2276 12 : ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_design_specification_outdoor_air_object_name");
2277 6 : int thisDsoaNum = Util::FindItemInList(thisDsoaName, state.dataSize->OARequirements, oaIndex);
2278 6 : if (thisDsoaNum > 0) {
2279 6 : thisOAReq.dsoaIndexes.emplace_back(thisDsoaNum);
2280 6 : ++thisOAReq.numDSOA;
2281 : } else {
2282 0 : ShowSevereError(state, format("{}{}={}", RoutineName, cCurrentModuleObject2, thisOAReq.Name));
2283 0 : ShowContinueError(state, format("DesignSpecification:OutdoorAir={} not found.", thisDsoaName));
2284 0 : ErrorsFound = true;
2285 : }
2286 9 : }
2287 : } else {
2288 0 : ShowSevereError(state, format("{}{}={} is empty.", RoutineName, cCurrentModuleObject2, thisOAReq.Name));
2289 0 : ShowContinueError(state, "At least one pair of Space Name and Space Design Specification Outdoor Air Object Name is required.");
2290 0 : ErrorsFound = true;
2291 : }
2292 6 : }
2293 :
2294 3 : if (ErrorsFound) {
2295 0 : ShowFatalError(state, format("{}Errors found in input. Preceding condition(s) cause termination.", RoutineName));
2296 : }
2297 : }
2298 433 : }
2299 796 : }
2300 :
2301 3975 : void ProcessInputOARequirements(EnergyPlusData &state,
2302 : std::string const &CurrentModuleObject,
2303 : int const OAIndex,
2304 : Array1D_string const &Alphas,
2305 : int &NumAlphas,
2306 : Array1D<Real64> const &Numbers,
2307 : int &NumNumbers,
2308 : Array1D_bool const &lAlphaBlanks,
2309 : Array1D_string const &cAlphaFields,
2310 : bool &ErrorsFound // If errors found in input
2311 : )
2312 : {
2313 :
2314 : // SUBROUTINE INFORMATION:
2315 : // AUTHOR R. Raustad - FSEC
2316 : // DATE WRITTEN February 2010
2317 : // MODIFIED na
2318 : // RE-ENGINEERED na
2319 :
2320 : // PURPOSE OF THIS SUBROUTINE:
2321 : // Obtains input data for the OA Requirements object and stores it in
2322 : // appropriate data structure.
2323 :
2324 : // METHODOLOGY EMPLOYED:
2325 : // Uses InputProcessor "Get" routines to obtain data.
2326 : // This object requires only a name where the default values are assumed
2327 : // if subsequent fields are not entered.
2328 :
2329 : // REFERENCES:
2330 : // na
2331 :
2332 : using ScheduleManager::CheckScheduleValueMinMax;
2333 : using ScheduleManager::GetScheduleIndex;
2334 : using ScheduleManager::GetScheduleMaxValue;
2335 :
2336 : // Locals
2337 : // SUBROUTINE ARGUMENT DEFINITIONS:
2338 : // na
2339 :
2340 : // SUBROUTINE PARAMETER DEFINITIONS:
2341 : static constexpr std::string_view RoutineName("GetOARequirements: "); // include trailing blank space
2342 :
2343 : // INTERFACE BLOCK SPECIFICATIONS
2344 : // na
2345 :
2346 : // DERIVED TYPE DEFINITIONS
2347 : // na
2348 :
2349 3975 : auto &thisOARequirements(state.dataSize->OARequirements(OAIndex));
2350 :
2351 3975 : if (NumAlphas > 1) {
2352 3975 : thisOARequirements.OAFlowMethod = static_cast<OAFlowCalcMethod>(getEnumValue(OAFlowCalcMethodNamesUC, Util::makeUPPER(Alphas(2))));
2353 3975 : if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Invalid) {
2354 0 : ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
2355 0 : ShowContinueError(state, format("...Invalid {}=\"{}\",", cAlphaFields(2), Alphas(2)));
2356 0 : ShowContinueError(state,
2357 : "...Valid choices are Flow/Person, Flow/Zone, Flow/Area, AirChanges/Hour, Sum, Maximum, IndoorAirQualityProcedure, "
2358 : "ProportionalControlBasedOnDesignOccupancy, and ProportionalControlBasedOnOccupancySchedule.");
2359 0 : ErrorsFound = true;
2360 : }
2361 : } else {
2362 : // default value for Outdoor Air Method
2363 0 : thisOARequirements.OAFlowMethod = OAFlowCalcMethod::PerPerson;
2364 : }
2365 3975 : if (NumNumbers > 0) {
2366 3974 : state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = Numbers(1);
2367 : } else {
2368 : // default value for Outdoor Air Flow per Person when per person flow is counted
2369 1 : state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = 0.00944;
2370 : }
2371 : // if one of the methods that should not use the flow per person field is chosen then zero out the flow per person to avoid it
2372 : // being counted later #4378
2373 3975 : if (thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PerPerson && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Sum &&
2374 1802 : thisOARequirements.OAFlowMethod != OAFlowCalcMethod::Max && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCOccSch &&
2375 1795 : thisOARequirements.OAFlowMethod != OAFlowCalcMethod::PCDesOcc && thisOARequirements.OAFlowMethod != OAFlowCalcMethod::IAQProcedure) {
2376 1787 : state.dataSize->OARequirements(OAIndex).OAFlowPerPerson = 0.0;
2377 : }
2378 : // remaining fields default to 0
2379 3975 : if (NumNumbers > 1) {
2380 3655 : if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerArea || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
2381 2390 : thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max) {
2382 1270 : state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
2383 2385 : } else if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCOccSch || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PCDesOcc ||
2384 2380 : thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
2385 10 : state.dataSize->OARequirements(OAIndex).OAFlowPerArea = Numbers(2);
2386 : } else {
2387 2375 : state.dataSize->OARequirements(OAIndex).OAFlowPerArea = 0.0;
2388 : }
2389 : }
2390 3975 : if (NumNumbers > 2) {
2391 3104 : if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::PerZone || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
2392 1784 : thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
2393 1330 : state.dataSize->OARequirements(OAIndex).OAFlowPerZone = Numbers(3);
2394 : } else {
2395 1774 : state.dataSize->OARequirements(OAIndex).OAFlowPerZone = 0.0;
2396 : }
2397 : }
2398 :
2399 3975 : if (NumNumbers > 3) {
2400 292 : if (thisOARequirements.OAFlowMethod == OAFlowCalcMethod::ACH || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Sum ||
2401 269 : thisOARequirements.OAFlowMethod == OAFlowCalcMethod::Max || thisOARequirements.OAFlowMethod == OAFlowCalcMethod::IAQProcedure) {
2402 23 : state.dataSize->OARequirements(OAIndex).OAFlowACH = Numbers(4);
2403 : } else {
2404 269 : state.dataSize->OARequirements(OAIndex).OAFlowACH = 0.0;
2405 : }
2406 : }
2407 :
2408 : // Set default schedule
2409 3975 : state.dataSize->OARequirements(OAIndex).OAFlowFracSchPtr = ScheduleManager::ScheduleAlwaysOn;
2410 3975 : if (NumAlphas > 2) {
2411 285 : if (!lAlphaBlanks(3)) {
2412 22 : state.dataSize->OARequirements(OAIndex).OAFlowFracSchPtr = GetScheduleIndex(state, Alphas(3));
2413 22 : if (state.dataSize->OARequirements(OAIndex).OAFlowFracSchPtr > 0) {
2414 22 : if (!CheckScheduleValueMinMax(state, state.dataSize->OARequirements(OAIndex).OAFlowFracSchPtr, ">=", 0.0, "<=", 1.0)) {
2415 0 : ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
2416 0 : ShowContinueError(state, format("Error found in {} = {}", cAlphaFields(3), Alphas(3)));
2417 0 : ShowContinueError(state, "Schedule values must be (>=0., <=1.)");
2418 0 : ErrorsFound = true;
2419 : }
2420 : } else {
2421 0 : ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
2422 0 : ShowContinueError(state, format("...Not Found {}=\"{}\".", cAlphaFields(3), Alphas(3)));
2423 0 : ErrorsFound = true;
2424 : }
2425 : }
2426 : }
2427 :
2428 3975 : if (NumAlphas > 3) {
2429 2 : if (!lAlphaBlanks(4)) {
2430 2 : state.dataSize->OARequirements(OAIndex).OAPropCtlMinRateSchPtr = GetScheduleIndex(state, Alphas(4));
2431 2 : if (state.dataSize->OARequirements(OAIndex).OAPropCtlMinRateSchPtr > 0) {
2432 2 : if (!CheckScheduleValueMinMax(state, state.dataSize->OARequirements(OAIndex).OAPropCtlMinRateSchPtr, ">=", 0.0, "<=", 1.0)) {
2433 0 : ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
2434 0 : ShowContinueError(state, format("Error found in {} = {}", cAlphaFields(4), Alphas(4)));
2435 0 : ShowContinueError(state, "Schedule values must be (>=0., <=1.)");
2436 0 : ErrorsFound = true;
2437 : }
2438 : } else {
2439 0 : ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->OARequirements(OAIndex).Name));
2440 0 : ShowContinueError(state, format("...Not Found {}=\"{}\".", cAlphaFields(4), Alphas(4)));
2441 0 : ErrorsFound = true;
2442 : }
2443 : }
2444 : }
2445 3975 : }
2446 :
2447 796 : void GetZoneAirDistribution(EnergyPlusData &state)
2448 : {
2449 :
2450 : // SUBROUTINE INFORMATION:
2451 : // AUTHOR T. Hong - LBNL
2452 : // DATE WRITTEN March 2012
2453 : // MODIFIED na
2454 : // RE-ENGINEERED na
2455 :
2456 : // PURPOSE OF THIS SUBROUTINE:
2457 : // Obtains input data for the zone air distribution objects and stores it in
2458 : // appropriate data structure.
2459 :
2460 : // METHODOLOGY EMPLOYED:
2461 : // Uses InputProcessor "Get" routines to obtain data.
2462 : // This object requires only a name where the default values are assumed
2463 : // if subsequent fields are not entered.
2464 :
2465 : // Using/Aliasing
2466 : using ScheduleManager::CheckScheduleValueMinMax;
2467 : using ScheduleManager::GetScheduleIndex;
2468 :
2469 : // SUBROUTINE PARAMETER DEFINITIONS:
2470 : static constexpr std::string_view RoutineName("GetZoneAirDistribution: "); // include trailing blank space
2471 :
2472 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
2473 : int NumAlphas; // Number of Alphas for each GetObjectItem call
2474 : int NumNumbers; // Number of Numbers for each GetObjectItem call
2475 : int TotalArgs; // Total number of alpha and numeric arguments (max) for a
2476 : int IOStatus; // Used in GetObjectItem
2477 : int ZADIndex;
2478 796 : bool ErrorsFound(false); // If errors detected in input
2479 :
2480 796 : std::string CurrentModuleObject; // for ease in getting objects
2481 796 : Array1D_string Alphas; // Alpha input items for object
2482 796 : Array1D_string cAlphaFields; // Alpha field names
2483 796 : Array1D_string cNumericFields; // Numeric field names
2484 796 : Array1D<Real64> Numbers; // Numeric input items for object
2485 796 : Array1D_bool lAlphaBlanks; // Logical array, alpha field input BLANK = .TRUE.
2486 796 : Array1D_bool lNumericBlanks; // Logical array, numeric field input BLANK = .TRUE.
2487 :
2488 796 : CurrentModuleObject = "DesignSpecification:ZoneAirDistribution";
2489 796 : state.dataSize->NumZoneAirDistribution = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
2490 796 : state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
2491 :
2492 796 : Alphas.allocate(NumAlphas);
2493 796 : cAlphaFields.allocate(NumAlphas);
2494 796 : cNumericFields.allocate(NumNumbers);
2495 796 : Numbers.dimension(NumNumbers, 0.0);
2496 796 : lAlphaBlanks.dimension(NumAlphas, true);
2497 796 : lNumericBlanks.dimension(NumNumbers, true);
2498 :
2499 796 : if (state.dataSize->NumZoneAirDistribution > 0) {
2500 86 : state.dataSize->ZoneAirDistribution.allocate(state.dataSize->NumZoneAirDistribution);
2501 :
2502 : // Start Loading the zone air distribution input
2503 617 : for (ZADIndex = 1; ZADIndex <= state.dataSize->NumZoneAirDistribution; ++ZADIndex) {
2504 :
2505 531 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2506 : CurrentModuleObject,
2507 : ZADIndex,
2508 : Alphas,
2509 : NumAlphas,
2510 : Numbers,
2511 : NumNumbers,
2512 : IOStatus,
2513 : lNumericBlanks,
2514 : lAlphaBlanks,
2515 : cAlphaFields,
2516 : cNumericFields);
2517 531 : Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
2518 :
2519 531 : state.dataSize->ZoneAirDistribution(ZADIndex).Name = Alphas(1);
2520 :
2521 : // Zone Air Distribution Effectiveness in Cooling Mode
2522 531 : if (NumNumbers > 0) {
2523 531 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffCooling = Numbers(1);
2524 : } else {
2525 : // default value
2526 0 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffCooling = 1.0;
2527 : }
2528 :
2529 : // Zone Air Distribution Effectiveness in Heating Mode
2530 531 : if (NumNumbers > 1) {
2531 531 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffHeating = Numbers(2);
2532 : } else {
2533 : // default value
2534 0 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffHeating = 1.0;
2535 : }
2536 :
2537 : // Zone Secondary Recirculation Fraction
2538 531 : if (NumNumbers > 2) {
2539 25 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = Numbers(3);
2540 : } else {
2541 : // default value
2542 506 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneSecondaryRecirculation = 0.0;
2543 : }
2544 :
2545 : // Zone Ventilation Efficiency
2546 531 : if (NumNumbers > 3) {
2547 11 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = Numbers(4);
2548 : } else {
2549 : // default value
2550 520 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneVentilationEff = 0.0;
2551 : }
2552 :
2553 531 : if (NumAlphas > 1) {
2554 58 : if (!lAlphaBlanks(2)) {
2555 6 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffSchName = Alphas(2);
2556 6 : state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffSchPtr = GetScheduleIndex(state, Alphas(2));
2557 6 : if (state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffSchPtr > 0) {
2558 6 : if (!CheckScheduleValueMinMax(state, state.dataSize->ZoneAirDistribution(ZADIndex).ZoneADEffSchPtr, false, 0.0)) {
2559 0 : ShowSevereError(
2560 0 : state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->ZoneAirDistribution(ZADIndex).Name));
2561 0 : ShowContinueError(state, format("Error found in {} = {}", cAlphaFields(2), Alphas(2)));
2562 0 : ShowContinueError(state, "Schedule values must be >0.0)");
2563 0 : ErrorsFound = true;
2564 : }
2565 : } else {
2566 0 : ShowSevereError(state,
2567 0 : format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, state.dataSize->ZoneAirDistribution(ZADIndex).Name));
2568 0 : ShowContinueError(state, format("...Not Found {}=\"{}\".", cAlphaFields(2), Alphas(2)));
2569 0 : ErrorsFound = true;
2570 : }
2571 : }
2572 : }
2573 : }
2574 :
2575 86 : Alphas.deallocate();
2576 86 : cAlphaFields.deallocate();
2577 86 : cNumericFields.deallocate();
2578 86 : Numbers.deallocate();
2579 86 : lAlphaBlanks.deallocate();
2580 86 : lNumericBlanks.deallocate();
2581 :
2582 86 : if (ErrorsFound) {
2583 0 : ShowFatalError(state, format("{}Errors found in input. Preceding condition(s) cause termination.", RoutineName));
2584 : }
2585 : }
2586 796 : }
2587 :
2588 796 : void GetSizingParams(EnergyPlusData &state)
2589 : {
2590 :
2591 : // SUBROUTINE INFORMATION:
2592 : // AUTHOR Fred Buhl
2593 : // DATE WRITTEN January 2002
2594 : // MODIFIED na
2595 : // RE-ENGINEERED na
2596 :
2597 : // PURPOSE OF THIS SUBROUTINE:
2598 : // Obtains input data for the Sizing Parameters object and stores it in
2599 : // appropriate data structure.
2600 :
2601 : // METHODOLOGY EMPLOYED:
2602 : // Uses InputProcessor "Get" routines to obtain data.
2603 :
2604 : // Using/Aliasing
2605 :
2606 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
2607 : int NumAlphas; // Number of Alphas for each GetObjectItem call
2608 : int NumNumbers; // Number of Numbers for each GetObjectItem call
2609 : int IOStatus; // Used in GetObjectItem
2610 : int NumSizParams;
2611 : int Temp;
2612 796 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
2613 796 : cCurrentModuleObject = "Sizing:Parameters";
2614 796 : NumSizParams = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
2615 :
2616 796 : if (NumSizParams == 1) {
2617 734 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2618 : cCurrentModuleObject,
2619 : 1,
2620 367 : state.dataIPShortCut->cAlphaArgs,
2621 : NumAlphas,
2622 367 : state.dataIPShortCut->rNumericArgs,
2623 : NumNumbers,
2624 : IOStatus,
2625 367 : state.dataIPShortCut->lNumericFieldBlanks,
2626 367 : state.dataIPShortCut->lAlphaFieldBlanks,
2627 367 : state.dataIPShortCut->cAlphaFieldNames,
2628 367 : state.dataIPShortCut->cNumericFieldNames);
2629 367 : if (state.dataIPShortCut->lNumericFieldBlanks(1) || state.dataIPShortCut->rNumericArgs(1) < 0.0) {
2630 0 : state.dataSize->GlobalHeatSizingFactor = 1.0;
2631 : } else {
2632 367 : state.dataSize->GlobalHeatSizingFactor = state.dataIPShortCut->rNumericArgs(1);
2633 : }
2634 367 : if (state.dataIPShortCut->lNumericFieldBlanks(2) || state.dataIPShortCut->rNumericArgs(2) < 0.0) {
2635 0 : state.dataSize->GlobalCoolSizingFactor = 1.0;
2636 : } else {
2637 367 : state.dataSize->GlobalCoolSizingFactor = state.dataIPShortCut->rNumericArgs(2);
2638 : }
2639 367 : if (state.dataIPShortCut->lNumericFieldBlanks(3) || state.dataIPShortCut->rNumericArgs(3) <= 0.0) {
2640 285 : state.dataSize->NumTimeStepsInAvg = state.dataGlobal->NumOfTimeStepInHour;
2641 : } else {
2642 82 : state.dataSize->NumTimeStepsInAvg = int(state.dataIPShortCut->rNumericArgs(3));
2643 : }
2644 429 : } else if (NumSizParams == 0) {
2645 429 : state.dataSize->GlobalHeatSizingFactor = 1.0;
2646 429 : state.dataSize->GlobalCoolSizingFactor = 1.0;
2647 429 : state.dataSize->NumTimeStepsInAvg = state.dataGlobal->NumOfTimeStepInHour;
2648 : } else {
2649 0 : ShowFatalError(state, format("{}: More than 1 occurrence of this object; only 1 allowed", cCurrentModuleObject));
2650 : }
2651 796 : if (state.dataGlobal->OverrideTimestep) {
2652 1 : state.dataSize->NumTimeStepsInAvg = state.dataGlobal->NumOfTimeStepInHour;
2653 1 : ShowWarningError(state,
2654 : "Due to the use of the fast simulation mode, the time step for simulation and averaging window of sizing is overwritten to "
2655 : "one hour. Original user inputs for averaging window and timestep are no longer used.");
2656 : }
2657 796 : if (state.dataSize->NumTimeStepsInAvg < state.dataGlobal->NumOfTimeStepInHour) {
2658 0 : ShowWarningError(state,
2659 0 : format("{}: note {} entered value=[{}] is less than 1 hour (i.e., {} timesteps).",
2660 : cCurrentModuleObject,
2661 0 : state.dataIPShortCut->cNumericFieldNames(3),
2662 0 : state.dataSize->NumTimeStepsInAvg,
2663 0 : state.dataGlobal->NumOfTimeStepInHour));
2664 : }
2665 :
2666 796 : cCurrentModuleObject = "OutputControl:Sizing:Style";
2667 796 : Temp = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
2668 :
2669 796 : if (Temp == 0) {
2670 795 : state.dataIPShortCut->cAlphaArgs(1) = "Comma";
2671 795 : state.dataSize->SizingFileColSep = CharComma; // comma
2672 1 : } else if (Temp == 1) {
2673 2 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2674 : cCurrentModuleObject,
2675 : 1,
2676 1 : state.dataIPShortCut->cAlphaArgs,
2677 : NumAlphas,
2678 1 : state.dataIPShortCut->rNumericArgs,
2679 : NumNumbers,
2680 : IOStatus,
2681 1 : state.dataIPShortCut->lNumericFieldBlanks,
2682 1 : state.dataIPShortCut->lAlphaFieldBlanks,
2683 1 : state.dataIPShortCut->cAlphaFieldNames,
2684 1 : state.dataIPShortCut->cNumericFieldNames);
2685 1 : if (state.dataIPShortCut->cAlphaArgs(1) == "COMMA") {
2686 1 : state.dataSize->SizingFileColSep = CharComma; // comma
2687 1 : state.dataIPShortCut->cAlphaArgs(1) = "Comma";
2688 0 : } else if (state.dataIPShortCut->cAlphaArgs(1) == "TAB") {
2689 0 : state.dataSize->SizingFileColSep = CharTab; // tab
2690 0 : state.dataIPShortCut->cAlphaArgs(1) = "Tab";
2691 0 : } else if (state.dataIPShortCut->cAlphaArgs(1) == "FIXED" || state.dataIPShortCut->cAlphaArgs(1) == "SPACE") {
2692 0 : state.dataSize->SizingFileColSep = CharSpace; // space
2693 0 : state.dataIPShortCut->cAlphaArgs(1) = "Space";
2694 : } else {
2695 0 : state.dataSize->SizingFileColSep = CharComma; // comma
2696 0 : ShowWarningError(state,
2697 0 : format("{}: invalid {} entered value=\"{}\", Commas will be used to separate fields.",
2698 : cCurrentModuleObject,
2699 0 : state.dataIPShortCut->cAlphaFieldNames(1),
2700 0 : state.dataIPShortCut->cAlphaArgs(1)));
2701 0 : state.dataIPShortCut->cAlphaArgs(1) = "Comma";
2702 : }
2703 1 : print(state.files.eio, "! <Sizing Output Files>,Style\n");
2704 1 : print(state.files.eio, "Sizing Output Files,{}\n", state.dataIPShortCut->cAlphaArgs(1));
2705 : }
2706 796 : }
2707 :
2708 796 : void GetZoneSizingInput(EnergyPlusData &state)
2709 : {
2710 :
2711 : // SUBROUTINE INFORMATION:
2712 : // AUTHOR Fred Buhl
2713 : // DATE WRITTEN December 2000
2714 : // MODIFIED Mangesh Basarkar, 06/2011: Specifying zone outside air based on design specification object
2715 : // RE-ENGINEERED na
2716 :
2717 : // PURPOSE OF THIS SUBROUTINE:
2718 : // Obtains input data for zone sizing objects and stores it in
2719 : // appropriate data structures.
2720 :
2721 : // METHODOLOGY EMPLOYED:
2722 : // Uses InputProcessor "Get" routines to obtain data.
2723 :
2724 : // Using/Aliasing
2725 :
2726 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
2727 : int ZoneSizIndex; // loop index
2728 : int NumAlphas; // Number of Alphas for each GetObjectItem call
2729 : int NumNumbers; // Number of Numbers for each GetObjectItem call
2730 : int IOStatus; // Used in GetObjectItem
2731 796 : bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
2732 : int NumDesDays; // Number of design days in input
2733 : int NumSizingZoneStatements;
2734 : int Item;
2735 : int Item1;
2736 : int ZLItem;
2737 : bool errFlag;
2738 796 : Array1D_string ZoneNames;
2739 : int NumZones;
2740 : int NumZoneLists;
2741 : int OAIndex; // Index of design specification object
2742 : int ObjIndex; // Index of zone air distribution effectiveness object name
2743 : bool DesHeatMaxAirFlowPerAreaUsrInp;
2744 : bool DesHeatMaxAirFlowUsrInp;
2745 : bool DesHeatMaxAirFlowFracUsrInp;
2746 :
2747 : struct GlobalMiscObject
2748 : {
2749 : // Members
2750 : std::string Name;
2751 : int ZoneOrZoneListPtr;
2752 : int NumOfZones;
2753 : int StartPtr;
2754 : bool ZoneListActive;
2755 :
2756 : // Default Constructor
2757 796 : GlobalMiscObject() : ZoneOrZoneListPtr(0), NumOfZones(0), StartPtr(0), ZoneListActive(false)
2758 : {
2759 796 : }
2760 : };
2761 :
2762 : // Object Data
2763 796 : Array1D<ZoneListData> ZoneListNames;
2764 796 : Array1D<GlobalMiscObject> SizingZoneObjects;
2765 796 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
2766 796 : cCurrentModuleObject = "Sizing:Zone";
2767 796 : NumSizingZoneStatements = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
2768 796 : SizingZoneObjects.allocate(NumSizingZoneStatements);
2769 :
2770 796 : if (NumSizingZoneStatements > 0) {
2771 436 : errFlag = false;
2772 436 : GetZoneAndZoneListNames(state, errFlag, NumZones, ZoneNames, NumZoneLists, ZoneListNames);
2773 : }
2774 :
2775 796 : cCurrentModuleObject = "Sizing:Zone";
2776 796 : state.dataSize->NumZoneSizingInput = 0;
2777 796 : errFlag = false;
2778 4347 : for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
2779 7102 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2780 : cCurrentModuleObject,
2781 : Item,
2782 3551 : state.dataIPShortCut->cAlphaArgs,
2783 : NumAlphas,
2784 3551 : state.dataIPShortCut->rNumericArgs,
2785 : NumNumbers,
2786 : IOStatus,
2787 3551 : state.dataIPShortCut->lNumericFieldBlanks,
2788 3551 : state.dataIPShortCut->lAlphaFieldBlanks,
2789 3551 : state.dataIPShortCut->cAlphaFieldNames,
2790 3551 : state.dataIPShortCut->cNumericFieldNames);
2791 3551 : Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
2792 :
2793 3551 : SizingZoneObjects(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
2794 :
2795 3551 : Item1 = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, NumZones);
2796 3551 : ZLItem = 0;
2797 3551 : if (Item1 == 0 && NumZoneLists > 0) ZLItem = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames);
2798 3551 : if (Item1 > 0) {
2799 3550 : SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
2800 3550 : ++state.dataSize->NumZoneSizingInput;
2801 3550 : SizingZoneObjects(Item).NumOfZones = 1;
2802 3550 : SizingZoneObjects(Item).ZoneListActive = false;
2803 3550 : SizingZoneObjects(Item).ZoneOrZoneListPtr = Item1;
2804 1 : } else if (ZLItem > 0) {
2805 1 : SizingZoneObjects(Item).StartPtr = state.dataSize->NumZoneSizingInput + 1;
2806 1 : state.dataSize->NumZoneSizingInput += ZoneListNames(ZLItem).NumOfZones;
2807 1 : SizingZoneObjects(Item).NumOfZones = ZoneListNames(ZLItem).NumOfZones;
2808 1 : SizingZoneObjects(Item).ZoneListActive = true;
2809 1 : SizingZoneObjects(Item).ZoneOrZoneListPtr = ZLItem;
2810 : } else {
2811 0 : ShowSevereError(state,
2812 0 : format("{}=\"{}\" invalid {} not found.",
2813 : cCurrentModuleObject,
2814 0 : state.dataIPShortCut->cAlphaArgs(1),
2815 0 : state.dataIPShortCut->cAlphaFieldNames(1)));
2816 0 : ErrorsFound = true;
2817 0 : errFlag = true;
2818 : }
2819 : }
2820 :
2821 796 : if (errFlag) {
2822 0 : ShowSevereError(state, format("GetZoneSizingInput: Errors with invalid names in {} objects.", cCurrentModuleObject));
2823 0 : ShowContinueError(state, "...These will not be read in. Other errors may occur.");
2824 0 : state.dataSize->NumZoneSizingInput = 0;
2825 : }
2826 :
2827 796 : if (state.dataSize->NumZoneSizingInput > 0) {
2828 436 : NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
2829 436 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
2830 436 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
2831 436 : if (NumDesDays == 0 && (state.dataGlobal->DoZoneSizing || state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
2832 0 : ShowSevereError(state, "Zone Sizing calculations need SizingPeriod:* input. None found.");
2833 0 : ErrorsFound = true;
2834 : }
2835 436 : state.dataSize->ZoneSizingInput.allocate(state.dataSize->NumZoneSizingInput);
2836 :
2837 436 : ZoneSizIndex = 0;
2838 3987 : for (Item = 1; Item <= NumSizingZoneStatements; ++Item) {
2839 :
2840 7102 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
2841 : cCurrentModuleObject,
2842 : Item,
2843 3551 : state.dataIPShortCut->cAlphaArgs,
2844 : NumAlphas,
2845 3551 : state.dataIPShortCut->rNumericArgs,
2846 : NumNumbers,
2847 : IOStatus,
2848 3551 : state.dataIPShortCut->lNumericFieldBlanks,
2849 3551 : state.dataIPShortCut->lAlphaFieldBlanks,
2850 3551 : state.dataIPShortCut->cAlphaFieldNames,
2851 3551 : state.dataIPShortCut->cNumericFieldNames);
2852 :
2853 7104 : for (Item1 = 1; Item1 <= SizingZoneObjects(Item).NumOfZones; ++Item1) {
2854 3553 : ++ZoneSizIndex;
2855 3553 : auto &zoneSizingIndex = state.dataSize->ZoneSizingInput(ZoneSizIndex);
2856 3553 : if (!SizingZoneObjects(Item).ZoneListActive) {
2857 3550 : if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0) {
2858 3550 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = ZoneNames(SizingZoneObjects(Item).ZoneOrZoneListPtr);
2859 : } else {
2860 : // Invalid zone, will be caught later
2861 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = "Invalid Zone Name";
2862 : }
2863 : } else { // Zone list active
2864 3 : if (SizingZoneObjects(Item).ZoneOrZoneListPtr > 0 && ZoneListNames(SizingZoneObjects(Item).ZoneOrZoneListPtr).Zones(Item1) > 0) {
2865 3 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName =
2866 6 : ZoneNames(ZoneListNames(SizingZoneObjects(Item).ZoneOrZoneListPtr).Zones(Item1));
2867 : } else {
2868 : // Invalid zone, will be caught later
2869 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneName = "Invalid Zone Name";
2870 : }
2871 : }
2872 3553 : bool const nameEmpty = Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
2873 3553 : if (nameEmpty && !SizingZoneObjects(Item).ZoneListActive) {
2874 0 : ShowContinueError(state, "Zone may have been entered in a ZoneList assignment.");
2875 : }
2876 :
2877 : // A2, \field Zone Cooling Design Supply Air Temperature Input Method
2878 : // \required-field
2879 : // \type choice
2880 : // \key SupplyAirTemperature
2881 : // \key TemperatureDifference
2882 : // \default SupplyAirTemperature
2883 : {
2884 3553 : std::string const &coolingSATMethod = state.dataIPShortCut->cAlphaArgs(2);
2885 3553 : if (coolingSATMethod == "SUPPLYAIRTEMPERATURE") {
2886 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod = SupplyAirTemperature;
2887 55 : } else if (coolingSATMethod == "TEMPERATUREDIFFERENCE") {
2888 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod = TemperatureDifference;
2889 : } else {
2890 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
2891 0 : ShowContinueError(
2892 0 : state, format("... incorrect {}=\"{}\"", state.dataIPShortCut->cAlphaFieldNames(2), state.dataIPShortCut->cAlphaArgs(2)));
2893 0 : ShowContinueError(state, "... valid values are SupplyAirTemperature or TemperatureDifference.");
2894 0 : ErrorsFound = true;
2895 : }
2896 : }
2897 : // N1, \field Zone Cooling Design Supply Air Temperature
2898 : // \type real
2899 : // \units C
2900 : // \note Zone Cooling Design Supply Air Temperature is only used when Zone Cooling Design
2901 : // \note Supply Air Temperature Input Method = SupplyAirTemperature
2902 3553 : Real64 lowTempLimit = 0.0;
2903 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(1)) {
2904 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0;
2905 3553 : } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == SupplyAirTemperature) {
2906 3498 : ReportTemperatureInputError(state, cCurrentModuleObject, 1, lowTempLimit, false, ErrorsFound);
2907 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = state.dataIPShortCut->rNumericArgs(1);
2908 : } else {
2909 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp = 0.0;
2910 : }
2911 : // N2, \field Zone Cooling Design Supply Air Temperature Difference
2912 : // \type real
2913 : // \units delta C
2914 : // \note Zone Cooling Design Supply Air Temperature is only used when Zone Cooling Design
2915 : // \note Supply Air Temperature Input Method = TemperatureDifference
2916 : // \note The absolute of this value is value will be subtracted from room temperature
2917 : // \note at peak load to calculate Zone Cooling Design Supply Air Temperature.
2918 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(2)) {
2919 3271 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = 0.0;
2920 282 : } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnCoolDgnSAMethod == TemperatureDifference) {
2921 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = state.dataIPShortCut->rNumericArgs(2);
2922 : } else {
2923 227 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTempDiff = 0.0;
2924 : }
2925 : // A3, \field Zone Heating Design Supply Air Temperature Input Method
2926 : // \required-field
2927 : // \type choice
2928 : // \key SupplyAirTemperature
2929 : // \key TemperatureDifference
2930 : // \default SupplyAirTemperature
2931 : {
2932 3553 : std::string const &heatingSATMethod = state.dataIPShortCut->cAlphaArgs(3);
2933 3553 : if (heatingSATMethod == "SUPPLYAIRTEMPERATURE") {
2934 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod = SupplyAirTemperature;
2935 55 : } else if (heatingSATMethod == "TEMPERATUREDIFFERENCE") {
2936 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod = TemperatureDifference;
2937 : }
2938 : }
2939 : // N3, \field Zone Heating Design Supply Air Temperature
2940 : // \type real
2941 : // \units C
2942 : // \note Zone Heating Design Supply Air Temperature is only used when Zone Heating Design
2943 : // \note Supply Air Temperature Input Method = SupplyAirTemperature
2944 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(3)) {
2945 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0;
2946 3553 : } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == SupplyAirTemperature) {
2947 3498 : ReportTemperatureInputError(state, cCurrentModuleObject, 3, lowTempLimit, false, ErrorsFound);
2948 3498 : ReportTemperatureInputError(
2949 3498 : state, cCurrentModuleObject, 3, state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesTemp, true, ErrorsFound);
2950 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = state.dataIPShortCut->rNumericArgs(3);
2951 : } else {
2952 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTemp = 0.0;
2953 : }
2954 : // N4, \field Zone Heating Design Supply Air Temperature Difference
2955 : // \type real
2956 : // \units deltaC
2957 : // \note Zone Heating Design Supply Air Temperature is only used when Zone Heating Design
2958 : // \note Supply Air Temperature Input Method = TemperatureDifference
2959 : // \note The absolute of this value is value will be added to room temperature
2960 : // \note at peak load to calculate Zone Heating Design Supply Air Temperature.
2961 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(4)) {
2962 3471 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = 0.0;
2963 82 : } else if (state.dataSize->ZoneSizingInput(ZoneSizIndex).ZnHeatDgnSAMethod == TemperatureDifference) {
2964 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = state.dataIPShortCut->rNumericArgs(4);
2965 : } else {
2966 27 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesTempDiff = 0.0;
2967 : }
2968 : // N5, \field Zone Cooling Design Supply Air Humidity Ratio
2969 : // \required-field
2970 : // \minimum 0.0
2971 : // \type real
2972 : // \units kgWater/kgDryAir
2973 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(5)) {
2974 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = 0.0;
2975 3553 : } else if (state.dataIPShortCut->rNumericArgs(5) < 0.0) {
2976 0 : ShowSevereError(state,
2977 0 : format("{}: incorrect {}: {:.2R}",
2978 : cCurrentModuleObject,
2979 0 : state.dataIPShortCut->cNumericFieldNames(5),
2980 0 : state.dataIPShortCut->rNumericArgs(5)));
2981 0 : ShowContinueError(state,
2982 0 : format(".. value should not be negative. Occurs in Sizing Object={}", state.dataIPShortCut->cAlphaArgs(1)));
2983 0 : ErrorsFound = true;
2984 : } else {
2985 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolDesHumRat = state.dataIPShortCut->rNumericArgs(5);
2986 : }
2987 : // N6, \field Zone Heating Design Supply Air Humidity Ratio
2988 : // \required-field
2989 : // \minimum 0.0
2990 : // \type real
2991 : // \units kgWater/kgDryAir
2992 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(6)) {
2993 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = 0.0;
2994 3553 : } else if (state.dataIPShortCut->rNumericArgs(6) < 0.0) {
2995 0 : ShowSevereError(state,
2996 0 : format("{}: incorrect {}: {:.2R}",
2997 : cCurrentModuleObject,
2998 0 : state.dataIPShortCut->cNumericFieldNames(6),
2999 0 : state.dataIPShortCut->rNumericArgs(6)));
3000 0 : ShowContinueError(state,
3001 0 : format(".. value should not be negative. Occurs in Sizing Object={}", state.dataIPShortCut->cAlphaArgs(1)));
3002 0 : ErrorsFound = true;
3003 : } else {
3004 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatDesHumRat = state.dataIPShortCut->rNumericArgs(6);
3005 : }
3006 : // A4, \field Design Specification Outdoor Air Object Name
3007 : // \type object-list
3008 : // \object-list DesignSpecificationOutdoorAirNames
3009 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName = state.dataIPShortCut->cAlphaArgs(4);
3010 :
3011 : // Getting zone OA parameters from Design Specification object
3012 3553 : if (!state.dataIPShortCut->lAlphaFieldBlanks(4)) {
3013 3535 : OAIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).DesignSpecOAObjName, state.dataSize->OARequirements);
3014 3535 : if (OAIndex > 0) {
3015 3535 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneDesignSpecOAIndex = OAIndex;
3016 : } else {
3017 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3018 0 : ShowContinueError(
3019 : state,
3020 0 : format("... incorrect {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4)));
3021 0 : ErrorsFound = true;
3022 : }
3023 : } else { // If no design spec object specified, i.e. no OA, then leave ZoneDesignSpecOAIndex = 0
3024 : }
3025 :
3026 : // N7, \field Zone Heating Sizing Factor
3027 : // \note if blank, global heating sizing factor from Sizing:Parameters is used.
3028 : // \minimum> 0
3029 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(7) || state.dataIPShortCut->rNumericArgs(7) == 0.0) {
3030 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = state.dataSize->GlobalHeatSizingFactor;
3031 55 : } else if (state.dataIPShortCut->rNumericArgs(7) < 0.0) {
3032 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3033 0 : ShowContinueError(state,
3034 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3035 0 : state.dataIPShortCut->cNumericFieldNames(7),
3036 0 : state.dataIPShortCut->rNumericArgs(7)));
3037 0 : ErrorsFound = true;
3038 : } else {
3039 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatSizingFactor = state.dataIPShortCut->rNumericArgs(7);
3040 : }
3041 : // N8, \field Zone Cooling Sizing Factor
3042 : // \note if blank, global cooling sizing factor from Sizing:Parameters is used.
3043 : // \minimum> 0
3044 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(8) || state.dataIPShortCut->rNumericArgs(8) == 0.0) {
3045 3498 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = state.dataSize->GlobalCoolSizingFactor;
3046 55 : } else if (state.dataIPShortCut->rNumericArgs(8) < 0.0) {
3047 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3048 0 : ShowContinueError(state,
3049 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3050 0 : state.dataIPShortCut->cNumericFieldNames(8),
3051 0 : state.dataIPShortCut->rNumericArgs(8)));
3052 0 : ErrorsFound = true;
3053 : } else {
3054 55 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolSizingFactor = state.dataIPShortCut->rNumericArgs(8);
3055 : }
3056 : // N9, \field Cooling Design Air Flow Rate
3057 : // \type real
3058 : // \units m3/s
3059 : // \minimum 0
3060 : // \default 0
3061 : // \note This input is used if Cooling Design Air Flow Method is Flow/Zone
3062 : // \note This value will be multiplied by the global or zone sizing factor and
3063 : // \note by zone multipliers.
3064 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(9)) {
3065 1774 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = 0.0;
3066 1779 : } else if (state.dataIPShortCut->rNumericArgs(9) < 0.0) {
3067 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3068 0 : ShowContinueError(state,
3069 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3070 0 : state.dataIPShortCut->cNumericFieldNames(9),
3071 0 : state.dataIPShortCut->rNumericArgs(9)));
3072 0 : ErrorsFound = true;
3073 : } else {
3074 1779 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolAirFlow = state.dataIPShortCut->rNumericArgs(9);
3075 : }
3076 : // N10,\field Cooling Minimum Air Flow per Zone Floor Area
3077 : // \type real
3078 : // \units m3/s-m2
3079 : // \minimum 0
3080 : // \default .000762
3081 : // \note default is .15 cfm/ft2
3082 : // \note This input is used if Cooling Design Air Flow Method is design day with limit
3083 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(10)) {
3084 3405 : if (state.dataIPShortCut->rNumericArgs(10) <= 0.0) { // in case someone changes the default in the IDD
3085 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = 0.000762;
3086 : } else {
3087 3405 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = state.dataIPShortCut->rNumericArgs(10);
3088 : }
3089 148 : } else if (state.dataIPShortCut->rNumericArgs(10) < 0.0) {
3090 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3091 0 : ShowContinueError(state,
3092 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3093 0 : state.dataIPShortCut->cNumericFieldNames(108),
3094 0 : state.dataIPShortCut->rNumericArgs(10)));
3095 0 : ErrorsFound = true;
3096 : } else {
3097 148 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowPerArea = state.dataIPShortCut->rNumericArgs(10);
3098 : }
3099 : // N11,\field Cooling Minimum Air Flow
3100 : // \type real
3101 : // \units m3/s
3102 : // \minimum 0
3103 : // \default 0
3104 : // \note This input is used if Cooling Design Air Flow Method is design day with limit
3105 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(11)) {
3106 2515 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = 0.0;
3107 1038 : } else if (state.dataIPShortCut->rNumericArgs(11) < 0.0) {
3108 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3109 0 : ShowContinueError(state,
3110 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3111 0 : state.dataIPShortCut->cNumericFieldNames(11),
3112 0 : state.dataIPShortCut->rNumericArgs(11)));
3113 0 : ErrorsFound = true;
3114 : } else {
3115 1038 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlow = state.dataIPShortCut->rNumericArgs(11);
3116 : }
3117 : // N12,\field Cooling Minimum Air Flow Fraction
3118 3553 : if (state.dataIPShortCut->rNumericArgs(12) < 0.0) {
3119 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3120 0 : ShowContinueError(state,
3121 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3122 0 : state.dataIPShortCut->cNumericFieldNames(12),
3123 0 : state.dataIPShortCut->rNumericArgs(12)));
3124 0 : ErrorsFound = true;
3125 : } else {
3126 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesCoolMinAirFlowFrac = state.dataIPShortCut->rNumericArgs(12);
3127 : }
3128 :
3129 : // N13,\field Heating Design Air Flow Rate
3130 : // \type real
3131 : // \units m3/s
3132 : // \minimum 0
3133 : // \default 0
3134 : // \note This input is used if Heating Design Air Flow Method is Flow/Zone.
3135 : // \note This value will be multiplied by the global or zone sizing factor and
3136 : // \note by zone multipliers.
3137 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(13)) {
3138 1163 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = 0.0;
3139 2390 : } else if (state.dataIPShortCut->rNumericArgs(13) < 0.0) {
3140 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3141 0 : ShowContinueError(state,
3142 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3143 0 : state.dataIPShortCut->cNumericFieldNames(13),
3144 0 : state.dataIPShortCut->rNumericArgs(13)));
3145 0 : ErrorsFound = true;
3146 : } else {
3147 2390 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatAirFlow = state.dataIPShortCut->rNumericArgs(13);
3148 : }
3149 : // N14,\field Heating Maximum Air Flow per Zone Floor Area
3150 : // \type real
3151 : // \units m3/s-m2
3152 : // \minimum 0
3153 : // \default .002032
3154 : // \note default is .40 cfm/ft2
3155 : // \note This input is not currently used for autosizing any of the components.
3156 3553 : DesHeatMaxAirFlowPerAreaUsrInp = false;
3157 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(14)) {
3158 3466 : if (state.dataIPShortCut->rNumericArgs(14) <= 0.0) { // in case someone changes the default in the IDD
3159 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = 0.002032;
3160 : } else {
3161 3466 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
3162 : }
3163 87 : } else if (state.dataIPShortCut->rNumericArgs(14) < 0.0) {
3164 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3165 0 : ShowContinueError(state,
3166 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3167 0 : state.dataIPShortCut->cNumericFieldNames(14),
3168 0 : state.dataIPShortCut->rNumericArgs(14)));
3169 0 : ErrorsFound = true;
3170 : } else {
3171 87 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = state.dataIPShortCut->rNumericArgs(14);
3172 87 : DesHeatMaxAirFlowPerAreaUsrInp = true;
3173 : }
3174 : // N15,\field Heating Maximum Air Flow
3175 : // \type real
3176 : // \units m3/s
3177 : // \minimum 0
3178 : // \default .1415762
3179 : // \note default is 300 cfm
3180 : // \note This input is not currently used for autosizing any of the components.
3181 3553 : DesHeatMaxAirFlowUsrInp = false;
3182 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(15)) {
3183 3466 : if (state.dataIPShortCut->rNumericArgs(15) <= 0.0) { // in case someone changes the default in the IDD
3184 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = 0.1415762;
3185 : } else {
3186 3466 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
3187 : }
3188 87 : } else if (state.dataIPShortCut->rNumericArgs(15) < 0.0) {
3189 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3190 0 : ShowContinueError(state,
3191 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3192 0 : state.dataIPShortCut->cNumericFieldNames(15),
3193 0 : state.dataIPShortCut->rNumericArgs(15)));
3194 0 : ErrorsFound = true;
3195 : } else {
3196 87 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = state.dataIPShortCut->rNumericArgs(15);
3197 87 : DesHeatMaxAirFlowUsrInp = true;
3198 : }
3199 : // N16;\field Heating Maximum Air Flow Fraction
3200 : // \note fraction of the Heating Design Air Flow Rate
3201 : // \note This input is not currently used for autosizing any of the components.
3202 : // \type real
3203 : // \minimum 0
3204 : // \default 0.3
3205 3553 : DesHeatMaxAirFlowFracUsrInp = false;
3206 3553 : if (state.dataIPShortCut->lNumericFieldBlanks(16)) {
3207 3010 : if (state.dataIPShortCut->rNumericArgs(16) <= 0.0) { // in case someone changes the default in the IDD
3208 0 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = 0.3;
3209 : } else {
3210 3010 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
3211 : }
3212 543 : } else if (state.dataIPShortCut->rNumericArgs(16) < 0.0) {
3213 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3214 0 : ShowContinueError(state,
3215 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3216 0 : state.dataIPShortCut->cNumericFieldNames(16),
3217 0 : state.dataIPShortCut->rNumericArgs(16)));
3218 0 : ErrorsFound = true;
3219 : } else {
3220 543 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = state.dataIPShortCut->rNumericArgs(16);
3221 543 : DesHeatMaxAirFlowFracUsrInp = true;
3222 : }
3223 : // make sure the user specified inputs of the previous 3 inputs override the defaults
3224 3553 : if (DesHeatMaxAirFlowPerAreaUsrInp || DesHeatMaxAirFlowUsrInp || DesHeatMaxAirFlowFracUsrInp) {
3225 544 : if (!DesHeatMaxAirFlowPerAreaUsrInp) {
3226 457 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowPerArea = 0.0;
3227 : }
3228 544 : if (!DesHeatMaxAirFlowUsrInp) {
3229 457 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlow = 0.0;
3230 : }
3231 544 : if (!DesHeatMaxAirFlowFracUsrInp) {
3232 1 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DesHeatMaxAirFlowFrac = 0.0;
3233 : }
3234 : }
3235 :
3236 : // A7, \field Zone Air Distribution Object Name and add its inputs
3237 3553 : if (!state.dataIPShortCut->lAlphaFieldBlanks(7)) {
3238 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName = state.dataIPShortCut->cAlphaArgs(7);
3239 619 : ObjIndex = Util::FindItemInList(state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistEffObjName,
3240 619 : state.dataSize->ZoneAirDistribution);
3241 619 : if (ObjIndex > 0) {
3242 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling =
3243 619 : state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffCooling;
3244 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating =
3245 619 : state.dataSize->ZoneAirDistribution(ObjIndex).ZoneADEffHeating;
3246 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneSecondaryRecirculation =
3247 619 : state.dataSize->ZoneAirDistribution(ObjIndex).ZoneSecondaryRecirculation;
3248 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneAirDistributionIndex = ObjIndex;
3249 619 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneVentilationEff =
3250 619 : state.dataSize->ZoneAirDistribution(ObjIndex).ZoneVentilationEff;
3251 : } else {
3252 : // generate a warning message
3253 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3254 0 : ShowContinueError(
3255 : state,
3256 0 : format("... not found {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(7), state.dataIPShortCut->cAlphaArgs(7)));
3257 0 : ErrorsFound = true;
3258 : }
3259 : } else {
3260 : // assume defaults
3261 2934 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffCooling = 1.0;
3262 2934 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneADEffHeating = 1.0;
3263 2934 : state.dataSize->ZoneSizingInput(ZoneSizIndex).ZoneSecondaryRecirculation = 0.0;
3264 : }
3265 :
3266 : constexpr static std::array<std::string_view, static_cast<int>(DataSizing::AirflowSizingMethod::Num)> AirflowSizingMethodNamesUC = {
3267 : "DESIGNDAY", "FLOW/ZONE", "DESIGNDAYWITHLIMIT"};
3268 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod =
3269 7106 : static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(5))));
3270 3553 : assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).CoolAirDesMethod != AirflowSizingMethod::Invalid);
3271 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod =
3272 7106 : static_cast<AirflowSizingMethod>(getEnumValue(AirflowSizingMethodNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(6))));
3273 3553 : assert(state.dataSize->ZoneSizingInput(ZoneSizIndex).HeatAirDesMethod != AirflowSizingMethod::Invalid);
3274 :
3275 3553 : BooleanSwitch accountForDOAS = getYesNoValue(state.dataIPShortCut->cAlphaArgs(8));
3276 3553 : state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS = (accountForDOAS == BooleanSwitch::Yes) ? true : false;
3277 :
3278 3553 : if (state.dataSize->ZoneSizingInput(ZoneSizIndex).AccountForDOAS) {
3279 : constexpr static std::array<std::string_view, static_cast<int>(DataSizing::DOASControl::Num)> DOASControlNamesUC = {
3280 : "NEUTRALSUPPLYAIR", "NEUTRALDEHUMIDIFIEDSUPPLYAIR", "COLDSUPPLYAIR"};
3281 72 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASControlStrategy =
3282 144 : static_cast<DataSizing::DOASControl>(getEnumValue(DOASControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(9))));
3283 :
3284 72 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASLowSetpoint = state.dataIPShortCut->rNumericArgs(17);
3285 72 : state.dataSize->ZoneSizingInput(ZoneSizIndex).DOASHighSetpoint = state.dataIPShortCut->rNumericArgs(18);
3286 144 : if (state.dataIPShortCut->rNumericArgs(17) > 0.0 && state.dataIPShortCut->rNumericArgs(18) > 0.0 &&
3287 72 : state.dataIPShortCut->rNumericArgs(17) >= state.dataIPShortCut->rNumericArgs(18)) {
3288 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
3289 0 : ShowContinueError(state, "... Dedicated Outside Air Low Setpoint for Design must be less than the High Setpoint");
3290 0 : ErrorsFound = true;
3291 : }
3292 : }
3293 3553 : zoneSizingIndex.spaceConcurrence = static_cast<DataSizing::SizingConcurrence>(
3294 3553 : getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(15)));
3295 3553 : zoneSizingIndex.zoneSizingMethod =
3296 3553 : static_cast<DataSizing::ZoneSizing>(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10)));
3297 3553 : if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) {
3298 8 : zoneSizingIndex.zoneLatentSizing = true;
3299 8 : state.dataHeatBal->DoLatentSizing = true;
3300 : }
3301 3553 : zoneSizingIndex.ZnLatCoolDgnSAMethod =
3302 3553 : (state.dataIPShortCut->cAlphaArgs(11) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
3303 3553 : zoneSizingIndex.LatentCoolDesHumRat = state.dataIPShortCut->rNumericArgs(19);
3304 3553 : zoneSizingIndex.CoolDesHumRatDiff = state.dataIPShortCut->rNumericArgs(20);
3305 3553 : zoneSizingIndex.ZnLatHeatDgnSAMethod =
3306 3553 : (state.dataIPShortCut->cAlphaArgs(12) == "SUPPLYAIRHUMIDITYRATIO") ? SupplyAirHumidityRatio : HumidityRatioDifference;
3307 3553 : zoneSizingIndex.LatentHeatDesHumRat = state.dataIPShortCut->rNumericArgs(21);
3308 3553 : zoneSizingIndex.HeatDesHumRatDiff = state.dataIPShortCut->rNumericArgs(22);
3309 3553 : if (NumAlphas > 12 && !state.dataIPShortCut->lAlphaFieldBlanks(13)) {
3310 3 : zoneSizingIndex.zoneRHDehumidifySchIndex = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(13));
3311 3 : if (zoneSizingIndex.zoneRHDehumidifySchIndex == 0) {
3312 0 : ShowWarningError(state,
3313 0 : format("{} = \"{}\", invalid Zone Humidistat Dehumidification Set Point Schedule Name = {}. Schedule will "
3314 : "not be used and simulation continues.",
3315 : cCurrentModuleObject,
3316 0 : state.dataIPShortCut->cAlphaArgs(1),
3317 0 : state.dataIPShortCut->cAlphaArgs(13)));
3318 : }
3319 : }
3320 3553 : if (NumAlphas > 13 && !state.dataIPShortCut->lAlphaFieldBlanks(14)) {
3321 3 : zoneSizingIndex.zoneRHHumidifySchIndex = ScheduleManager::GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(14));
3322 3 : if (zoneSizingIndex.zoneRHHumidifySchIndex == 0) {
3323 0 : ShowWarningError(state,
3324 0 : format("{} = \"{}\", invalid Zone Humidistat Humidification Set Point Schedule Name = {}. Schedule will "
3325 : "not be used and simulation continues.",
3326 : cCurrentModuleObject,
3327 0 : state.dataIPShortCut->cAlphaArgs(1),
3328 0 : state.dataIPShortCut->cAlphaArgs(14)));
3329 3 : } else if (zoneSizingIndex.zoneRHDehumidifySchIndex) {
3330 : // check max and min of each schedule and compare RHHumidify > RHDehumidify and warn
3331 3 : Real64 maxHumidify = ScheduleManager::GetScheduleMaxValue(state, zoneSizingIndex.zoneRHHumidifySchIndex);
3332 3 : Real64 minDehumidify = ScheduleManager::GetScheduleMinValue(state, zoneSizingIndex.zoneRHDehumidifySchIndex);
3333 3 : if (maxHumidify > minDehumidify) {
3334 0 : ShowWarningError(
3335 : state,
3336 0 : format("{} = \"{}\", maximum value ({}%) of Zone Humidistat Humidification Set Point Schedule Name = {} is "
3337 : "greater than minimum value ({}%) of Zone Humidistat Dehumidifcation Set Point Schedule Name = {}. "
3338 : "Humidification set point will be limited by Dehumidification set point during zone sizing and simulation "
3339 : "continues.",
3340 : cCurrentModuleObject,
3341 0 : state.dataIPShortCut->cAlphaArgs(1),
3342 : maxHumidify,
3343 0 : state.dataIPShortCut->cAlphaArgs(14),
3344 : minDehumidify,
3345 0 : state.dataIPShortCut->cAlphaArgs(13)));
3346 : }
3347 : }
3348 : }
3349 : }
3350 : }
3351 : }
3352 :
3353 796 : if (ErrorsFound) {
3354 0 : ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
3355 : }
3356 796 : }
3357 :
3358 10494 : void ReportTemperatureInputError(
3359 : EnergyPlusData &state, std::string cObjectName, int const paramNum, Real64 comparisonTemperature, bool const shouldFlagSevere, bool &ErrorsFound)
3360 : {
3361 10494 : if (state.dataIPShortCut->rNumericArgs(paramNum) < comparisonTemperature) {
3362 0 : if (shouldFlagSevere) { // heating supply air temperature is lower than cooling supply air temperature--not allowed
3363 0 : ShowSevereError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
3364 0 : ShowContinueError(state,
3365 0 : format("... incorrect {}=[{:.2R}] is less than {}=[{:.2R}]",
3366 0 : state.dataIPShortCut->cNumericFieldNames(paramNum),
3367 0 : state.dataIPShortCut->rNumericArgs(paramNum),
3368 0 : state.dataIPShortCut->cNumericFieldNames(paramNum - 2),
3369 0 : state.dataIPShortCut->rNumericArgs(paramNum - 2)));
3370 0 : ShowContinueError(state, "This is not allowed. Please check and revise your input.");
3371 0 : ErrorsFound = true;
3372 : } else { // then input is lower than comparison tempeature--just produce a warning for user to check input
3373 0 : ShowWarningError(state, format("{}=\"{}\" has invalid data.", cObjectName, state.dataIPShortCut->cAlphaArgs(1)));
3374 0 : ShowContinueError(state,
3375 0 : format("... incorrect {}=[{:.2R}] is less than [{:.2R}]",
3376 0 : state.dataIPShortCut->cNumericFieldNames(paramNum),
3377 0 : state.dataIPShortCut->rNumericArgs(paramNum),
3378 : comparisonTemperature));
3379 0 : ShowContinueError(state, "Please check your input to make sure this is correct.");
3380 : }
3381 : }
3382 10494 : }
3383 :
3384 436 : void GetZoneAndZoneListNames(
3385 : EnergyPlusData &state, bool &ErrorsFound, int &NumZones, Array1D_string &ZoneNames, int &NumZoneLists, Array1D<ZoneListData> &ZoneListNames)
3386 : {
3387 :
3388 : // SUBROUTINE INFORMATION:
3389 : // AUTHOR Linda Lawrie
3390 : // DATE WRITTEN October 2010
3391 : // MODIFIED na
3392 : // RE-ENGINEERED na
3393 :
3394 : // PURPOSE OF THIS SUBROUTINE:
3395 : // Get Zone and ZoneList Names so Sizing:Zone can use global ZoneList.
3396 : // This is not a full validation of these objects -- only enough to fill
3397 : // structures for the Sizing:Zone object.
3398 :
3399 : // Using/Aliasing
3400 :
3401 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
3402 : int Item;
3403 : int Found;
3404 : int Item1;
3405 : int NumAlphas;
3406 : int NumNumbers;
3407 : int IOStatus;
3408 : bool InErrFlag; // Preserve (no current use) the input status of ErrorsFound
3409 :
3410 436 : InErrFlag = ErrorsFound;
3411 436 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
3412 436 : cCurrentModuleObject = "Zone";
3413 436 : NumZones = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
3414 436 : ZoneNames.allocate(NumZones);
3415 :
3416 4521 : for (Item = 1; Item <= NumZones; ++Item) {
3417 8170 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
3418 : cCurrentModuleObject,
3419 : Item,
3420 4085 : state.dataIPShortCut->cAlphaArgs,
3421 : NumAlphas,
3422 4085 : state.dataIPShortCut->rNumericArgs,
3423 : NumNumbers,
3424 : IOStatus,
3425 4085 : state.dataIPShortCut->lNumericFieldBlanks,
3426 4085 : state.dataIPShortCut->lAlphaFieldBlanks,
3427 4085 : state.dataIPShortCut->cAlphaFieldNames,
3428 4085 : state.dataIPShortCut->cNumericFieldNames);
3429 : // validation, but no error
3430 4085 : Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneNames, Item - 1);
3431 4085 : if (Found == 0) {
3432 4085 : ZoneNames(Item) = state.dataIPShortCut->cAlphaArgs(1);
3433 : } else {
3434 0 : ZoneNames(Item) = "xxxxx";
3435 : }
3436 : }
3437 :
3438 436 : cCurrentModuleObject = "ZoneList";
3439 436 : NumZoneLists = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
3440 436 : ZoneListNames.allocate(NumZoneLists);
3441 :
3442 472 : for (Item = 1; Item <= NumZoneLists; ++Item) {
3443 72 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
3444 : cCurrentModuleObject,
3445 : Item,
3446 36 : state.dataIPShortCut->cAlphaArgs,
3447 : NumAlphas,
3448 36 : state.dataIPShortCut->rNumericArgs,
3449 : NumNumbers,
3450 : IOStatus,
3451 36 : state.dataIPShortCut->lNumericFieldBlanks,
3452 36 : state.dataIPShortCut->lAlphaFieldBlanks,
3453 36 : state.dataIPShortCut->cAlphaFieldNames,
3454 36 : state.dataIPShortCut->cNumericFieldNames);
3455 : // validation, but no error
3456 36 : Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), ZoneListNames, Item - 1);
3457 36 : if (Found == 0) {
3458 36 : ZoneListNames(Item).Name = state.dataIPShortCut->cAlphaArgs(1);
3459 : } else {
3460 0 : ZoneListNames(Item).Name = "xxxxx";
3461 : }
3462 36 : ZoneListNames(Item).Zones.allocate(NumAlphas - 1);
3463 36 : ZoneListNames(Item).NumOfZones = NumAlphas - 1;
3464 311 : for (Item1 = 2; Item1 <= NumAlphas; ++Item1) {
3465 275 : Found = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(Item1), ZoneNames, NumZones);
3466 275 : ZoneListNames(Item).Zones(Item1 - 1) = Found;
3467 : }
3468 : }
3469 436 : }
3470 :
3471 796 : void GetSystemSizingInput(EnergyPlusData &state)
3472 : {
3473 :
3474 : // SUBROUTINE INFORMATION:
3475 : // AUTHOR Fred Buhl
3476 : // DATE WRITTEN January 2001
3477 : // MODIFIED na
3478 : // RE-ENGINEERED na
3479 :
3480 : // PURPOSE OF THIS SUBROUTINE:
3481 : // Obtains input data for System Sizing objects and stores it in
3482 : // appropriate data structures.
3483 :
3484 : // METHODOLOGY EMPLOYED:
3485 : // Uses InputProcessor "Get" routines to obtain data.
3486 :
3487 : // Using/Aliasing
3488 :
3489 : // Sizing:System;
3490 796 : constexpr int iNameAlphaNum = 1; // A1, \field AirLoop Name
3491 796 : constexpr int iLoadTypeSizeAlphaNum = 2; // A2, \field Type of Load to Size On
3492 796 : constexpr int iCoolCapControlAlphaNum = 11; // A11 \field Central Cooling Capacity Control Method
3493 796 : constexpr int iDesignOAVolFlowNumericNum = 1; // N1, \field Design Outdoor Air Flow Rate
3494 796 : constexpr int iMinSysAirFlowRatioNumericNum = 2; // N2, \field Minimum System Air Flow Ratio
3495 796 : constexpr int iPreheatDesignTempNumericNum = 3; // N3, \field Preheat Design Temperature
3496 796 : constexpr int iPreheatDesignHumRatNumericNum = 4; // N4, \field Preheat Design Humidity Ratio
3497 796 : constexpr int iPrecoolDesignTempNumericNum = 5; // N5, \field Precool Design Temperature
3498 796 : constexpr int iPrecoolDesignHumRatNumericNum = 6; // N6, \field Precool Design Humidity Ratio
3499 796 : constexpr int iCentralCoolDesignSATempNumericNum = 7; // N7, \field Central Cooling Design Supply Air Temperature
3500 796 : constexpr int iCentralHeatDesignSATempNumericNum = 8; // N8, \field Central Heating Design Supply Air Temperature
3501 796 : constexpr int iSizingOptionAlphaNum = 3; // A3, \field Sizing Option
3502 796 : constexpr int i100PercentOACoolingAlphaNum = 4; // A4, \field 100% Outdoor Air in Cooling
3503 796 : constexpr int i100PercentOAHeatingAlphaNum = 5; // A5, \field 100% Outdoor Air in Heating
3504 796 : constexpr int iCentralCoolDesignSAHumRatNumericNum = 9; // N9, \field Central Cooling Design Supply Air Humidity Ratio
3505 796 : constexpr int iCentralHeatDesignSAHumRatNumericNum = 10; // N10, \field Central Heating Design Supply Air Humidity Ratio
3506 796 : constexpr int iCoolSAFMAlphaNum = 6; // A6, \field Cooling Design Air Flow Method
3507 796 : constexpr int iMaxCoolAirVolFlowNumericNum = 11; // N11, \field Cooling Design Air Flow Rate {m3/s}
3508 796 : constexpr int iCoolFlowPerFloorAreaNumericNum = 12; // N12, \field Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2}
3509 796 : constexpr int iCoolFlowPerFracCoolNumericNum = 13; // N13, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
3510 796 : constexpr int iCoolFlowPerCoolCapNumericNum = 14; // N14, \field Design Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
3511 796 : constexpr int iHeatSAFMAlphaNum = 7; // A7, \field Heating Design Air Flow Method
3512 796 : constexpr int iMaxHeatAirVolFlowNumericNum = 15; // N15, \field Heating Design Air Flow Rate {m3/s}
3513 796 : constexpr int iHeatFlowPerFloorAreaNumericNum = 16; // N16, \field Supply Air Flow Rate Per Floor Area During Heating Operation {m3/s-m2}
3514 796 : constexpr int iHeatFlowPerFracHeatNumericNum = 17; // N17, \field Fraction of Autosized Design Heating Supply Air Flow Rate {-}
3515 796 : constexpr int iHeatFlowPerFracCoolNumericNum = 18; // N18, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
3516 796 : constexpr int iHeatFlowPerHeatCapNumericNum = 19; // N19, \field Design Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
3517 796 : constexpr int iSystemOASMethodAlphaNum = 8; // A8, \field System Outdoor Air Method
3518 796 : constexpr int iZoneMaxOAFractionNumericNum = 20; // N20, \field Zone Maximum Outdoor Air Fraction
3519 796 : constexpr int iCoolCAPMAlphaNum(9); // A9, \field Cooling Design Capacity Method
3520 796 : constexpr int iCoolDesignCapacityNumericNum(21); // N21, \field Cooling Design Capacity {W}
3521 796 : constexpr int iCoolCapacityPerFloorAreaNumericNum(22); // N22, \field Cooling Design Capacity Per Floor Area {W/m2}
3522 796 : constexpr int iCoolFracOfAutosizedCapacityNumericNum(23); // N23, \field Fraction of Autosized Cooling Design Capacity {-}
3523 796 : constexpr int iHeatCAPMAlphaNum(10); // A10, \field Heating Design Capacity Method
3524 796 : constexpr int iHeatDesignCapacityNumericNum(24); // N24, \field Heating Design Capacity {W}
3525 796 : constexpr int iHeatCapacityPerFloorAreaNumericNum(25); // N25, \field Heating Design Capacity Per Floor Area {W/m2}
3526 796 : constexpr int iHeatFracOfAutosizedCapacityNumericNum(26); // N26, \field Fraction of Autosized Cooling Design Capacity {-}
3527 796 : constexpr int iOccupantDiversity = 27; // N26, \field Occupant Diversity
3528 :
3529 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
3530 : int SysSizIndex; // loop index
3531 : int NumAlphas; // Number of Alphas for each GetObjectItem call
3532 : int NumNumbers; // Number of Numbers for each GetObjectItem call
3533 : int IOStatus; // Used in GetObjectItem
3534 796 : bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
3535 : int NumDesDays; // Number of design days in input
3536 :
3537 796 : auto &SysSizInput = state.dataSize->SysSizInput;
3538 :
3539 796 : state.dataSizingManager->NumAirLoops = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "AirLoopHVAC");
3540 796 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
3541 796 : cCurrentModuleObject = "Sizing:System";
3542 796 : state.dataSize->NumSysSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
3543 :
3544 796 : if (state.dataSize->NumSysSizInput > 0) {
3545 349 : NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
3546 349 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
3547 349 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
3548 349 : if (NumDesDays == 0 && (state.dataGlobal->DoSystemSizing || state.dataGlobal->DoPlantSizing)) {
3549 0 : ShowSevereError(state, "System Sizing calculations need SizingPeriod:* input. None found.");
3550 0 : ErrorsFound = true;
3551 : }
3552 349 : SysSizInput.allocate(state.dataSize->NumSysSizInput);
3553 : }
3554 :
3555 1762 : for (SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) {
3556 1932 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
3557 : cCurrentModuleObject,
3558 : SysSizIndex,
3559 966 : state.dataIPShortCut->cAlphaArgs,
3560 : NumAlphas,
3561 966 : state.dataIPShortCut->rNumericArgs,
3562 : NumNumbers,
3563 : IOStatus,
3564 966 : state.dataIPShortCut->lNumericFieldBlanks,
3565 966 : state.dataIPShortCut->lAlphaFieldBlanks,
3566 966 : state.dataIPShortCut->cAlphaFieldNames,
3567 966 : state.dataIPShortCut->cNumericFieldNames);
3568 966 : assert(!state.dataIPShortCut->cAlphaArgs(iNameAlphaNum).empty());
3569 :
3570 966 : SysSizInput(SysSizIndex).AirPriLoopName = state.dataIPShortCut->cAlphaArgs(iNameAlphaNum);
3571 :
3572 966 : constexpr std::array<std::string_view, static_cast<int>(DataSizing::LoadSizing::Num)> LoadSizingNamesUC{
3573 : "SENSIBLE", "LATENT", "TOTAL", "VENTILATIONREQUIREMENT"};
3574 1932 : SysSizInput(SysSizIndex).loadSizingType = static_cast<DataSizing::LoadSizing>(
3575 966 : getEnumValue(LoadSizingNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum))));
3576 :
3577 : // assign PeakLoad based on LoadSizing for now
3578 966 : if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Sensible) {
3579 927 : SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
3580 69 : } else if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Total ||
3581 30 : (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Latent && state.dataHeatBal->DoLatentSizing)) {
3582 10 : SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::TotalCooling;
3583 : } else {
3584 29 : SysSizInput(SysSizIndex).coolingPeakLoad = DataSizing::PeakLoad::SensibleCooling;
3585 : }
3586 : // set the CoolCapControl input
3587 966 : constexpr std::array<std::string_view, static_cast<int>(CapacityControl::Num)> CapacityControlNamesUC{"VAV", "BYPASS", "VT", "ONOFF"};
3588 1932 : SysSizInput(SysSizIndex).CoolCapControl = static_cast<CapacityControl>(
3589 966 : getEnumValue(CapacityControlNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(iCoolCapControlAlphaNum))));
3590 :
3591 : {
3592 966 : std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum);
3593 966 : if (sizingOption == "COINCIDENT") {
3594 95 : SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::Coincident;
3595 871 : } else if (sizingOption == "NONCOINCIDENT") {
3596 871 : SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::NonCoincident;
3597 : } else {
3598 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3599 0 : ShowContinueError(state,
3600 0 : format("... incorrect {}=\"{}\".",
3601 0 : state.dataIPShortCut->cAlphaFieldNames(iSizingOptionAlphaNum),
3602 0 : state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum)));
3603 0 : ShowContinueError(state, "... valid values are Coincident or NonCoincident.");
3604 0 : ErrorsFound = true;
3605 : }
3606 : }
3607 :
3608 966 : BooleanSwitch is100PctOACooling = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOACoolingAlphaNum));
3609 966 : SysSizInput(SysSizIndex).CoolOAOption = (is100PctOACooling == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA;
3610 :
3611 966 : BooleanSwitch is100PctOAHeating = getYesNoValue(state.dataIPShortCut->cAlphaArgs(i100PercentOAHeatingAlphaNum));
3612 966 : SysSizInput(SysSizIndex).HeatOAOption = (is100PctOAHeating == BooleanSwitch::Yes) ? OAControl::AllOA : OAControl::MinOA;
3613 :
3614 : // N1, \field Design Outdoor Air Flow Rate
3615 : // \type real
3616 : // \default autosize
3617 : // \minimum 0.0
3618 : // int const iDesignOAVolFlowNumericNum = 1; // N1, \field Design Outdoor Air Flow Rate
3619 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iDesignOAVolFlowNumericNum)) {
3620 0 : SysSizInput(SysSizIndex).DesOutAirVolFlow = AutoSize;
3621 1886 : } else if (state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum) < 0.0 &&
3622 920 : state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum) != AutoSize) {
3623 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3624 0 : ShowContinueError(state,
3625 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3626 0 : state.dataIPShortCut->cNumericFieldNames(iDesignOAVolFlowNumericNum),
3627 0 : state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum)));
3628 0 : ErrorsFound = true;
3629 : } else {
3630 966 : SysSizInput(SysSizIndex).DesOutAirVolFlow = state.dataIPShortCut->rNumericArgs(iDesignOAVolFlowNumericNum);
3631 : }
3632 966 : if (SysSizInput(SysSizIndex).DesOutAirVolFlow == AutoSize) {
3633 920 : SysSizInput(SysSizIndex).OAAutoSized = true;
3634 : }
3635 :
3636 : // N2, \field Minimum System Air Flow Ratio
3637 : // \required-field
3638 : // \type real
3639 : // \minimum 0.0
3640 : // \maximum 1.0
3641 : // int const iMinSysAirFlowRatioNumericNum = 2; // N2, \field Minimum System Air Flow Ratio
3642 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iMinSysAirFlowRatioNumericNum)) {
3643 0 : SysSizInput(SysSizIndex).SysAirMinFlowRat = 0.0;
3644 969 : } else if ((state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) < 0.0) &&
3645 3 : (state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) != DataSizing::AutoSize)) {
3646 0 : ShowSevereError(
3647 0 : state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iMinSysAirFlowRatioNumericNum)));
3648 0 : ShowContinueError(state,
3649 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3650 0 : state.dataIPShortCut->cNumericFieldNames(iMinSysAirFlowRatioNumericNum),
3651 0 : state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum)));
3652 0 : ErrorsFound = true;
3653 : } else {
3654 966 : SysSizInput(SysSizIndex).SysAirMinFlowRat = state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum);
3655 966 : if (state.dataIPShortCut->rNumericArgs(iMinSysAirFlowRatioNumericNum) == DataSizing::AutoSize) {
3656 3 : SysSizInput(SysSizIndex).SysAirMinFlowRatWasAutoSized = true;
3657 : }
3658 : }
3659 : // int const iPreheatDesignTempNumericNum = 3; // N3, \field Preheat Design Temperature
3660 : // int const iPreheatDesignHumRatNumericNum = 4; // N4, \field Preheat Design Humidity Ratio
3661 : // int const iPrecoolDesignTempNumericNum = 5; // N5, \field Precool Design Temperature
3662 : // int const iPrecoolDesignHumRatNumericNum = 6; // N6, \field Precool Design Humidity Ratio
3663 : // int const iCentralCoolDesignSATempNumericNum = 7; // N7, \field Central Cooling Design Supply Air Temperature
3664 : // int const iCentralHeatDesignSATempNumericNum = 8; // N8, \field Central Heating Design Supply Air Temperature
3665 : // int const iCentralCoolDesignSAHumRatNumericNum = 9; // N9, \field Central Cooling Design Supply Air Humidity Ratio
3666 : // int const iCentralHeatDesignSAHumRatNumericNum = 10; // N10, \field Central Heating Design Supply Air Humidity Ratio
3667 966 : SysSizInput(SysSizIndex).PreheatTemp = state.dataIPShortCut->rNumericArgs(iPreheatDesignTempNumericNum);
3668 966 : SysSizInput(SysSizIndex).PreheatHumRat = state.dataIPShortCut->rNumericArgs(iPreheatDesignHumRatNumericNum);
3669 966 : SysSizInput(SysSizIndex).PrecoolTemp = state.dataIPShortCut->rNumericArgs(iPrecoolDesignTempNumericNum);
3670 966 : SysSizInput(SysSizIndex).PrecoolHumRat = state.dataIPShortCut->rNumericArgs(iPrecoolDesignHumRatNumericNum);
3671 966 : SysSizInput(SysSizIndex).CoolSupTemp = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSATempNumericNum);
3672 966 : SysSizInput(SysSizIndex).HeatSupTemp = state.dataIPShortCut->rNumericArgs(iCentralHeatDesignSATempNumericNum);
3673 966 : SysSizInput(SysSizIndex).CoolSupHumRat = state.dataIPShortCut->rNumericArgs(iCentralCoolDesignSAHumRatNumericNum);
3674 966 : SysSizInput(SysSizIndex).HeatSupHumRat = state.dataIPShortCut->rNumericArgs(iCentralHeatDesignSAHumRatNumericNum);
3675 : // N11, \field Cooling Design Air Flow Rate
3676 : // \note This input is used if Cooling Design Air Flow Method is Flow/System
3677 : // \note This value will *not* be multiplied by any sizing factor or by zone multipliers.
3678 : // \note If using zone multipliers, this value must be large enough to serve the multiplied zones.
3679 : // \type real
3680 : // \units m3/s
3681 : // \minimum 0
3682 : // \default 0
3683 : // int const iCoolSAFMAlphaNum = 6; // A6, \field Cooling Design Air Flow Method
3684 : // int const iMaxCoolAirVolFlowNumericNum = 11; // N11, \field Cooling Design Air Flow Rate {m3/s}
3685 : // int const iCoolFlowPerFloorAreaNumericNum = 12; // N12, \field Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2}
3686 : // int const iCoolFlowPerFracCoolNumericNum = 13; // N13, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
3687 : // int const iCoolFlowPerCoolCapNumericNum = 14; // N14, \field Design Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
3688 :
3689 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iMaxCoolAirVolFlowNumericNum)) {
3690 172 : SysSizInput(SysSizIndex).DesCoolAirFlow = 0.0;
3691 794 : } else if (state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum) < 0.0) {
3692 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3693 0 : ShowContinueError(state,
3694 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3695 0 : state.dataIPShortCut->cNumericFieldNames(iMaxCoolAirVolFlowNumericNum),
3696 0 : state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum)));
3697 0 : ErrorsFound = true;
3698 : } else {
3699 794 : SysSizInput(SysSizIndex).DesCoolAirFlow = state.dataIPShortCut->rNumericArgs(iMaxCoolAirVolFlowNumericNum);
3700 : }
3701 : // N12;\field Heating Design Air Flow Rate
3702 : // \note This input is used if Heating Design Air Flow Method is Flow/System
3703 : // \note This value will *not* be multiplied by any sizing factor or by zone multipliers.
3704 : // \note If using zone multipliers, this value must be large enough to serve the multiplied zones.
3705 : // \type real
3706 : // \units m3/s
3707 : // \minimum 0
3708 : // \default 0
3709 : // int const iHeatSAFMAlphaNum = 7; // A7, \field Heating Design Air Flow Method
3710 : // int const iMaxHeatAirVolFlowNumericNum = 12; // N15, \field Heating Design Air Flow Rate {m3/s}
3711 : // int const iHeatFlowPerFloorAreaNumericNum = 16; // N16, \field Supply Air Flow Rate Per Floor Area During Heating Operation {m3/s-m2}
3712 : // int const iHeatFlowPerFracHeatNumericNum = 17; // N17, \field Fraction of Autosized Design Heating Supply Air Flow Rate {-}
3713 : // int const iHeatFlowPerFracCoolNumericNum = 18; // N18, \field Fraction of Autosized Design Cooling Supply Air Flow Rate {-}
3714 : // int const iHeatFlowPerHeatCapNumericNum = 19; // N19, \field Design Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
3715 : // add input fields for other cooling sizing methods
3716 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iMaxHeatAirVolFlowNumericNum)) {
3717 172 : SysSizInput(SysSizIndex).DesHeatAirFlow = 0.0;
3718 794 : } else if (state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum) < 0.0) {
3719 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3720 0 : ShowContinueError(state,
3721 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3722 0 : state.dataIPShortCut->cNumericFieldNames(iMaxHeatAirVolFlowNumericNum),
3723 0 : state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum)));
3724 0 : ErrorsFound = true;
3725 : } else {
3726 794 : SysSizInput(SysSizIndex).DesHeatAirFlow = state.dataIPShortCut->rNumericArgs(iMaxHeatAirVolFlowNumericNum);
3727 : }
3728 : // N13;\field Maximum Zone Outdoor Air Fraction
3729 : // \type real
3730 : // \default 1.0
3731 : // \minimum> 0.0
3732 : // \units dimensionless
3733 : // int const iSystemOASMethodAlphaNum = 8; // A8, \field System Outdoor Air Method
3734 : // int const iZoneMaxOAFractionNumericNum = 13; // N20, \field Zone Maximum Outdoor Air Fraction
3735 :
3736 : // add input fields for other heating sizing methods
3737 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iZoneMaxOAFractionNumericNum)) {
3738 179 : SysSizInput(SysSizIndex).MaxZoneOAFraction = 0.0;
3739 787 : } else if (state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum) < 0.0) {
3740 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3741 0 : ShowContinueError(state,
3742 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
3743 0 : state.dataIPShortCut->cNumericFieldNames(iZoneMaxOAFractionNumericNum),
3744 0 : state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum)));
3745 0 : ErrorsFound = true;
3746 : } else {
3747 787 : SysSizInput(SysSizIndex).MaxZoneOAFraction = state.dataIPShortCut->rNumericArgs(iZoneMaxOAFractionNumericNum);
3748 : }
3749 : {
3750 966 : std::string const &coolAirDesMethod = state.dataIPShortCut->cAlphaArgs(iCoolSAFMAlphaNum);
3751 966 : if (coolAirDesMethod == "DESIGNDAY") {
3752 961 : SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
3753 5 : } else if (coolAirDesMethod == "FLOW/SYSTEM") {
3754 4 : SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
3755 1 : } else if (coolAirDesMethod == "FLOWPERFLOORAREA") {
3756 0 : SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
3757 0 : SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FlowPerFloorArea;
3758 0 : SysSizInput(SysSizIndex).FlowPerFloorAreaCooled = state.dataIPShortCut->rNumericArgs(iCoolFlowPerFloorAreaNumericNum);
3759 1 : } else if (coolAirDesMethod == "FRACTIONOFAUTOSIZEDCOOLINGAIRFLOW") {
3760 0 : SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
3761 0 : SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FractionOfAutosizedCoolingAirflow;
3762 0 : SysSizInput(SysSizIndex).FractionOfAutosizedCoolingAirflow = state.dataIPShortCut->rNumericArgs(iCoolFlowPerFracCoolNumericNum);
3763 1 : } else if (coolAirDesMethod == "FLOWPERCOOLINGCAPACITY") {
3764 1 : SysSizInput(SysSizIndex).CoolAirDesMethod = AirflowSizingMethod::FromDDCalc;
3765 1 : SysSizInput(SysSizIndex).ScaleCoolSAFMethod = FlowPerCoolingCapacity;
3766 1 : SysSizInput(SysSizIndex).FlowPerCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolFlowPerCoolCapNumericNum);
3767 : } else {
3768 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3769 0 : ShowContinueError(state,
3770 0 : format("... incorrect {}=\"{}\".",
3771 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolSAFMAlphaNum),
3772 0 : state.dataIPShortCut->cAlphaArgs(iCoolSAFMAlphaNum)));
3773 0 : ShowContinueError(state,
3774 : "... valid values are DesignDay, Flow/System, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, or "
3775 : "FlowPerCoolingCapacity.");
3776 0 : ErrorsFound = true;
3777 : }
3778 : }
3779 : {
3780 966 : std::string const &heatAirDesMethod = state.dataIPShortCut->cAlphaArgs(iHeatSAFMAlphaNum);
3781 966 : if (heatAirDesMethod == "DESIGNDAY") {
3782 962 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
3783 4 : } else if (heatAirDesMethod == "FLOW/SYSTEM") {
3784 3 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
3785 1 : } else if (heatAirDesMethod == "FLOWPERFLOORAREA") {
3786 0 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::InpDesAirFlow;
3787 0 : SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FlowPerFloorArea;
3788 0 : SysSizInput(SysSizIndex).FlowPerFloorAreaHeated = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFloorAreaNumericNum);
3789 1 : } else if (heatAirDesMethod == "FRACTIONOFAUTOSIZEDHEATINGAIRFLOW") {
3790 0 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
3791 0 : SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FractionOfAutosizedHeatingAirflow;
3792 0 : SysSizInput(SysSizIndex).FractionOfAutosizedHeatingAirflow = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFracHeatNumericNum);
3793 1 : } else if (heatAirDesMethod == "FRACTIONOFAUTOSIZEDCOOLINGAIRFLOW") {
3794 0 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
3795 0 : SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FractionOfAutosizedCoolingAirflow;
3796 0 : SysSizInput(SysSizIndex).FractionOfAutosizedCoolingAirflow = state.dataIPShortCut->rNumericArgs(iHeatFlowPerFracCoolNumericNum);
3797 1 : } else if (heatAirDesMethod == "FLOWPERHEATINGCAPACITY") {
3798 1 : SysSizInput(SysSizIndex).HeatAirDesMethod = AirflowSizingMethod::FromDDCalc;
3799 1 : SysSizInput(SysSizIndex).ScaleHeatSAFMethod = FlowPerHeatingCapacity;
3800 1 : SysSizInput(SysSizIndex).FlowPerHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFlowPerHeatCapNumericNum);
3801 : } else {
3802 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3803 0 : ShowContinueError(state,
3804 0 : format("... incorrect {}=\"{}\".",
3805 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatSAFMAlphaNum),
3806 0 : state.dataIPShortCut->cAlphaArgs(iHeatSAFMAlphaNum)));
3807 0 : ShowContinueError(state,
3808 : "... valid values are DesignDay, Flow/System, FlowPerFloorArea, FractionOfAutosizedHeatingAirflow, or "
3809 : "FlowPerHeatingCapacity.");
3810 0 : ErrorsFound = true;
3811 : }
3812 : }
3813 : {
3814 966 : std::string const &systemOAMethod = state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum);
3815 966 : if (systemOAMethod == "ZONESUM") {
3816 956 : SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::ZoneSum;
3817 10 : } else if (systemOAMethod == "STANDARD62.1VENTILATIONRATEPROCEDURE") {
3818 7 : SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::VRP;
3819 7 : if (SysSizInput(SysSizIndex).loadSizingType == DataSizing::LoadSizing::Ventilation) {
3820 0 : ShowWarningError(
3821 : state,
3822 0 : format("{}=\"{}\", invalid combination of inputs.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3823 0 : ShowContinueError(state,
3824 0 : format("{} = {} and {} = {}.",
3825 0 : state.dataIPShortCut->cAlphaFieldNames(iLoadTypeSizeAlphaNum),
3826 0 : state.dataIPShortCut->cAlphaArgs(iLoadTypeSizeAlphaNum),
3827 0 : state.dataIPShortCut->cAlphaFieldNames(iSystemOASMethodAlphaNum),
3828 0 : state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum)));
3829 0 : ShowContinueError(state, "Resetting System Outdoor Air Method to ZoneSum.");
3830 0 : SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::ZoneSum;
3831 : } else {
3832 7 : if (SysSizInput(SysSizIndex).DesOutAirVolFlow > 0) {
3833 0 : ShowSevereError(state,
3834 0 : format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3835 0 : ShowContinueError(state,
3836 0 : format("SystemOAMethod is set to VRP and {} > 0, user entry will be ignored.",
3837 0 : state.dataIPShortCut->cNumericFieldNames(iDesignOAVolFlowNumericNum)));
3838 : }
3839 : }
3840 3 : } else if (systemOAMethod == "STANDARD62.1SIMPLIFIEDPROCEDURE") {
3841 3 : SysSizInput(SysSizIndex).SystemOAMethod = SysOAMethod::SP;
3842 : } else {
3843 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3844 0 : ShowContinueError(state,
3845 0 : format("... incorrect {}=\"{}\".",
3846 0 : state.dataIPShortCut->cAlphaFieldNames(iSystemOASMethodAlphaNum),
3847 0 : state.dataIPShortCut->cAlphaArgs(iSystemOASMethodAlphaNum)));
3848 0 : ShowContinueError(state, "... valid values are ZoneSum or Standard62.1VentilationRateProcedure.");
3849 0 : ErrorsFound = true;
3850 : }
3851 : }
3852 :
3853 : // Determine SysSizInput electric Cooling design capacity sizing method
3854 966 : if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "COOLINGDESIGNCAPACITY")) {
3855 965 : SysSizInput(SysSizIndex).CoolingCapMethod = CoolingDesignCapacity;
3856 : // SysSizInput( SysSizIndex ).ScaledCoolingCapacity = AutoSize can be set to autosize cooling capacity
3857 965 : SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum);
3858 965 : if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledCoolingCapacity != AutoSize) {
3859 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3860 0 : ShowContinueError(state,
3861 0 : format("Illegal {} = {:.7T}",
3862 0 : state.dataIPShortCut->cNumericFieldNames(iCoolDesignCapacityNumericNum),
3863 0 : state.dataIPShortCut->rNumericArgs(iCoolDesignCapacityNumericNum)));
3864 0 : ErrorsFound = true;
3865 : }
3866 1 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "CAPACITYPERFLOORAREA")) {
3867 0 : SysSizInput(SysSizIndex).CoolingCapMethod = CapacityPerFloorArea;
3868 0 : if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolCapacityPerFloorAreaNumericNum)) {
3869 0 : SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolCapacityPerFloorAreaNumericNum);
3870 0 : if (SysSizInput(SysSizIndex).ScaledCoolingCapacity <= 0.0) {
3871 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3872 0 : ShowContinueError(state,
3873 0 : format("Input for {} = {}",
3874 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
3875 0 : state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
3876 0 : ShowContinueError(state,
3877 0 : format("Illegal {} = {:.7T}",
3878 0 : state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum),
3879 0 : state.dataIPShortCut->rNumericArgs(iCoolCapacityPerFloorAreaNumericNum)));
3880 0 : ErrorsFound = true;
3881 0 : } else if (SysSizInput(SysSizIndex).ScaledCoolingCapacity == AutoSize) {
3882 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3883 0 : ShowContinueError(state,
3884 0 : format("Input for {} = {}",
3885 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
3886 0 : state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
3887 0 : ShowContinueError(state,
3888 0 : format("Illegal {} = Autosize", state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum)));
3889 0 : ErrorsFound = true;
3890 : }
3891 : } else {
3892 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3893 0 : ShowContinueError(state,
3894 0 : format("Input for {} = {}",
3895 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
3896 0 : state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
3897 0 : ShowContinueError(
3898 0 : state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolCapacityPerFloorAreaNumericNum)));
3899 0 : ErrorsFound = true;
3900 : }
3901 1 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "FRACTIONOFAUTOSIZEDCOOLINGCAPACITY")) {
3902 1 : SysSizInput(SysSizIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity;
3903 1 : if (!state.dataIPShortCut->lNumericFieldBlanks(iCoolFracOfAutosizedCapacityNumericNum)) {
3904 1 : SysSizInput(SysSizIndex).ScaledCoolingCapacity = state.dataIPShortCut->rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum);
3905 1 : if (SysSizInput(SysSizIndex).ScaledCoolingCapacity < 0.0) {
3906 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3907 0 : ShowContinueError(state,
3908 0 : format("Illegal {} = {:.7T}",
3909 0 : state.dataIPShortCut->cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum),
3910 0 : state.dataIPShortCut->rNumericArgs(iCoolFracOfAutosizedCapacityNumericNum)));
3911 0 : ErrorsFound = true;
3912 : }
3913 : } else {
3914 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3915 0 : ShowContinueError(state,
3916 0 : format("Input for {} = {}",
3917 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
3918 0 : state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
3919 0 : ShowContinueError(
3920 : state,
3921 0 : format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iCoolFracOfAutosizedCapacityNumericNum)));
3922 0 : ErrorsFound = true;
3923 : }
3924 0 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum), "NONE")) {
3925 0 : SysSizInput(SysSizIndex).CoolingCapMethod = None;
3926 0 : SysSizInput(SysSizIndex).ScaledCoolingCapacity = 0.0;
3927 : } else {
3928 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
3929 0 : ShowContinueError(state,
3930 0 : format("... incorrect {}=\"{}\".",
3931 0 : state.dataIPShortCut->cAlphaFieldNames(iCoolCAPMAlphaNum),
3932 0 : state.dataIPShortCut->cAlphaArgs(iCoolCAPMAlphaNum)));
3933 0 : ShowContinueError(state,
3934 : "... valid values are CoolingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, or None.");
3935 0 : ErrorsFound = true;
3936 : }
3937 :
3938 : // Determine SysSizInput electric heating design capacity sizing method
3939 966 : if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "HEATINGDESIGNCAPACITY")) {
3940 965 : SysSizInput(SysSizIndex).HeatingCapMethod = HeatingDesignCapacity;
3941 : // SysSizInput( SysSizIndex ).ScaledHeatingCapacity = AutoSize can be set to autosize heating capacity
3942 965 : SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum);
3943 965 : if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0 && SysSizInput(SysSizIndex).ScaledHeatingCapacity != AutoSize) {
3944 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3945 0 : ShowContinueError(state,
3946 0 : format("Illegal {} = {:.7T}",
3947 0 : state.dataIPShortCut->cNumericFieldNames(iHeatDesignCapacityNumericNum),
3948 0 : state.dataIPShortCut->rNumericArgs(iHeatDesignCapacityNumericNum)));
3949 0 : ErrorsFound = true;
3950 : }
3951 1 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "CAPACITYPERFLOORAREA")) {
3952 0 : SysSizInput(SysSizIndex).HeatingCapMethod = CapacityPerFloorArea;
3953 0 : if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatCapacityPerFloorAreaNumericNum)) {
3954 0 : SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum);
3955 0 : if (SysSizInput(SysSizIndex).ScaledHeatingCapacity <= 0.0) {
3956 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3957 0 : ShowContinueError(state,
3958 0 : format("Input for {} = {}",
3959 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
3960 0 : state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
3961 0 : ShowContinueError(state,
3962 0 : format("Illegal {} = {:.7T}",
3963 0 : state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum),
3964 0 : state.dataIPShortCut->rNumericArgs(iHeatCapacityPerFloorAreaNumericNum)));
3965 0 : ErrorsFound = true;
3966 0 : } else if (SysSizInput(SysSizIndex).ScaledHeatingCapacity == AutoSize) {
3967 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3968 0 : ShowContinueError(state,
3969 0 : format("Input for {} = {}",
3970 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
3971 0 : state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
3972 0 : ShowContinueError(state,
3973 0 : format("Illegal {} = Autosize", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)));
3974 0 : ErrorsFound = true;
3975 : }
3976 : } else {
3977 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3978 0 : ShowContinueError(state,
3979 0 : format("Input for {} = {}",
3980 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
3981 0 : state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
3982 0 : ShowContinueError(
3983 0 : state, format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatCapacityPerFloorAreaNumericNum)));
3984 0 : ErrorsFound = true;
3985 : }
3986 1 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "FRACTIONOFAUTOSIZEDHEATINGCAPACITY")) {
3987 1 : SysSizInput(SysSizIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
3988 1 : if (!state.dataIPShortCut->lNumericFieldBlanks(iHeatFracOfAutosizedCapacityNumericNum)) {
3989 1 : SysSizInput(SysSizIndex).ScaledHeatingCapacity = state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum);
3990 1 : if (SysSizInput(SysSizIndex).ScaledHeatingCapacity < 0.0) {
3991 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
3992 0 : ShowContinueError(state,
3993 0 : format("Illegal {} = {:.7T}",
3994 0 : state.dataIPShortCut->cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum),
3995 0 : state.dataIPShortCut->rNumericArgs(iHeatFracOfAutosizedCapacityNumericNum)));
3996 0 : ErrorsFound = true;
3997 : }
3998 : } else {
3999 0 : ShowSevereError(state, format("{} = {}", cCurrentModuleObject, SysSizInput(SysSizIndex).AirPriLoopName));
4000 0 : ShowContinueError(state,
4001 0 : format("Input for {} = {}",
4002 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
4003 0 : state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
4004 0 : ShowContinueError(
4005 : state,
4006 0 : format("Blank field not allowed for {}", state.dataIPShortCut->cNumericFieldNames(iHeatFracOfAutosizedCapacityNumericNum)));
4007 0 : ErrorsFound = true;
4008 : }
4009 0 : } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum), "NONE")) {
4010 0 : SysSizInput(SysSizIndex).HeatingCapMethod = None;
4011 0 : SysSizInput(SysSizIndex).ScaledHeatingCapacity = 0.0;
4012 : } else {
4013 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
4014 0 : ShowContinueError(state,
4015 0 : format("... incorrect {}=\"{}\".",
4016 0 : state.dataIPShortCut->cAlphaFieldNames(iHeatCAPMAlphaNum),
4017 0 : state.dataIPShortCut->cAlphaArgs(iHeatCAPMAlphaNum)));
4018 0 : ShowContinueError(state,
4019 : "... valid values are HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedHeatingCapacity, or None.");
4020 0 : ErrorsFound = true;
4021 : }
4022 :
4023 : // N27; \field Occupant Diversity
4024 : // \type real
4025 : // \maximum 1.0
4026 : // \minimum> 0.0
4027 : // int const iOccupantDiversity = 27; // N27, \field Occupant Diversity
4028 966 : if (state.dataIPShortCut->lNumericFieldBlanks(iOccupantDiversity)) {
4029 963 : SysSizInput(SysSizIndex).OccupantDiversity = AutoSize;
4030 4 : } else if (state.dataIPShortCut->rNumericArgs(iOccupantDiversity) <= 0.0 &&
4031 1 : state.dataIPShortCut->rNumericArgs(iOccupantDiversity) != AutoSize) {
4032 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
4033 0 : ShowContinueError(state,
4034 0 : format("... incorrect {}=[{:.2R}], value should not be negative.",
4035 0 : state.dataIPShortCut->cNumericFieldNames(iOccupantDiversity),
4036 0 : state.dataIPShortCut->rNumericArgs(iOccupantDiversity)));
4037 0 : ErrorsFound = true;
4038 3 : } else if (state.dataIPShortCut->rNumericArgs(iOccupantDiversity) > 1.0 &&
4039 0 : state.dataIPShortCut->rNumericArgs(iOccupantDiversity) != AutoSize) {
4040 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum)));
4041 0 : ShowContinueError(state,
4042 0 : format("... incorrect {}=[{:.2R}], value should not be greater than 1.0.",
4043 0 : state.dataIPShortCut->cNumericFieldNames(iOccupantDiversity),
4044 0 : state.dataIPShortCut->rNumericArgs(iOccupantDiversity)));
4045 0 : ErrorsFound = true;
4046 : } else {
4047 3 : SysSizInput(SysSizIndex).OccupantDiversity = state.dataIPShortCut->rNumericArgs(iOccupantDiversity);
4048 : }
4049 : }
4050 :
4051 796 : if (ErrorsFound) {
4052 0 : ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
4053 : }
4054 796 : }
4055 :
4056 796 : void GetPlantSizingInput(EnergyPlusData &state)
4057 : {
4058 :
4059 : // SUBROUTINE INFORMATION:
4060 : // AUTHOR Fred Buhl
4061 : // DATE WRITTEN October 2001
4062 : // MODIFIED na
4063 : // RE-ENGINEERED na
4064 :
4065 : // PURPOSE OF THIS SUBROUTINE:
4066 : // Obtains input data for Plant Sizing objects and stores it in
4067 : // appropriate data structures.
4068 :
4069 : // METHODOLOGY EMPLOYED:
4070 : // Uses InputProcessor "Get" routines to obtain data.
4071 :
4072 : // Using/Aliasing
4073 :
4074 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
4075 : int PltSizIndex; // loop index
4076 : int NumAlphas; // Number of Alphas for each GetObjectItem call
4077 : int NumNumbers; // Number of Numbers for each GetObjectItem call
4078 : int IOStatus; // Used in GetObjectItem
4079 796 : bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
4080 : int NumDesDays; // Number of design days in input
4081 796 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
4082 796 : cCurrentModuleObject = "Sizing:Plant";
4083 796 : state.dataSize->NumPltSizInput = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
4084 :
4085 796 : if (state.dataSize->NumPltSizInput > 0) {
4086 333 : NumDesDays = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:DesignDay") +
4087 333 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileDays") +
4088 333 : state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "SizingPeriod:WeatherFileConditionType");
4089 333 : if (NumDesDays == 0 && state.dataGlobal->DoPlantSizing) {
4090 0 : ShowSevereError(state, "Plant Sizing calculations need SizingPeriod:* input");
4091 0 : ErrorsFound = true;
4092 : }
4093 333 : state.dataSize->PlantSizData.allocate(state.dataSize->NumPltSizInput);
4094 1136 : for (auto &e : state.dataSize->PlantSizData) {
4095 803 : e.PlantLoopName.clear();
4096 803 : e.ExitTemp = 0.0;
4097 803 : e.DeltaT = 0.0;
4098 803 : e.LoopType = DataSizing::TypeOfPlantLoop::Invalid;
4099 803 : e.DesVolFlowRate = 0.0;
4100 333 : }
4101 1136 : for (int i = 1; i <= state.dataSize->NumPltSizInput; ++i) {
4102 803 : state.dataSize->PlantSizData(i).ConcurrenceOption = NonCoincident;
4103 803 : state.dataSize->PlantSizData(i).NumTimeStepsInAvg = 1;
4104 : }
4105 : }
4106 :
4107 1599 : for (PltSizIndex = 1; PltSizIndex <= state.dataSize->NumPltSizInput; ++PltSizIndex) {
4108 1606 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
4109 : cCurrentModuleObject,
4110 : PltSizIndex,
4111 803 : state.dataIPShortCut->cAlphaArgs,
4112 : NumAlphas,
4113 803 : state.dataIPShortCut->rNumericArgs,
4114 : NumNumbers,
4115 : IOStatus,
4116 803 : state.dataIPShortCut->lNumericFieldBlanks,
4117 803 : state.dataIPShortCut->lAlphaFieldBlanks,
4118 803 : state.dataIPShortCut->cAlphaFieldNames,
4119 803 : state.dataIPShortCut->cNumericFieldNames);
4120 803 : Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
4121 :
4122 803 : state.dataSize->PlantSizData(PltSizIndex).PlantLoopName = state.dataIPShortCut->cAlphaArgs(1);
4123 803 : state.dataSize->PlantSizData(PltSizIndex).ExitTemp = state.dataIPShortCut->rNumericArgs(1);
4124 803 : state.dataSize->PlantSizData(PltSizIndex).DeltaT = state.dataIPShortCut->rNumericArgs(2);
4125 803 : if (NumNumbers > 2) {
4126 57 : state.dataSize->PlantSizData(PltSizIndex).NumTimeStepsInAvg = state.dataIPShortCut->rNumericArgs(3);
4127 : } else {
4128 746 : state.dataSize->PlantSizData(PltSizIndex).NumTimeStepsInAvg = 1.0;
4129 : }
4130 :
4131 : constexpr static std::array<std::string_view, static_cast<int>(DataSizing::TypeOfPlantLoop::Num)> TypeOfPlantLoopNamesUC = {
4132 : "HEATING", "COOLING", "CONDENSER", "STEAM"};
4133 803 : state.dataSize->PlantSizData(PltSizIndex).LoopType =
4134 1606 : static_cast<TypeOfPlantLoop>(getEnumValue(TypeOfPlantLoopNamesUC, Util::makeUPPER(state.dataIPShortCut->cAlphaArgs(2))));
4135 803 : assert(state.dataSize->PlantSizData(PltSizIndex).LoopType != TypeOfPlantLoop::Invalid);
4136 :
4137 803 : if (NumAlphas > 2) {
4138 : {
4139 57 : std::string const &concurrenceOption = state.dataIPShortCut->cAlphaArgs(3);
4140 57 : if (concurrenceOption == "NONCOINCIDENT") {
4141 13 : state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = NonCoincident;
4142 44 : } else if (concurrenceOption == "COINCIDENT") {
4143 44 : state.dataSize->PlantSizData(PltSizIndex).ConcurrenceOption = Coincident;
4144 : } else {
4145 0 : ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
4146 0 : ShowContinueError(
4147 0 : state, format("...incorrect {}=\"{}\".", state.dataIPShortCut->cAlphaFieldNames(3), state.dataIPShortCut->cAlphaArgs(3)));
4148 0 : ShowContinueError(state, R"(...Valid values are "NonCoincident" or "Coincident".)");
4149 0 : ErrorsFound = true;
4150 : }
4151 : }
4152 : }
4153 803 : if (NumAlphas > 3) {
4154 : {
4155 57 : std::string const &sizingFactorOption = state.dataIPShortCut->cAlphaArgs(4);
4156 57 : if (sizingFactorOption == "NONE") {
4157 52 : state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = NoSizingFactorMode;
4158 5 : } else if (sizingFactorOption == "GLOBALHEATINGSIZINGFACTOR") {
4159 0 : state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalHeatingSizingFactorMode;
4160 5 : } else if (sizingFactorOption == "GLOBALCOOLINGSIZINGFACTOR") {
4161 5 : state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = GlobalCoolingSizingFactorMode;
4162 0 : } else if (sizingFactorOption == "LOOPCOMPONENTSIZINGFACTOR") {
4163 0 : state.dataSize->PlantSizData(PltSizIndex).SizingFactorOption = LoopComponentSizingFactorMode;
4164 : }
4165 : }
4166 : }
4167 803 : SetupEMSInternalVariable(state,
4168 : "Plant Design Volume Flow Rate",
4169 803 : state.dataSize->PlantSizData(PltSizIndex).PlantLoopName,
4170 : "[m3/s]",
4171 803 : state.dataSize->PlantSizData(PltSizIndex).DesVolFlowRate);
4172 : }
4173 :
4174 796 : if (ErrorsFound) {
4175 0 : ShowFatalError(state, format("{}: Errors found in getting input. Program terminates.", cCurrentModuleObject));
4176 : }
4177 796 : }
4178 :
4179 422 : void SetupZoneSizing(EnergyPlusData &state, bool &ErrorsFound)
4180 : {
4181 :
4182 : // SUBROUTINE INFORMATION:
4183 : // AUTHOR L. Lawrie/F. Buhl
4184 : // DATE WRITTEN March 2010
4185 : // MODIFIED na
4186 : // RE-ENGINEERED na
4187 :
4188 : // PURPOSE OF THIS SUBROUTINE:
4189 : // execute a few (1) time steps of a simulation to facilitate setting up model for zone sizing
4190 : // developed to resolve reverse DD problems caused be the differences
4191 : // that stem from setup and information gathering that occurs during the first pass.
4192 :
4193 : // METHODOLOGY EMPLOYED:
4194 : // Using global flag (kickoff sizing simulation), only a few time steps are executed.
4195 : // global flag is used in other parts of simulation to terminate quickly.
4196 :
4197 422 : bool Available = true;
4198 :
4199 422 : state.dataSize->CurOverallSimDay = 0;
4200 1295 : while (Available) { // do for each environment
4201 :
4202 1295 : Weather::GetNextEnvironment(state, Available, ErrorsFound);
4203 :
4204 1295 : if (!Available) break;
4205 873 : if (ErrorsFound) break;
4206 :
4207 : // check that environment is one of the design days
4208 873 : if (state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather) {
4209 0 : continue;
4210 : }
4211 :
4212 873 : state.dataGlobal->BeginEnvrnFlag = true;
4213 873 : state.dataGlobal->EndEnvrnFlag = false;
4214 873 : state.dataEnvrn->EndMonthFlag = false;
4215 873 : state.dataGlobal->WarmupFlag = true;
4216 873 : state.dataGlobal->DayOfSim = 0;
4217 :
4218 873 : state.dataSize->CurEnvirNumSimDay = 1;
4219 873 : ++state.dataSize->CurOverallSimDay;
4220 :
4221 873 : ++state.dataGlobal->DayOfSim;
4222 873 : state.dataGlobal->BeginDayFlag = true;
4223 873 : state.dataGlobal->EndDayFlag = false;
4224 :
4225 873 : state.dataGlobal->HourOfDay = 1;
4226 :
4227 873 : state.dataGlobal->BeginHourFlag = true;
4228 873 : state.dataGlobal->EndHourFlag = false;
4229 :
4230 873 : state.dataGlobal->TimeStep = 1;
4231 :
4232 873 : state.dataGlobal->BeginTimeStepFlag = true;
4233 :
4234 873 : Weather::ManageWeather(state);
4235 :
4236 873 : ManageHeatBalance(state);
4237 :
4238 873 : state.dataGlobal->BeginHourFlag = false;
4239 873 : state.dataGlobal->BeginDayFlag = false;
4240 873 : state.dataGlobal->BeginEnvrnFlag = false;
4241 873 : state.dataGlobal->BeginSimFlag = false;
4242 :
4243 : // ! do another timestep=1
4244 873 : Weather::ManageWeather(state);
4245 :
4246 873 : ManageHeatBalance(state);
4247 :
4248 : // do an end of day, end of environment time step
4249 :
4250 873 : state.dataGlobal->HourOfDay = 24;
4251 873 : state.dataGlobal->TimeStep = state.dataGlobal->NumOfTimeStepInHour;
4252 873 : state.dataGlobal->EndEnvrnFlag = true;
4253 :
4254 873 : Weather::ManageWeather(state);
4255 :
4256 873 : ManageHeatBalance(state);
4257 :
4258 : } // ... End environment loop.
4259 422 : }
4260 :
4261 3530 : void reportZoneSizing(EnergyPlusData &state,
4262 : DataHeatBalance::ZoneSpaceData const &zoneOrSpace,
4263 : DataSizing::ZoneSizingData const &zsFinalSizing,
4264 : DataSizing::ZoneSizingData const &zsCalcFinalSizing,
4265 : Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing,
4266 : Array2D<DataSizing::ZoneSizingData> const &zSizing,
4267 : bool const isSpace)
4268 : {
4269 3530 : std::string_view const curName = zoneOrSpace.Name;
4270 : // shift for predefined reports for space vs zone
4271 3530 : int shift = 0;
4272 3530 : if (isSpace) shift = state.dataOutRptPredefined->pdchSpClCalcDesLd - state.dataOutRptPredefined->pdchZnClCalcDesLd;
4273 3530 : int thisNum = zsFinalSizing.ZoneNum; // Zone or space num
4274 3530 : if (zsFinalSizing.DesCoolVolFlow > 0.0) {
4275 3488 : int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtCoolMax;
4276 3488 : int DDNum = zsFinalSizing.CoolDDNum;
4277 3488 : Real64 TempAtPeak = 0.0;
4278 3488 : Real64 HumRatAtPeak = 0.0;
4279 3488 : Real64 DOASHeatGainRateAtClPk = 0.0;
4280 3488 : Real64 TStatSetPtAtPk = 0.0;
4281 3488 : if (DDNum > 0 && TimeStepAtPeak > 0) {
4282 3488 : TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
4283 3488 : HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
4284 3488 : DOASHeatGainRateAtClPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
4285 3488 : TStatSetPtAtPk = zSizing(DDNum, thisNum).CoolTstatTempSeq(TimeStepAtPeak);
4286 : } else {
4287 0 : TempAtPeak = zsCalcFinalSizing.OutTempAtCoolPeak;
4288 0 : HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtCoolPeak;
4289 0 : DOASHeatGainRateAtClPk = zsCalcFinalSizing.DOASCoolLoad;
4290 0 : TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtCoolPeak;
4291 : }
4292 3488 : reportZoneSizingEio(state,
4293 3488 : zsFinalSizing.ZoneName,
4294 3488 : zsCalcFinalSizing.CoolSizingType,
4295 3488 : zsCalcFinalSizing.DesCoolLoad,
4296 3488 : zsFinalSizing.DesCoolLoad,
4297 3488 : zsCalcFinalSizing.DesCoolVolFlow,
4298 3488 : zsFinalSizing.DesCoolVolFlow,
4299 3488 : zsFinalSizing.CoolDesDay,
4300 3488 : zsCalcFinalSizing.CoolPeakDateHrMin,
4301 : TempAtPeak,
4302 : HumRatAtPeak,
4303 3488 : zoneOrSpace.FloorArea,
4304 3488 : zoneOrSpace.TotOccupants,
4305 3488 : zsFinalSizing.MinOA,
4306 : DOASHeatGainRateAtClPk,
4307 : isSpace);
4308 6976 : OutputReportPredefined::PreDefTableEntry(
4309 3488 : state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, zsCalcFinalSizing.DesCoolLoad);
4310 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, zsFinalSizing.DesCoolLoad);
4311 3488 : if (zoneOrSpace.FloorArea != 0.0) {
4312 6974 : OutputReportPredefined::PreDefTableEntry(
4313 3487 : state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, zsFinalSizing.DesCoolLoad / zoneOrSpace.FloorArea);
4314 : }
4315 3488 : OutputReportPredefined::PreDefTableEntry(
4316 3488 : state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, zsCalcFinalSizing.DesCoolVolFlow, 3);
4317 3488 : OutputReportPredefined::PreDefTableEntry(
4318 3488 : state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, zsFinalSizing.DesCoolVolFlow, 3);
4319 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, zsFinalSizing.CoolDesDay);
4320 3488 : OutputReportPredefined::PreDefTableEntry(
4321 3488 : state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, zsCalcFinalSizing.CoolPeakDateHrMin);
4322 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, TStatSetPtAtPk);
4323 6976 : OutputReportPredefined::PreDefTableEntry(
4324 3488 : state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtCoolPeak);
4325 3488 : OutputReportPredefined::PreDefTableEntry(
4326 3488 : state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtCoolPeak, 5);
4327 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, TempAtPeak);
4328 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, HumRatAtPeak, 5);
4329 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
4330 3488 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, DOASHeatGainRateAtClPk);
4331 : } else {
4332 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesLd, curName, 0.0, 1);
4333 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLd, curName, 0.0, 1);
4334 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesLdPerArea, curName, 0.0, 1);
4335 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClCalcDesAirFlow, curName, 0.0, 1);
4336 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClUserDesAirFlow, curName, 0.0, 1);
4337 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClDesDay, curName, "N/A");
4338 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTime, curName, "N/A");
4339 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkTstatTemp, curName, 0.0, 1);
4340 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndTemp, curName, 0.0, 1);
4341 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkIndHum, curName, 0.0, 1);
4342 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOATemp, curName, 0.0, 1);
4343 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAHum, curName, 0.0, 1);
4344 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkOAMinFlow, curName, 0.0, 1);
4345 42 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnClPkDOASHeatGain, curName, 0.0, 1);
4346 : }
4347 3530 : if (zsFinalSizing.DesHeatVolFlow > 0.0) {
4348 3513 : int TimeStepAtPeak = zsFinalSizing.TimeStepNumAtHeatMax;
4349 3513 : int DDNum = zsFinalSizing.HeatDDNum;
4350 3513 : Real64 TempAtPeak = 0.0;
4351 3513 : Real64 HumRatAtPeak = 0.0;
4352 3513 : Real64 DOASHeatGainRateAtHtPk = 0.0;
4353 3513 : Real64 TStatSetPtAtPk = 0.0;
4354 3513 : if (DDNum > 0 && TimeStepAtPeak > 0) {
4355 3513 : TempAtPeak = state.dataSize->DesDayWeath(DDNum).Temp(TimeStepAtPeak);
4356 3513 : HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak);
4357 3513 : DOASHeatGainRateAtHtPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak);
4358 3513 : TStatSetPtAtPk = zSizing(DDNum, thisNum).HeatTstatTempSeq(TimeStepAtPeak);
4359 : } else {
4360 0 : TempAtPeak = zsCalcFinalSizing.OutTempAtHeatPeak;
4361 0 : HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtHeatPeak;
4362 0 : DOASHeatGainRateAtHtPk = zsCalcFinalSizing.DOASHeatLoad;
4363 0 : TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtHeatPeak;
4364 : }
4365 3513 : reportZoneSizingEio(state,
4366 3513 : zsFinalSizing.ZoneName,
4367 3513 : zsCalcFinalSizing.HeatSizingType,
4368 3513 : zsCalcFinalSizing.DesHeatLoad,
4369 3513 : zsFinalSizing.DesHeatLoad,
4370 3513 : zsCalcFinalSizing.DesHeatVolFlow,
4371 3513 : zsFinalSizing.DesHeatVolFlow,
4372 3513 : zsFinalSizing.HeatDesDay,
4373 3513 : zsCalcFinalSizing.HeatPeakDateHrMin,
4374 : TempAtPeak,
4375 : HumRatAtPeak,
4376 3513 : zoneOrSpace.FloorArea,
4377 3513 : zoneOrSpace.TotOccupants,
4378 3513 : zsFinalSizing.MinOA,
4379 : DOASHeatGainRateAtHtPk,
4380 : isSpace);
4381 7026 : OutputReportPredefined::PreDefTableEntry(
4382 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, zsCalcFinalSizing.DesHeatLoad);
4383 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, zsFinalSizing.DesHeatLoad);
4384 3513 : if (zoneOrSpace.FloorArea != 0.0) {
4385 7024 : OutputReportPredefined::PreDefTableEntry(
4386 3512 : state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, zsFinalSizing.DesHeatLoad / zoneOrSpace.FloorArea);
4387 : }
4388 3513 : OutputReportPredefined::PreDefTableEntry(
4389 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, zsCalcFinalSizing.DesHeatVolFlow, 3);
4390 3513 : OutputReportPredefined::PreDefTableEntry(
4391 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, zsFinalSizing.DesHeatVolFlow, 3);
4392 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, zsFinalSizing.HeatDesDay);
4393 3513 : OutputReportPredefined::PreDefTableEntry(
4394 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, zsCalcFinalSizing.HeatPeakDateHrMin);
4395 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, TStatSetPtAtPk);
4396 7026 : OutputReportPredefined::PreDefTableEntry(
4397 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, zsCalcFinalSizing.ZoneTempAtHeatPeak);
4398 3513 : OutputReportPredefined::PreDefTableEntry(
4399 3513 : state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, zsCalcFinalSizing.ZoneHumRatAtHeatPeak, 5);
4400 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, TempAtPeak);
4401 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, HumRatAtPeak, 5);
4402 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, zsFinalSizing.MinOA, 3);
4403 3513 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, DOASHeatGainRateAtHtPk);
4404 : } else {
4405 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesLd, curName, 0.0, 1);
4406 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLd, curName, 0.0, 1);
4407 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesLdPerArea, curName, 0.0, 1);
4408 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtCalcDesAirFlow, curName, 0.0, 1);
4409 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtUserDesAirFlow, curName, 0.0, 1);
4410 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtDesDay, curName, "N/A");
4411 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTime, curName, "N/A");
4412 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkTstatTemp, curName, 0.0, 1);
4413 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndTemp, curName, 0.0, 1);
4414 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkIndHum, curName, 0.0, 1);
4415 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOATemp, curName, 0.0, 1);
4416 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAHum, curName, 0.0, 1);
4417 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkOAMinFlow, curName, 0.0, 1);
4418 17 : OutputReportPredefined::PreDefTableEntry(state, shift + state.dataOutRptPredefined->pdchZnHtPkDOASHeatGain, curName, 0.0, 1);
4419 : }
4420 3530 : }
4421 7001 : void reportZoneSizingEio(EnergyPlusData &state,
4422 : std::string const &ZoneName, // the name of the zone
4423 : std::string const &LoadType, // the description of the input variable
4424 : Real64 const CalcDesLoad, // the value from the sizing calculation [W]
4425 : Real64 const UserDesLoad, // the value from the sizing calculation modified by user input [W]
4426 : Real64 const CalcDesFlow, // calculated design air flow rate [m3/s]
4427 : Real64 const UserDesFlow, // user input or modified design air flow rate [m3/s]
4428 : std::string const &DesDayName, // the name of the design day that produced the peak
4429 : std::string const &PeakHrMin, // time stamp of the peak
4430 : Real64 const PeakTemp, // temperature at peak [C]
4431 : Real64 const PeakHumRat, // humidity ratio at peak [kg water/kg dry air]
4432 : Real64 const FloorArea, // zone floor area [m2]
4433 : Real64 const TotOccs, // design number of occupants for the zone
4434 : Real64 const MinOAVolFlow, // zone design minimum outside air flow rate [m3/s]
4435 : Real64 const DOASHeatAddRate, // zone design heat addition rate from the DOAS [W]
4436 : bool const isSpace)
4437 : {
4438 :
4439 : // SUBROUTINE INFORMATION:
4440 : // AUTHOR Fred Buhl
4441 : // DATE WRITTEN Decenber 2001
4442 : // MODIFIED August 2008, Greg Stark
4443 :
4444 : // PURPOSE OF THIS SUBROUTINE:
4445 : // This subroutine writes one item of zone sizing data to the "eio" file..
4446 :
4447 7001 : if (state.dataSizingManager->ReportZoneSizingMyOneTimeFlag && !isSpace) {
4448 : static constexpr std::string_view Format_990_Zone(
4449 : "! <Zone Sizing Information>, Zone Name, Load Type, Calc Des Load {W}, User Des Load {W}, Calc Des Air Flow "
4450 : "Rate {m3/s}, User Des Air Flow Rate {m3/s}, Design Day Name, Date/Time of Peak, Temperature at Peak {C}, "
4451 : "Humidity Ratio at Peak {kgWater/kgDryAir}, Floor Area {m2}, # Occupants, Calc Outdoor Air Flow Rate {m3/s}, "
4452 : "Calc DOAS Heat Addition Rate {W}");
4453 421 : print(state.files.eio, "{}\n", Format_990_Zone);
4454 421 : state.dataSizingManager->ReportZoneSizingMyOneTimeFlag = false;
4455 : }
4456 7001 : if (state.dataSizingManager->ReportSpaceSizingMyOneTimeFlag && isSpace) {
4457 : static constexpr std::string_view Format_990_Space(
4458 : "! <Space Sizing Information>, Space Name, Load Type, Calc Des Load {W}, User Des Load {W}, Calc Des Air Flow "
4459 : "Rate {m3/s}, User Des Air Flow Rate {m3/s}, Design Day Name, Date/Time of Peak, Temperature at Peak {C}, "
4460 : "Humidity Ratio at Peak {kgWater/kgDryAir}, Floor Area {m2}, # Occupants, Calc Outdoor Air Flow Rate {m3/s}, "
4461 : "Calc DOAS Heat Addition Rate {W}");
4462 2 : print(state.files.eio, "{}\n", Format_990_Space);
4463 2 : state.dataSizingManager->ReportSpaceSizingMyOneTimeFlag = false;
4464 : }
4465 :
4466 : static constexpr std::string_view Format_991_Space(
4467 : " Space Sizing Information, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}\n");
4468 : static constexpr std::string_view Format_991_Zone(
4469 : " Zone Sizing Information, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {}, {}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}, {:.5R}\n");
4470 7001 : if (isSpace) {
4471 28 : print(state.files.eio,
4472 : Format_991_Space,
4473 : ZoneName,
4474 : LoadType,
4475 : CalcDesLoad,
4476 : UserDesLoad,
4477 : CalcDesFlow,
4478 : UserDesFlow,
4479 : DesDayName,
4480 : PeakHrMin,
4481 : PeakTemp,
4482 : PeakHumRat,
4483 : FloorArea,
4484 : TotOccs,
4485 : MinOAVolFlow,
4486 : DOASHeatAddRate);
4487 : } else {
4488 6973 : print(state.files.eio,
4489 : Format_991_Zone,
4490 : ZoneName,
4491 : LoadType,
4492 : CalcDesLoad,
4493 : UserDesLoad,
4494 : CalcDesFlow,
4495 : UserDesFlow,
4496 : DesDayName,
4497 : PeakHrMin,
4498 : PeakTemp,
4499 : PeakHumRat,
4500 : FloorArea,
4501 : TotOccs,
4502 : MinOAVolFlow,
4503 : DOASHeatAddRate);
4504 : }
4505 :
4506 : // BSLLC Start
4507 7001 : if (state.dataSQLiteProcedures->sqlite) {
4508 2494 : state.dataSQLiteProcedures->sqlite->addSQLiteZoneSizingRecord(ZoneName,
4509 : LoadType,
4510 : CalcDesLoad,
4511 : UserDesLoad,
4512 : CalcDesFlow,
4513 : UserDesFlow,
4514 : DesDayName,
4515 : PeakHrMin,
4516 : PeakTemp,
4517 : PeakHumRat,
4518 : MinOAVolFlow,
4519 : DOASHeatAddRate);
4520 : }
4521 : // BSLLC Finish
4522 7001 : }
4523 :
4524 : // Writes system sizing data to EIO file using one row per system
4525 1914 : void ReportSysSizing(EnergyPlusData &state,
4526 : std::string const &SysName, // the name of the zone
4527 : std::string_view LoadType, // either "Cooling" or "Heating"
4528 : std::string_view PeakLoadKind, // either "Sensible" or "Total"
4529 : Real64 const UserDesCap, // User Design Capacity
4530 : Real64 const CalcDesVolFlow, // Calculated Design Air Flow Rate
4531 : Real64 const UserDesVolFlow, // User Design Air Flow Rate
4532 : std::string const &DesDayName, // the name of the design day that produced the peak
4533 : std::string const &DesDayDate, // the date that produced the peak
4534 : int const TimeStepIndex // time step of the peak
4535 : )
4536 : {
4537 :
4538 1914 : if (state.dataSizingManager->ReportSysSizingMyOneTimeFlag) {
4539 344 : print(state.files.eio,
4540 : "{}\n",
4541 : "! <System Sizing Information>, System Name, Load Type, Peak Load Kind, User Design Capacity [W], Calc Des Air "
4542 : "Flow Rate [m3/s], User Des Air Flow Rate [m3/s], Design Day Name, Date/Time of Peak");
4543 344 : state.dataSizingManager->ReportSysSizingMyOneTimeFlag = false;
4544 : }
4545 3828 : std::string dateHrMin = DesDayDate + " " + TimeIndexToHrMinString(state, TimeStepIndex);
4546 1914 : print(state.files.eio,
4547 : " System Sizing Information, {}, {}, {}, {:.2R}, {:.5R}, {:.5R}, {}, {}\n",
4548 : SysName,
4549 : LoadType,
4550 : PeakLoadKind,
4551 : UserDesCap,
4552 : CalcDesVolFlow,
4553 : UserDesVolFlow,
4554 : DesDayName,
4555 : dateHrMin);
4556 :
4557 : // BSLLC Start
4558 1914 : if (state.dataSQLiteProcedures->sqlite)
4559 532 : state.dataSQLiteProcedures->sqlite->addSQLiteSystemSizingRecord(
4560 : SysName, LoadType, PeakLoadKind, UserDesCap, CalcDesVolFlow, UserDesVolFlow, DesDayName, dateHrMin);
4561 : // BSLLC Finish
4562 1914 : }
4563 :
4564 : // convert an index for the timestep of the day into a hour minute string in the format 00:00
4565 1914 : std::string TimeIndexToHrMinString(EnergyPlusData &state, int timeIndex)
4566 : {
4567 1914 : int tMinOfDay = timeIndex * state.dataGlobal->MinutesPerTimeStep;
4568 1914 : int tHr = int(tMinOfDay / 60.);
4569 1914 : int tMin = tMinOfDay - tHr * 60;
4570 3828 : return format(PeakHrMinFmt, tHr, tMin);
4571 : }
4572 :
4573 796 : void GetZoneHVACSizing(EnergyPlusData &state)
4574 : {
4575 : // SUBROUTINE INFORMATION:
4576 : // AUTHOR B. Nigusse - FSEC
4577 : // DATE WRITTEN July 2014
4578 : // MODIFIED na
4579 : // RE-ENGINEERED na
4580 :
4581 : // PURPOSE OF THIS SUBROUTINE:
4582 : // Obtains input data for the ZoneHVAC sizing methods object and stores it in
4583 : // appropriate data structure.
4584 :
4585 : // METHODOLOGY EMPLOYED:
4586 : // Uses InputProcessor "Get" routines to obtain data.
4587 : // This object requires only a name where the default values are assumed
4588 : // if subsequent fields are not entered.
4589 :
4590 : // Using/Aliasing
4591 :
4592 : // SUBROUTINE PARAMETER DEFINITIONS:
4593 : static constexpr std::string_view RoutineName("GetZoneHVACSizing: "); // include trailing blank space
4594 :
4595 : // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
4596 :
4597 : int iHeatSAFMAlphaNum; // get input index to Zone HVAC sizing heat supp air flow method
4598 : int iCoolSAFMAlphaNum; // get input index to Zone HVAC sizing cool supp air flow method
4599 : int iMaxCoolAirVolFlowNumericNum; // get input index to Zone HVAC sizing cool supply air flow
4600 : int iMaxHeatAirVolFlowNumericNum; // get input index to Zone HVAC sizing heat supply air flow
4601 : int iNoCoolHeatSAFMAlphaNum; // get input index to Zone HVAC sizing no cool/heat supply air flow
4602 : int iMaxNoCoolHeatAirVolFlowNumericNum; // get input index to Zone HVAC sizing no cool/heat supply air flow
4603 : int iCoolFlowPerFloorAreaNumericNum; // get input index to Zone HVAC sizing cool flow per floor area
4604 : int iCoolFlowPerFracCoolNumericNum; // get input index to Zone HVAC sizing cool flow per fraction cool
4605 : int iCoolFlowPerCoolCapNumericNum; // get input index to Zone HVAC sizing cool flow per cooling cap
4606 : int iHeatFlowPerFloorAreaNumericNum; // get input index to Zone HVAC sizing heat flow per floor area
4607 : int iHeatFlowPerFracCoolNumericNum; // get input index to Zone HVAC sizing heat flow per fraction heat
4608 : int iHeatFlowPerHeatCapNumericNum; // get input index to Zone HVAC sizing heat flow per heating cap
4609 : int iNoCoolHeatFlowPerFloorAreaNumericNum; // get input index to Zone HVAC sizing no cool/heat FPA
4610 : int iNoCoolHeatFlowPerFracCoolNumericNum; // get input index to Zone HVAC sizing no cool/heat FPFC
4611 : int iNoCoolHeatFlowPerFracHeatNumericNum; // get input index to Zone HVAC sizing no cool/heat FPFH
4612 :
4613 : int iCoolCAPMAlphaNum; // get input index to Zone HVAC sizing chilled water flow method
4614 : int iCoolDesignCapacityNumericNum; // get input index to Zone HVAC sizing chilled water flow
4615 : int iCoolCapacityPerFloorAreaNumericNum; // get input index to Zone HVAC sizing cooling capacity per floor area
4616 : int iCoolFracOfAutosizedCapacityNumericNum; // get input index to Zone HVAC sizing capacity as fraction autozized cooling capacity
4617 :
4618 : int iHeatCAPMAlphaNum; // get input index to Zone HVAC sizing heating capacity
4619 : int iHeatDesignCapacityNumericNum; // get input index to Zone HVAC sizing heating design capacity
4620 : int iHeatCapacityPerFloorAreaNumericNum; // get input index to Zone HVAC sizing heating capacity per floor area
4621 : int iHeatFracOfAutosizedCapacityNumericNum; // get input index to Zone HVAC sizing capacity as fraction autozized cooling capacity
4622 :
4623 796 : iCoolSAFMAlphaNum = 2; // get input index to Zone HVAC sizing heat supp air flow method
4624 796 : iMaxCoolAirVolFlowNumericNum = 1; // get input index to Zone HVAC sizing cool supply air flow
4625 796 : iCoolFlowPerFloorAreaNumericNum = 2; // get input index to Zone HVAC sizing cool flow per floor area
4626 796 : iCoolFlowPerFracCoolNumericNum = 3; // get input index to Zone HVAC sizing cool flow per fraction cool
4627 796 : iCoolFlowPerCoolCapNumericNum = 4; // get input index to Zone HVAC sizing cool flow per cooling cap
4628 :
4629 796 : iNoCoolHeatSAFMAlphaNum = 3; // get input index to Zone HVAC sizing no cool/heat supply air flow
4630 796 : iMaxNoCoolHeatAirVolFlowNumericNum = 5; // get input index to Zone HVAC sizing no cool/heat supply air flow
4631 796 : iNoCoolHeatFlowPerFloorAreaNumericNum = 6; // get input index to Zone HVAC sizing no cool/heat FPA
4632 796 : iNoCoolHeatFlowPerFracCoolNumericNum = 7; // get input index to Zone HVAC sizing no cool/heat FPFC
4633 796 : iNoCoolHeatFlowPerFracHeatNumericNum = 8; // get input index to Zone HVAC sizing no cool/heat FPFH
4634 :
4635 796 : iHeatSAFMAlphaNum = 4; // get input index to Zone HVAC sizing cool supp air flow method
4636 796 : iMaxHeatAirVolFlowNumericNum = 9; // get input index to Zone HVAC sizing heat supply air flow
4637 796 : iHeatFlowPerFloorAreaNumericNum = 10; // get input index to Zone HVAC sizing heat flow per floor area
4638 796 : iHeatFlowPerFracCoolNumericNum = 11; // get input index to Zone HVAC sizing heat flow per fraction heat
4639 796 : iHeatFlowPerHeatCapNumericNum = 12; // get input index to Zone HVAC sizing heat flow per heating cap
4640 :
4641 796 : iCoolCAPMAlphaNum = 5; // get input index to Zone HVAC sizing cooling design capacity method
4642 796 : iCoolDesignCapacityNumericNum = 13; // get input index to Zone HVAC sizing cooling design capacity
4643 796 : iCoolCapacityPerFloorAreaNumericNum = 14; // get input index to Zone HVAC sizing cooling design capacity per floor area
4644 796 : iCoolFracOfAutosizedCapacityNumericNum = 15; // get input index to Zone HVAC sizing as a fraction of cooling design capacity
4645 :
4646 796 : iHeatCAPMAlphaNum = 6; // get input index to Zone HVAC sizing heating capacity
4647 796 : iHeatDesignCapacityNumericNum = 16; // get input index to Zone HVAC sizing heating design capacity
4648 796 : iHeatCapacityPerFloorAreaNumericNum = 17; // get input index to Zone HVAC sizing heating capacity per floor area
4649 796 : iHeatFracOfAutosizedCapacityNumericNum = 18; // get input index to Zone HVAC sizing capacity as fraction autozized heating capacity
4650 :
4651 : int NumAlphas; // Number of Alphas for each GetObjectItem call
4652 : int NumNumbers; // Number of Numbers for each GetObjectItem call
4653 : int TotalArgs; // Total number of alpha and numeric arguments (max) for a
4654 : int IOStatus; // Used in GetObjectItem
4655 : int zSIndex; // index of "DesignSpecification:ZoneHVAC:Sizing" objects
4656 796 : bool ErrorsFound(false); // If errors detected in input
4657 : // REAL(r64) :: CalcAmt
4658 :
4659 796 : std::string CurrentModuleObject; // for ease in getting objects
4660 796 : Array1D_string Alphas; // Alpha input items for object
4661 796 : Array1D_string cAlphaFields; // Alpha field names
4662 796 : Array1D_string cNumericFields; // Numeric field names
4663 796 : Array1D<Real64> Numbers; // Numeric input items for object
4664 796 : Array1D_bool lAlphaBlanks; // Logical array, alpha field input BLANK = .TRUE.
4665 796 : Array1D_bool lNumericBlanks; // Logical array, numeric field input BLANK = .TRUE.
4666 :
4667 796 : CurrentModuleObject = "DesignSpecification:ZoneHVAC:Sizing";
4668 796 : state.dataSize->NumZoneHVACSizing = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, CurrentModuleObject);
4669 796 : state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, CurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
4670 :
4671 796 : Alphas.allocate(NumAlphas);
4672 796 : cAlphaFields.allocate(NumAlphas);
4673 796 : cNumericFields.allocate(NumNumbers);
4674 796 : Numbers.dimension(NumNumbers, 0.0);
4675 796 : lAlphaBlanks.dimension(NumAlphas, true);
4676 796 : lNumericBlanks.dimension(NumNumbers, true);
4677 :
4678 796 : if (state.dataSize->NumZoneHVACSizing > 0) {
4679 1 : state.dataSize->ZoneHVACSizing.allocate(state.dataSize->NumZoneHVACSizing);
4680 :
4681 : // Start Loading the System Input
4682 4 : for (zSIndex = 1; zSIndex <= state.dataSize->NumZoneHVACSizing; ++zSIndex) {
4683 :
4684 3 : Alphas = "";
4685 3 : cAlphaFields = "";
4686 3 : cNumericFields = "";
4687 3 : Numbers = 0;
4688 3 : lAlphaBlanks = true;
4689 3 : lNumericBlanks = true;
4690 :
4691 3 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
4692 : CurrentModuleObject,
4693 : zSIndex,
4694 : Alphas,
4695 : NumAlphas,
4696 : Numbers,
4697 : NumNumbers,
4698 : IOStatus,
4699 : lNumericBlanks,
4700 : lAlphaBlanks,
4701 : cAlphaFields,
4702 : cNumericFields);
4703 3 : Util::IsNameEmpty(state, Alphas(1), CurrentModuleObject, ErrorsFound);
4704 :
4705 3 : state.dataSize->ZoneHVACSizing(zSIndex).Name = Alphas(1);
4706 :
4707 : // Determine supply air flow rate sizing method for cooling mode
4708 3 : if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "SupplyAirFlowRate")) {
4709 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = SupplyAirFlowRate;
4710 :
4711 1 : if (!lNumericBlanks(iMaxCoolAirVolFlowNumericNum)) {
4712 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iMaxCoolAirVolFlowNumericNum);
4713 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize)
4714 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4715 2 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
4716 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
4717 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4718 0 : ShowContinueError(
4719 : state,
4720 0 : format("Illegal {} = {:.7T}", cNumericFields(iMaxCoolAirVolFlowNumericNum), Numbers(iMaxCoolAirVolFlowNumericNum)));
4721 0 : ErrorsFound = true;
4722 : }
4723 : } else {
4724 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4725 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4726 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxCoolAirVolFlowNumericNum)));
4727 0 : ErrorsFound = true;
4728 : }
4729 2 : } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerFloorArea")) {
4730 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerFloorArea;
4731 1 : if (!lNumericBlanks(iCoolFlowPerFloorAreaNumericNum)) {
4732 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFloorAreaNumericNum);
4733 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
4734 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
4735 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4736 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4737 0 : ShowContinueError(
4738 : state,
4739 0 : format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerFloorAreaNumericNum), Numbers(iCoolFlowPerFloorAreaNumericNum)));
4740 0 : ErrorsFound = true;
4741 : // Autosized input is not allowed
4742 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
4743 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4744 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4745 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerFloorAreaNumericNum)));
4746 0 : ErrorsFound = true;
4747 : } else {
4748 : // user input cooling supply air flow per unit conditioned area is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
4749 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4750 : }
4751 : } else {
4752 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4753 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4754 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFloorAreaNumericNum)));
4755 0 : ErrorsFound = true;
4756 : }
4757 1 : } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) {
4758 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FractionOfAutosizedCoolingAirflow;
4759 1 : if (!lNumericBlanks(iCoolFlowPerFracCoolNumericNum)) {
4760 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerFracCoolNumericNum);
4761 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
4762 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
4763 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4764 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4765 0 : ShowContinueError(
4766 : state,
4767 0 : format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerFracCoolNumericNum), Numbers(iCoolFlowPerFracCoolNumericNum)));
4768 0 : ErrorsFound = true;
4769 : // Autosized input is not allowed
4770 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
4771 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4772 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4773 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerFracCoolNumericNum)));
4774 0 : ErrorsFound = true;
4775 : } else {
4776 : // user input fraction of cooling supply air flow rate is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
4777 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4778 : }
4779 : } else {
4780 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4781 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4782 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerFracCoolNumericNum)));
4783 0 : ErrorsFound = true;
4784 : }
4785 0 : } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "FlowPerCoolingCapacity")) {
4786 :
4787 0 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = FlowPerCoolingCapacity;
4788 0 : if (!lNumericBlanks(iCoolFlowPerCoolCapNumericNum)) {
4789 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = Numbers(iCoolFlowPerCoolCapNumericNum);
4790 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow <= 0.0 &&
4791 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow != AutoSize) {
4792 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4793 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4794 0 : ShowContinueError(
4795 : state,
4796 0 : format("Illegal {} = {:.7T}", cNumericFields(iCoolFlowPerCoolCapNumericNum), Numbers(iCoolFlowPerCoolCapNumericNum)));
4797 0 : ErrorsFound = true;
4798 : // Autosized input is not allowed
4799 0 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow == AutoSize) {
4800 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4801 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4802 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolFlowPerCoolCapNumericNum)));
4803 0 : ErrorsFound = true;
4804 : } else {
4805 : // user input cooling supply air flow per unit cooling capacity is saved in ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow
4806 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4807 : }
4808 : } else {
4809 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4810 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4811 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFlowPerCoolCapNumericNum)));
4812 0 : ErrorsFound = true;
4813 : }
4814 0 : } else if (Util::SameString(Alphas(iCoolSAFMAlphaNum), "None") || lAlphaBlanks(iCoolSAFMAlphaNum)) {
4815 0 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingSAFMethod = None;
4816 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxCoolAirVolFlow = 0.0;
4817 : // cooling supply air flow rate will not be sized, may be cooling coil does not exist
4818 : } else {
4819 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4820 0 : ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iCoolSAFMAlphaNum), Alphas(iCoolSAFMAlphaNum)));
4821 0 : ErrorsFound = true;
4822 : }
4823 : // Determine supply air flow rate sizing method for heating mode
4824 3 : if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
4825 1 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = SupplyAirFlowRate;
4826 1 : if (!lNumericBlanks(iMaxHeatAirVolFlowNumericNum)) {
4827 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iMaxHeatAirVolFlowNumericNum);
4828 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize)
4829 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4830 :
4831 2 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
4832 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
4833 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4834 0 : ShowContinueError(
4835 : state,
4836 0 : format("Illegal {} = {:.7T}", cNumericFields(iMaxHeatAirVolFlowNumericNum), Numbers(iMaxHeatAirVolFlowNumericNum)));
4837 0 : ErrorsFound = true;
4838 : }
4839 : } else {
4840 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4841 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4842 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxHeatAirVolFlowNumericNum)));
4843 0 : ErrorsFound = true;
4844 : }
4845 2 : } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerFloorArea")) {
4846 1 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerFloorArea;
4847 1 : if (!lNumericBlanks(iHeatFlowPerFloorAreaNumericNum)) {
4848 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFloorAreaNumericNum);
4849 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
4850 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
4851 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4852 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4853 0 : ShowContinueError(
4854 : state,
4855 0 : format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerFloorAreaNumericNum), Numbers(iHeatFlowPerFloorAreaNumericNum)));
4856 0 : ErrorsFound = true;
4857 : // Autosized input is not allowed
4858 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
4859 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4860 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4861 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerFloorAreaNumericNum)));
4862 0 : ErrorsFound = true;
4863 : } else {
4864 : // user input heating supply air flow per unit conditioned area is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
4865 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4866 : }
4867 : } else {
4868 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4869 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4870 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFloorAreaNumericNum)));
4871 0 : ErrorsFound = true;
4872 : }
4873 1 : } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) {
4874 1 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FractionOfAutosizedHeatingAirflow;
4875 1 : if (!lNumericBlanks(iHeatFlowPerFracCoolNumericNum)) {
4876 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerFracCoolNumericNum);
4877 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
4878 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
4879 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4880 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4881 0 : ShowContinueError(
4882 : state,
4883 0 : format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerFracCoolNumericNum), Numbers(iHeatFlowPerFracCoolNumericNum)));
4884 0 : ErrorsFound = true;
4885 : // Autosized input is not allowed
4886 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
4887 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4888 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4889 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerFracCoolNumericNum)));
4890 0 : ErrorsFound = true;
4891 : } else {
4892 : // user input fraction of heating supply air flow rate is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
4893 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4894 : }
4895 : } else {
4896 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4897 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4898 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerFracCoolNumericNum)));
4899 0 : ErrorsFound = true;
4900 : }
4901 0 : } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "FlowPerHeatingCapacity")) {
4902 0 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = FlowPerHeatingCapacity;
4903 0 : if (!lNumericBlanks(iHeatFlowPerHeatCapNumericNum)) {
4904 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = Numbers(iHeatFlowPerHeatCapNumericNum);
4905 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow <= 0.0 &&
4906 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow != AutoSize) {
4907 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4908 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4909 0 : ShowContinueError(
4910 : state,
4911 0 : format("Illegal {} = {:.7T}", cNumericFields(iHeatFlowPerHeatCapNumericNum), Numbers(iHeatFlowPerHeatCapNumericNum)));
4912 0 : ErrorsFound = true;
4913 : // Autosized input is not allowed
4914 0 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow == AutoSize) {
4915 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4916 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4917 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatFlowPerHeatCapNumericNum)));
4918 0 : ErrorsFound = true;
4919 : } else {
4920 : // user input heating supply air flow per unit heating capacity is saved in ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow
4921 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4922 : }
4923 : } else {
4924 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4925 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4926 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFlowPerHeatCapNumericNum)));
4927 0 : ErrorsFound = true;
4928 : }
4929 0 : } else if (Util::SameString(Alphas(iHeatSAFMAlphaNum), "None") || lAlphaBlanks(iHeatSAFMAlphaNum)) {
4930 0 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingSAFMethod = None;
4931 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxHeatAirVolFlow = 0.0;
4932 : } else {
4933 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4934 0 : ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iHeatSAFMAlphaNum), Alphas(iHeatSAFMAlphaNum)));
4935 0 : ErrorsFound = true;
4936 : }
4937 :
4938 : // Determine supply air flow rate sizing method when cooling or heating is not needed
4939 3 : if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "SupplyAirFlowRate")) {
4940 2 : state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = SupplyAirFlowRate;
4941 2 : if (!lNumericBlanks(iMaxNoCoolHeatAirVolFlowNumericNum)) {
4942 2 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iMaxNoCoolHeatAirVolFlowNumericNum);
4943 2 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize)
4944 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4945 3 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
4946 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
4947 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4948 0 : ShowContinueError(state,
4949 0 : format("Illegal {} = {:.7T}",
4950 : cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum),
4951 : Numbers(iMaxNoCoolHeatAirVolFlowNumericNum)));
4952 0 : ErrorsFound = true;
4953 : }
4954 : } else {
4955 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4956 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
4957 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iMaxNoCoolHeatAirVolFlowNumericNum)));
4958 0 : ErrorsFound = true;
4959 : }
4960 1 : } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FlowPerFloorArea")) {
4961 1 : state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FlowPerFloorArea;
4962 1 : if (!lNumericBlanks(iNoCoolHeatFlowPerFloorAreaNumericNum)) {
4963 1 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum);
4964 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
4965 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
4966 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4967 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
4968 0 : ShowContinueError(state,
4969 0 : format("Illegal {} = {:.7T}",
4970 : cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum),
4971 : Numbers(iNoCoolHeatFlowPerFloorAreaNumericNum)));
4972 0 : ErrorsFound = true;
4973 : // Autosized input is not allowed
4974 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
4975 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4976 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
4977 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum)));
4978 0 : ErrorsFound = true;
4979 : } else {
4980 : // user input supply air flow per unit floor area during no cooling or heating area is saved in
4981 : // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
4982 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
4983 : }
4984 : } else {
4985 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4986 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
4987 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFloorAreaNumericNum)));
4988 0 : ErrorsFound = true;
4989 : }
4990 0 : } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedCoolingAirflow")) {
4991 0 : state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedCoolingAirflow;
4992 0 : if (!lNumericBlanks(iNoCoolHeatFlowPerFracCoolNumericNum)) {
4993 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracCoolNumericNum);
4994 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
4995 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
4996 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
4997 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
4998 0 : ShowContinueError(state,
4999 0 : format("Illegal {} = {:.7T}",
5000 : cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum),
5001 : Numbers(iNoCoolHeatFlowPerFracCoolNumericNum)));
5002 0 : ErrorsFound = true;
5003 : // Autosized input is not allowed
5004 0 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
5005 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5006 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5007 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum)));
5008 0 : ErrorsFound = true;
5009 : } else {
5010 : // user input frcation of cooling supply air flow rate during no cooling or heating area is saved in
5011 : // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
5012 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5013 : }
5014 : } else {
5015 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5016 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5017 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracCoolNumericNum)));
5018 0 : ErrorsFound = true;
5019 : }
5020 0 : } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "FractionOfAutosizedHeatingAirflow")) {
5021 0 : state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = FractionOfAutosizedHeatingAirflow;
5022 0 : if (!lNumericBlanks(iNoCoolHeatFlowPerFracHeatNumericNum)) {
5023 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = Numbers(iNoCoolHeatFlowPerFracHeatNumericNum);
5024 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow < 0.0 &&
5025 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow != AutoSize) {
5026 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5027 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5028 0 : ShowContinueError(state,
5029 0 : format("Illegal {} = {:.7T}",
5030 : cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum),
5031 : Numbers(iNoCoolHeatFlowPerFracHeatNumericNum)));
5032 0 : ErrorsFound = true;
5033 : // Autosized input is not allowed
5034 0 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow == AutoSize) {
5035 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5036 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5037 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum)));
5038 0 : ErrorsFound = true;
5039 : } else {
5040 : // user input frcation of heating supply air flow rate during no cooling or heating area is saved in
5041 : // ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow
5042 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5043 : }
5044 : } else {
5045 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5046 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5047 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iNoCoolHeatFlowPerFracHeatNumericNum)));
5048 0 : ErrorsFound = true;
5049 : }
5050 0 : } else if (Util::SameString(Alphas(iNoCoolHeatSAFMAlphaNum), "None") || lAlphaBlanks(iNoCoolHeatSAFMAlphaNum)) {
5051 0 : state.dataSize->ZoneHVACSizing(zSIndex).NoCoolHeatSAFMethod = None;
5052 0 : state.dataSize->ZoneHVACSizing(zSIndex).MaxNoCoolHeatAirVolFlow = 0.0;
5053 : } else {
5054 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5055 0 : ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iNoCoolHeatSAFMAlphaNum), Alphas(iNoCoolHeatSAFMAlphaNum)));
5056 0 : ErrorsFound = true;
5057 : }
5058 :
5059 : // Determine cooling design capacity of zoneHVAC equipment
5060 3 : if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CoolingDesignCapacity")) {
5061 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CoolingDesignCapacity;
5062 1 : if (!lNumericBlanks(iCoolDesignCapacityNumericNum)) {
5063 1 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolDesignCapacityNumericNum);
5064 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize)
5065 1 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5066 2 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 &&
5067 1 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
5068 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5069 0 : ShowContinueError(
5070 : state,
5071 0 : format("Illegal {} = {:.7T}", cNumericFields(iCoolDesignCapacityNumericNum), Numbers(iCoolDesignCapacityNumericNum)));
5072 0 : ErrorsFound = true;
5073 : }
5074 : } else {
5075 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5076 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5077 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolDesignCapacityNumericNum)));
5078 0 : ErrorsFound = true;
5079 : }
5080 2 : } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "CapacityPerFloorArea")) {
5081 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = CapacityPerFloorArea;
5082 1 : if (!lNumericBlanks(iCoolCapacityPerFloorAreaNumericNum)) {
5083 1 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolCapacityPerFloorAreaNumericNum);
5084 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity <= 0.0) {
5085 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5086 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5087 0 : ShowContinueError(state,
5088 0 : format("Illegal {} = {:.7T}",
5089 : cNumericFields(iCoolCapacityPerFloorAreaNumericNum),
5090 : Numbers(iCoolCapacityPerFloorAreaNumericNum)));
5091 0 : ErrorsFound = true;
5092 : // Autosized input is not allowed
5093 1 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize) {
5094 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5095 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5096 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iCoolCapacityPerFloorAreaNumericNum)));
5097 0 : ErrorsFound = true;
5098 : }
5099 : } else {
5100 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5101 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5102 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolCapacityPerFloorAreaNumericNum)));
5103 0 : ErrorsFound = true;
5104 : }
5105 1 : } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "FractionOfAutosizedCoolingCapacity")) {
5106 1 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = FractionOfAutosizedCoolingCapacity;
5107 1 : if (!lNumericBlanks(iCoolFracOfAutosizedCapacityNumericNum)) {
5108 1 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity = Numbers(iCoolFracOfAutosizedCapacityNumericNum);
5109 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity == AutoSize)
5110 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5111 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity < 0.0 &&
5112 0 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
5113 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5114 0 : ShowContinueError(state,
5115 0 : format("Illegal {} = {:.7T}",
5116 : cNumericFields(iCoolFracOfAutosizedCapacityNumericNum),
5117 : Numbers(iCoolFracOfAutosizedCapacityNumericNum)));
5118 0 : ErrorsFound = true;
5119 : }
5120 : } else {
5121 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5122 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5123 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iCoolFracOfAutosizedCapacityNumericNum)));
5124 0 : ErrorsFound = true;
5125 : }
5126 0 : } else if (Util::SameString(Alphas(iCoolCAPMAlphaNum), "None") || lAlphaBlanks(iCoolCAPMAlphaNum)) {
5127 0 : state.dataSize->ZoneHVACSizing(zSIndex).CoolingCapMethod = None;
5128 : } else {
5129 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5130 0 : ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iCoolCAPMAlphaNum), Alphas(iCoolCAPMAlphaNum)));
5131 0 : ErrorsFound = true;
5132 : }
5133 :
5134 : // Determine heating design capacity of zone HVAC equipment
5135 3 : if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "HeatingDesignCapacity")) {
5136 0 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = HeatingDesignCapacity;
5137 0 : if (!lNumericBlanks(iHeatDesignCapacityNumericNum)) {
5138 0 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatDesignCapacityNumericNum);
5139 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize)
5140 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5141 0 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 &&
5142 0 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity != AutoSize) {
5143 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5144 0 : ShowContinueError(
5145 : state,
5146 0 : format("Illegal {} = {:.7T}", cNumericFields(iHeatDesignCapacityNumericNum), Numbers(iHeatDesignCapacityNumericNum)));
5147 0 : ErrorsFound = true;
5148 : }
5149 : } else {
5150 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5151 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5152 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatDesignCapacityNumericNum)));
5153 0 : ErrorsFound = true;
5154 : }
5155 3 : } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "CapacityPerFloorArea")) {
5156 2 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = CapacityPerFloorArea;
5157 2 : if (!lNumericBlanks(iHeatCapacityPerFloorAreaNumericNum)) {
5158 2 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatCapacityPerFloorAreaNumericNum);
5159 2 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity <= 0.0) {
5160 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5161 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5162 0 : ShowContinueError(state,
5163 0 : format("Illegal {} = {:.7T}",
5164 : cNumericFields(iHeatCapacityPerFloorAreaNumericNum),
5165 : Numbers(iHeatCapacityPerFloorAreaNumericNum)));
5166 0 : ErrorsFound = true;
5167 : // Autosized input is not allowed
5168 2 : } else if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize) {
5169 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5170 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5171 0 : ShowContinueError(state, format("Illegal {} = Autosize", cNumericFields(iHeatCapacityPerFloorAreaNumericNum)));
5172 0 : ErrorsFound = true;
5173 : }
5174 : } else {
5175 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5176 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5177 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatCapacityPerFloorAreaNumericNum)));
5178 0 : ErrorsFound = true;
5179 : }
5180 1 : } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "FractionOfAutosizedHeatingCapacity")) {
5181 1 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = FractionOfAutosizedHeatingCapacity;
5182 1 : if (!lNumericBlanks(iHeatFracOfAutosizedCapacityNumericNum)) {
5183 1 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity = Numbers(iHeatFracOfAutosizedCapacityNumericNum);
5184 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity == AutoSize)
5185 0 : state.dataSize->ZoneHVACSizing(zSIndex).RequestAutoSize = true;
5186 1 : if (state.dataSize->ZoneHVACSizing(zSIndex).ScaledHeatingCapacity < 0.0 &&
5187 0 : state.dataSize->ZoneHVACSizing(zSIndex).ScaledCoolingCapacity != AutoSize) {
5188 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5189 0 : ShowContinueError(state,
5190 0 : format("Illegal {} = {:.7T}",
5191 : cNumericFields(iHeatFracOfAutosizedCapacityNumericNum),
5192 : Numbers(iHeatFracOfAutosizedCapacityNumericNum)));
5193 0 : ErrorsFound = true;
5194 : }
5195 : } else {
5196 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5197 0 : ShowContinueError(state, format("Input for {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5198 0 : ShowContinueError(state, format("Blank field not allowed for {}", cNumericFields(iHeatFracOfAutosizedCapacityNumericNum)));
5199 0 : ErrorsFound = true;
5200 : }
5201 0 : } else if (Util::SameString(Alphas(iHeatCAPMAlphaNum), "None") || lAlphaBlanks(iHeatCAPMAlphaNum)) {
5202 0 : state.dataSize->ZoneHVACSizing(zSIndex).HeatingCapMethod = None;
5203 : } else {
5204 0 : ShowSevereError(state, format("{} = {}", CurrentModuleObject, state.dataSize->ZoneHVACSizing(zSIndex).Name));
5205 0 : ShowContinueError(state, format("Illegal {} = {}", cAlphaFields(iHeatCAPMAlphaNum), Alphas(iHeatCAPMAlphaNum)));
5206 0 : ErrorsFound = true;
5207 : }
5208 : }
5209 : }
5210 :
5211 796 : Alphas.deallocate();
5212 796 : cAlphaFields.deallocate();
5213 796 : cNumericFields.deallocate();
5214 796 : Numbers.deallocate();
5215 796 : lAlphaBlanks.deallocate();
5216 796 : lNumericBlanks.deallocate();
5217 :
5218 796 : if (ErrorsFound) {
5219 0 : ShowFatalError(state, format("{}Errors found in input. Preceding condition(s) cause termination.", RoutineName));
5220 : }
5221 796 : }
5222 :
5223 796 : void GetAirTerminalSizing(EnergyPlusData &state)
5224 : {
5225 : // SUBROUTINE INFORMATION:
5226 : // AUTHOR M.J. Witte
5227 : // DATE WRITTEN February 2017
5228 :
5229 : // PURPOSE OF THIS SUBROUTINE:
5230 : // Obtains input data for the AirTerminal sizing methods object and stores it in
5231 : // appropriate data structure.
5232 :
5233 : static constexpr std::string_view RoutineName("GetAirTerminalSizing: "); // include trailing blank space
5234 :
5235 : int NumAlphas; // Number of Alphas for each GetObjectItem call
5236 : int NumNumbers; // Number of Numbers for each GetObjectItem call
5237 : int TotalArgs; // Total number of alpha and numeric arguments (max) for a
5238 : int IOStatus; // Used in GetObjectItem
5239 796 : bool ErrorsFound(false); // If errors detected in input
5240 796 : auto &cCurrentModuleObject = state.dataIPShortCut->cCurrentModuleObject;
5241 796 : cCurrentModuleObject = "DesignSpecification:AirTerminal:Sizing";
5242 796 : state.dataSize->NumAirTerminalSizingSpec = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
5243 796 : state.dataInputProcessing->inputProcessor->getObjectDefMaxArgs(state, cCurrentModuleObject, TotalArgs, NumAlphas, NumNumbers);
5244 :
5245 796 : if (state.dataSize->NumAirTerminalSizingSpec > 0) {
5246 8 : state.dataSize->AirTerminalSizingSpec.allocate(state.dataSize->NumAirTerminalSizingSpec);
5247 :
5248 : // Start Loading the System Input
5249 24 : for (int zSIndex = 1; zSIndex <= state.dataSize->NumAirTerminalSizingSpec; ++zSIndex) {
5250 :
5251 32 : state.dataInputProcessing->inputProcessor->getObjectItem(state,
5252 : cCurrentModuleObject,
5253 : zSIndex,
5254 16 : state.dataIPShortCut->cAlphaArgs,
5255 : NumAlphas,
5256 16 : state.dataIPShortCut->rNumericArgs,
5257 : NumNumbers,
5258 : IOStatus,
5259 16 : state.dataIPShortCut->lNumericFieldBlanks,
5260 16 : state.dataIPShortCut->lAlphaFieldBlanks,
5261 16 : state.dataIPShortCut->cAlphaFieldNames,
5262 16 : state.dataIPShortCut->cNumericFieldNames);
5263 :
5264 16 : Util::IsNameEmpty(state, state.dataIPShortCut->cAlphaArgs(1), cCurrentModuleObject, ErrorsFound);
5265 :
5266 16 : auto &thisATSizing = state.dataSize->AirTerminalSizingSpec(zSIndex);
5267 16 : thisATSizing.Name = state.dataIPShortCut->cAlphaArgs(1);
5268 16 : thisATSizing.DesSensCoolingFrac = state.dataIPShortCut->rNumericArgs(1);
5269 16 : thisATSizing.DesCoolSATRatio = state.dataIPShortCut->rNumericArgs(2);
5270 16 : thisATSizing.DesSensHeatingFrac = state.dataIPShortCut->rNumericArgs(3);
5271 16 : thisATSizing.DesHeatSATRatio = state.dataIPShortCut->rNumericArgs(4);
5272 16 : thisATSizing.MinOAFrac = state.dataIPShortCut->rNumericArgs(5);
5273 : }
5274 : }
5275 :
5276 796 : if (ErrorsFound) {
5277 0 : ShowFatalError(state, format("{}Errors found in input. Preceding condition(s) cause termination.", RoutineName));
5278 : }
5279 796 : }
5280 :
5281 : // Update the sizing for the entire facilty to gather values for reporting - Glazer January 2017
5282 140366 : void UpdateFacilitySizing([[maybe_unused]] EnergyPlusData &state, Constant::CallIndicator const CallIndicator)
5283 : {
5284 140366 : int NumOfTimeStepInDay = state.dataGlobal->NumOfTimeStepInHour * 24;
5285 :
5286 140366 : auto &CalcFacilitySizing = state.dataSize->CalcFacilitySizing;
5287 140366 : auto &CalcFinalFacilitySizing = state.dataSize->CalcFinalFacilitySizing;
5288 :
5289 : // test if allocated here
5290 140366 : if (!CalcFacilitySizing.allocated()) {
5291 422 : CalcFacilitySizing.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays);
5292 1328 : for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
5293 906 : CalcFacilitySizing(DDNum).DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
5294 906 : CalcFacilitySizing(DDNum).DOASLatAddSeq.allocate(NumOfTimeStepInDay);
5295 906 : CalcFacilitySizing(DDNum).CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
5296 906 : CalcFacilitySizing(DDNum).CoolOutTempSeq.allocate(NumOfTimeStepInDay);
5297 906 : CalcFacilitySizing(DDNum).CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
5298 906 : CalcFacilitySizing(DDNum).CoolLoadSeq.allocate(NumOfTimeStepInDay);
5299 906 : CalcFacilitySizing(DDNum).HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
5300 906 : CalcFacilitySizing(DDNum).HeatOutTempSeq.allocate(NumOfTimeStepInDay);
5301 906 : CalcFacilitySizing(DDNum).HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
5302 906 : CalcFacilitySizing(DDNum).HeatLoadSeq.allocate(NumOfTimeStepInDay);
5303 :
5304 906 : CalcFacilitySizing(DDNum).DOASHeatAddSeq = 0.;
5305 906 : CalcFacilitySizing(DDNum).DOASLatAddSeq = 0.;
5306 906 : CalcFacilitySizing(DDNum).CoolOutHumRatSeq = 0.;
5307 906 : CalcFacilitySizing(DDNum).CoolOutTempSeq = 0.;
5308 906 : CalcFacilitySizing(DDNum).CoolZoneTempSeq = 0.;
5309 906 : CalcFacilitySizing(DDNum).CoolLoadSeq = 0.;
5310 906 : CalcFacilitySizing(DDNum).HeatOutHumRatSeq = 0.;
5311 906 : CalcFacilitySizing(DDNum).HeatOutTempSeq = 0.;
5312 906 : CalcFacilitySizing(DDNum).HeatZoneTempSeq = 0.;
5313 906 : CalcFacilitySizing(DDNum).HeatLoadSeq = 0.;
5314 : }
5315 : }
5316 140366 : if (!CalcFinalFacilitySizing.DOASHeatAddSeq.allocated()) {
5317 422 : CalcFinalFacilitySizing.DOASHeatAddSeq.allocate(NumOfTimeStepInDay);
5318 422 : CalcFinalFacilitySizing.DOASLatAddSeq.allocate(NumOfTimeStepInDay);
5319 422 : CalcFinalFacilitySizing.CoolOutHumRatSeq.allocate(NumOfTimeStepInDay);
5320 422 : CalcFinalFacilitySizing.CoolOutTempSeq.allocate(NumOfTimeStepInDay);
5321 422 : CalcFinalFacilitySizing.CoolZoneTempSeq.allocate(NumOfTimeStepInDay);
5322 422 : CalcFinalFacilitySizing.CoolLoadSeq.allocate(NumOfTimeStepInDay);
5323 422 : CalcFinalFacilitySizing.HeatOutHumRatSeq.allocate(NumOfTimeStepInDay);
5324 422 : CalcFinalFacilitySizing.HeatOutTempSeq.allocate(NumOfTimeStepInDay);
5325 422 : CalcFinalFacilitySizing.HeatZoneTempSeq.allocate(NumOfTimeStepInDay);
5326 422 : CalcFinalFacilitySizing.HeatLoadSeq.allocate(NumOfTimeStepInDay);
5327 :
5328 422 : CalcFinalFacilitySizing.DOASHeatAddSeq = 0.;
5329 422 : CalcFinalFacilitySizing.DOASLatAddSeq = 0.;
5330 422 : CalcFinalFacilitySizing.CoolOutHumRatSeq = 0.;
5331 422 : CalcFinalFacilitySizing.CoolOutTempSeq = 0.;
5332 422 : CalcFinalFacilitySizing.CoolZoneTempSeq = 0.;
5333 422 : CalcFinalFacilitySizing.CoolLoadSeq = 0.;
5334 422 : CalcFinalFacilitySizing.HeatOutHumRatSeq = 0.;
5335 422 : CalcFinalFacilitySizing.HeatOutTempSeq = 0.;
5336 422 : CalcFinalFacilitySizing.HeatZoneTempSeq = 0.;
5337 422 : CalcFinalFacilitySizing.HeatLoadSeq = 0.;
5338 : }
5339 140366 : if (CallIndicator == Constant::CallIndicator::BeginDay) {
5340 960 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatDDNum = state.dataSize->CurOverallSimDay;
5341 960 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolDDNum = state.dataSize->CurOverallSimDay;
5342 139406 : } else if (CallIndicator == Constant::CallIndicator::DuringDay) {
5343 137070 : int TimeStepInDay = (state.dataGlobal->HourOfDay - 1) * state.dataGlobal->NumOfTimeStepInHour + state.dataGlobal->TimeStep;
5344 : // save the results of the ideal zone component calculation in the CalcZoneSizing sequence variables
5345 137070 : Real64 sumCoolLoad = 0.;
5346 137070 : Real64 sumHeatLoad = 0.;
5347 137070 : Real64 wghtdCoolZoneTemp = 0.;
5348 137070 : Real64 wghtdHeatZoneTemp = 0.;
5349 137070 : Real64 wghtdCoolHumRat = 0.;
5350 137070 : Real64 wghtdHeatHumRat = 0.;
5351 137070 : Real64 wghtdCoolDOASHeatAdd = 0.;
5352 137070 : Real64 wghtdCoolDOASLatAdd = 0.;
5353 1423243 : for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) {
5354 1286173 : if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue;
5355 1134837 : auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, CtrlZoneNum);
5356 1134837 : Real64 curCoolLoad = thisCalcZoneSizing.CoolLoadSeq(TimeStepInDay);
5357 1134837 : if (curCoolLoad > 0.0) {
5358 505811 : sumCoolLoad += curCoolLoad;
5359 505811 : wghtdCoolZoneTemp += thisCalcZoneSizing.CoolZoneTempSeq(TimeStepInDay) * curCoolLoad;
5360 505811 : wghtdCoolHumRat += thisCalcZoneSizing.CoolZoneHumRatSeq(TimeStepInDay) * curCoolLoad;
5361 505811 : wghtdCoolDOASHeatAdd += thisCalcZoneSizing.DOASHeatAddSeq(TimeStepInDay) * curCoolLoad;
5362 505811 : wghtdCoolDOASLatAdd += thisCalcZoneSizing.DOASLatAddSeq(TimeStepInDay) * curCoolLoad;
5363 : }
5364 1134837 : Real64 curHeatLoad = thisCalcZoneSizing.HeatLoadSeq(TimeStepInDay);
5365 1134837 : if (curHeatLoad > 0.0) {
5366 469141 : sumHeatLoad += curHeatLoad;
5367 469141 : wghtdHeatZoneTemp += thisCalcZoneSizing.HeatZoneTempSeq(TimeStepInDay) * curHeatLoad;
5368 469141 : wghtdHeatHumRat += thisCalcZoneSizing.HeatZoneHumRatSeq(TimeStepInDay) * curHeatLoad;
5369 : }
5370 : }
5371 :
5372 137070 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepInDay) = sumCoolLoad;
5373 137070 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepInDay) = sumHeatLoad;
5374 :
5375 137070 : if (sumCoolLoad != 0.) {
5376 61229 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolZoneTempSeq(TimeStepInDay) = wghtdCoolZoneTemp / sumCoolLoad;
5377 61229 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolOutHumRatSeq(TimeStepInDay) = wghtdCoolHumRat / sumCoolLoad;
5378 61229 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASHeatAddSeq(TimeStepInDay) = wghtdCoolDOASHeatAdd / sumCoolLoad;
5379 61229 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DOASLatAddSeq(TimeStepInDay) = wghtdCoolDOASLatAdd / sumCoolLoad;
5380 : }
5381 137070 : if (sumHeatLoad != 0.) {
5382 62863 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatZoneTempSeq(TimeStepInDay) = wghtdHeatZoneTemp / sumHeatLoad;
5383 62863 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatOutHumRatSeq(TimeStepInDay) = wghtdHeatHumRat / sumHeatLoad;
5384 : }
5385 :
5386 2336 : } else if (CallIndicator == Constant::CallIndicator::EndDay) {
5387 235695 : for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
5388 233808 : if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex) >
5389 233808 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad) {
5390 16401 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesCoolLoad =
5391 16401 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).CoolLoadSeq(TimeStepIndex);
5392 16401 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtCoolMax = TimeStepIndex;
5393 : }
5394 233808 : if (CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex) >
5395 233808 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad) {
5396 31443 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).DesHeatLoad =
5397 31443 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).HeatLoadSeq(TimeStepIndex);
5398 31443 : CalcFacilitySizing(state.dataSize->CurOverallSimDay).TimeStepNumAtHeatMax = TimeStepIndex;
5399 : }
5400 : }
5401 :
5402 449 : } else if (CallIndicator == Constant::CallIndicator::EndZoneSizingCalc) {
5403 1409 : for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
5404 960 : if (CalcFacilitySizing(DDNum).DesCoolLoad > CalcFinalFacilitySizing.DesCoolLoad) {
5405 461 : CalcFinalFacilitySizing.DesCoolLoad = CalcFacilitySizing(DDNum).DesCoolLoad;
5406 461 : CalcFinalFacilitySizing.TimeStepNumAtCoolMax = CalcFacilitySizing(DDNum).TimeStepNumAtCoolMax;
5407 461 : CalcFinalFacilitySizing.CoolDDNum = CalcFacilitySizing(DDNum).CoolDDNum;
5408 57701 : for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
5409 57240 : CalcFinalFacilitySizing.CoolOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutHumRatSeq(TimeStepIndex);
5410 57240 : CalcFinalFacilitySizing.CoolOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolOutTempSeq(TimeStepIndex);
5411 57240 : CalcFinalFacilitySizing.CoolZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).CoolZoneTempSeq(TimeStepIndex);
5412 57240 : CalcFinalFacilitySizing.DOASHeatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASHeatAddSeq(TimeStepIndex);
5413 57240 : CalcFinalFacilitySizing.DOASLatAddSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).DOASLatAddSeq(TimeStepIndex);
5414 : }
5415 : }
5416 960 : if (CalcFacilitySizing(DDNum).DesHeatLoad > CalcFinalFacilitySizing.DesHeatLoad) {
5417 447 : CalcFinalFacilitySizing.DesHeatLoad = CalcFacilitySizing(DDNum).DesHeatLoad;
5418 447 : CalcFinalFacilitySizing.TimeStepNumAtHeatMax = CalcFacilitySizing(DDNum).TimeStepNumAtHeatMax;
5419 447 : CalcFinalFacilitySizing.HeatDDNum = CalcFacilitySizing(DDNum).HeatDDNum;
5420 55527 : for (int TimeStepIndex = 1; TimeStepIndex <= NumOfTimeStepInDay; ++TimeStepIndex) {
5421 55080 : CalcFinalFacilitySizing.HeatOutHumRatSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutHumRatSeq(TimeStepIndex);
5422 55080 : CalcFinalFacilitySizing.HeatOutTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatOutTempSeq(TimeStepIndex);
5423 55080 : CalcFinalFacilitySizing.HeatZoneTempSeq(TimeStepIndex) = CalcFacilitySizing(DDNum).HeatZoneTempSeq(TimeStepIndex);
5424 : }
5425 : }
5426 : }
5427 : }
5428 140366 : }
5429 :
5430 421 : void UpdateTermUnitFinalZoneSizing(EnergyPlusData &state)
5431 : {
5432 : // Move data from FinalZoneSizing to TermUnitFinalZoneSizing and apply terminal unit sizing adjustments
5433 : // Called once to initialize before system sizing
5434 : // M.J. Witte, July 2017
5435 :
5436 4117 : for (int termUnitSizingIndex = 1; termUnitSizingIndex <= state.dataSize->NumAirTerminalUnits; ++termUnitSizingIndex) {
5437 3696 : auto &thisTUFZSizing = state.dataSize->TermUnitFinalZoneSizing(termUnitSizingIndex);
5438 3696 : auto &thisTUSizing = state.dataSize->TermUnitSizing(termUnitSizingIndex);
5439 3696 : int ctrlZoneNum = thisTUSizing.CtrlZoneNum;
5440 3696 : auto const &thisFZSizing = state.dataSize->FinalZoneSizing(ctrlZoneNum);
5441 :
5442 : // Copy everything from FinalZoneSizing to TermUnitFinalZoneSizing
5443 3696 : thisTUFZSizing.copyFromZoneSizing(thisFZSizing);
5444 3696 : thisTUFZSizing.ADUName = thisTUSizing.ADUName;
5445 :
5446 3696 : if (state.dataSize->NumAirTerminalSizingSpec > 0) {
5447 : // Apply DesignSpecification:AirTerminal:Sizing adjustments - default ratios are 1.0
5448 40 : Real64 minOAFrac = thisTUSizing.SpecMinOAFrac;
5449 : // Outdoor air
5450 40 : thisTUFZSizing.MinOA = thisFZSizing.MinOA * minOAFrac;
5451 40 : thisTUFZSizing.TotalOAFromPeople = thisFZSizing.TotalOAFromPeople * minOAFrac;
5452 40 : thisTUFZSizing.TotalOAFromArea = thisFZSizing.TotalOAFromArea * minOAFrac;
5453 40 : Real64 minOACoolMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesCoolDens;
5454 40 : Real64 minOAHeatMassFlow = thisTUFZSizing.MinOA * thisFZSizing.DesHeatDens;
5455 : // Cooling
5456 40 : Real64 coolFlowRatio = 1.0;
5457 40 : if (thisTUSizing.SpecDesCoolSATRatio > 0.0) {
5458 40 : coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac / thisTUSizing.SpecDesCoolSATRatio;
5459 : } else {
5460 0 : coolFlowRatio = thisTUSizing.SpecDesSensCoolingFrac;
5461 : }
5462 40 : Real64 coolLoadRatio = thisTUSizing.SpecDesSensCoolingFrac;
5463 40 : thisTUFZSizing.DesCoolLoad = thisFZSizing.DesCoolLoad * coolLoadRatio;
5464 40 : thisTUFZSizing.NonAirSysDesCoolLoad = thisFZSizing.NonAirSysDesCoolLoad * coolLoadRatio;
5465 40 : thisTUFZSizing.NonAirSysDesCoolVolFlow = thisFZSizing.NonAirSysDesCoolVolFlow * coolFlowRatio;
5466 : // Adjust DesCoolVolFlow, DesCoolMassFlow, and CoolFlowSeq with cooling frac, SAT ratio, and minOA frac adjustments
5467 40 : thisTUFZSizing.DesCoolVolFlow = thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.DesCoolVolFlow, thisFZSizing.DesCoolVolFlowNoOA);
5468 40 : thisTUFZSizing.DesCoolVolFlow = max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.MinOA);
5469 40 : thisTUFZSizing.DesCoolVolFlowNoOA = thisFZSizing.DesCoolVolFlowNoOA * coolFlowRatio;
5470 40 : thisTUFZSizing.DesCoolMassFlow = thisTUFZSizing.DesCoolVolFlow * thisFZSizing.DesCoolDens;
5471 40 : thisTUFZSizing.DesCoolMassFlow = max(thisTUFZSizing.DesCoolMassFlow, minOACoolMassFlow);
5472 40 : thisTUFZSizing.DesCoolMassFlowNoOA = thisTUFZSizing.DesCoolVolFlowNoOA * thisFZSizing.DesCoolDens;
5473 4360 : for (int timeIndex = 1; timeIndex <= (state.dataGlobal->NumOfTimeStepInHour * 24); ++timeIndex) {
5474 8640 : thisTUFZSizing.CoolFlowSeq(timeIndex) =
5475 4320 : thisTUSizing.applyTermUnitSizingCoolFlow(thisFZSizing.CoolFlowSeq(timeIndex), thisFZSizing.CoolFlowSeqNoOA(timeIndex));
5476 4320 : thisTUFZSizing.CoolFlowSeq(timeIndex) = max(thisTUFZSizing.CoolFlowSeq(timeIndex), minOACoolMassFlow);
5477 4320 : thisTUFZSizing.CoolFlowSeqNoOA(timeIndex) = thisFZSizing.CoolFlowSeqNoOA(timeIndex) * coolFlowRatio;
5478 : }
5479 : // Adjust for possible MinOA impact on DesCoolVolFlowMin, with cooling frac adjustment but no SAT adjustment
5480 40 : thisTUFZSizing.DesCoolMinAirFlow =
5481 40 : thisFZSizing.DesCoolMinAirFlow * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is a straight flow rate input
5482 40 : thisTUFZSizing.DesCoolMinAirFlow2 =
5483 40 : thisFZSizing.DesCoolMinAirFlow2 * thisTUSizing.SpecDesSensCoolingFrac; // no SAT adjustment, this is based on area
5484 80 : thisTUFZSizing.DesCoolVolFlowMin = max(thisTUFZSizing.DesCoolMinAirFlow,
5485 : thisTUFZSizing.DesCoolMinAirFlow2,
5486 40 : thisTUFZSizing.DesCoolVolFlow * thisTUFZSizing.DesCoolMinAirFlowFrac);
5487 :
5488 : // Heating
5489 40 : Real64 heatFlowRatio = 1.0;
5490 40 : if (thisTUSizing.SpecDesHeatSATRatio > 0.0) {
5491 40 : heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac / thisTUSizing.SpecDesHeatSATRatio;
5492 : } else {
5493 0 : heatFlowRatio = thisTUSizing.SpecDesSensHeatingFrac;
5494 : }
5495 40 : Real64 heatLoadRatio = thisTUSizing.SpecDesSensHeatingFrac;
5496 40 : thisTUFZSizing.DesHeatLoad = thisFZSizing.DesHeatLoad * heatLoadRatio;
5497 40 : thisTUFZSizing.NonAirSysDesHeatLoad = thisFZSizing.NonAirSysDesHeatLoad * heatLoadRatio;
5498 40 : thisTUFZSizing.NonAirSysDesHeatVolFlow = thisFZSizing.NonAirSysDesHeatVolFlow * heatFlowRatio;
5499 : // Adjust DesHeatVolFlow, DesHeatMassFlow, and HeatFlowSeq with Heating frac, SAT ratio, and minOA frac adjustments
5500 40 : thisTUFZSizing.DesHeatVolFlow = thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.DesHeatVolFlow, thisFZSizing.DesHeatVolFlowNoOA);
5501 40 : thisTUFZSizing.DesHeatVolFlow = max(thisTUFZSizing.DesHeatVolFlow, thisTUFZSizing.MinOA);
5502 40 : thisTUFZSizing.DesHeatVolFlowNoOA = thisFZSizing.DesHeatVolFlowNoOA * heatFlowRatio;
5503 40 : thisTUFZSizing.DesHeatMassFlow = thisTUFZSizing.DesHeatVolFlow * thisFZSizing.DesHeatDens;
5504 40 : thisTUFZSizing.DesHeatMassFlow = max(thisTUFZSizing.DesHeatMassFlow, minOAHeatMassFlow);
5505 40 : thisTUFZSizing.DesHeatMassFlowNoOA = thisTUFZSizing.DesHeatVolFlowNoOA * thisFZSizing.DesHeatDens;
5506 4360 : for (int timeIndex = 1; timeIndex <= (state.dataGlobal->NumOfTimeStepInHour * 24); ++timeIndex) {
5507 8640 : thisTUFZSizing.HeatFlowSeq(timeIndex) =
5508 4320 : thisTUSizing.applyTermUnitSizingHeatFlow(thisFZSizing.HeatFlowSeq(timeIndex), thisFZSizing.HeatFlowSeqNoOA(timeIndex));
5509 4320 : thisTUFZSizing.HeatFlowSeq(timeIndex) = max(thisTUFZSizing.HeatFlowSeq(timeIndex), minOAHeatMassFlow);
5510 4320 : thisTUFZSizing.HeatFlowSeqNoOA(timeIndex) = thisFZSizing.HeatFlowSeqNoOA(timeIndex) * heatFlowRatio;
5511 : }
5512 : // DesHeatVolFlowMax is a mixed bag, so just repeat the original comparison from UpdateZoneSizing using the new flows
5513 40 : thisTUFZSizing.DesHeatMaxAirFlow =
5514 40 : thisFZSizing.DesHeatMaxAirFlow * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is a straight flow rate input
5515 40 : thisTUFZSizing.DesHeatMaxAirFlow2 =
5516 40 : thisFZSizing.DesHeatMaxAirFlow2 * thisTUSizing.SpecDesSensHeatingFrac; // no SAT adjustment, this is based on area
5517 40 : thisTUFZSizing.DesHeatVolFlowMax =
5518 40 : max(thisTUFZSizing.DesHeatMaxAirFlow,
5519 : thisTUFZSizing.DesHeatMaxAirFlow2,
5520 40 : max(thisTUFZSizing.DesCoolVolFlow, thisTUFZSizing.DesHeatVolFlow) * thisTUFZSizing.DesHeatMaxAirFlowFrac);
5521 : // Outdoor air fractions
5522 40 : if (thisTUFZSizing.DesCoolVolFlow > 0.0) {
5523 40 : thisTUFZSizing.DesCoolOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesCoolVolFlow, 1.0);
5524 : } else {
5525 0 : thisTUFZSizing.DesCoolOAFlowFrac = 0.0;
5526 : }
5527 40 : if (thisTUFZSizing.DesHeatVolFlow > 0.0) {
5528 40 : thisTUFZSizing.DesHeatOAFlowFrac = min(thisFZSizing.MinOA / thisTUFZSizing.DesHeatVolFlow, 1.0);
5529 : } else {
5530 0 : thisTUFZSizing.DesHeatOAFlowFrac = 0.0;
5531 : }
5532 : }
5533 : }
5534 421 : }
5535 : } // namespace EnergyPlus::SizingManager
|