LCOV - code coverage report
Current view: top level - EnergyPlus/Autosizing - Base.cc (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 317 579 54.7 %
Date: 2024-08-23 23:50:59 Functions: 17 20 85.0 %

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

Generated by: LCOV version 1.14