LCOV - code coverage report
Current view: top level - EnergyPlus/Autosizing - Base.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 77.1 % 582 449
Test Date: 2025-06-02 12:03:30 Functions: 100.0 % 20 20

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : #include <EnergyPlus/Autosizing/All_Simple_Sizing.hh>
      49              : #include <EnergyPlus/Autosizing/Base.hh>
      50              : #include <EnergyPlus/Data/EnergyPlusData.hh>
      51              : #include <EnergyPlus/DataEnvironment.hh>
      52              : #include <EnergyPlus/DataHVACGlobals.hh>
      53              : #include <EnergyPlus/General.hh>
      54              : #include <EnergyPlus/OutputReportPredefined.hh>
      55              : #include <EnergyPlus/Psychrometrics.hh>
      56              : #include <EnergyPlus/SQLiteProcedures.hh>
      57              : #include <EnergyPlus/UtilityRoutines.hh>
      58              : 
      59              : namespace EnergyPlus {
      60              : 
      61         2935 : void BaseSizer::initializeWithinEP(EnergyPlusData &state,
      62              :                                    std::string_view const _compType,
      63              :                                    std::string_view const _compName,
      64              :                                    bool _printWarningFlag,
      65              :                                    std::string_view const _callingRoutine)
      66              : {
      67         2935 :     this->initialized = true;
      68         2935 :     this->compType = _compType;
      69         2935 :     this->compName = _compName;
      70         2935 :     this->isEpJSON = state.dataGlobal->isEpJSON;
      71         2935 :     this->printWarningFlag = _printWarningFlag;
      72         2935 :     this->callingRoutine = _callingRoutine;
      73         2935 :     this->stdRhoAir = state.dataEnvrn->StdRhoAir;
      74         2935 :     this->sysSizingRunDone = state.dataSize->SysSizingRunDone;
      75         2935 :     this->zoneSizingRunDone = state.dataSize->ZoneSizingRunDone;
      76         2935 :     this->curSysNum = state.dataSize->CurSysNum;
      77         2935 :     this->curOASysNum = state.dataSize->CurOASysNum;
      78         2935 :     this->curZoneEqNum = state.dataSize->CurZoneEqNum;
      79         2935 :     this->curDuctType = state.dataSize->CurDuctType;
      80         2935 :     this->numPrimaryAirSys = state.dataHVACGlobal->NumPrimaryAirSys;
      81         2935 :     this->numSysSizInput = state.dataSize->NumSysSizInput;
      82         2935 :     this->doSystemSizing = state.dataGlobal->DoSystemSizing;
      83         2935 :     this->numZoneSizingInput = state.dataSize->NumZoneSizingInput;
      84         2935 :     this->doZoneSizing = state.dataGlobal->DoZoneSizing;
      85         2935 :     this->curTermUnitSizingNum = state.dataSize->CurTermUnitSizingNum;
      86         2935 :     this->termUnitSingDuct = state.dataSize->TermUnitSingDuct;
      87         2935 :     this->termUnitPIU = state.dataSize->TermUnitPIU;
      88         2935 :     this->termUnitIU = state.dataSize->TermUnitIU;
      89         2935 :     this->zoneEqFanCoil = state.dataSize->ZoneEqFanCoil;
      90         2935 :     this->otherEqType = !(this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU || this->zoneEqFanCoil);
      91         2935 :     this->zoneEqUnitHeater = state.dataSize->ZoneEqUnitHeater;
      92         2935 :     this->zoneEqUnitVent = state.dataSize->ZoneEqUnitVent;
      93         2935 :     this->zoneEqVentedSlab = state.dataSize->ZoneEqVentedSlab;
      94         2935 :     this->zoneSizingInput = state.dataSize->ZoneSizingInput;
      95         2935 :     this->unitarySysEqSizing = state.dataSize->UnitarySysEqSizing;
      96         2935 :     this->oaSysEqSizing = state.dataSize->OASysEqSizing;
      97         2935 :     this->outsideAirSys = state.dataAirLoop->OutsideAirSys;
      98         2935 :     this->termUnitSizing = state.dataSize->TermUnitSizing;
      99         2935 :     this->finalZoneSizing = state.dataSize->FinalZoneSizing;
     100         2935 :     this->termUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing;
     101         2935 :     this->zoneEqSizing = state.dataSize->ZoneEqSizing;
     102         2935 :     this->sysSizingInputData = state.dataSize->SysSizInput;
     103         2935 :     this->finalSysSizing = state.dataSize->FinalSysSizing;
     104         2935 :     this->plantSizData = state.dataSize->PlantSizData;
     105         2935 :     this->primaryAirSystem = state.dataAirSystemsData->PrimaryAirSystems;
     106         2935 :     this->airLoopControlInfo = state.dataAirLoop->AirLoopControlInfo;
     107         2935 :     this->airloopDOAS = state.dataAirLoopHVACDOAS->airloopDOAS;
     108         2935 :     if (EnergyPlus::BaseSizer::isValidCoilType(this->compType)) { // coil reports fail if compType is not one of HVAC::cAllCoilTypes
     109         1788 :         this->isCoilReportObject = true;
     110              :     }
     111         2935 :     if (EnergyPlus::BaseSizer::isValidFanType(this->compType)) { // fan reports fail if compType is not a valid fan type
     112          158 :         this->isFanReportObject = true;
     113              :     }
     114              : 
     115              :     // global sizing data
     116         2935 :     dataEMSOverrideON = state.dataSize->DataEMSOverrideON;
     117         2935 :     dataEMSOverride = state.dataSize->DataEMSOverride;
     118         2935 :     this->dataAutosizable = state.dataSize->DataAutosizable;
     119         2935 :     this->minOA = DataSizing::OAControl::MinOA;
     120         2935 :     this->dataConstantUsedForSizing = state.dataSize->DataConstantUsedForSizing;
     121         2935 :     this->dataFractionUsedForSizing = state.dataSize->DataFractionUsedForSizing;
     122         2935 :     state.dataSize->DataConstantUsedForSizing = 0.0; // reset here instead of in component model?
     123         2935 :     state.dataSize->DataFractionUsedForSizing = 0.0;
     124              : 
     125         2935 :     this->dataFanIndex = state.dataSize->DataFanIndex;
     126         2935 :     this->dataFanType = state.dataSize->DataFanType;
     127              : 
     128              :     // global Data* sizing constants
     129         2935 :     this->dataPltSizHeatNum = state.dataSize->DataPltSizHeatNum;
     130         2935 :     this->dataWaterLoopNum = state.dataSize->DataWaterLoopNum;
     131         2935 :     this->dataPltSizCoolNum = state.dataSize->DataPltSizCoolNum;
     132         2935 :     this->dataWaterCoilSizHeatDeltaT = state.dataSize->DataWaterCoilSizHeatDeltaT;
     133         2935 :     this->dataWaterCoilSizCoolDeltaT = state.dataSize->DataWaterCoilSizCoolDeltaT;
     134         2935 :     this->dataCapacityUsedForSizing = state.dataSize->DataCapacityUsedForSizing;
     135         2935 :     this->dataHeatSizeRatio = state.dataSize->DataHeatSizeRatio;
     136              : 
     137         2935 :     this->dataAirFlowUsedForSizing = state.dataSize->DataAirFlowUsedForSizing;
     138         2935 :     this->dataDesInletAirTemp = state.dataSize->DataDesInletAirTemp;
     139         2935 :     this->dataDesAccountForFanHeat = state.dataSize->DataDesAccountForFanHeat;
     140         2935 :     this->dataFanPlacement = state.dataSize->DataFanPlacement;
     141         2935 :     this->dataDesInletAirHumRat = state.dataSize->DataDesInletAirHumRat;
     142         2935 :     this->dataDesOutletAirHumRat = state.dataSize->DataDesOutletAirHumRat;
     143         2935 :     this->dataDesOutletAirTemp = state.dataSize->DataDesOutletAirTemp;
     144         2935 :     this->dataDesInletWaterTemp = state.dataSize->DataDesInletWaterTemp;
     145         2935 :     this->dataFlowUsedForSizing = state.dataSize->DataFlowUsedForSizing;
     146         2935 :     this->dataWaterFlowUsedForSizing = state.dataSize->DataWaterFlowUsedForSizing;
     147              : 
     148         2935 :     this->dataSizingFraction = state.dataSize->DataSizingFraction;
     149         2935 :     this->dataDXSpeedNum = state.dataSize->DataDXSpeedNum;
     150         2935 :     this->dataDesicRegCoil = state.dataSize->DataDesicRegCoil;
     151         2935 :     this->dataZoneUsedForSizing = state.dataSize->DataZoneUsedForSizing;
     152         2935 :     this->dataDesicDehumNum = state.dataSize->DataDesicDehumNum;
     153              : 
     154         2935 :     this->dataNomCapInpMeth = state.dataSize->DataNomCapInpMeth;
     155         2935 :     this->dataCoilNum = state.dataSize->DataCoilNum;
     156         2935 :     this->dataFanOp = state.dataSize->DataFanOp;
     157         2935 :     this->dataDesignCoilCapacity = state.dataSize->DataDesignCoilCapacity;
     158         2935 :     this->dataErrorsFound = state.dataSize->DataErrorsFound;
     159         2935 :     this->dataBypassFrac = state.dataSize->DataBypassFrac;
     160         2935 :     this->dataIsDXCoil = state.dataSize->DataIsDXCoil;
     161         2935 :     this->dataNonZoneNonAirloopValue = state.dataSize->DataNonZoneNonAirloopValue;
     162         2935 :     this->dataDXCoolsLowSpeedsAutozize = state.dataSize->DataDXCoolsLowSpeedsAutozize;
     163         2935 : }
     164              : 
     165            2 : void BaseSizer::initializeFromAPI(EnergyPlusData &state, Real64 const elevation)
     166              : {
     167            2 :     this->clearState();
     168            2 :     this->initialized = true;
     169            2 :     this->compType = "API_component_type";
     170            2 :     this->compName = "API_component_name";
     171            2 :     this->printWarningFlag = false;
     172            2 :     this->callingRoutine = "called_from_API";
     173            2 :     Real64 barometricPressure = DataEnvironment::StdPressureSeaLevel * std::pow(1.0 - 2.25577e-05 * elevation, 5.2559);
     174            2 :     this->stdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(state, barometricPressure, 20.0, 0.0);
     175            2 :     this->isCoilReportObject = false;
     176            2 : }
     177              : 
     178          172 : void BaseSizer::addErrorMessage(std::string const &s)
     179              : {
     180          172 :     this->lastErrorMessages.append(s).append("\n");
     181          172 : }
     182              : 
     183            5 : std::string BaseSizer::getLastErrorMessages()
     184              : {
     185            5 :     std::string s(this->lastErrorMessages);
     186            5 :     this->lastErrorMessages = "";
     187            5 :     return s;
     188            0 : }
     189              : 
     190         2933 : void BaseSizer::preSize(EnergyPlusData &state, Real64 const _originalValue)
     191              : {
     192         2933 :     if (this->sizingType == AutoSizingType::Invalid) {
     193            0 :         std::string msg = "Sizing Library Base Class: preSize, SizingType not defined.";
     194            0 :         this->addErrorMessage(msg);
     195            0 :         ShowSevereError(state, msg);
     196            0 :         ShowFatalError(state, "Sizing type causes fatal error.");
     197            0 :     }
     198         2933 :     this->originalValue = _originalValue;
     199         2933 :     this->autoCalculate = false;
     200         2933 :     this->errorType = EnergyPlus::AutoSizingResultType::NoError;
     201         2933 :     this->initialized = false; // force use of Init then Size in subsequent calls
     202         2933 :     this->hardSizeNoDesignRun = !(this->sysSizingRunDone || this->zoneSizingRunDone);
     203         2933 :     this->sizingDesRunThisZone = false;
     204         2933 :     this->sizingDesRunThisAirSys = false;
     205              : 
     206         2933 :     if (this->dataFractionUsedForSizing == 0.0 && this->dataConstantUsedForSizing > 0.0) {
     207            1 :         this->errorType = AutoSizingResultType::ErrorType1;
     208            1 :         this->autoCalculate = true;
     209            1 :         this->hardSizeNoDesignRun = false;
     210            1 :         if (this->wasAutoSized) {
     211            0 :             this->autoSizedValue = 0.0;
     212            0 :             std::string msg = "Sizing Library: DataConstantUsedForSizing and DataFractionUsedForSizing used for autocalculating " +
     213            0 :                               this->sizingString + " must both be greater than 0.";
     214            0 :             this->addErrorMessage(msg);
     215            0 :             ShowSevereError(state, msg);
     216            0 :         }
     217         2933 :     } else if (this->dataFractionUsedForSizing > 0.0) {
     218          318 :         this->autoCalculate = true;
     219          318 :         this->hardSizeNoDesignRun = false;
     220         2614 :     } else if (this->sizingType == AutoSizingType::AutoCalculateSizing) {
     221            4 :         this->autoCalculate = true;
     222            4 :         if (this->originalValue == DataSizing::AutoSize && !this->dataEMSOverrideON) {
     223            1 :             this->errorType = AutoSizingResultType::ErrorType1;
     224            1 :             std::string msg = "Sizing Library: DataConstantUsedForSizing and DataFractionUsedForSizing used for autocalculating " +
     225            1 :                               this->sizingString + " must both be greater than 0.";
     226            1 :             this->addErrorMessage(msg);
     227            1 :             ShowSevereError(state, msg);
     228            1 :         }
     229              :     }
     230              : 
     231         2933 :     if (this->curSysNum > 0 && this->curSysNum <= this->numPrimaryAirSys) {
     232          714 :         if (this->sysSizingRunDone) {
     233          614 :             int sysNum = this->curSysNum;
     234          614 :             this->sizingDesRunThisAirSys = std::any_of(
     235         1838 :                 this->sysSizingInputData.begin(), this->sysSizingInputData.end(), [sysNum](auto const &ssid) { return ssid.AirLoopNum == sysNum; });
     236              :         }
     237          714 :         if (allocated(this->unitarySysEqSizing)) {
     238          543 :             this->airLoopSysFlag =
     239          543 :                 this->unitarySysEqSizing(this->curSysNum).CoolingCapacity || this->unitarySysEqSizing(this->curSysNum).HeatingCapacity;
     240              :         }
     241          714 :         if (this->curOASysNum > 0) {
     242          106 :             this->oaSysFlag = this->oaSysEqSizing(this->curOASysNum).CoolingCapacity || this->oaSysEqSizing(this->curOASysNum).HeatingCapacity;
     243              :         }
     244              :     }
     245              : 
     246         2933 :     if (this->curZoneEqNum > 0) {
     247         1680 :         if (allocated(this->zoneEqSizing)) {
     248         1643 :             this->sizingDesValueFromParent = this->zoneEqSizing(this->curZoneEqNum).DesignSizeFromParent;
     249              :         }
     250         1680 :         if (this->zoneSizingRunDone) {
     251         1446 :             int zoneNum = this->curZoneEqNum;
     252         1446 :             this->sizingDesRunThisZone = std::any_of(
     253         3832 :                 this->zoneSizingInput.begin(), this->zoneSizingInput.end(), [zoneNum](auto const &zsi) { return zsi.ZoneNum == zoneNum; });
     254              :         }
     255         1680 :         this->hardSizeNoDesignRun = false;
     256              :     }
     257              : 
     258         2933 :     if (this->originalValue == DataSizing::AutoSize) {
     259         1973 :         this->wasAutoSized = true;
     260         1973 :         this->hardSizeNoDesignRun = false;
     261         1973 :         if (!this->sizingDesRunThisAirSys && this->curSysNum > 0 && !this->autoCalculate) {
     262          292 :             if (!this->sysSizingRunDone) {
     263            0 :                 std::string msg = "For autosizing of " + this->compType + ' ' + this->compName + ", a system sizing run must be done.";
     264            0 :                 this->addErrorMessage(msg);
     265            0 :                 ShowSevereError(state, msg);
     266            0 :                 if (this->numSysSizInput == 0) {
     267            0 :                     std::string msg2 = "No \"Sizing:System\" objects were entered.";
     268            0 :                     this->addErrorMessage(msg2);
     269            0 :                     ShowContinueError(state, msg2);
     270            0 :                 }
     271            0 :                 if (!this->doSystemSizing) {
     272            0 :                     std::string msg2 = R"(The "SimulationControl" object did not have the field "Do System Sizing Calculation" set to Yes.)";
     273            0 :                     this->addErrorMessage(msg2);
     274            0 :                     ShowContinueError(state, msg2);
     275            0 :                 }
     276            0 :                 ShowFatalError(state, "Program terminates due to previously shown condition(s).");
     277            0 :             }
     278              :         }
     279         1973 :         if (!this->sizingDesRunThisZone && this->curZoneEqNum > 0 && !this->sizingDesValueFromParent && !this->autoCalculate) {
     280          537 :             if (!this->zoneSizingRunDone) {
     281            0 :                 std::string msg = "For autosizing of " + this->compType + ' ' + this->compName + ", a zone sizing run must be done.";
     282            0 :                 this->addErrorMessage(msg);
     283            0 :                 ShowSevereError(state, msg);
     284            0 :                 if (this->numZoneSizingInput == 0) {
     285            0 :                     std::string msg2 = "No \"Sizing:Zone\" objects were entered.";
     286            0 :                     this->addErrorMessage(msg2);
     287            0 :                     ShowContinueError(state, msg2);
     288            0 :                 }
     289            0 :                 if (!this->doZoneSizing) {
     290            0 :                     std::string msg2 = R"(The "SimulationControl" object did not have the field "Do Zone Sizing Calculation" set to Yes.)";
     291            0 :                     this->addErrorMessage(msg2);
     292            0 :                     ShowContinueError(state, msg2);
     293            0 :                 }
     294            0 :                 ShowFatalError(state, "Program terminates due to previously shown condition(s).");
     295            0 :             }
     296              :         }
     297              :     } else {
     298          960 :         this->wasAutoSized = false;
     299              :     }
     300         2933 : }
     301              : 
     302         3278 : void BaseSizer::reportSizerOutput(EnergyPlusData &state,
     303              :                                   std::string_view CompType,
     304              :                                   std::string_view CompName,
     305              :                                   std::string_view VarDesc,
     306              :                                   Real64 const VarValue,
     307              :                                   ObjexxFCL::Optional_string_const UsrDesc,
     308              :                                   ObjexxFCL::Optional<Real64 const> UsrValue)
     309              : {
     310              : 
     311              :     static constexpr std::string_view Format_990(
     312              :         "! <Component Sizing Information>, Component Type, Component Name, Input Field Description, Value\n");
     313              :     static constexpr std::string_view Format_991(" Component Sizing Information, {}, {}, {}, {:.5R}\n");
     314              : 
     315              :     // to do, make this a parameter. Unfortunately this function is used in MANY
     316              :     // places so it involves touching most of E+
     317         3278 :     if (state.dataEnvrn->oneTimeCompRptHeaderFlag) {
     318          344 :         print(state.files.eio, Format_990);
     319          344 :         state.dataEnvrn->oneTimeCompRptHeaderFlag = false;
     320              :     }
     321              : 
     322         3278 :     print(state.files.eio, Format_991, CompType, CompName, VarDesc, VarValue);
     323              :     // add to tabular output reports
     324         3278 :     OutputReportPredefined::AddCompSizeTableEntry(state, CompType, CompName, VarDesc, VarValue);
     325              : 
     326         3278 :     if (present(UsrDesc) && present(UsrValue)) {
     327          210 :         print(state.files.eio, Format_991, CompType, CompName, UsrDesc(), UsrValue());
     328          210 :         OutputReportPredefined::AddCompSizeTableEntry(state, CompType, CompName, UsrDesc(), UsrValue);
     329         3068 :     } else if (present(UsrDesc) || present(UsrValue)) {
     330            0 :         ShowFatalError(state, "ReportSizingOutput: (Developer Error) - called with user-specified description or value but not both.");
     331              :     }
     332              : 
     333              :     // add to SQL output
     334         3278 :     if (state.dataSQLiteProcedures->sqlite) {
     335          147 :         state.dataSQLiteProcedures->sqlite->addSQLiteComponentSizingRecord(CompType, CompName, VarDesc, VarValue);
     336              :     }
     337         3278 :     if (present(UsrDesc) && present(UsrValue)) {
     338          210 :         if (state.dataSQLiteProcedures->sqlite) {
     339           30 :             state.dataSQLiteProcedures->sqlite->addSQLiteComponentSizingRecord(CompType, CompName, UsrDesc(), UsrValue);
     340              :         }
     341              :     }
     342         3278 : }
     343              : 
     344         2512 : void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound)
     345              : {
     346         2512 :     if (this->printWarningFlag) {
     347         1590 :         if (this->dataEMSOverrideON) { // EMS overrides value
     348            8 :             this->autoSizedValue = this->dataEMSOverride;
     349           24 :             this->reportSizerOutput(
     350           16 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     351         1582 :         } else if (this->hardSizeNoDesignRun && !this->wasAutoSized && Util::SameString(this->compType, "Fan:ZoneExhaust")) {
     352            0 :             this->autoSizedValue = this->originalValue;
     353         1582 :         } else if (this->wasAutoSized && this->dataFractionUsedForSizing > 0.0 && this->dataConstantUsedForSizing > 0.0) {
     354           96 :             this->autoSizedValue = this->dataFractionUsedForSizing * this->dataConstantUsedForSizing;
     355          288 :             this->reportSizerOutput(
     356          192 :                 state, this->compType, this->compName, "Design Size " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     357         1486 :         } else if (!this->wasAutoSized &&
     358          608 :                    (this->autoSizedValue == this->originalValue || this->autoSizedValue == 0.0)) { // no sizing run done or autosizes to 0
     359          444 :             this->autoSizedValue = this->originalValue;
     360          887 :             if (this->dataAutosizable || (!this->sizingDesRunThisZone && Util::SameString(this->compType, "Fan:ZoneExhaust"))) {
     361         1329 :                 this->reportSizerOutput(
     362          886 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     363              :             }
     364         1042 :         } else if (!this->wasAutoSized && this->autoSizedValue >= 0.0 && this->originalValue == 0.0) { // input was blank or zero
     365           23 :             this->autoSizedValue = this->originalValue;
     366           69 :             this->reportSizerOutput(
     367           46 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     368         1019 :         } else if (this->wasAutoSized && this->autoSizedValue >= 0.0 &&
     369          877 :                    this->originalValue <= 0.0) { // autosized to 0 or greater and input is 0 or autosize
     370              :             // might need more logic here to catch everything correctly
     371          877 :             if (this->dataScalableSizingON && int(this->zoneAirFlowSizMethod) > 0) {
     372            0 :                 this->reportSizerOutput(
     373            0 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     374              :             } else {
     375          877 :                 this->reportSizerOutput(state, this->compType, this->compName, "Design Size " + this->sizingString, this->autoSizedValue);
     376              :             }
     377          142 :         } else if (this->autoSizedValue >= 0.0 && this->originalValue > 0.0) {
     378          141 :             if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     379           95 :                 if (this->dataAutosizable) {
     380          282 :                     this->reportSizerOutput(state,
     381              :                                             this->compType,
     382              :                                             this->compName,
     383          188 :                                             "Design Size " + this->sizingString,
     384              :                                             this->autoSizedValue,
     385          188 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString,
     386           94 :                                             this->originalValue);
     387              :                 }
     388              :             } else {
     389           46 :                 if (this->dataAutosizable) {
     390          138 :                     this->reportSizerOutput(state,
     391              :                                             this->compType,
     392              :                                             this->compName,
     393           92 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString,
     394              :                                             this->originalValue);
     395              :                 }
     396              :             }
     397          141 :             if (state.dataGlobal->DisplayExtraWarnings && this->dataAutosizable) {
     398            0 :                 if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     399            0 :                     std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName;
     400            0 :                     this->addErrorMessage(msg);
     401            0 :                     ShowMessage(state, msg);
     402            0 :                     msg = format("User-Specified {}{} = {:.5R}", this->sizingStringScalable, this->sizingString, this->originalValue);
     403            0 :                     this->addErrorMessage(msg);
     404            0 :                     ShowContinueError(state, msg);
     405            0 :                     msg = format("differs from Design Size {} = {:.5R}", this->sizingString, this->autoSizedValue);
     406            0 :                     this->addErrorMessage(msg);
     407            0 :                     ShowContinueError(state, msg);
     408            0 :                     msg = "This may, or may not, indicate mismatched component sizes.";
     409            0 :                     this->addErrorMessage(msg);
     410            0 :                     ShowContinueError(state, msg);
     411            0 :                     msg = "Verify that the value entered is intended and is consistent with other components.";
     412            0 :                     this->addErrorMessage(msg);
     413            0 :                     ShowContinueError(state, msg);
     414            0 :                 }
     415              :             }
     416          141 :             if (!this->wasAutoSized) {
     417          141 :                 this->autoSizedValue = this->originalValue;
     418              :             }
     419          142 :         } else if (this->wasAutoSized && this->autoSizedValue != DataSizing::AutoSize) {
     420            3 :             this->reportSizerOutput(
     421            2 :                 state, this->compType, this->compName, "Design Size " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     422              :         } else {
     423            0 :             std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
     424            0 :             this->addErrorMessage(msg);
     425            0 :             ShowSevereError(state, msg);
     426            0 :             msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->originalValue);
     427            0 :             this->addErrorMessage(msg);
     428            0 :             ShowContinueError(state, msg);
     429            0 :             this->errorType = AutoSizingResultType::ErrorType1;
     430            0 :         }
     431          922 :     } else if (!this->wasAutoSized && !this->autoCalculate) {
     432          179 :         this->autoSizedValue = this->originalValue;
     433              :     }
     434         2512 :     this->overrideSizeString = true; // reset for next sizer
     435         2512 :     if (this->errorType != AutoSizingResultType::NoError) {
     436           13 :         std::string msg = "Developer Error: sizing of " + this->sizingString + " failed.";
     437           13 :         this->addErrorMessage(msg);
     438           13 :         ShowSevereError(state, msg);
     439           13 :         msg = "Occurs in " + this->compType + " " + this->compName;
     440           13 :         this->addErrorMessage(msg);
     441           13 :         ShowContinueError(state, msg);
     442           13 :         errorsFound = true;
     443           13 :     }
     444         2512 : }
     445              : 
     446          421 : void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &errorsFound)
     447              : {
     448          421 :     if (this->printWarningFlag) {
     449          263 :         if (this->dataEMSOverrideON) { // EMS overrides value
     450            6 :             this->reportSizerOutput(
     451            4 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     452            2 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     453            0 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     454            0 :                 this->reportSizerOutput(state,
     455              :                                         this->compType,
     456              :                                         this->compName,
     457            0 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     458              :                                         this->autoSizedValue);
     459              :             }
     460          261 :         } else if (!this->wasAutoSized && (this->autoSizedValue == this->originalValue || this->autoSizedValue == 0.0)) { // no sizing run done
     461           78 :             this->autoSizedValue = this->originalValue;
     462          234 :             this->reportSizerOutput(
     463          156 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     464           78 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     465            0 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     466            0 :                 this->reportSizerOutput(state,
     467              :                                         this->compType,
     468              :                                         this->compName,
     469            0 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     470              :                                         this->autoSizedValue);
     471              :             }
     472          183 :         } else if (!this->wasAutoSized && this->autoSizedValue >= 0.0 && this->originalValue == 0.0) { // input was blank or zero
     473            0 :             this->autoSizedValue = this->originalValue;
     474            0 :             this->reportSizerOutput(
     475            0 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     476            0 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     477            0 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     478            0 :                 this->reportSizerOutput(state,
     479              :                                         this->compType,
     480              :                                         this->compName,
     481            0 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     482              :                                         this->autoSizedValue);
     483              :             }
     484          183 :         } else if (this->wasAutoSized && this->autoSizedValue >= 0.0 &&
     485          153 :                    this->originalValue <= 0.0) { // autosized to 0 or greater and input is 0 or autosize
     486              :                                                  // might need more logic here to catch everything correctly
     487          153 :             if (this->dataScalableSizingON && int(this->zoneAirFlowSizMethod) > 0) {
     488            3 :                 this->reportSizerOutput(
     489            2 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     490              :             } else {
     491          152 :                 this->reportSizerOutput(state, this->compType, this->compName, "Design Size " + this->sizingString, this->autoSizedValue);
     492              :             }
     493          153 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     494            0 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     495            0 :                 this->reportSizerOutput(
     496            0 :                     state, this->compType, this->compName, "Design Size " + this->sizingString + " ( non-bypassed )", this->autoSizedValue);
     497              :             }
     498           30 :         } else if (this->autoSizedValue >= 0.0 && this->originalValue > 0.0) {
     499           30 :             if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     500           58 :                 this->reportSizerOutput(state,
     501              :                                         this->compType,
     502              :                                         this->compName,
     503           58 :                                         "Design Size " + this->sizingString,
     504              :                                         this->autoSizedValue,
     505           58 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString,
     506           29 :                                         this->originalValue);
     507           29 :                 if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     508            0 :                     this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     509            0 :                     this->originalValue *= (1 - this->dataBypassFrac);  // now reapply for second message and remianing simulation calcs
     510            0 :                     this->reportSizerOutput(state,
     511              :                                             this->compType,
     512              :                                             this->compName,
     513            0 :                                             "Design Size " + this->sizingString + " ( non-bypassed )",
     514              :                                             this->autoSizedValue,
     515            0 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     516            0 :                                             this->originalValue);
     517              :                 }
     518              :             } else {
     519            1 :                 if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     520            0 :                     this->autoSizedValue /= (1 - this->dataBypassFrac); // back out bypass fraction applied in GetInput
     521              :                 }
     522            3 :                 this->reportSizerOutput(
     523            2 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->originalValue);
     524            1 :                 if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     525            0 :                     this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     526            0 :                     this->reportSizerOutput(state,
     527              :                                             this->compType,
     528              :                                             this->compName,
     529            0 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     530              :                                             this->autoSizedValue);
     531              :                 }
     532              :             }
     533           30 :             if (state.dataGlobal->DisplayExtraWarnings) {
     534            0 :                 if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     535            0 :                     std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName;
     536            0 :                     this->addErrorMessage(msg);
     537            0 :                     ShowMessage(state, msg);
     538            0 :                     msg = format("User-Specified {}{} = {:.5R}", this->sizingStringScalable, this->sizingString, this->originalValue);
     539            0 :                     this->addErrorMessage(msg);
     540            0 :                     ShowContinueError(state, msg);
     541            0 :                     msg = format("differs from Design Size {} = {:.5R}", this->sizingString, this->autoSizedValue);
     542            0 :                     this->addErrorMessage(msg);
     543            0 :                     ShowContinueError(state, msg);
     544            0 :                     msg = "This may, or may not, indicate mismatched component sizes.";
     545            0 :                     this->addErrorMessage(msg);
     546            0 :                     ShowContinueError(state, msg);
     547            0 :                     msg = "Verify that the value entered is intended and is consistent with other components.";
     548            0 :                     this->addErrorMessage(msg);
     549            0 :                     ShowContinueError(state, msg);
     550            0 :                 }
     551              :             }
     552           30 :             if (!this->wasAutoSized) {
     553           30 :                 this->autoSizedValue = this->originalValue;
     554              :             }
     555           30 :         } else if (this->wasAutoSized && this->autoSizedValue != DataSizing::AutoSize) {
     556            0 :             this->reportSizerOutput(
     557            0 :                 state, this->compType, this->compName, "Design Size " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     558              :         } else {
     559            0 :             std::string msg = this->callingRoutine + ' ' + this->compType + ' ' + this->compName + ", Developer Error: Component sizing incomplete.";
     560            0 :             this->addErrorMessage(msg);
     561            0 :             ShowSevereError(state, msg);
     562            0 :             msg = format("SizingString = {}, SizingResult = {:.1T}", this->sizingString, this->originalValue);
     563            0 :             this->addErrorMessage(msg);
     564            0 :             ShowContinueError(state, msg);
     565            0 :             this->errorType = AutoSizingResultType::ErrorType1;
     566            0 :         }
     567          158 :     } else if (!this->wasAutoSized && !this->autoCalculate) {
     568           35 :         this->autoSizedValue = this->originalValue;
     569              :     }
     570          421 :     this->overrideSizeString = true; // reset for next sizer
     571          421 :     if (this->errorType != AutoSizingResultType::NoError) {
     572            0 :         std::string msg = "Developer Error: sizing of " + this->sizingString + " failed.";
     573            0 :         this->addErrorMessage(msg);
     574            0 :         ShowSevereError(state, msg);
     575            0 :         msg = "Occurs in " + this->compType + " " + this->compName;
     576            0 :         this->addErrorMessage(msg);
     577            0 :         ShowContinueError(state, msg);
     578            0 :         errorsFound = true;
     579            0 :     }
     580          421 : }
     581              : 
     582         2935 : bool BaseSizer::isValidCoilType(std::string const &_compType)
     583              : {
     584         2935 :     int coilNum = 0;
     585        71522 :     for (auto const &coilType : HVAC::cAllCoilTypes) {
     586        70375 :         coilNum += 1;
     587        70375 :         if (Util::SameString(_compType, coilType)) {
     588         1788 :             this->coilType_Num = coilNum;
     589         1788 :             return true;
     590              :         }
     591              :     }
     592         1147 :     this->coilType_Num = 0;
     593         1147 :     return false;
     594              : }
     595              : 
     596         2935 : bool BaseSizer::isValidFanType(std::string const &_compType)
     597              : {
     598              :     // if compType name is one of the fan objects, then return true
     599         2935 :     if (Util::SameString(_compType, "Fan:SystemModel")) {
     600           50 :         return true;
     601         2885 :     } else if (Util::SameString(_compType, "Fan:ComponentModel")) {
     602            0 :         return true;
     603         2885 :     } else if (Util::SameString(_compType, "Fan:OnOff")) {
     604           71 :         return true;
     605         2814 :     } else if (Util::SameString(_compType, "Fan:ConstantVolume")) {
     606           17 :         return true;
     607         2797 :     } else if (Util::SameString(_compType, "Fan:VariableVolume")) {
     608           20 :         return true;
     609              :     } else {
     610         2777 :         return false;
     611              :     }
     612              : }
     613              : 
     614         2964 : bool BaseSizer::checkInitialized(EnergyPlusData &state, bool &errorsFound)
     615              : {
     616         2964 :     if (!this->initialized) {
     617           31 :         errorsFound = true;
     618           31 :         this->errorType = AutoSizingResultType::ErrorType2;
     619           31 :         this->autoSizedValue = 0.0;
     620           31 :         std::string msg = "Developer Error: uninitialized sizing of " + this->sizingString + ".";
     621           31 :         this->addErrorMessage(msg);
     622           31 :         ShowSevereError(state, msg);
     623           31 :         msg = "Occurs in " + this->compType + " " + this->compName;
     624           31 :         this->addErrorMessage(msg);
     625           31 :         ShowContinueError(state, msg);
     626           31 :         return false;
     627           31 :     }
     628         2933 :     return true;
     629              : }
     630              : 
     631         1590 : void BaseSizer::overrideSizingString(std::string_view const string)
     632              : {
     633         1590 :     this->sizingString = string;
     634         1590 :     this->overrideSizeString = false;
     635         1590 : }
     636              : 
     637          199 : Real64 BaseSizer::setOAFracForZoneEqSizing(const EnergyPlusData &state, Real64 const desMassFlow, DataSizing::ZoneEqSizingData const &zoneEqSizing)
     638              : {
     639          199 :     Real64 outAirFrac = 0.0;
     640          199 :     if (desMassFlow <= 0.0) {
     641            7 :         return outAirFrac;
     642              :     }
     643              : 
     644          192 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     645              :         // set central DOAS AT mixer OA fraction
     646           22 :         outAirFrac = min(state.dataEnvrn->StdRhoAir * zoneEqSizing.ATMixerVolFlow / desMassFlow, 1.0);
     647          170 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // set zone equipment OA fraction
     648           20 :         outAirFrac = min(state.dataEnvrn->StdRhoAir * zoneEqSizing.OAVolFlow / desMassFlow, 1.0);
     649              :     }
     650          192 :     return outAirFrac;
     651              : }
     652              : 
     653           91 : Real64 BaseSizer::setHeatCoilInletTempForZoneEqSizing(Real64 const outAirFrac,
     654              :                                                       DataSizing::ZoneEqSizingData const &zoneEqSizing,
     655              :                                                       DataSizing::ZoneSizingData const &finalZoneSizing)
     656              : {
     657           91 :     Real64 coilInTemp = 0.0;
     658           91 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     659              :         // adjust for central DOAS AT mixer mixed inlet temp
     660            9 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneRetTempAtHeatPeak + outAirFrac * zoneEqSizing.ATMixerHeatPriDryBulb;
     661           82 :     } else if (zoneEqSizing.OAVolFlow > 0.0) {
     662              :         // adjust for raw OA mixed inlet temp
     663           11 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneTempAtHeatPeak + outAirFrac * finalZoneSizing.OutTempAtHeatPeak;
     664              :     } else {
     665              :         // use zone condition for sizing zone equipment
     666           71 :         coilInTemp = finalZoneSizing.ZoneTempAtHeatPeak;
     667              :     }
     668           91 :     return coilInTemp;
     669              : }
     670              : 
     671           68 : Real64 BaseSizer::setHeatCoilInletHumRatForZoneEqSizing(Real64 const outAirFrac,
     672              :                                                         DataSizing::ZoneEqSizingData const &zoneEqSizing,
     673              :                                                         DataSizing::ZoneSizingData const &finalZoneSizing)
     674              : {
     675           68 :     Real64 coilInHumRat = 0.0;
     676           68 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     677              :         // adjust for central DOAS AT mixer mixed inlet humrat
     678            8 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak + outAirFrac * zoneEqSizing.ATMixerHeatPriHumRat;
     679           60 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // adjust for raw OA mixed inlet humrat
     680           10 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak + outAirFrac * finalZoneSizing.OutHumRatAtHeatPeak;
     681              :     } else {
     682           50 :         coilInHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak;
     683              :     }
     684           68 :     return coilInHumRat;
     685              : }
     686              : 
     687           27 : Real64 BaseSizer::setCoolCoilInletTempForZoneEqSizing(Real64 const outAirFrac,
     688              :                                                       DataSizing::ZoneEqSizingData const &zoneEqSizing,
     689              :                                                       DataSizing::ZoneSizingData const &finalZoneSizing)
     690              : {
     691           27 :     Real64 coilInTemp = 0.0;
     692           27 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     693              :         // adjust for central DOAS AT mixer mixed inlet temp
     694            6 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneRetTempAtCoolPeak + outAirFrac * zoneEqSizing.ATMixerCoolPriDryBulb;
     695           21 :     } else if (zoneEqSizing.OAVolFlow > 0.0) {
     696              :         // adjust for raw OA mixed inlet temp
     697            3 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneTempAtCoolPeak + outAirFrac * finalZoneSizing.OutTempAtCoolPeak;
     698              :     } else {
     699              :         // use zone condition for sizing zone equipment
     700           18 :         coilInTemp = finalZoneSizing.ZoneTempAtCoolPeak;
     701              :     }
     702           27 :     return coilInTemp;
     703              : }
     704              : 
     705           34 : Real64 BaseSizer::setCoolCoilInletHumRatForZoneEqSizing(Real64 const outAirFrac,
     706              :                                                         DataSizing::ZoneEqSizingData const &zoneEqSizing,
     707              :                                                         DataSizing::ZoneSizingData const &finalZoneSizing)
     708              : {
     709           34 :     Real64 coilInHumRat = 0.0;
     710           34 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     711              :         // adjust for central DOAS AT mixer mixed inlet humrat
     712            6 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtCoolPeak + outAirFrac * zoneEqSizing.ATMixerCoolPriHumRat;
     713           28 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // adjust for raw OA mixed inlet humrat
     714            3 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtCoolPeak + outAirFrac * finalZoneSizing.OutHumRatAtCoolPeak;
     715              :     } else {
     716           25 :         coilInHumRat = finalZoneSizing.ZoneHumRatAtCoolPeak;
     717              :     }
     718           34 :     return coilInHumRat;
     719              : }
     720              : 
     721            5 : void BaseSizer::clearState()
     722              : {
     723            5 :     stdRhoAir = 0.0;
     724              : 
     725            5 :     zoneAirFlowSizMethod = 0;
     726            5 :     dataScalableSizingON = false;
     727            5 :     dataScalableCapSizingON = false;
     728            5 :     isCoilReportObject = false; // provides access to coil reporting
     729            5 :     isFanReportObject = false;  // provides access to fan reporting
     730            5 :     initialized = false;        // indicates initializeWithinEP was called
     731            5 :     errorType = AutoSizingResultType::NoError;
     732            5 :     sizingString = "";
     733            5 :     sizingStringScalable = "";
     734            5 :     overrideSizeString = true;
     735            5 :     originalValue = 0.0;
     736            5 :     autoSizedValue = 0.0;
     737            5 :     wasAutoSized = false;
     738            5 :     hardSizeNoDesignRun = false;
     739            5 :     sizingDesRunThisAirSys = false;
     740            5 :     sizingDesRunThisZone = false;
     741            5 :     sizingDesValueFromParent = false;
     742            5 :     airLoopSysFlag = false;
     743            5 :     oaSysFlag = false;
     744            5 :     coilType_Num = 0;
     745            5 :     compType = "";
     746            5 :     compName = "";
     747            5 :     isEpJSON = false;
     748              : 
     749            5 :     sysSizingRunDone = false;
     750            5 :     zoneSizingRunDone = false;
     751            5 :     curSysNum = 0;
     752            5 :     curOASysNum = 0;
     753            5 :     curZoneEqNum = 0;
     754            5 :     curDuctType = HVAC::AirDuctType::Invalid;
     755            5 :     curTermUnitSizingNum = 0; // index in zone equipment vector - for single duct, IU, and PIU
     756            5 :     numPrimaryAirSys = 0;
     757            5 :     numSysSizInput = 0;
     758            5 :     doSystemSizing = false;
     759            5 :     numZoneSizingInput = 0;
     760            5 :     doZoneSizing = false;
     761            5 :     autoCalculate = false; // indicator that AutoCalculate is used
     762              : 
     763              :     // terminal units
     764            5 :     termUnitSingDuct = false; // single duct terminal unit
     765            5 :     termUnitPIU = false;      // powered induction unit
     766            5 :     termUnitIU = false;       // induction terminal unit
     767            5 :     zoneEqFanCoil = false;    // fan coil zone equipment
     768            5 :     otherEqType = false;      // this covers the ELSE type switch
     769            5 :     zoneEqUnitHeater = false; // unit heater zone equipment
     770            5 :     zoneEqUnitVent = false;   // unit ventilator zone equipment
     771            5 :     zoneEqVentedSlab = false; // ventilated slab zone equipment
     772              : 
     773              :     // error message handling
     774            5 :     getLastErrorMessages();
     775              : 
     776              :     // global sizing data
     777            5 :     minOA = DataSizing::OAControl::Invalid;
     778              : 
     779              :     // global Data* sizing constants
     780            5 :     dataEMSOverrideON = false;
     781            5 :     dataEMSOverride = 0.0;
     782            5 :     dataAutosizable = false;
     783            5 :     dataConstantUsedForSizing = 0.0;
     784            5 :     dataFractionUsedForSizing = 0.0;
     785            5 :     dataDXCoolsLowSpeedsAutozize = false;
     786            5 :     dataPltSizHeatNum = 0;
     787            5 :     dataWaterLoopNum = 0;
     788            5 :     dataFanIndex = -1;
     789            5 :     dataFanType = HVAC::FanType::Invalid;
     790            5 :     dataWaterCoilSizCoolDeltaT = 0.0;
     791            5 :     dataWaterCoilSizHeatDeltaT = 0.0;
     792            5 :     dataCapacityUsedForSizing = 0.0;
     793            5 :     dataPltSizCoolNum = 0;
     794            5 :     dataDesInletAirHumRat = 0.0;
     795            5 :     dataFlowUsedForSizing = 0.0;
     796            5 :     dataDesOutletAirHumRat = 0.0;
     797            5 :     dataDesInletWaterTemp = 0.0;
     798            5 :     dataDesOutletAirTemp = 0.0;
     799            5 :     dataWaterFlowUsedForSizing = 0.0;
     800            5 :     dataSizingFraction = 1.0;
     801            5 :     dataDXSpeedNum = 0.0;
     802            5 :     dataAirFlowUsedForSizing = 0.0;
     803            5 :     dataDesInletAirTemp = 0.0;
     804            5 :     dataDesAccountForFanHeat = false;
     805            5 :     dataFanPlacement = HVAC::FanPlace::Invalid;
     806            5 :     dataDesicRegCoil = false;
     807            5 :     dataHeatSizeRatio = 0.0;
     808            5 :     dataZoneUsedForSizing = 0;
     809            5 :     dataDesicDehumNum = 0;
     810            5 :     dataNomCapInpMeth = false;
     811            5 :     dataCoilNum = 0;
     812            5 :     dataFanOp = HVAC::FanOp::Invalid;
     813            5 :     dataDesignCoilCapacity = 0.0;
     814            5 :     dataErrorsFound = false;
     815            5 :     dataBypassFrac = 0.0;
     816            5 :     dataIsDXCoil = false;
     817              : 
     818            5 :     dataNonZoneNonAirloopValue = 0.0;
     819              : 
     820            5 :     printWarningFlag = false;
     821            5 :     callingRoutine = "";
     822            5 :     sysSizingInputData.clear();
     823            5 :     zoneSizingInput.clear();
     824            5 :     unitarySysEqSizing.clear();
     825            5 :     oaSysEqSizing.clear();
     826            5 :     zoneEqSizing.clear();
     827            5 :     outsideAirSys.clear();
     828            5 :     termUnitSizing.clear();
     829            5 :     termUnitFinalZoneSizing.clear();
     830            5 :     finalZoneSizing.clear();
     831            5 :     finalSysSizing.clear();
     832            5 :     plantSizData.clear();
     833            5 :     primaryAirSystem.clear();
     834            5 :     airloopDOAS.clear();
     835            5 : }
     836              : 
     837              : } // namespace EnergyPlus
        

Generated by: LCOV version 2.0-1