LCOV - code coverage report
Current view: top level - EnergyPlus/Autosizing - Base.cc (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 315 562 56.0 %
Date: 2023-01-17 19:17:23 Functions: 17 20 85.0 %

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

Generated by: LCOV version 1.13