LCOV - code coverage report
Current view: top level - EnergyPlus/Autosizing - Base.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 55.0 % 582 320
Test Date: 2025-06-02 07:23:51 Functions: 85.0 % 20 17

            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        44746 : 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        44746 :     this->initialized = true;
      68        44746 :     this->compType = _compType;
      69        44746 :     this->compName = _compName;
      70        44746 :     this->isEpJSON = state.dataGlobal->isEpJSON;
      71        44746 :     this->printWarningFlag = _printWarningFlag;
      72        44746 :     this->callingRoutine = _callingRoutine;
      73        44746 :     this->stdRhoAir = state.dataEnvrn->StdRhoAir;
      74        44746 :     this->sysSizingRunDone = state.dataSize->SysSizingRunDone;
      75        44746 :     this->zoneSizingRunDone = state.dataSize->ZoneSizingRunDone;
      76        44746 :     this->curSysNum = state.dataSize->CurSysNum;
      77        44746 :     this->curOASysNum = state.dataSize->CurOASysNum;
      78        44746 :     this->curZoneEqNum = state.dataSize->CurZoneEqNum;
      79        44746 :     this->curDuctType = state.dataSize->CurDuctType;
      80        44746 :     this->numPrimaryAirSys = state.dataHVACGlobal->NumPrimaryAirSys;
      81        44746 :     this->numSysSizInput = state.dataSize->NumSysSizInput;
      82        44746 :     this->doSystemSizing = state.dataGlobal->DoSystemSizing;
      83        44746 :     this->numZoneSizingInput = state.dataSize->NumZoneSizingInput;
      84        44746 :     this->doZoneSizing = state.dataGlobal->DoZoneSizing;
      85        44746 :     this->curTermUnitSizingNum = state.dataSize->CurTermUnitSizingNum;
      86        44746 :     this->termUnitSingDuct = state.dataSize->TermUnitSingDuct;
      87        44746 :     this->termUnitPIU = state.dataSize->TermUnitPIU;
      88        44746 :     this->termUnitIU = state.dataSize->TermUnitIU;
      89        44746 :     this->zoneEqFanCoil = state.dataSize->ZoneEqFanCoil;
      90        44746 :     this->otherEqType = !(this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU || this->zoneEqFanCoil);
      91        44746 :     this->zoneEqUnitHeater = state.dataSize->ZoneEqUnitHeater;
      92        44746 :     this->zoneEqUnitVent = state.dataSize->ZoneEqUnitVent;
      93        44746 :     this->zoneEqVentedSlab = state.dataSize->ZoneEqVentedSlab;
      94        44746 :     this->zoneSizingInput = state.dataSize->ZoneSizingInput;
      95        44746 :     this->unitarySysEqSizing = state.dataSize->UnitarySysEqSizing;
      96        44746 :     this->oaSysEqSizing = state.dataSize->OASysEqSizing;
      97        44746 :     this->outsideAirSys = state.dataAirLoop->OutsideAirSys;
      98        44746 :     this->termUnitSizing = state.dataSize->TermUnitSizing;
      99        44746 :     this->finalZoneSizing = state.dataSize->FinalZoneSizing;
     100        44746 :     this->termUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing;
     101        44746 :     this->zoneEqSizing = state.dataSize->ZoneEqSizing;
     102        44746 :     this->sysSizingInputData = state.dataSize->SysSizInput;
     103        44746 :     this->finalSysSizing = state.dataSize->FinalSysSizing;
     104        44746 :     this->plantSizData = state.dataSize->PlantSizData;
     105        44746 :     this->primaryAirSystem = state.dataAirSystemsData->PrimaryAirSystems;
     106        44746 :     this->airLoopControlInfo = state.dataAirLoop->AirLoopControlInfo;
     107        44746 :     this->airloopDOAS = state.dataAirLoopHVACDOAS->airloopDOAS;
     108        44746 :     if (EnergyPlus::BaseSizer::isValidCoilType(this->compType)) { // coil reports fail if compType is not one of HVAC::cAllCoilTypes
     109        33964 :         this->isCoilReportObject = true;
     110              :     }
     111        44746 :     if (EnergyPlus::BaseSizer::isValidFanType(this->compType)) { // fan reports fail if compType is not a valid fan type
     112         2215 :         this->isFanReportObject = true;
     113              :     }
     114              : 
     115              :     // global sizing data
     116        44746 :     dataEMSOverrideON = state.dataSize->DataEMSOverrideON;
     117        44746 :     dataEMSOverride = state.dataSize->DataEMSOverride;
     118        44746 :     this->dataAutosizable = state.dataSize->DataAutosizable;
     119        44746 :     this->minOA = DataSizing::OAControl::MinOA;
     120        44746 :     this->dataConstantUsedForSizing = state.dataSize->DataConstantUsedForSizing;
     121        44746 :     this->dataFractionUsedForSizing = state.dataSize->DataFractionUsedForSizing;
     122        44746 :     state.dataSize->DataConstantUsedForSizing = 0.0; // reset here instead of in component model?
     123        44746 :     state.dataSize->DataFractionUsedForSizing = 0.0;
     124              : 
     125        44746 :     this->dataFanIndex = state.dataSize->DataFanIndex;
     126        44746 :     this->dataFanType = state.dataSize->DataFanType;
     127              : 
     128              :     // global Data* sizing constants
     129        44746 :     this->dataPltSizHeatNum = state.dataSize->DataPltSizHeatNum;
     130        44746 :     this->dataWaterLoopNum = state.dataSize->DataWaterLoopNum;
     131        44746 :     this->dataPltSizCoolNum = state.dataSize->DataPltSizCoolNum;
     132        44746 :     this->dataWaterCoilSizHeatDeltaT = state.dataSize->DataWaterCoilSizHeatDeltaT;
     133        44746 :     this->dataWaterCoilSizCoolDeltaT = state.dataSize->DataWaterCoilSizCoolDeltaT;
     134        44746 :     this->dataCapacityUsedForSizing = state.dataSize->DataCapacityUsedForSizing;
     135        44746 :     this->dataHeatSizeRatio = state.dataSize->DataHeatSizeRatio;
     136              : 
     137        44746 :     this->dataAirFlowUsedForSizing = state.dataSize->DataAirFlowUsedForSizing;
     138        44746 :     this->dataDesInletAirTemp = state.dataSize->DataDesInletAirTemp;
     139        44746 :     this->dataDesAccountForFanHeat = state.dataSize->DataDesAccountForFanHeat;
     140        44746 :     this->dataFanPlacement = state.dataSize->DataFanPlacement;
     141        44746 :     this->dataDesInletAirHumRat = state.dataSize->DataDesInletAirHumRat;
     142        44746 :     this->dataDesOutletAirHumRat = state.dataSize->DataDesOutletAirHumRat;
     143        44746 :     this->dataDesOutletAirTemp = state.dataSize->DataDesOutletAirTemp;
     144        44746 :     this->dataDesInletWaterTemp = state.dataSize->DataDesInletWaterTemp;
     145        44746 :     this->dataFlowUsedForSizing = state.dataSize->DataFlowUsedForSizing;
     146        44746 :     this->dataWaterFlowUsedForSizing = state.dataSize->DataWaterFlowUsedForSizing;
     147              : 
     148        44746 :     this->dataSizingFraction = state.dataSize->DataSizingFraction;
     149        44746 :     this->dataDXSpeedNum = state.dataSize->DataDXSpeedNum;
     150        44746 :     this->dataDesicRegCoil = state.dataSize->DataDesicRegCoil;
     151        44746 :     this->dataZoneUsedForSizing = state.dataSize->DataZoneUsedForSizing;
     152        44746 :     this->dataDesicDehumNum = state.dataSize->DataDesicDehumNum;
     153              : 
     154        44746 :     this->dataNomCapInpMeth = state.dataSize->DataNomCapInpMeth;
     155        44746 :     this->dataCoilNum = state.dataSize->DataCoilNum;
     156        44746 :     this->dataFanOp = state.dataSize->DataFanOp;
     157        44746 :     this->dataDesignCoilCapacity = state.dataSize->DataDesignCoilCapacity;
     158        44746 :     this->dataErrorsFound = state.dataSize->DataErrorsFound;
     159        44746 :     this->dataBypassFrac = state.dataSize->DataBypassFrac;
     160        44746 :     this->dataIsDXCoil = state.dataSize->DataIsDXCoil;
     161        44746 :     this->dataNonZoneNonAirloopValue = state.dataSize->DataNonZoneNonAirloopValue;
     162        44746 :     this->dataDXCoolsLowSpeedsAutozize = state.dataSize->DataDXCoolsLowSpeedsAutozize;
     163        44746 : }
     164              : 
     165            0 : void BaseSizer::initializeFromAPI(EnergyPlusData &state, Real64 const elevation)
     166              : {
     167            0 :     this->clearState();
     168            0 :     this->initialized = true;
     169            0 :     this->compType = "API_component_type";
     170            0 :     this->compName = "API_component_name";
     171            0 :     this->printWarningFlag = false;
     172            0 :     this->callingRoutine = "called_from_API";
     173            0 :     Real64 barometricPressure = DataEnvironment::StdPressureSeaLevel * std::pow(1.0 - 2.25577e-05 * elevation, 5.2559);
     174            0 :     this->stdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(state, barometricPressure, 20.0, 0.0);
     175            0 :     this->isCoilReportObject = false;
     176            0 : }
     177              : 
     178          231 : void BaseSizer::addErrorMessage(std::string const &s)
     179              : {
     180          231 :     this->lastErrorMessages.append(s).append("\n");
     181          231 : }
     182              : 
     183            0 : std::string BaseSizer::getLastErrorMessages()
     184              : {
     185            0 :     std::string s(this->lastErrorMessages);
     186            0 :     this->lastErrorMessages = "";
     187            0 :     return s;
     188            0 : }
     189              : 
     190        44742 : void BaseSizer::preSize(EnergyPlusData &state, Real64 const _originalValue)
     191              : {
     192        44742 :     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        44742 :     this->originalValue = _originalValue;
     199        44742 :     this->autoCalculate = false;
     200        44742 :     this->errorType = EnergyPlus::AutoSizingResultType::NoError;
     201        44742 :     this->initialized = false; // force use of Init then Size in subsequent calls
     202        44742 :     this->hardSizeNoDesignRun = !(this->sysSizingRunDone || this->zoneSizingRunDone);
     203        44742 :     this->sizingDesRunThisZone = false;
     204        44742 :     this->sizingDesRunThisAirSys = false;
     205              : 
     206        44742 :     if (this->dataFractionUsedForSizing == 0.0 && this->dataConstantUsedForSizing > 0.0) {
     207            0 :         this->errorType = AutoSizingResultType::ErrorType1;
     208            0 :         this->autoCalculate = true;
     209            0 :         this->hardSizeNoDesignRun = false;
     210            0 :         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        44742 :     } else if (this->dataFractionUsedForSizing > 0.0) {
     218         2802 :         this->autoCalculate = true;
     219         2802 :         this->hardSizeNoDesignRun = false;
     220        41940 :     } else if (this->sizingType == AutoSizingType::AutoCalculateSizing) {
     221            0 :         this->autoCalculate = true;
     222            0 :         if (this->originalValue == DataSizing::AutoSize && !this->dataEMSOverrideON) {
     223            0 :             this->errorType = AutoSizingResultType::ErrorType1;
     224            0 :             std::string msg = "Sizing Library: DataConstantUsedForSizing and DataFractionUsedForSizing used for autocalculating " +
     225            0 :                               this->sizingString + " must both be greater than 0.";
     226            0 :             this->addErrorMessage(msg);
     227            0 :             ShowSevereError(state, msg);
     228            0 :         }
     229              :     }
     230              : 
     231        44742 :     if (this->curSysNum > 0 && this->curSysNum <= this->numPrimaryAirSys) {
     232        16891 :         if (this->sysSizingRunDone) {
     233        15577 :             int sysNum = this->curSysNum;
     234        15577 :             this->sizingDesRunThisAirSys = std::any_of(
     235        78794 :                 this->sysSizingInputData.begin(), this->sysSizingInputData.end(), [sysNum](auto const &ssid) { return ssid.AirLoopNum == sysNum; });
     236              :         }
     237        16891 :         if (allocated(this->unitarySysEqSizing)) {
     238        16891 :             this->airLoopSysFlag =
     239        16891 :                 this->unitarySysEqSizing(this->curSysNum).CoolingCapacity || this->unitarySysEqSizing(this->curSysNum).HeatingCapacity;
     240              :         }
     241        16891 :         if (this->curOASysNum > 0) {
     242          704 :             this->oaSysFlag = this->oaSysEqSizing(this->curOASysNum).CoolingCapacity || this->oaSysEqSizing(this->curOASysNum).HeatingCapacity;
     243              :         }
     244              :     }
     245              : 
     246        44742 :     if (this->curZoneEqNum > 0) {
     247        27773 :         if (allocated(this->zoneEqSizing)) {
     248        27773 :             this->sizingDesValueFromParent = this->zoneEqSizing(this->curZoneEqNum).DesignSizeFromParent;
     249              :         }
     250        27773 :         if (this->zoneSizingRunDone) {
     251        27616 :             int zoneNum = this->curZoneEqNum;
     252        27616 :             this->sizingDesRunThisZone = std::any_of(
     253       616620 :                 this->zoneSizingInput.begin(), this->zoneSizingInput.end(), [zoneNum](auto const &zsi) { return zsi.ZoneNum == zoneNum; });
     254              :         }
     255        27773 :         this->hardSizeNoDesignRun = false;
     256              :     }
     257              : 
     258        44742 :     if (this->originalValue == DataSizing::AutoSize) {
     259        40275 :         this->wasAutoSized = true;
     260        40275 :         this->hardSizeNoDesignRun = false;
     261        40275 :         if (!this->sizingDesRunThisAirSys && this->curSysNum > 0 && !this->autoCalculate) {
     262           21 :             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        40275 :         if (!this->sizingDesRunThisZone && this->curZoneEqNum > 0 && !this->sizingDesValueFromParent && !this->autoCalculate) {
     280          198 :             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         4467 :         this->wasAutoSized = false;
     299              :     }
     300        44742 : }
     301              : 
     302        75192 : 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        75192 :     if (state.dataEnvrn->oneTimeCompRptHeaderFlag) {
     318          660 :         print(state.files.eio, Format_990);
     319          660 :         state.dataEnvrn->oneTimeCompRptHeaderFlag = false;
     320              :     }
     321              : 
     322        75192 :     print(state.files.eio, Format_991, CompType, CompName, VarDesc, VarValue);
     323              :     // add to tabular output reports
     324        75192 :     OutputReportPredefined::AddCompSizeTableEntry(state, CompType, CompName, VarDesc, VarValue);
     325              : 
     326        75192 :     if (present(UsrDesc) && present(UsrValue)) {
     327         3888 :         print(state.files.eio, Format_991, CompType, CompName, UsrDesc(), UsrValue());
     328         3888 :         OutputReportPredefined::AddCompSizeTableEntry(state, CompType, CompName, UsrDesc(), UsrValue);
     329        71304 :     } 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        75192 :     if (state.dataSQLiteProcedures->sqlite) {
     335        20862 :         state.dataSQLiteProcedures->sqlite->addSQLiteComponentSizingRecord(CompType, CompName, VarDesc, VarValue);
     336              :     }
     337        75192 :     if (present(UsrDesc) && present(UsrValue)) {
     338         3888 :         if (state.dataSQLiteProcedures->sqlite) {
     339          958 :             state.dataSQLiteProcedures->sqlite->addSQLiteComponentSizingRecord(CompType, CompName, UsrDesc(), UsrValue);
     340              :         }
     341              :     }
     342        75192 : }
     343              : 
     344        40936 : void BaseSizer::selectSizerOutput(EnergyPlusData &state, bool &errorsFound)
     345              : {
     346        40936 :     if (this->printWarningFlag) {
     347        20274 :         if (this->dataEMSOverrideON) { // EMS overrides value
     348            0 :             this->autoSizedValue = this->dataEMSOverride;
     349            0 :             this->reportSizerOutput(
     350            0 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     351        20274 :         } else if (this->hardSizeNoDesignRun && !this->wasAutoSized && Util::SameString(this->compType, "Fan:ZoneExhaust")) {
     352            0 :             this->autoSizedValue = this->originalValue;
     353        20274 :         } else if (this->wasAutoSized && this->dataFractionUsedForSizing > 0.0 && this->dataConstantUsedForSizing > 0.0) {
     354         1016 :             this->autoSizedValue = this->dataFractionUsedForSizing * this->dataConstantUsedForSizing;
     355         3048 :             this->reportSizerOutput(
     356         2032 :                 state, this->compType, this->compName, "Design Size " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     357        19258 :         } else if (!this->wasAutoSized &&
     358         2577 :                    (this->autoSizedValue == this->originalValue || this->autoSizedValue == 0.0)) { // no sizing run done or autosizes to 0
     359         1599 :             this->autoSizedValue = this->originalValue;
     360         3198 :             if (this->dataAutosizable || (!this->sizingDesRunThisZone && Util::SameString(this->compType, "Fan:ZoneExhaust"))) {
     361         4797 :                 this->reportSizerOutput(
     362         3198 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     363              :             }
     364        17659 :         } else if (!this->wasAutoSized && this->autoSizedValue >= 0.0 && this->originalValue == 0.0) { // input was blank or zero
     365          219 :             this->autoSizedValue = this->originalValue;
     366          657 :             this->reportSizerOutput(
     367          438 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     368        17440 :         } else if (this->wasAutoSized && this->autoSizedValue >= 0.0 &&
     369        16681 :                    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        16681 :             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        16681 :                 this->reportSizerOutput(state, this->compType, this->compName, "Design Size " + this->sizingString, this->autoSizedValue);
     376              :             }
     377          759 :         } else if (this->autoSizedValue >= 0.0 && this->originalValue > 0.0) {
     378          759 :             if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     379          500 :                 if (this->dataAutosizable) {
     380         1155 :                     this->reportSizerOutput(state,
     381              :                                             this->compType,
     382              :                                             this->compName,
     383          770 :                                             "Design Size " + this->sizingString,
     384              :                                             this->autoSizedValue,
     385          770 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString,
     386          385 :                                             this->originalValue);
     387              :                 }
     388              :             } else {
     389          259 :                 if (this->dataAutosizable) {
     390          681 :                     this->reportSizerOutput(state,
     391              :                                             this->compType,
     392              :                                             this->compName,
     393          454 :                                             "User-Specified " + this->sizingStringScalable + this->sizingString,
     394              :                                             this->originalValue);
     395              :                 }
     396              :             }
     397          759 :             if (state.dataGlobal->DisplayExtraWarnings && this->dataAutosizable) {
     398            5 :                 if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     399            5 :                     std::string msg = this->callingRoutine + ": Potential issue with equipment sizing for " + this->compType + ' ' + this->compName;
     400            5 :                     this->addErrorMessage(msg);
     401            5 :                     ShowMessage(state, msg);
     402            5 :                     msg = format("User-Specified {}{} = {:.5R}", this->sizingStringScalable, this->sizingString, this->originalValue);
     403            5 :                     this->addErrorMessage(msg);
     404            5 :                     ShowContinueError(state, msg);
     405            5 :                     msg = format("differs from Design Size {} = {:.5R}", this->sizingString, this->autoSizedValue);
     406            5 :                     this->addErrorMessage(msg);
     407            5 :                     ShowContinueError(state, msg);
     408            5 :                     msg = "This may, or may not, indicate mismatched component sizes.";
     409            5 :                     this->addErrorMessage(msg);
     410            5 :                     ShowContinueError(state, msg);
     411            5 :                     msg = "Verify that the value entered is intended and is consistent with other components.";
     412            5 :                     this->addErrorMessage(msg);
     413            5 :                     ShowContinueError(state, msg);
     414            5 :                 }
     415              :             }
     416          759 :             if (!this->wasAutoSized) {
     417          759 :                 this->autoSizedValue = this->originalValue;
     418              :             }
     419          759 :         } else if (this->wasAutoSized && this->autoSizedValue != DataSizing::AutoSize) {
     420            0 :             this->reportSizerOutput(
     421            0 :                 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        20662 :     } else if (!this->wasAutoSized && !this->autoCalculate) {
     432          732 :         this->autoSizedValue = this->originalValue;
     433              :     }
     434        40936 :     this->overrideSizeString = true; // reset for next sizer
     435        40936 :     if (this->errorType != AutoSizingResultType::NoError) {
     436            0 :         std::string msg = "Developer Error: sizing of " + this->sizingString + " failed.";
     437            0 :         this->addErrorMessage(msg);
     438            0 :         ShowSevereError(state, msg);
     439            0 :         msg = "Occurs in " + this->compType + " " + this->compName;
     440            0 :         this->addErrorMessage(msg);
     441            0 :         ShowContinueError(state, msg);
     442            0 :         errorsFound = true;
     443            0 :     }
     444        40936 : }
     445              : 
     446         3806 : void BaseSizer::select2StgDXHumCtrlSizerOutput(EnergyPlusData &state, bool &errorsFound)
     447              : {
     448         3806 :     if (this->printWarningFlag) {
     449         2068 :         if (this->dataEMSOverrideON) { // EMS overrides value
     450            0 :             this->reportSizerOutput(
     451            0 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     452            0 :             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         2068 :         } else if (!this->wasAutoSized && (this->autoSizedValue == this->originalValue || this->autoSizedValue == 0.0)) { // no sizing run done
     461          291 :             this->autoSizedValue = this->originalValue;
     462          873 :             this->reportSizerOutput(
     463          582 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     464          298 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     465            7 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     466           21 :                 this->reportSizerOutput(state,
     467              :                                         this->compType,
     468              :                                         this->compName,
     469           14 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString + " ( non-bypassed )",
     470              :                                         this->autoSizedValue);
     471              :             }
     472         1777 :         } else if (!this->wasAutoSized && this->autoSizedValue >= 0.0 && this->originalValue == 0.0) { // input was blank or zero
     473            3 :             this->autoSizedValue = this->originalValue;
     474            9 :             this->reportSizerOutput(
     475            6 :                 state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     476            3 :             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         1774 :         } else if (this->wasAutoSized && this->autoSizedValue >= 0.0 &&
     485         1602 :                    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         1602 :             if (this->dataScalableSizingON && int(this->zoneAirFlowSizMethod) > 0) {
     488            6 :                 this->reportSizerOutput(
     489            4 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->autoSizedValue);
     490              :             } else {
     491         1600 :                 this->reportSizerOutput(state, this->compType, this->compName, "Design Size " + this->sizingString, this->autoSizedValue);
     492              :             }
     493         1630 :             if (Util::SameString(this->compType, "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE")) {
     494           28 :                 this->autoSizedValue *= (1 - this->dataBypassFrac); // now reapply for second message and remianing simulation calcs
     495           84 :                 this->reportSizerOutput(
     496           56 :                     state, this->compType, this->compName, "Design Size " + this->sizingString + " ( non-bypassed )", this->autoSizedValue);
     497              :             }
     498          172 :         } else if (this->autoSizedValue >= 0.0 && this->originalValue > 0.0) {
     499          172 :             if ((std::abs(this->autoSizedValue - this->originalValue) / this->originalValue) > state.dataSize->AutoVsHardSizingThreshold) {
     500          238 :                 this->reportSizerOutput(state,
     501              :                                         this->compType,
     502              :                                         this->compName,
     503          238 :                                         "Design Size " + this->sizingString,
     504              :                                         this->autoSizedValue,
     505          238 :                                         "User-Specified " + this->sizingStringScalable + this->sizingString,
     506          119 :                                         this->originalValue);
     507          119 :                 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           53 :                 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          159 :                 this->reportSizerOutput(
     523          106 :                     state, this->compType, this->compName, "User-Specified " + this->sizingStringScalable + this->sizingString, this->originalValue);
     524           53 :                 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          172 :             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          172 :             if (!this->wasAutoSized) {
     553          172 :                 this->autoSizedValue = this->originalValue;
     554              :             }
     555          172 :         } 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         1738 :     } else if (!this->wasAutoSized && !this->autoCalculate) {
     568          391 :         this->autoSizedValue = this->originalValue;
     569              :     }
     570         3806 :     this->overrideSizeString = true; // reset for next sizer
     571         3806 :     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         3806 : }
     581              : 
     582        44746 : bool BaseSizer::isValidCoilType(std::string const &_compType)
     583              : {
     584        44746 :     int coilNum = 0;
     585       930088 :     for (auto const &coilType : HVAC::cAllCoilTypes) {
     586       919306 :         coilNum += 1;
     587       919306 :         if (Util::SameString(_compType, coilType)) {
     588        33964 :             this->coilType_Num = coilNum;
     589        33964 :             return true;
     590              :         }
     591              :     }
     592        10782 :     this->coilType_Num = 0;
     593        10782 :     return false;
     594              : }
     595              : 
     596        44746 : bool BaseSizer::isValidFanType(std::string const &_compType)
     597              : {
     598              :     // if compType name is one of the fan objects, then return true
     599        44746 :     if (Util::SameString(_compType, "Fan:SystemModel")) {
     600          231 :         return true;
     601        44515 :     } else if (Util::SameString(_compType, "Fan:ComponentModel")) {
     602            5 :         return true;
     603        44510 :     } else if (Util::SameString(_compType, "Fan:OnOff")) {
     604         1013 :         return true;
     605        43497 :     } else if (Util::SameString(_compType, "Fan:ConstantVolume")) {
     606          529 :         return true;
     607        42968 :     } else if (Util::SameString(_compType, "Fan:VariableVolume")) {
     608          437 :         return true;
     609              :     } else {
     610        42531 :         return false;
     611              :     }
     612              : }
     613              : 
     614        44742 : bool BaseSizer::checkInitialized(EnergyPlusData &state, bool &errorsFound)
     615              : {
     616        44742 :     if (!this->initialized) {
     617            0 :         errorsFound = true;
     618            0 :         this->errorType = AutoSizingResultType::ErrorType2;
     619            0 :         this->autoSizedValue = 0.0;
     620            0 :         std::string msg = "Developer Error: uninitialized sizing of " + this->sizingString + ".";
     621            0 :         this->addErrorMessage(msg);
     622            0 :         ShowSevereError(state, msg);
     623            0 :         msg = "Occurs in " + this->compType + " " + this->compName;
     624            0 :         this->addErrorMessage(msg);
     625            0 :         ShowContinueError(state, msg);
     626            0 :         return false;
     627            0 :     }
     628        44742 :     return true;
     629              : }
     630              : 
     631        18729 : void BaseSizer::overrideSizingString(std::string_view const string)
     632              : {
     633        18729 :     this->sizingString = string;
     634        18729 :     this->overrideSizeString = false;
     635        18729 : }
     636              : 
     637         2698 : Real64 BaseSizer::setOAFracForZoneEqSizing(const EnergyPlusData &state, Real64 const desMassFlow, DataSizing::ZoneEqSizingData const &zoneEqSizing)
     638              : {
     639         2698 :     Real64 outAirFrac = 0.0;
     640         2698 :     if (desMassFlow <= 0.0) {
     641            0 :         return outAirFrac;
     642              :     }
     643              : 
     644         2698 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     645              :         // set central DOAS AT mixer OA fraction
     646          208 :         outAirFrac = min(state.dataEnvrn->StdRhoAir * zoneEqSizing.ATMixerVolFlow / desMassFlow, 1.0);
     647         2490 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // set zone equipment OA fraction
     648         1243 :         outAirFrac = min(state.dataEnvrn->StdRhoAir * zoneEqSizing.OAVolFlow / desMassFlow, 1.0);
     649              :     }
     650         2698 :     return outAirFrac;
     651              : }
     652              : 
     653         1154 : Real64 BaseSizer::setHeatCoilInletTempForZoneEqSizing(Real64 const outAirFrac,
     654              :                                                       DataSizing::ZoneEqSizingData const &zoneEqSizing,
     655              :                                                       DataSizing::ZoneSizingData const &finalZoneSizing)
     656              : {
     657         1154 :     Real64 coilInTemp = 0.0;
     658         1154 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     659              :         // adjust for central DOAS AT mixer mixed inlet temp
     660           72 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneRetTempAtHeatPeak + outAirFrac * zoneEqSizing.ATMixerHeatPriDryBulb;
     661         1082 :     } else if (zoneEqSizing.OAVolFlow > 0.0) {
     662              :         // adjust for raw OA mixed inlet temp
     663          596 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneTempAtHeatPeak + outAirFrac * finalZoneSizing.OutTempAtHeatPeak;
     664              :     } else {
     665              :         // use zone condition for sizing zone equipment
     666          486 :         coilInTemp = finalZoneSizing.ZoneTempAtHeatPeak;
     667              :     }
     668         1154 :     return coilInTemp;
     669              : }
     670              : 
     671         1091 : Real64 BaseSizer::setHeatCoilInletHumRatForZoneEqSizing(Real64 const outAirFrac,
     672              :                                                         DataSizing::ZoneEqSizingData const &zoneEqSizing,
     673              :                                                         DataSizing::ZoneSizingData const &finalZoneSizing)
     674              : {
     675         1091 :     Real64 coilInHumRat = 0.0;
     676         1091 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     677              :         // adjust for central DOAS AT mixer mixed inlet humrat
     678           63 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak + outAirFrac * zoneEqSizing.ATMixerHeatPriHumRat;
     679         1028 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // adjust for raw OA mixed inlet humrat
     680          542 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak + outAirFrac * finalZoneSizing.OutHumRatAtHeatPeak;
     681              :     } else {
     682          486 :         coilInHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak;
     683              :     }
     684         1091 :     return coilInHumRat;
     685              : }
     686              : 
     687          186 : Real64 BaseSizer::setCoolCoilInletTempForZoneEqSizing(Real64 const outAirFrac,
     688              :                                                       DataSizing::ZoneEqSizingData const &zoneEqSizing,
     689              :                                                       DataSizing::ZoneSizingData const &finalZoneSizing)
     690              : {
     691          186 :     Real64 coilInTemp = 0.0;
     692          186 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     693              :         // adjust for central DOAS AT mixer mixed inlet temp
     694           34 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneRetTempAtCoolPeak + outAirFrac * zoneEqSizing.ATMixerCoolPriDryBulb;
     695          152 :     } else if (zoneEqSizing.OAVolFlow > 0.0) {
     696              :         // adjust for raw OA mixed inlet temp
     697           42 :         coilInTemp = (1.0 - outAirFrac) * finalZoneSizing.ZoneTempAtCoolPeak + outAirFrac * finalZoneSizing.OutTempAtCoolPeak;
     698              :     } else {
     699              :         // use zone condition for sizing zone equipment
     700          110 :         coilInTemp = finalZoneSizing.ZoneTempAtCoolPeak;
     701              :     }
     702          186 :     return coilInTemp;
     703              : }
     704              : 
     705          267 : Real64 BaseSizer::setCoolCoilInletHumRatForZoneEqSizing(Real64 const outAirFrac,
     706              :                                                         DataSizing::ZoneEqSizingData const &zoneEqSizing,
     707              :                                                         DataSizing::ZoneSizingData const &finalZoneSizing)
     708              : {
     709          267 :     Real64 coilInHumRat = 0.0;
     710          267 :     if (zoneEqSizing.ATMixerVolFlow > 0.0) {
     711              :         // adjust for central DOAS AT mixer mixed inlet humrat
     712           39 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtCoolPeak + outAirFrac * zoneEqSizing.ATMixerCoolPriHumRat;
     713          228 :     } else if (zoneEqSizing.OAVolFlow > 0.0) { // adjust for raw OA mixed inlet humrat
     714           63 :         coilInHumRat = (1.0 - outAirFrac) * finalZoneSizing.ZoneHumRatAtCoolPeak + outAirFrac * finalZoneSizing.OutHumRatAtCoolPeak;
     715              :     } else {
     716          165 :         coilInHumRat = finalZoneSizing.ZoneHumRatAtCoolPeak;
     717              :     }
     718          267 :     return coilInHumRat;
     719              : }
     720              : 
     721            0 : void BaseSizer::clearState()
     722              : {
     723            0 :     stdRhoAir = 0.0;
     724              : 
     725            0 :     zoneAirFlowSizMethod = 0;
     726            0 :     dataScalableSizingON = false;
     727            0 :     dataScalableCapSizingON = false;
     728            0 :     isCoilReportObject = false; // provides access to coil reporting
     729            0 :     isFanReportObject = false;  // provides access to fan reporting
     730            0 :     initialized = false;        // indicates initializeWithinEP was called
     731            0 :     errorType = AutoSizingResultType::NoError;
     732            0 :     sizingString = "";
     733            0 :     sizingStringScalable = "";
     734            0 :     overrideSizeString = true;
     735            0 :     originalValue = 0.0;
     736            0 :     autoSizedValue = 0.0;
     737            0 :     wasAutoSized = false;
     738            0 :     hardSizeNoDesignRun = false;
     739            0 :     sizingDesRunThisAirSys = false;
     740            0 :     sizingDesRunThisZone = false;
     741            0 :     sizingDesValueFromParent = false;
     742            0 :     airLoopSysFlag = false;
     743            0 :     oaSysFlag = false;
     744            0 :     coilType_Num = 0;
     745            0 :     compType = "";
     746            0 :     compName = "";
     747            0 :     isEpJSON = false;
     748              : 
     749            0 :     sysSizingRunDone = false;
     750            0 :     zoneSizingRunDone = false;
     751            0 :     curSysNum = 0;
     752            0 :     curOASysNum = 0;
     753            0 :     curZoneEqNum = 0;
     754            0 :     curDuctType = HVAC::AirDuctType::Invalid;
     755            0 :     curTermUnitSizingNum = 0; // index in zone equipment vector - for single duct, IU, and PIU
     756            0 :     numPrimaryAirSys = 0;
     757            0 :     numSysSizInput = 0;
     758            0 :     doSystemSizing = false;
     759            0 :     numZoneSizingInput = 0;
     760            0 :     doZoneSizing = false;
     761            0 :     autoCalculate = false; // indicator that AutoCalculate is used
     762              : 
     763              :     // terminal units
     764            0 :     termUnitSingDuct = false; // single duct terminal unit
     765            0 :     termUnitPIU = false;      // powered induction unit
     766            0 :     termUnitIU = false;       // induction terminal unit
     767            0 :     zoneEqFanCoil = false;    // fan coil zone equipment
     768            0 :     otherEqType = false;      // this covers the ELSE type switch
     769            0 :     zoneEqUnitHeater = false; // unit heater zone equipment
     770            0 :     zoneEqUnitVent = false;   // unit ventilator zone equipment
     771            0 :     zoneEqVentedSlab = false; // ventilated slab zone equipment
     772              : 
     773              :     // error message handling
     774            0 :     getLastErrorMessages();
     775              : 
     776              :     // global sizing data
     777            0 :     minOA = DataSizing::OAControl::Invalid;
     778              : 
     779              :     // global Data* sizing constants
     780            0 :     dataEMSOverrideON = false;
     781            0 :     dataEMSOverride = 0.0;
     782            0 :     dataAutosizable = false;
     783            0 :     dataConstantUsedForSizing = 0.0;
     784            0 :     dataFractionUsedForSizing = 0.0;
     785            0 :     dataDXCoolsLowSpeedsAutozize = false;
     786            0 :     dataPltSizHeatNum = 0;
     787            0 :     dataWaterLoopNum = 0;
     788            0 :     dataFanIndex = -1;
     789            0 :     dataFanType = HVAC::FanType::Invalid;
     790            0 :     dataWaterCoilSizCoolDeltaT = 0.0;
     791            0 :     dataWaterCoilSizHeatDeltaT = 0.0;
     792            0 :     dataCapacityUsedForSizing = 0.0;
     793            0 :     dataPltSizCoolNum = 0;
     794            0 :     dataDesInletAirHumRat = 0.0;
     795            0 :     dataFlowUsedForSizing = 0.0;
     796            0 :     dataDesOutletAirHumRat = 0.0;
     797            0 :     dataDesInletWaterTemp = 0.0;
     798            0 :     dataDesOutletAirTemp = 0.0;
     799            0 :     dataWaterFlowUsedForSizing = 0.0;
     800            0 :     dataSizingFraction = 1.0;
     801            0 :     dataDXSpeedNum = 0.0;
     802            0 :     dataAirFlowUsedForSizing = 0.0;
     803            0 :     dataDesInletAirTemp = 0.0;
     804            0 :     dataDesAccountForFanHeat = false;
     805            0 :     dataFanPlacement = HVAC::FanPlace::Invalid;
     806            0 :     dataDesicRegCoil = false;
     807            0 :     dataHeatSizeRatio = 0.0;
     808            0 :     dataZoneUsedForSizing = 0;
     809            0 :     dataDesicDehumNum = 0;
     810            0 :     dataNomCapInpMeth = false;
     811            0 :     dataCoilNum = 0;
     812            0 :     dataFanOp = HVAC::FanOp::Invalid;
     813            0 :     dataDesignCoilCapacity = 0.0;
     814            0 :     dataErrorsFound = false;
     815            0 :     dataBypassFrac = 0.0;
     816            0 :     dataIsDXCoil = false;
     817              : 
     818            0 :     dataNonZoneNonAirloopValue = 0.0;
     819              : 
     820            0 :     printWarningFlag = false;
     821            0 :     callingRoutine = "";
     822            0 :     sysSizingInputData.clear();
     823            0 :     zoneSizingInput.clear();
     824            0 :     unitarySysEqSizing.clear();
     825            0 :     oaSysEqSizing.clear();
     826            0 :     zoneEqSizing.clear();
     827            0 :     outsideAirSys.clear();
     828            0 :     termUnitSizing.clear();
     829            0 :     termUnitFinalZoneSizing.clear();
     830            0 :     finalZoneSizing.clear();
     831            0 :     finalSysSizing.clear();
     832            0 :     plantSizData.clear();
     833            0 :     primaryAirSystem.clear();
     834            0 :     airloopDOAS.clear();
     835            0 : }
     836              : 
     837              : } // namespace EnergyPlus
        

Generated by: LCOV version 2.0-1