LCOV - code coverage report
Current view: top level - EnergyPlus - ReportCoilSelection.cc (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 1141 1277 89.4 %
Date: 2024-08-24 18:31:18 Functions: 40 41 97.6 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2024, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : // C++ Headers
      49             : #include <memory>
      50             : #include <string>
      51             : 
      52             : // EnergyPlus Headers
      53             : #include <EnergyPlus/AirLoopHVACDOAS.hh>
      54             : #include <EnergyPlus/BoilerSteam.hh>
      55             : #include <EnergyPlus/Data/EnergyPlusData.hh>
      56             : #include <EnergyPlus/DataAirLoop.hh>
      57             : #include <EnergyPlus/DataAirSystems.hh>
      58             : #include <EnergyPlus/DataEnvironment.hh>
      59             : #include <EnergyPlus/DataHVACGlobals.hh>
      60             : #include <EnergyPlus/DataHeatBalance.hh>
      61             : #include <EnergyPlus/DataSizing.hh>
      62             : #include <EnergyPlus/DataZoneEquipment.hh>
      63             : #include <EnergyPlus/Fans.hh>
      64             : #include <EnergyPlus/FluidProperties.hh>
      65             : #include <EnergyPlus/MixedAir.hh>
      66             : #include <EnergyPlus/OutputReportPredefined.hh>
      67             : #include <EnergyPlus/Plant/DataPlant.hh>
      68             : #include <EnergyPlus/PlantUtilities.hh>
      69             : #include <EnergyPlus/Psychrometrics.hh>
      70             : #include <EnergyPlus/ReportCoilSelection.hh>
      71             : #include <EnergyPlus/UtilityRoutines.hh>
      72             : #include <EnergyPlus/WeatherManager.hh>
      73             : 
      74             : namespace EnergyPlus {
      75             : 
      76         796 : void createCoilSelectionReportObj(EnergyPlusData &state)
      77             : {
      78         796 :     state.dataRptCoilSelection->coilSelectionReportObj = std::make_unique<ReportCoilSelection>();
      79         796 : }
      80             : 
      81        6331 : CoilSelectionData::CoilSelectionData( // constructor
      82        6331 :     std::string const &coilName)
      83       18993 :     : isCooling(false), isHeating(false), coilNum(-999), airloopNum(-999), oaControllerNum(-999), zoneEqNum(-999), oASysNum(-999), zoneHVACTypeNum(0),
      84       25324 :       zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), isCoilSizingForTotalLoad(false),
      85       31655 :       capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), isSupplementalHeater(false),
      86        6331 :       coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0),
      87        6331 :       coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0),
      88        6331 :       coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0),
      89        6331 :       coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0),
      90       12662 :       pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0),
      91        6331 :       oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), raPeakHumRat(-999.0), rmPeakTemp(-999.0),
      92        6331 :       rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), coilIdealSizCapOverSimPeakCap(-999.0),
      93        6331 :       coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), cpMoistAir(-999.0), cpDryAir(-999.0),
      94        6331 :       rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), coilRatedSensCap(-999.0),
      95        6331 :       ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), ratedCoilInEnth(-999.0),
      96        6331 :       ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), ratedCoilEff(-999.0),
      97        6331 :       ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0),
      98             : 
      99        6331 :       supFanType(HVAC::FanType::Invalid), supFanNum(0), fanSizeMaxAirVolumeFlow(-999.0), fanSizeMaxAirMassFlow(-999.0), fanHeatGainIdealPeak(-999.0),
     100        6331 :       coilAndFanNetTotalCapacityIdealPeak(-999.0), plantDesMaxMassFlowRate(-999.0), plantDesRetTemp(-999.0), plantDesSupTemp(-999.0),
     101        6331 :       plantDesDeltaTemp(-999.0), plantDesCapacity(-999.0), coilCapPrcntPlantCap(-999.0), coilFlowPrcntPlantFlow(-999.0), coilUA(-999.0)
     102             : {
     103        6331 :     coilName_ = coilName;
     104        6331 :     coilLocation = "unknown";
     105        6331 :     desDayNameAtSensPeak = "unknown";
     106        6331 :     coilSensePeakHrMin = "unknown";
     107        6331 :     desDayNameAtTotalPeak = "unknown";
     108        6331 :     coilTotalPeakHrMin = "unknown";
     109        6331 :     desDayNameAtAirFlowPeak = "unknown";
     110        6331 :     airPeakHrMin = "unknown";
     111        6331 :     typeHVACname = "unknown";
     112        6331 :     userNameforHVACsystem = "unknown";
     113        6331 :     coilSizingMethodConcurrenceName = "N/A";
     114        6331 :     coilSizingMethodCapacityName = "N/A";
     115        6331 :     coilSizingMethodAirFlowName = "N/A";
     116        6331 :     coilPeakLoadTypeToSizeOnName = "N/A";
     117        6331 :     coilCapAutoMsg = "unknown";
     118        6331 :     coilVolFlowAutoMsg = "unknown";
     119        6331 :     coilWaterFlowAutoMsg = "unknown";
     120        6331 :     coilOAPretreatMsg = "unknown";
     121        6331 :     plantLoopName = "unknown";
     122        6331 :     fanAssociatedWithCoilName = "unknown";
     123        6331 :     fanTypeName = "unknown";
     124        6331 : }
     125             : 
     126         754 : void ReportCoilSelection::finishCoilSummaryReportTable(EnergyPlusData &state)
     127             : {
     128         754 :     doFinalProcessingOfCoilData(state);
     129         754 :     writeCoilSelectionOutput(state);
     130         754 :     writeCoilSelectionOutput2(state);
     131         754 : }
     132             : 
     133         754 : void ReportCoilSelection::writeCoilSelectionOutput(EnergyPlusData &state)
     134             : {
     135             : 
     136             :     // make calls to fill out predefined tabular report entries for each coil selection report object
     137        6944 :     for (auto &c : coilSelectionDataObjs) {
     138             : 
     139        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, c->coilObjName);
     140        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLocation, c->coilName_, c->coilLocation);
     141        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType, c->coilName_, c->typeHVACname);
     142        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName, c->coilName_, c->userNameforHVACsystem);
     143             : 
     144             :         // begin std 229 existing heating coil table adding new variables
     145        6190 :         if (c->isHeating) {
     146       13275 :             OutputReportPredefined::PreDefTableEntry(
     147       13275 :                 state, state.dataOutRptPredefined->pdchHeatCoilUsedAsSupHeat, c->coilName_, c->isSupplementalHeater ? "Yes" : "No");
     148       13275 :             OutputReportPredefined::PreDefTableEntry(state,
     149        4425 :                                                      state.dataOutRptPredefined->pdchHeatCoilAirloopName,
     150        4425 :                                                      c->coilName_,
     151        1383 :                                                      c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys
     152       10233 :                                                          ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name
     153             :                                                          : "N/A");
     154       13275 :             OutputReportPredefined::PreDefTableEntry(state,
     155        4425 :                                                      state.dataOutRptPredefined->pdchHeatCoilPlantloopName,
     156        4425 :                                                      c->coilName_,
     157        8850 :                                                      c->waterLoopNum > 0 ? state.dataPlnt->PlantLoop(c->waterLoopNum).Name : "N/A");
     158             :         }
     159             :         // end std 229 existing heating coil table adding new variables
     160             : 
     161             :         // begin std 229 New coil connections table entries
     162        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilName_CCs, c->coilName_, c->coilName_);
     163        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType_CCs, c->coilName_, c->coilObjName);
     164        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLoc_CCs, c->coilName_, c->coilLocation);
     165        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType_CCs, c->coilName_, c->typeHVACname);
     166        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName_CCs, c->coilName_, c->userNameforHVACsystem);
     167             :         // end of std 229 New coil connections table entries
     168             : 
     169        6190 :         if (c->zoneName.size() == 1) {
     170        4907 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, c->zoneName[0]);
     171             :             // begin std 229 New coil connections table entries
     172        4907 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, c->zoneName[0]);
     173             :             // end of std 229 New coil connections table entries
     174        1283 :         } else if (c->zoneName.size() > 1) {
     175             :             // make list of zone names
     176        1044 :             std::string tmpZoneList;
     177        7834 :             for (std::size_t vecLoop = 0; vecLoop < c->zoneName.size(); ++vecLoop) {
     178        6790 :                 tmpZoneList += c->zoneName[vecLoop] + "; ";
     179             :             }
     180        1044 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, tmpZoneList);
     181             :             // begin std 229 New coil connections table entries
     182        1044 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, tmpZoneList);
     183             :             // end of std 229 New coil connections table entries
     184        1044 :         } else {
     185         239 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, "N/A");
     186             :             // begin std 229 New coil connections table entries
     187         239 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, "N/A");
     188             :             // end of std 229 New coil connections table entries
     189             :         }
     190             : 
     191       18570 :         OutputReportPredefined::PreDefTableEntry(
     192       18570 :             state, state.dataOutRptPredefined->pdchSysSizingMethCoinc, c->coilName_, c->coilSizingMethodConcurrenceName);
     193       18570 :         OutputReportPredefined::PreDefTableEntry(
     194       18570 :             state, state.dataOutRptPredefined->pdchSysSizingMethCap, c->coilName_, c->coilSizingMethodCapacityName);
     195       18570 :         OutputReportPredefined::PreDefTableEntry(
     196       18570 :             state, state.dataOutRptPredefined->pdchSysSizingMethAir, c->coilName_, c->coilSizingMethodAirFlowName);
     197        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsCapAutosized, c->coilName_, c->coilCapAutoMsg);
     198        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsAirFlowAutosized, c->coilName_, c->coilVolFlowAutoMsg);
     199       18570 :         OutputReportPredefined::PreDefTableEntry(
     200       18570 :             state, state.dataOutRptPredefined->pdchCoilIsWaterFlowAutosized, c->coilName_, c->coilWaterFlowAutoMsg);
     201        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsOATreated, c->coilName_, c->coilOAPretreatMsg);
     202        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3);
     203        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3);
     204        6190 :         if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) {
     205        3240 :             OutputReportPredefined::PreDefTableEntry(
     206        4860 :                 state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1);
     207             :         } else {
     208        9140 :             OutputReportPredefined::PreDefTableEntry(
     209       13710 :                 state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6);
     210             :         }
     211             : 
     212        6190 :         if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) {
     213        5368 :             OutputReportPredefined::PreDefTableEntry(
     214        8052 :                 state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1);
     215             :         } else {
     216        7012 :             OutputReportPredefined::PreDefTableEntry(
     217       10518 :                 state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8);
     218             :         }
     219             : 
     220       18570 :         OutputReportPredefined::PreDefTableEntry(
     221       18570 :             state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilName, c->coilName_, c->fanAssociatedWithCoilName);
     222             :         // begin std 229 New coil connections table entries
     223       18570 :         OutputReportPredefined::PreDefTableEntry(
     224       18570 :             state, state.dataOutRptPredefined->pdchCoilSupFanName_CCs, c->coilName_, c->fanAssociatedWithCoilName);
     225             :         // end of std 229 New coil connections table entries
     226             : 
     227        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilType, c->coilName_, c->fanTypeName);
     228             :         // begin std 229 New coil connections table entries
     229        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilSupFanType_CCs, c->coilName_, c->fanTypeName);
     230             :         // end of std 229 New coil connections table entries
     231             : 
     232        6190 :         if (c->fanSizeMaxAirVolumeFlow == -999.0 || c->fanSizeMaxAirVolumeFlow == -99999.0) {
     233        5672 :             OutputReportPredefined::PreDefTableEntry(
     234        8508 :                 state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 1);
     235             :         } else {
     236        6708 :             OutputReportPredefined::PreDefTableEntry(
     237       10062 :                 state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 6);
     238             :         }
     239        6190 :         if (c->fanSizeMaxAirMassFlow == -999.0 || c->fanSizeMaxAirMassFlow == -99999.0) {
     240        5672 :             OutputReportPredefined::PreDefTableEntry(
     241        8508 :                 state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 1);
     242             :         } else {
     243        6708 :             OutputReportPredefined::PreDefTableEntry(
     244       10062 :                 state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 8);
     245             :         }
     246             : 
     247             :         // begin std 229 New coil connections table entries
     248        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantName_CCs, c->coilName_, c->plantLoopName);
     249       18570 :         OutputReportPredefined::PreDefTableEntry(state,
     250        6190 :                                                  state.dataOutRptPredefined->pdchCoilAirloopName_CCs,
     251        6190 :                                                  c->coilName_,
     252        2645 :                                                  c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys
     253       15025 :                                                      ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name
     254             :                                                      : "N/A");
     255        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantloopName_CCs, c->coilName_, c->plantLoopName);
     256             :         // end of std 229 New coil connections table entries
     257             : 
     258       18570 :         OutputReportPredefined::PreDefTableEntry(
     259       18570 :             state, state.dataOutRptPredefined->pdchCoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak);
     260       18570 :         OutputReportPredefined::PreDefTableEntry(
     261       18570 :             state, state.dataOutRptPredefined->pdchCoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin);
     262       18570 :         OutputReportPredefined::PreDefTableEntry(
     263       18570 :             state, state.dataOutRptPredefined->pdchCoilDDnameTotIdealPeak, c->coilName_, c->desDayNameAtTotalPeak);
     264       18570 :         OutputReportPredefined::PreDefTableEntry(
     265       18570 :             state, state.dataOutRptPredefined->pdchCoilDateTimeTotIdealPeak, c->coilName_, c->coilTotalPeakHrMin);
     266       18570 :         OutputReportPredefined::PreDefTableEntry(
     267       18570 :             state, state.dataOutRptPredefined->pdchCoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak);
     268        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin);
     269             : 
     270       18570 :         OutputReportPredefined::PreDefTableEntry(
     271       18570 :             state, state.dataOutRptPredefined->pdchCoilPeakLoadTypeToSizeOn, c->coilName_, c->coilPeakLoadTypeToSizeOnName);
     272             : 
     273        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2);
     274        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2);
     275        6190 :         if (c->coilDesMassFlow == -999.0 || c->coilDesMassFlow == -99999.0) {
     276         526 :             OutputReportPredefined::PreDefTableEntry(
     277         789 :                 state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 1);
     278             :         } else {
     279       11854 :             OutputReportPredefined::PreDefTableEntry(
     280       17781 :                 state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 8);
     281             :         }
     282        6190 :         if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) {
     283         792 :             OutputReportPredefined::PreDefTableEntry(
     284        1188 :                 state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1);
     285             :         } else {
     286       11588 :             OutputReportPredefined::PreDefTableEntry(
     287       17382 :                 state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6);
     288             :         }
     289        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2);
     290       12380 :         OutputReportPredefined::PreDefTableEntry(
     291       12380 :             state, state.dataOutRptPredefined->pdchCoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2);
     292        6190 :         if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) {
     293        1976 :             OutputReportPredefined::PreDefTableEntry(
     294        2964 :                 state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1);
     295             :         } else {
     296       10404 :             OutputReportPredefined::PreDefTableEntry(
     297       15606 :                 state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8);
     298             :         }
     299        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilEntEnthalpyIdealPeak, c->coilName_, c->coilDesEntEnth, 1);
     300        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2);
     301       12380 :         OutputReportPredefined::PreDefTableEntry(
     302       12380 :             state, state.dataOutRptPredefined->pdchCoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2);
     303        6190 :         if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) {
     304        1972 :             OutputReportPredefined::PreDefTableEntry(
     305        2958 :                 state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1);
     306             :         } else {
     307       10408 :             OutputReportPredefined::PreDefTableEntry(
     308       15612 :                 state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8);
     309             :         }
     310        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLvgEnthalpyIdealPeak, c->coilName_, c->coilDesLvgEnth, 1);
     311        6190 :         if (c->coilDesWaterMassFlow == -999.0 || c->coilDesWaterMassFlow == -99999.0) {
     312        6710 :             OutputReportPredefined::PreDefTableEntry(
     313       10065 :                 state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 1);
     314             :         } else {
     315        5670 :             OutputReportPredefined::PreDefTableEntry(
     316        8505 :                 state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 8);
     317             :         }
     318             : 
     319       12380 :         OutputReportPredefined::PreDefTableEntry(
     320       12380 :             state, state.dataOutRptPredefined->pdchCoilEntWaterTempIdealPeak, c->coilName_, c->coilDesWaterEntTemp, 2);
     321       12380 :         OutputReportPredefined::PreDefTableEntry(
     322       12380 :             state, state.dataOutRptPredefined->pdchCoilLvgWaterTempIdealPeak, c->coilName_, c->coilDesWaterLvgTemp, 2);
     323       12380 :         OutputReportPredefined::PreDefTableEntry(
     324       12380 :             state, state.dataOutRptPredefined->pdchCoilWaterDeltaTempIdealPeak, c->coilName_, c->coilDesWaterTempDiff, 2);
     325       12380 :         OutputReportPredefined::PreDefTableEntry(
     326       12380 :             state, state.dataOutRptPredefined->pdchFanHeatGainIdealPeak, c->coilName_, c->fanHeatGainIdealPeak, 3);
     327       12380 :         OutputReportPredefined::PreDefTableEntry(
     328       12380 :             state, state.dataOutRptPredefined->pdchCoilNetTotalCapacityIdealPeak, c->coilName_, c->coilAndFanNetTotalCapacityIdealPeak, 2);
     329             : 
     330        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2);
     331        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2);
     332       12380 :         OutputReportPredefined::PreDefTableEntry(
     333       12380 :             state, state.dataOutRptPredefined->pdchCoilOffRatingCapacityModifierIdealPeak, c->coilName_, c->coilCapFTIdealPeak, 4);
     334        6190 :         if (c->ratedAirMassFlow == -999.0 || c->ratedAirMassFlow == -99999.0) {
     335        1992 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 1);
     336             :         } else {
     337        4198 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 8);
     338             :         }
     339             : 
     340        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntDryBulb, c->coilName_, c->ratedCoilInDb, 2);
     341        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntWetBulb, c->coilName_, c->ratedCoilInWb, 2);
     342        6190 :         if (c->ratedCoilInHumRat == -999.0 || c->ratedCoilInHumRat == -99999.0) {
     343        3984 :             OutputReportPredefined::PreDefTableEntry(
     344        5976 :                 state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 1);
     345             :         } else {
     346        8396 :             OutputReportPredefined::PreDefTableEntry(
     347       12594 :                 state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 8);
     348             :         }
     349             : 
     350        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntEnthalpy, c->coilName_, c->ratedCoilInEnth, 1);
     351        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgDryBulb, c->coilName_, c->ratedCoilOutDb, 2);
     352        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgWetBulb, c->coilName_, c->ratedCoilOutWb, 2);
     353        6190 :         if (c->ratedCoilOutHumRat == -999.0 || c->ratedCoilOutHumRat == -99999.0) {
     354        3984 :             OutputReportPredefined::PreDefTableEntry(
     355        5976 :                 state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 1);
     356             :         } else {
     357        8396 :             OutputReportPredefined::PreDefTableEntry(
     358       12594 :                 state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 8);
     359             :         }
     360             : 
     361        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgEnthalpy, c->coilName_, c->ratedCoilOutEnth, 1);
     362             : 
     363        6190 :         if (c->plantDesMaxMassFlowRate == -999.0 || c->plantDesMaxMassFlowRate == -99999.0) {
     364        6656 :             OutputReportPredefined::PreDefTableEntry(
     365        9984 :                 state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 1);
     366             :         } else {
     367        5724 :             OutputReportPredefined::PreDefTableEntry(
     368        8586 :                 state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 8);
     369             :         }
     370        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantRetTempDesign, c->coilName_, c->plantDesRetTemp, 2);
     371        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSupTempDesign, c->coilName_, c->plantDesSupTemp, 2);
     372        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantDeltaTempDesign, c->coilName_, c->plantDesDeltaTemp, 2);
     373        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantCapacity, c->coilName_, c->plantDesCapacity, 2);
     374       12380 :         OutputReportPredefined::PreDefTableEntry(
     375       12380 :             state, state.dataOutRptPredefined->pdchCoilCapPrcntPlantCapacity, c->coilName_, c->coilCapPrcntPlantCap, 4);
     376        6190 :         if (c->coilFlowPrcntPlantFlow == -999.0 || c->coilFlowPrcntPlantFlow == -99999.0) {
     377        6776 :             OutputReportPredefined::PreDefTableEntry(
     378       10164 :                 state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 1);
     379             :         } else {
     380        5604 :             OutputReportPredefined::PreDefTableEntry(
     381        8406 :                 state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 6);
     382             :         }
     383             : 
     384        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2);
     385        6190 :         if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) {
     386        1111 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1);
     387             :         } else {
     388        5079 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8);
     389             :         }
     390             : 
     391        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2);
     392        6190 :         if (c->oaPeakVolFlow == -999.0 || c->oaPeakVolFlow == -99999.0) {
     393        1111 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 1);
     394             :         } else {
     395        5079 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 8);
     396             :         }
     397             : 
     398        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4);
     399        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchAirSysRADryBulbIdealPeak, c->coilName_, c->raPeakTemp, 2);
     400        6190 :         if (c->raPeakHumRat == -999.0 || c->raPeakHumRat == -99999.0) {
     401        2222 :             OutputReportPredefined::PreDefTableEntry(
     402        3333 :                 state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 1);
     403             :         } else {
     404       10158 :             OutputReportPredefined::PreDefTableEntry(
     405       15237 :                 state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 8);
     406             :         }
     407             : 
     408        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2);
     409        6190 :         if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) {
     410        1114 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1);
     411             :         } else {
     412        5076 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8);
     413             :         }
     414             : 
     415        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4);
     416        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilUA, c->coilName_, c->coilUA, 3);
     417       12380 :         OutputReportPredefined::PreDefTableEntry(
     418       12380 :             state, state.dataOutRptPredefined->pdchZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2);
     419        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak);
     420        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchReheatCoilMultiplier, c->coilName_, c->reheatLoadMult, 4);
     421       12380 :         OutputReportPredefined::PreDefTableEntry(
     422       12380 :             state, state.dataOutRptPredefined->pdchFlowCapRatioLowCapIncreaseRatio, c->coilName_, c->maxRatio, 5);
     423        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchFlowCapRatioHiCapDecreaseRatio, c->coilName_, c->minRatio, 5);
     424        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidSpecificHeat, c->coilName_, c->cpFluid, 4);
     425        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidDensity, c->coilName_, c->rhoFluid, 4);
     426        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMoistAirSpecificHeat, c->coilName_, c->cpMoistAir, 4);
     427        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDryAirSpecificHeat, c->coilName_, c->cpDryAir, 4);
     428        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchStandRhoAir, c->coilName_, c->rhoStandAir, 4);
     429         754 :     }
     430         754 : }
     431             : 
     432         754 : void ReportCoilSelection::writeCoilSelectionOutput2(EnergyPlusData &state)
     433             : {
     434             : 
     435             :     // make calls to fill out predefined tabular report entries for each coil selection report object
     436        6944 :     for (auto &c : coilSelectionDataObjs) {
     437        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilType, c->coilName_, c->coilObjName);
     438        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACType, c->coilName_, c->typeHVACname);
     439        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACName, c->coilName_, c->userNameforHVACsystem);
     440             : 
     441        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3);
     442        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3);
     443        6190 :         if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) {
     444        3240 :             OutputReportPredefined::PreDefTableEntry(
     445        4860 :                 state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1);
     446             :         } else {
     447        9140 :             OutputReportPredefined::PreDefTableEntry(
     448       13710 :                 state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6);
     449             :         }
     450             : 
     451        6190 :         if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) {
     452        5368 :             OutputReportPredefined::PreDefTableEntry(
     453        8052 :                 state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1);
     454             :         } else {
     455        7012 :             OutputReportPredefined::PreDefTableEntry(
     456       10518 :                 state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8);
     457             :         }
     458             : 
     459       18570 :         OutputReportPredefined::PreDefTableEntry(
     460       18570 :             state, state.dataOutRptPredefined->pdch2CoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak);
     461       18570 :         OutputReportPredefined::PreDefTableEntry(
     462       18570 :             state, state.dataOutRptPredefined->pdch2CoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin);
     463       18570 :         OutputReportPredefined::PreDefTableEntry(
     464       18570 :             state, state.dataOutRptPredefined->pdch2CoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak);
     465        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin);
     466        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2);
     467        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2);
     468        6190 :         if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) {
     469         792 :             OutputReportPredefined::PreDefTableEntry(
     470        1188 :                 state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1);
     471             :         } else {
     472       11588 :             OutputReportPredefined::PreDefTableEntry(
     473       17382 :                 state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6);
     474             :         }
     475        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2);
     476       12380 :         OutputReportPredefined::PreDefTableEntry(
     477       12380 :             state, state.dataOutRptPredefined->pdch2CoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2);
     478        6190 :         if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) {
     479        1976 :             OutputReportPredefined::PreDefTableEntry(
     480        2964 :                 state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1);
     481             :         } else {
     482       10404 :             OutputReportPredefined::PreDefTableEntry(
     483       15606 :                 state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8);
     484             :         }
     485        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2);
     486       12380 :         OutputReportPredefined::PreDefTableEntry(
     487       12380 :             state, state.dataOutRptPredefined->pdch2CoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2);
     488        6190 :         if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) {
     489        1972 :             OutputReportPredefined::PreDefTableEntry(
     490        2958 :                 state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1);
     491             :         } else {
     492       10408 :             OutputReportPredefined::PreDefTableEntry(
     493       15612 :                 state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8);
     494             :         }
     495             : 
     496        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2);
     497        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2);
     498             : 
     499        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2);
     500        6190 :         if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) {
     501        1111 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1);
     502             :         } else {
     503        5079 :             OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8);
     504             :         }
     505             : 
     506        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2);
     507        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4);
     508             : 
     509        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2);
     510        6190 :         if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) {
     511        2228 :             OutputReportPredefined::PreDefTableEntry(
     512        3342 :                 state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1);
     513             :         } else {
     514       10152 :             OutputReportPredefined::PreDefTableEntry(
     515       15228 :                 state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8);
     516             :         }
     517             : 
     518        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4);
     519        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilUA, c->coilName_, c->coilUA, 3);
     520       12380 :         OutputReportPredefined::PreDefTableEntry(
     521       12380 :             state, state.dataOutRptPredefined->pdch2ZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2);
     522        6190 :         OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak);
     523         754 :     }
     524         754 : }
     525             : 
     526        6112 : void ReportCoilSelection::setCoilFinalSizes(EnergyPlusData &state,
     527             :                                             std::string const &coilName,    // user-defined name of the coil
     528             :                                             std::string const &coilObjName, //  coil object name, e.g., Coil:Cooling:Water
     529             :                                             Real64 const totGrossCap,       // total capacity [W]
     530             :                                             Real64 const sensGrossCap,      // sensible capacity [W]
     531             :                                             Real64 const airFlowRate,       // design or reference or rated air flow rate [m3/s]
     532             :                                             Real64 const waterFlowRate      // design or reference or rated water flow rate [m3/s]
     533             : )
     534             : {
     535        6112 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilObjName);
     536        6112 :     auto &c(coilSelectionDataObjs[index]);
     537        6112 :     if (c != nullptr) {
     538        6112 :         c->coilTotCapFinal = totGrossCap;
     539        6112 :         c->coilSensCapFinal = sensGrossCap;
     540        6112 :         c->coilRefAirVolFlowFinal = airFlowRate;
     541        6112 :         c->coilRefWaterVolFlowFinal = waterFlowRate;
     542             :     }
     543        6112 : }
     544             : 
     545       15693 : void ReportCoilSelection::doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex)
     546             : {
     547             :     // this routine sets up some things for central air systems, needs to follow setting of an airloop num
     548       15693 :     auto &c(coilSelectionDataObjs[coilVecIndex]);
     549       15693 :     if (c->airloopNum > 0 && c->airloopNum <= int(state.dataAirSystemsData->PrimaryAirSystems.size())) {
     550             :         // see if there is an OA controller
     551        7372 :         if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) {
     552             :             // loop over OA controllers and match node num ?
     553       92093 :             for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) {
     554       85011 :                 if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == state.dataMixedAir->OAController(loop).RetNode) {
     555        7042 :                     c->oaControllerNum = loop;
     556             :                 }
     557             :             }
     558             :         }
     559             :         // fill list of zones connected to this air loop
     560             :         // this could be reworked to use different structure which is available now since std 62.1 changes
     561        7372 :         if (allocated(state.dataAirLoop->AirToZoneNodeInfo)) {
     562        7372 :             if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled > 0) {
     563        7372 :                 int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled;
     564        7372 :                 c->zoneNum.resize(zoneCount);
     565        7372 :                 c->zoneName.resize(zoneCount);
     566       40319 :                 for (int loopZone = 1; loopZone <= state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled; ++loopZone) {
     567       32947 :                     c->zoneNum[loopZone - 1] = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).CoolCtrlZoneNums(loopZone);
     568       32947 :                     c->zoneName[loopZone - 1] = state.dataHeatBal->Zone(c->zoneNum[loopZone - 1]).Name;
     569             :                 }
     570             :             }
     571             : 
     572        7372 :             if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated > 0) {
     573          36 :                 int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated;
     574         209 :                 for (int loopZone = 1; loopZone <= zoneCount; ++loopZone) {
     575         173 :                     int zoneIndex = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).HeatCtrlZoneNums(loopZone);
     576             :                     // see if this zone is new or already in list
     577         173 :                     bool found = false;
     578         531 :                     for (auto &z : c->zoneNum) {
     579         531 :                         if (z == zoneIndex) {
     580         173 :                             found = true;
     581         173 :                             break;
     582             :                         }
     583         173 :                     }
     584         173 :                     if (!found) { // add it
     585           0 :                         c->zoneNum.emplace_back(zoneIndex);
     586           0 :                         c->zoneName.emplace_back(state.dataHeatBal->Zone(zoneIndex).Name);
     587             :                     }
     588             :                 }
     589             :             }
     590             :         }
     591             :     }
     592       15693 : }
     593             : 
     594           0 : void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVecIndex)
     595             : {
     596           0 :     auto &c(coilSelectionDataObjs[coilVecIndex]);
     597           0 :     c->coilLocation = "Zone";
     598           0 :     c->zoneNum.resize(1);
     599           0 :     c->zoneNum[0] = c->zoneEqNum;
     600           0 :     c->zoneName.resize(1);
     601           0 :     c->zoneName[0] = state.dataHeatBal->Zone(c->zoneNum[0]).Name;
     602           0 :     c->typeHVACname = "Zone Equipment"; // init
     603             : 
     604             :     // find the system and get   c->oaControllerNum
     605             : 
     606             :     // need to rework for new multiple air handler in zone
     607             : 
     608             :     // going to need the zone inlet node index for this now... how to find it??
     609             : 
     610             :     // maybe not needed, would be set in other calls   c->airloopNum = DataZoneEquipment::ZoneEquipConfig( c->zoneEqNum  ).AirLoopNum;
     611             : 
     612           0 :     if (c->airloopNum > 0) {
     613           0 :         if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) {
     614             :             // loop over OA controllers and match node num ?
     615           0 :             for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) {
     616           0 :                 if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == state.dataMixedAir->OAController(loop).RetNode) {
     617           0 :                     c->oaControllerNum = loop;
     618             :                 }
     619             :             }
     620             :         }
     621             :         // fill out supply fan info
     622           0 :         auto *fan = state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum);
     623           0 :         state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(
     624           0 :             state, c->coilName_, c->coilObjName, fan->Name, fan->type, state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum);
     625             :     }
     626             : 
     627           0 :     if (c->zoneEqNum > 0) {
     628           0 :         associateZoneCoilWithParent(state, c);
     629             :     }
     630           0 : }
     631             : 
     632         754 : void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state)
     633             : {
     634             :     // this routine does some final processing in preparation for writing out results
     635        6944 :     for (auto &c : coilSelectionDataObjs) {
     636             : 
     637             :         // mine final/hard values from coil models
     638             : 
     639        6190 :         if (c->zoneEqNum > 0) {
     640        3415 :             associateZoneCoilWithParent(state, c);
     641             :         }
     642             : 
     643        6190 :         if (c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys && c->oASysNum > 0) {
     644           2 :             c->coilLocation = "DOAS AirLoop";
     645           2 :             c->typeHVACname = "AirLoopHVAC:DedicatedOutdoorAirSystem";
     646           2 :             int DOASSysNum = state.dataAirLoop->OutsideAirSys(c->oASysNum).AirLoopDOASNum;
     647           2 :             c->userNameforHVACsystem = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].Name;
     648        6188 :         } else if (c->airloopNum > 0 && c->zoneEqNum == 0) {
     649        2643 :             c->coilLocation = "AirLoop";
     650        2643 :             c->typeHVACname = "AirLoopHVAC";
     651        2643 :             c->userNameforHVACsystem = state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name;
     652        3545 :         } else if (c->zoneEqNum > 0 && c->airloopNum > 0) { // e.g. reheat coil, has a system and is zone equipment
     653           0 :             c->userNameforHVACsystem += " on air system named " + state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name;
     654           0 :             c->coilLocation = "Zone Equipment";
     655             :         }
     656             : 
     657        6190 :         if (c->coilDesVolFlow > 0) {
     658        5525 :             c->oaPeakVolFrac = (c->oaPeakVolFlow / c->coilDesVolFlow) * 100.0; // make into percentage
     659             :         } else {
     660         665 :             c->oaPeakVolFrac = -999.0;
     661             :         }
     662             : 
     663        6190 :         c->coilSizingMethodConcurrenceName = DataSizing::CoilSizingConcurrenceNames[(int)c->coilSizingMethodConcurrence];
     664             : 
     665        6190 :         if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) {
     666         956 :             c->coilSizingMethodCapacityName = "CoolingDesignCapacity";
     667        5234 :         } else if (c->coilSizingMethodCapacity == DataSizing::HeatingDesignCapacity) {
     668        1127 :             c->coilSizingMethodCapacityName = "HeatingDesignCapacity";
     669        4107 :         } else if (c->coilSizingMethodCapacity == DataSizing::CapacityPerFloorArea) {
     670           0 :             c->coilSizingMethodCapacityName = "CapacityPerFloorArea";
     671        4107 :         } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedCoolingCapacity) {
     672           1 :             c->coilSizingMethodCapacityName = "FractionOfAutosizedCoolingCapacity";
     673        4106 :         } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedHeatingCapacity) {
     674           1 :             c->coilSizingMethodCapacityName = "FractionOfAutosizedHeatingCapacity";
     675             :         }
     676             : 
     677        6190 :         if (c->coilSizingMethodAirFlow == DataSizing::SupplyAirFlowRate) {
     678           0 :             c->coilSizingMethodAirFlowName = "SupplyAirFlowRate";
     679        6190 :         } else if (c->coilSizingMethodAirFlow == DataSizing::FlowPerFloorArea) {
     680           0 :             c->coilSizingMethodAirFlowName = "FlowPerFloorArea";
     681        6190 :         } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedCoolingAirflow) {
     682           0 :             c->coilSizingMethodAirFlowName = "FractionOfAutosizedCoolingAirflow";
     683        6190 :         } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedHeatingAirflow) {
     684           0 :             c->coilSizingMethodAirFlowName = "FractionOfAutosizedHeatingAirflow";
     685             :         }
     686             : 
     687        6190 :         if (c->isCoilSizingForTotalLoad) {
     688          12 :             c->coilPeakLoadTypeToSizeOnName = "Total";
     689             :         } else {
     690        6178 :             c->coilPeakLoadTypeToSizeOnName = "Sensible";
     691             :         }
     692             : 
     693        6190 :         if (c->capIsAutosized) {
     694        4849 :             c->coilCapAutoMsg = "Yes";
     695             :         } else {
     696        1341 :             c->coilCapAutoMsg = "No";
     697             :         }
     698             : 
     699        6190 :         if (c->volFlowIsAutosized) {
     700        4708 :             c->coilVolFlowAutoMsg = "Yes";
     701             :         } else {
     702        1482 :             c->coilVolFlowAutoMsg = "No";
     703             :         }
     704             : 
     705        6190 :         if (c->oaPretreated) {
     706          58 :             c->coilOAPretreatMsg = "Yes";
     707             :         } else {
     708        6132 :             c->coilOAPretreatMsg = "No";
     709             :         }
     710             : 
     711             :         // call psych routine to flush out moist air metrics from those available
     712        6190 :         if (c->coilDesEntTemp != -999.0 && c->coilDesEntHumRat != -999.0) {
     713       10402 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
     714        5201 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::doFinalProcessingOfCoilData");
     715        5201 :             if (c->coilDesEntHumRat != -999.0) {
     716        5201 :                 c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
     717             :             }
     718             :         }
     719        6190 :         if (c->oaPeakTemp != -999.0 && c->oaPeakHumRat != -999.0) {
     720       10158 :             c->oaPeakWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
     721        5079 :                 state, c->oaPeakTemp, c->oaPeakHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::doFinalProcessingOfCoilData");
     722             :         }
     723             : 
     724        6190 :         if (c->waterLoopNum > 0 && c->pltSizNum > 0) {
     725             : 
     726        2862 :             c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name;
     727        2862 :             if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) {
     728        5684 :                 c->rhoFluid = FluidProperties::GetDensityGlycol(state,
     729        2842 :                                                                 state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
     730             :                                                                 Constant::InitConvTemp,
     731        2842 :                                                                 state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
     732             :                                                                 "ReportCoilSelection::doFinalProcessingOfCoilData");
     733             : 
     734        5684 :                 c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state,
     735        2842 :                                                                     state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
     736             :                                                                     Constant::InitConvTemp,
     737        2842 :                                                                     state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
     738             :                                                                     "ReportCoilSelection::doFinalProcessingOfCoilData");
     739             :             } else { // steam loop
     740          40 :                 c->rhoFluid = FluidProperties::GetSatDensityRefrig(state,
     741          20 :                                                                    state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
     742             :                                                                    100.0,
     743             :                                                                    1.0,
     744          20 :                                                                    state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
     745             :                                                                    "ReportCoilSelection::doFinalProcessingOfCoilData");
     746          40 :                 c->cpFluid = FluidProperties::GetSatSpecificHeatRefrig(state,
     747          20 :                                                                        state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
     748             :                                                                        100.0,
     749             :                                                                        0.0,
     750          20 :                                                                        state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
     751             :                                                                        "ReportCoilSelection::doFinalProcessingOfCoilData");
     752             :             }
     753        2862 :             c->plantDesMaxMassFlowRate = state.dataPlnt->PlantLoop(c->waterLoopNum).MaxMassFlowRate;
     754        2862 :             if (c->plantDesMaxMassFlowRate > 0.0 && c->coilDesWaterMassFlow > 0.0) {
     755        2802 :                 c->coilFlowPrcntPlantFlow = (c->coilDesWaterMassFlow / c->plantDesMaxMassFlowRate) * 100.0; // convert to percentage.
     756             :             }
     757             :         }
     758             :         // fill out some fan information
     759        6190 :         HVAC::FanType locFanType = HVAC::FanType::Invalid;
     760        6190 :         bool errorsFound(false);
     761        6190 :         if (c->supFanNum == 0) {
     762        3075 :             c->supFanNum = Fans::GetFanIndex(state, c->fanAssociatedWithCoilName);
     763             :         }
     764             : 
     765        6190 :         if (c->supFanNum != 0) {
     766        3354 :             auto *fan = state.dataFans->fans(c->supFanNum);
     767        3354 :             locFanType = fan->type;
     768        3354 :             c->fanTypeName = HVAC::fanTypeNames[(int)locFanType];
     769        3354 :             c->fanSizeMaxAirVolumeFlow = fan->maxAirFlowRate;
     770        3354 :             c->fanSizeMaxAirMassFlow = fan->maxAirMassFlowRate;
     771             :         }
     772             : 
     773        6190 :         c->coilAndFanNetTotalCapacityIdealPeak = c->coilTotCapAtPeak - c->fanHeatGainIdealPeak;
     774             : 
     775             :         // fill out some plant design info
     776        6190 :         if (c->pltSizNum > 0) {
     777        2862 :             c->plantDesSupTemp = state.dataSize->PlantSizData(c->pltSizNum).ExitTemp;
     778        2862 :             c->plantDesDeltaTemp = state.dataSize->PlantSizData(c->pltSizNum).DeltaT;
     779        2862 :             if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Heating) {
     780        2358 :                 c->plantDesRetTemp = c->plantDesSupTemp - c->plantDesDeltaTemp;
     781         532 :             } else if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Cooling ||
     782          28 :                        state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Condenser) {
     783         484 :                 c->plantDesRetTemp = c->plantDesSupTemp + c->plantDesDeltaTemp;
     784             :             }
     785             : 
     786        2862 :             if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) {
     787        5684 :                 c->plantDesCapacity = c->cpFluid * c->rhoFluid * state.dataSize->PlantSizData(c->pltSizNum).DeltaT *
     788        2842 :                                       state.dataSize->PlantSizData(c->pltSizNum).DesVolFlowRate;
     789             :             } else {
     790             :                 // find boiler on this plant loop and get capacity from it
     791          20 :                 if (allocated(state.dataBoilerSteam->Boiler)) {
     792          28 :                     for (int boilerIndex = 1; boilerIndex <= (int)state.dataBoilerSteam->Boiler.size(); ++boilerIndex) {
     793          14 :                         if (state.dataBoilerSteam->Boiler(boilerIndex).plantLoc.loopNum == c->waterLoopNum) { // steam boiler on this loop
     794          14 :                             c->plantDesSupTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut;
     795          14 :                             c->plantDesRetTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut - c->plantDesDeltaTemp;
     796          14 :                             c->plantDesCapacity = state.dataBoilerSteam->Boiler(boilerIndex).NomCap;
     797             :                         }
     798             :                     }
     799             :                 }
     800             :             }
     801             : 
     802        2862 :             if (c->plantDesCapacity > 0.0) {
     803        2856 :                 c->coilCapPrcntPlantCap = (c->coilTotCapAtPeak / c->plantDesCapacity) * 100.0; // convert to percentage.
     804             :             }
     805             :         }
     806             : 
     807        6190 :         if (c->pltSizNum == 0 && c->waterLoopNum == 0) {
     808           0 :             c->rhoFluid = -999.0;
     809           0 :             c->cpFluid = -999.0;
     810           0 :             c->plantDesMaxMassFlowRate = -999.0;
     811           0 :             c->coilFlowPrcntPlantFlow = -999.0;
     812           0 :             c->plantDesSupTemp = -999.0;
     813           0 :             c->plantDesDeltaTemp = -999.0;
     814           0 :             c->plantDesRetTemp = -999.0;
     815           0 :             c->coilDesWaterMassFlow = -999.0;
     816           0 :             c->coilDesWaterEntTemp = -999.0;
     817           0 :             c->coilDesWaterLvgTemp = -999.0;
     818           0 :             c->coilDesWaterTempDiff = -999.0;
     819           0 :             c->plantDesCapacity = -999.0;
     820           0 :             c->coilCapPrcntPlantCap = -999.0;
     821           0 :             c->coilFlowPrcntPlantFlow = -999.0;
     822             :         }
     823             : 
     824        6190 :         c->cpDryAir = Psychrometrics::PsyCpAirFnW(0.0);
     825        6190 :         c->rhoStandAir = state.dataEnvrn->StdRhoAir;
     826             : 
     827             :         // apply ADP method to find an SHR for Ideal loads peak, calculate sensible capacity for cooling coils
     828        6190 :         if (c->coilDesEntTemp > c->coilDesLvgTemp) { // cooling coil
     829             :             Real64 CoilADPTemp =
     830        1491 :                 Psychrometrics::PsyTdpFnWPb(state, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress); // apparatus dewpoint temperature
     831             :             Real64 CoilADPHumRat =
     832        1491 :                 Psychrometrics::PsyWFnTdpPb(state, CoilADPTemp, state.dataEnvrn->StdBaroPress); // humidity ratio at apparatus dewpoint temperaure
     833        1491 :             Real64 CoilTinwADPEnthalpy = Psychrometrics::PsyHFnTdbW(
     834        1491 :                 c->coilDesEntTemp, CoilADPHumRat); // Enthalpy at inlet drybulb and humidity ratio at apparatus dewpoint temperature
     835             :             Real64 CoilADPEnthalpy =
     836        1491 :                 Psychrometrics::PsyHFnTdbW(CoilADPTemp, CoilADPHumRat); // Enthalpy at apparatus dewpoint, with Tdb set at apparatus dewpoint
     837        1491 :             Real64 SHRatIdealPeak(1.0);
     838        1491 :             if ((c->coilDesEntEnth - CoilADPEnthalpy) > 1.e-10) {
     839        1473 :                 SHRatIdealPeak = min((CoilTinwADPEnthalpy - CoilADPEnthalpy) / (c->coilDesEntEnth - CoilADPEnthalpy), 1.0); // calculate SHR
     840             :             } else {
     841          18 :                 SHRatIdealPeak = 1.0;
     842             :             }
     843        1491 :             c->coilSensCapAtPeak = SHRatIdealPeak * c->coilTotCapAtPeak;
     844             :         }
     845         754 :     } // end for loop over each coil
     846         754 : }
     847             : 
     848       89745 : int ReportCoilSelection::getIndexForOrCreateDataObjFromCoilName(EnergyPlusData &state,
     849             :                                                                 std::string const &coilName, // user-defined name of the coil
     850             :                                                                 std::string const &coilType  // idf input object class name of coil
     851             : )
     852             : {
     853       89745 :     int index(-1);
     854     1932833 :     for (int i = 0; i < numCoilsReported_; i++) {
     855     1926502 :         if (coilSelectionDataObjs[i] != nullptr) {
     856     1926502 :             if (Util::SameString(coilSelectionDataObjs[i]->coilName_, coilName)) {
     857       83414 :                 if (Util::SameString(coilSelectionDataObjs[i]->coilObjName, coilType)) {
     858       83414 :                     return index = i;
     859             :                 } else {
     860             :                     // throw error  coil type does not match coil name, check for unique names across coil types
     861           0 :                     ShowWarningError(state,
     862           0 :                                      format("check for unique coil names across different coil types: {} occurs in both {} and {}",
     863             :                                             coilName,
     864             :                                             coilType,
     865           0 :                                             coilSelectionDataObjs[i]->coilObjName));
     866             :                 }
     867             :             }
     868             :         }
     869             :     }
     870             : 
     871        6331 :     if (index == -1) { // then did not find it
     872             :         // check if really a coil type
     873        6331 :         bool found(false);
     874        6331 :         bool locIsCooling(false);
     875        6331 :         bool locIsHeating(false);
     876       91986 :         for (int loop = 1; loop <= HVAC::NumAllCoilTypes; ++loop) {
     877       91986 :             if (Util::SameString(coilType, HVAC::cAllCoilTypes(loop))) {
     878        6331 :                 found = true;
     879        6331 :                 locIsCooling = Util::SameString(coilType, HVAC::cCoolingCoilTypes(loop));
     880        6331 :                 locIsHeating = Util::SameString(coilType, HVAC::cHeatingCoilTypes(loop));
     881        6331 :                 break;
     882             :             }
     883             :         }
     884        6331 :         if (found) {
     885        6331 :             coilSelectionDataObjs.emplace_back(new CoilSelectionData(coilName));
     886        6331 :             index = coilSelectionDataObjs.size() - 1;
     887        6331 :             coilSelectionDataObjs[index]->coilObjName = coilType;
     888        6331 :             ++numCoilsReported_;
     889        6331 :             coilSelectionDataObjs[index]->isCooling = locIsCooling;
     890        6331 :             coilSelectionDataObjs[index]->isHeating = locIsHeating;
     891             :         }
     892             :     }
     893             : 
     894        6331 :     if (index == -1) {
     895           0 :         ShowFatalError(state, format("getIndexForOrCreateDataObjFromCoilName: Developer error - not a coil: {} = {}", coilType, coilName));
     896             :     }
     897        6331 :     return index;
     898             : }
     899             : 
     900        3415 : void ReportCoilSelection::associateZoneCoilWithParent(EnergyPlusData &state, std::unique_ptr<CoilSelectionData> &c)
     901             : {
     902        3415 :     c->coilLocation = "Unknown";
     903        3415 :     c->typeHVACname = "Unknown";
     904        3415 :     c->userNameforHVACsystem = "Unknown";
     905             :     // now search equipment
     906        3415 :     auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum);
     907        3415 :     bool coilFound = false;
     908        3415 :     std::string fanType;
     909        3415 :     std::string fanName;
     910       10746 :     auto thisSubCoilLambda = [&c](const DataZoneEquipment::SubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; };
     911        4982 :     auto thisSubFanLambda = [](const DataZoneEquipment::SubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; };
     912        2570 :     auto thisSubSubCoilLambda = [&c](const DataZoneEquipment::SubSubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; };
     913        2582 :     auto thisSubSubFanLambda = [](const DataZoneEquipment::SubSubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; };
     914             : 
     915        3793 :     for (int equipLoop = 1; equipLoop <= zoneEquipList.NumOfEquipTypes; ++equipLoop) {
     916             :         // coil should be found only once, fan could be found multiple times, reset here
     917             :         // for each type of equipment (equipLoop) only one coil and fan could be found as a pair
     918        3793 :         bool fanFound = false;
     919        3793 :         auto &thisSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData;
     920             : 
     921             :         // search for coil and fan SubEquipData and return parent type/name and fan type/name for coil reports.
     922        3793 :         auto const &coilIterator = std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda);
     923        3793 :         if (std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda) != thisSubEq.end()) {
     924         912 :             c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop);
     925         912 :             c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop);
     926         912 :             c->coilLocation = "Zone Equipment";
     927         912 :             int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList);
     928         912 :             if (c->zoneNum.empty()) c->zoneNum.resize(1);
     929         912 :             c->zoneNum[0] = zoneEqListIndex;
     930         912 :             if (c->zoneName.empty()) c->zoneName.resize(1);
     931         912 :             c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name;
     932         912 :             coilFound = true;
     933             :         }
     934        3793 :         auto const &fanIterator = std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubFanLambda);
     935        3793 :         if (fanIterator != thisSubEq.end()) {
     936         937 :             unsigned int fanIndex = fanIterator - thisSubEq.begin();
     937             :             // notice the brackets on the Array1D for [fanIndex]
     938         937 :             fanType = thisSubEq[fanIndex].TypeOf;
     939         937 :             fanName = thisSubEq[fanIndex].Name;
     940         937 :             fanFound = true;
     941             :         }
     942             :         // if coil not found in SubEquipData then maybe it's HXAssisted and in SubSubEquipData. Fan is usually already found if exists.
     943        3793 :         if (!coilFound || !fanFound) {
     944        5722 :             for (int subEq = 1; subEq <= zoneEquipList.EquipData(equipLoop).NumSubEquip; ++subEq) {
     945        2918 :                 auto &thisSubSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData(subEq).SubSubEquipData;
     946        2918 :                 if (!coilFound) {
     947        2918 :                     auto const &coilIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubCoilLambda);
     948        2918 :                     if (coilIterator2 != thisSubSubEq.end()) {
     949        2503 :                         c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop);
     950        2503 :                         c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop);
     951        2503 :                         c->coilLocation = "Zone Equipment";
     952        2503 :                         int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList);
     953        2503 :                         if (c->zoneNum.empty()) c->zoneNum.resize(1);
     954        2503 :                         c->zoneNum[0] = zoneEqListIndex;
     955        2503 :                         if (c->zoneName.empty()) c->zoneName.resize(1);
     956        2503 :                         c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name;
     957        2503 :                         coilFound = true;
     958             :                     }
     959             :                 }
     960        2918 :                 if (!fanFound) {
     961        2818 :                     auto const &fanIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubFanLambda);
     962        2818 :                     if (fanIterator2 != thisSubSubEq.end()) {
     963          80 :                         unsigned int fanIndex = fanIterator2 - thisSubSubEq.begin();
     964             :                         // notice the brackets on the Array1D for [fanIndex]
     965          80 :                         fanType = thisSubSubEq[fanIndex].TypeOf;
     966          80 :                         fanName = thisSubSubEq[fanIndex].Name;
     967          80 :                         fanFound = true;
     968             :                     }
     969             :                 }
     970        2918 :                 if (coilFound && fanFound) break;
     971             :             }
     972             :         }
     973        3793 :         if (coilFound) {
     974        3415 :             if (fanFound) {
     975         989 :                 c->fanTypeName = fanType;
     976         989 :                 c->fanAssociatedWithCoilName = fanName;
     977             :             }
     978        3415 :             break;
     979             :         }
     980             : 
     981             :     } // for (equipLoop)
     982             : 
     983        3415 :     if (c->typeHVACname == "Unknown") {
     984           0 :         ShowWarningError(state, format("Parent object not found for zone coil = {}", c->coilName_));
     985             :     }
     986        3415 : }
     987             : 
     988        4332 : void ReportCoilSelection::setRatedCoilConditions(EnergyPlusData &state,
     989             :                                                  std::string const &coilName,     // ! user-defined name of the coil
     990             :                                                  std::string const &coilObjName,  //  coil object name, e.g., Coil:Cooling:Water
     991             :                                                  Real64 const RatedCoilTotCap,    // ! rated coil total capacity [W]
     992             :                                                  Real64 const RatedCoilSensCap,   // rated coil sensible capacity [W]
     993             :                                                  Real64 const RatedAirMassFlow,   // rated coil design air mass flow rate [m3/s]
     994             :                                                  Real64 const RatedCoilInDb,      // rated coil inlet air dry bulb at time of peak [C]
     995             :                                                  Real64 const RatedCoilInHumRat,  // rated coil inlet air humidity ratio [kgWater/kgDryAir]
     996             :                                                  Real64 const RatedCoilInWb,      // rated coil inlet air wet bulb [C]
     997             :                                                  Real64 const RatedCoilOutDb,     // rated coil outlet air dry bulb [C]
     998             :                                                  Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir]
     999             :                                                  Real64 const RatedCoilOutWb,     // rated coil outlet air wet bulb [C]
    1000             :                                                  Real64 const RatedCoilOadbRef,   // rated DX coil outside air dry bulb reference [C]
    1001             :                                                  Real64 const RatedCoilOawbRef,   // rated DX coil outside air wet bulb reference [C]
    1002             :                                                  Real64 const RatedCoilBpFactor,  // rated coil bypass factor
    1003             :                                                  Real64 const RatedCoilEff        // rated coil effectiveness
    1004             : )
    1005             : {
    1006        4332 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilObjName);
    1007        4332 :     auto &c(coilSelectionDataObjs[index]);
    1008        4332 :     c->coilRatedTotCap = RatedCoilTotCap;
    1009        4332 :     c->coilRatedSensCap = RatedCoilSensCap;
    1010        4332 :     c->ratedAirMassFlow = RatedAirMassFlow;
    1011        4332 :     c->ratedCoilInDb = RatedCoilInDb;
    1012        4332 :     c->ratedCoilInWb = RatedCoilInWb;
    1013        4332 :     c->ratedCoilInHumRat = RatedCoilInHumRat;
    1014        4332 :     if ((RatedCoilInDb == -999.0) || (RatedCoilInHumRat == -999.0)) {
    1015          20 :         c->ratedCoilInEnth = -999.0;
    1016             :     } else {
    1017        4312 :         c->ratedCoilInEnth = Psychrometrics::PsyHFnTdbW(RatedCoilInDb, RatedCoilInHumRat);
    1018             :     }
    1019             : 
    1020        4332 :     c->ratedCoilOutDb = RatedCoilOutDb;
    1021        4332 :     c->ratedCoilOutWb = RatedCoilOutWb;
    1022        4332 :     c->ratedCoilOutHumRat = RatedCoilOutHumRat;
    1023        4332 :     if ((RatedCoilOutDb == -999.0) || (RatedCoilOutHumRat == -999.0)) {
    1024          20 :         c->ratedCoilOutEnth = -999.0;
    1025             :     } else {
    1026        4312 :         c->ratedCoilOutEnth = Psychrometrics::PsyHFnTdbW(RatedCoilOutDb, RatedCoilOutHumRat);
    1027             :     }
    1028             : 
    1029        4332 :     c->ratedCoilEff = RatedCoilEff;
    1030        4332 :     c->ratedCoilBpFactor = RatedCoilBpFactor;
    1031             :     // TODO    //c->ratedCoilAppDewPt =
    1032        4332 :     c->ratedCoilOadbRef = RatedCoilOadbRef;
    1033        4332 :     c->ratedCoilOawbRef = RatedCoilOawbRef;
    1034        4332 : }
    1035             : 
    1036       10186 : void ReportCoilSelection::setCoilAirFlow(EnergyPlusData &state,
    1037             :                                          std::string const &coilName, // user-defined name of the coil
    1038             :                                          std::string const &coilType, // idf input object class name of coil
    1039             :                                          Real64 const airVdot,        // air flow rate in m3/s
    1040             :                                          bool const isAutoSized       // true if air flow was autosized
    1041             : )
    1042             : {
    1043       10186 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1044       10186 :     auto &c(coilSelectionDataObjs[index]);
    1045       10186 :     c->coilDesVolFlow = airVdot;
    1046       10186 :     c->volFlowIsAutosized = isAutoSized;
    1047             : 
    1048       10186 :     c->coilDesMassFlow = airVdot * state.dataEnvrn->StdRhoAir;
    1049       10186 : }
    1050             : 
    1051          26 : void ReportCoilSelection::setCoilWaterFlowNodeNums(EnergyPlusData &state,
    1052             :                                                    std::string const &coilName, // user-defined name of the coil
    1053             :                                                    std::string const &coilType, // idf input object class name of coil
    1054             :                                                    Real64 const waterVdot,      // plant fluid flow rate in m3/s
    1055             :                                                    bool const isAutoSized,      // true if water flow was autosized
    1056             :                                                    int const inletNodeNum,      // coil chw inlet node num
    1057             :                                                    int const outletNodeNum,     // coil chw outlet node num
    1058             :                                                    int const plantLoopNum       // plant loop structure index
    1059             : )
    1060             : {
    1061          26 :     int plantSizNum = -999;
    1062          26 :     if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) {
    1063          26 :         bool errorsfound = false;
    1064          26 :         plantSizNum = PlantUtilities::MyPlantSizingIndex(state, "water coil", coilName, inletNodeNum, outletNodeNum, errorsfound);
    1065             :     }
    1066          26 :     state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum(
    1067             :         state, coilName, coilType, waterVdot, isAutoSized, plantSizNum, plantLoopNum);
    1068          26 : }
    1069             : 
    1070        5813 : void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state,
    1071             :                                                     std::string const &coilName, // user-defined name of the coil
    1072             :                                                     std::string const &coilType, // idf input object class name of coil
    1073             :                                                     Real64 const waterVdot,      // plant fluid flow rate in m3/s
    1074             :                                                     bool const isAutoSized,      // true if water flow was autosized
    1075             :                                                     int const plantSizNum,       // plant sizing structure index
    1076             :                                                     int const plantLoopNum       // plant loop structure index
    1077             : )
    1078             : {
    1079        5813 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1080        5813 :     auto &c(coilSelectionDataObjs[index]);
    1081        5813 :     c->pltSizNum = plantSizNum;
    1082        5813 :     c->waterLoopNum = plantLoopNum;
    1083        5813 :     if (c->waterLoopNum > 0) {
    1084        5799 :         c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name;
    1085             :     }
    1086             : 
    1087        5813 :     if (c->waterLoopNum > 0 && c->pltSizNum > 0) {
    1088        5799 :         if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) {
    1089       11558 :             c->rhoFluid = FluidProperties::GetDensityGlycol(state,
    1090        5779 :                                                             state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
    1091             :                                                             Constant::InitConvTemp,
    1092        5779 :                                                             state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
    1093             :                                                             "ReportCoilSelection::setCoilWaterFlow");
    1094             : 
    1095       11558 :             c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state,
    1096        5779 :                                                                 state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
    1097             :                                                                 Constant::InitConvTemp,
    1098        5779 :                                                                 state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
    1099             :                                                                 "ReportCoilSelection::setCoilWaterFlow");
    1100             :         } else { // steam loop
    1101          40 :             c->rhoFluid = FluidProperties::GetSatDensityRefrig(state,
    1102          20 :                                                                state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
    1103             :                                                                100.0,
    1104             :                                                                1.0,
    1105          20 :                                                                state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
    1106             :                                                                "ReportCoilSelection::setCoilWaterFlow");
    1107          40 :             c->cpFluid = FluidProperties::GetSatSpecificHeatRefrig(state,
    1108          20 :                                                                    state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName,
    1109             :                                                                    100.0,
    1110             :                                                                    0.0,
    1111          20 :                                                                    state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex,
    1112             :                                                                    "ReportCoilSelection::setCoilWaterFlow");
    1113             :         }
    1114             :     }
    1115        5813 :     if (c->rhoFluid > 0.0) {
    1116        5799 :         c->coilDesWaterMassFlow = waterVdot * c->rhoFluid;
    1117             :     }
    1118        5813 :     if (isAutoSized) {
    1119        5803 :         c->coilWaterFlowAutoMsg = "Yes";
    1120             :     } else {
    1121          10 :         c->coilWaterFlowAutoMsg = "No";
    1122             :     }
    1123        5813 : }
    1124             : 
    1125        6482 : void ReportCoilSelection::setCoilEntAirTemp(EnergyPlusData &state,
    1126             :                                             std::string const &coilName,    // user-defined name of the coil
    1127             :                                             std::string const &coilType,    // idf input object class name of coil
    1128             :                                             Real64 const entAirDryBulbTemp, // degree C air entering coil
    1129             :                                             int const curSysNum,            // airloop system number index, if non zero
    1130             :                                             int const curZoneEqNum          // zone equipment list index, if non-zero
    1131             : )
    1132             : {
    1133        6482 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1134        6482 :     auto &c(coilSelectionDataObjs[index]);
    1135        6482 :     c->coilDesEntTemp = entAirDryBulbTemp;
    1136        6482 :     c->airloopNum = curSysNum;
    1137        6482 :     doAirLoopSetup(state, index);
    1138        6482 :     c->zoneEqNum = curZoneEqNum;
    1139        6482 : }
    1140             : 
    1141        6965 : void ReportCoilSelection::setCoilEntAirHumRat(EnergyPlusData &state,
    1142             :                                               std::string const &coilName, // user-defined name of the coil
    1143             :                                               std::string const &coilType, // idf input object class name of coil
    1144             :                                               Real64 const entAirHumrat    //
    1145             : )
    1146             : {
    1147        6965 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1148        6965 :     auto &c(coilSelectionDataObjs[index]);
    1149        6965 :     c->coilDesEntHumRat = entAirHumrat;
    1150        6965 : }
    1151             : 
    1152        3892 : void ReportCoilSelection::setCoilEntWaterTemp(EnergyPlusData &state,
    1153             :                                               std::string const &coilName, // user-defined name of the coil
    1154             :                                               std::string const &coilType, // idf input object class name of coil
    1155             :                                               Real64 const entWaterTemp    //
    1156             : )
    1157             : {
    1158        3892 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1159        3892 :     auto &c(coilSelectionDataObjs[index]);
    1160        3892 :     c->coilDesWaterEntTemp = entWaterTemp;
    1161        3892 : }
    1162             : 
    1163        3411 : void ReportCoilSelection::setCoilLvgWaterTemp(EnergyPlusData &state,
    1164             :                                               std::string const &coilName, // user-defined name of the coil
    1165             :                                               std::string const &coilType, // idf input object class name of coil
    1166             :                                               Real64 const lvgWaterTemp    //
    1167             : )
    1168             : {
    1169        3411 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1170        3411 :     auto &c(coilSelectionDataObjs[index]);
    1171        3411 :     c->coilDesWaterLvgTemp = lvgWaterTemp;
    1172        3411 : }
    1173             : 
    1174        3411 : void ReportCoilSelection::setCoilWaterDeltaT(EnergyPlusData &state,
    1175             :                                              std::string const &coilName, // user-defined name of the coil
    1176             :                                              std::string const &coilType, // idf input object class name of coil
    1177             :                                              Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil
    1178             : )
    1179             : {
    1180        3411 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1181        3411 :     auto &c(coilSelectionDataObjs[index]);
    1182        3411 :     c->coilDesWaterTempDiff = CoilWaterDeltaT;
    1183        3411 : }
    1184             : 
    1185        4104 : void ReportCoilSelection::setCoilLvgAirTemp(EnergyPlusData &state,
    1186             :                                             std::string const &coilName,   // user-defined name of the coil
    1187             :                                             std::string const &coilType,   // idf input object class name of coil
    1188             :                                             Real64 const lvgAirDryBulbTemp //
    1189             : )
    1190             : {
    1191        4104 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1192        4104 :     auto &c(coilSelectionDataObjs[index]);
    1193        4104 :     c->coilDesLvgTemp = lvgAirDryBulbTemp;
    1194        4104 : }
    1195             : 
    1196        4104 : void ReportCoilSelection::setCoilLvgAirHumRat(EnergyPlusData &state,
    1197             :                                               std::string const &coilName, // user-defined name of the coil
    1198             :                                               std::string const &coilType, // idf input object class name of coil
    1199             :                                               Real64 const lvgAirHumRat    //
    1200             : )
    1201             : {
    1202        4104 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1203        4104 :     auto &c(coilSelectionDataObjs[index]);
    1204        4104 :     c->coilDesLvgHumRat = lvgAirHumRat;
    1205        4104 : }
    1206             : 
    1207       13989 : std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const int timeStepAtPeak)
    1208             : {
    1209             :     return fmt::format("{}/{} {}",
    1210       13989 :                        state.dataWeather->DesDayInput(designDay).Month,
    1211       13989 :                        state.dataWeather->DesDayInput(designDay).DayOfMonth,
    1212       27978 :                        ReportCoilSelection::getTimeText(state, timeStepAtPeak));
    1213             : }
    1214             : 
    1215        2145 : void ReportCoilSelection::setCoilCoolingCapacity(
    1216             :     EnergyPlusData &state,
    1217             :     std::string const &coilName,       // user-defined name of the coil
    1218             :     std::string const &coilType,       // idf input object class name of coil
    1219             :     Real64 const TotalCoolingCap,      // {W} coil cooling capacity, sizing result
    1220             :     bool const isAutoSize,             // true if value was autosized
    1221             :     int const curSysNum,               // airloop system number index, if non zero
    1222             :     int const curZoneEqNum,            // zone equipment list index, if non-zero
    1223             :     int const curOASysNum,             // OA system equipment list index, if non-zero
    1224             :     Real64 const fanCoolLoad,          // {W} fan load used in ideal loads coil sizing
    1225             :     Real64 const coilCapFunTempFac,    // {W} curve result for modification factor for capacity as a function of temperature
    1226             :     Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min
    1227             :     Real64 const DXFlowPerCapMaxRatio  // non dimensional ratio, capacity adjustment ratio max
    1228             : )
    1229             : {
    1230        2145 :     auto &ZoneEqSizing(state.dataSize->ZoneEqSizing);
    1231        2145 :     auto &SysSizPeakDDNum(state.dataSize->SysSizPeakDDNum);
    1232             : 
    1233        2145 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1234        2145 :     auto &c(coilSelectionDataObjs[index]);
    1235             :     // no this is adjusted back to ratings    c->coilTotCapAtPeak = TotalCoolingCap;
    1236        2145 :     c->coilCapFTIdealPeak = coilCapFunTempFac;
    1237        2145 :     c->coilTotCapAtPeak = TotalCoolingCap * c->coilCapFTIdealPeak;
    1238        2145 :     c->capIsAutosized = isAutoSize;
    1239        2145 :     c->minRatio = DXFlowPerCapMinRatio;
    1240        2145 :     c->maxRatio = DXFlowPerCapMaxRatio;
    1241             : 
    1242        2145 :     c->fanHeatGainIdealPeak = fanCoolLoad;
    1243        2145 :     c->airloopNum = curSysNum;
    1244        2145 :     doAirLoopSetup(state, index);
    1245        2145 :     c->zoneEqNum = curZoneEqNum;
    1246             :     //    if ( c->zoneEqNum > 0 ) doZoneEqSetup( index );
    1247        2145 :     c->oASysNum = curOASysNum;
    1248             : 
    1249        3612 :     if (curSysNum > 0 && c->zoneEqNum == 0 && allocated(state.dataSize->FinalSysSizing) && allocated(SysSizPeakDDNum) &&
    1250        1467 :         curSysNum <= state.dataHVACGlobal->NumPrimaryAirSys) {
    1251             : 
    1252             :         // These next blocks does not always work with SizingPeriod:WeatherFileDays or SizingPeriod:WeatherFileConditionType, protect against hard
    1253             :         // crash
    1254        1467 :         if (SysSizPeakDDNum(curSysNum).SensCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).SensCoolPeakDD <= state.dataEnvrn->TotDesDays) {
    1255        1465 :             c->desDayNameAtSensPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title;
    1256        2930 :             c->coilSensePeakHrMin = PeakHrMinString(state,
    1257        1465 :                                                     SysSizPeakDDNum(curSysNum).SensCoolPeakDD,
    1258        2930 :                                                     SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD));
    1259             :         }
    1260        1467 :         if (SysSizPeakDDNum(curSysNum).TotCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).TotCoolPeakDD <= state.dataEnvrn->TotDesDays) {
    1261        1465 :             c->desDayNameAtTotalPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title;
    1262        2930 :             c->coilTotalPeakHrMin = PeakHrMinString(state,
    1263        1465 :                                                     SysSizPeakDDNum(curSysNum).TotCoolPeakDD,
    1264        2930 :                                                     SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD));
    1265             :         }
    1266             : 
    1267        1467 :         if (SysSizPeakDDNum(curSysNum).CoolFlowPeakDD > 0 && SysSizPeakDDNum(curSysNum).CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) {
    1268        1465 :             c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title;
    1269        2930 :             c->airPeakHrMin = PeakHrMinString(state,
    1270        1465 :                                               SysSizPeakDDNum(curSysNum).CoolFlowPeakDD,
    1271        2930 :                                               SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD));
    1272             :         }
    1273             : 
    1274        1467 :         auto &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum);
    1275        1467 :         c->isCoilSizingForTotalLoad = (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling);
    1276        1467 :         c->oaPeakTemp = finalSysSizing.OutTempAtCoolPeak;
    1277        1467 :         c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow;
    1278        1467 :         c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak;
    1279        1467 :         c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak;
    1280        1467 :         c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak;
    1281        1467 :         c->coilSizingMethodConcurrence = static_cast<DataSizing::CoilSizingConcurrence>(finalSysSizing.SizingOption);
    1282        1467 :         c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod;
    1283        1467 :         c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod;
    1284             :         // DesOutAirVolFlow
    1285             : 
    1286             :         // loop over cooled zones attached to this airloop to find average Room condition
    1287             :         // change weighting to use supply air flow rate rather than zone air volume for all the zones on this coil's air system
    1288        1467 :         Real64 sumT_Vdot(0.0);   // numerator for average zone temperature, zone temperature values times zone supply air volume flow rate
    1289        1467 :         Real64 sumW_Vdot(0.0);   // numerator average zone humidity ratio, zone hum rat value times zone supply air volume flow rate
    1290        1467 :         Real64 sumSensLoad(0.0); // straight total for zone design loads
    1291        1467 :         Real64 sumVdot(0.0);     // denominator for supply air flow rate weighted averages
    1292             : 
    1293             :         // Decide what day and time to use for zone/room averages
    1294        1467 :         int SysPeakDDnum(0);
    1295        1467 :         int SysPeakTimeStepInDay(0);
    1296        1467 :         if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) {
    1297          18 :             SysPeakDDnum = SysSizPeakDDNum(curSysNum).TotCoolPeakDD;
    1298          18 :             if (SysPeakDDnum > 0) SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD);
    1299        1449 :         } else if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) {
    1300        1449 :             SysPeakDDnum = SysSizPeakDDNum(curSysNum).SensCoolPeakDD;
    1301        1449 :             if (SysPeakDDnum > 0) SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD);
    1302             :         }
    1303             : 
    1304        1467 :         if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) {
    1305        7444 :             for (auto &z : c->zoneNum) {
    1306        5977 :                 auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z);
    1307        5977 :                 auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z);
    1308        5977 :                 Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier;
    1309        5977 :                 Real64 Tz = thisCalcZoneSizing.CoolZoneTempSeq(SysPeakTimeStepInDay);
    1310        5977 :                 Real64 Vdot_z = thisCalcZoneSizing.CoolFlowSeq(SysPeakTimeStepInDay);
    1311        5977 :                 if (Vdot_z == 0.0) { // take value from final zone sizing
    1312          78 :                     Vdot_z = thisFinalZoneSizing.CoolMassFlow;
    1313          78 :                     if (Vdot_z == 0.0) {
    1314          78 :                         Vdot_z = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size();
    1315             :                     }
    1316             :                 }
    1317        5977 :                 Real64 Wz = thisCalcZoneSizing.CoolZoneHumRatSeq(SysPeakTimeStepInDay);
    1318        5977 :                 sumT_Vdot += Tz * Vdot_z * mult;
    1319        5977 :                 sumW_Vdot += Wz * Vdot_z * mult;
    1320        5977 :                 sumVdot += Vdot_z * mult;
    1321        5977 :                 Real64 Qdot_z = thisCalcZoneSizing.CoolLoadSeq(SysPeakTimeStepInDay);
    1322        5977 :                 if (Qdot_z > 0.0) {
    1323        5899 :                     sumSensLoad += Qdot_z * mult;
    1324             :                 } else {
    1325          78 :                     sumSensLoad += thisFinalZoneSizing.DesCoolLoad * mult;
    1326             :                 }
    1327        1467 :             }
    1328             :         }
    1329        1467 :         if (c->zoneNum.size() > 0 && sumVdot > 0.0) {
    1330        1467 :             c->rmPeakTemp = (sumT_Vdot / sumVdot);
    1331        1467 :             c->rmPeakHumRat = (sumW_Vdot / sumVdot);
    1332        2934 :             c->rmPeakRelHum =
    1333        1467 :                 Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage
    1334             :         } else {
    1335           0 :             c->rmPeakTemp = -999.0;
    1336           0 :             c->rmPeakHumRat = -999.0;
    1337           0 :             c->rmPeakRelHum = -999.0;
    1338             :         }
    1339             : 
    1340        1467 :         if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) {
    1341         202 :             c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens;
    1342        1265 :         } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) {
    1343        1265 :             c->rmSensibleAtPeak = sumSensLoad;
    1344             :         } else { // DataSizing::Combination or other
    1345           0 :             c->rmSensibleAtPeak = sumSensLoad;
    1346             :         }
    1347             : 
    1348             :         // now set Coil Ent And Lvg Conditions
    1349        1467 :         if (curOASysNum > 0) {                 // then this system coil is part of OA system
    1350          61 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly
    1351           0 :                 c->coilDesEntTemp = finalSysSizing.OutTempAtCoolPeak;
    1352             :             }
    1353          61 :             if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly
    1354           0 :                 c->coilDesEntHumRat = finalSysSizing.OutHumRatAtCoolPeak;
    1355             :             }
    1356         122 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1357          61 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1358          61 :             c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1359          61 :             if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly
    1360           0 :                 c->coilDesLvgTemp = finalSysSizing.PrecoolTemp;
    1361             :             }
    1362          61 :             if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly
    1363           0 :                 c->coilDesLvgHumRat = finalSysSizing.PrecoolHumRat;
    1364             :             }
    1365         122 :             c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1366          61 :                 state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1367          61 :             c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1368             : 
    1369             :         } else {                               // part of main air loop
    1370        1406 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly
    1371           0 :                 c->coilDesEntTemp = finalSysSizing.MixTempAtCoolPeak;
    1372             :             }
    1373        1406 :             if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly
    1374           0 :                 c->coilDesEntHumRat = finalSysSizing.MixHumRatAtCoolPeak;
    1375             :             }
    1376        2812 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1377        1406 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1378        1406 :             c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1379        1406 :             if (c->coilDesLvgTemp == -999.0) {
    1380           0 :                 c->coilDesLvgTemp = finalSysSizing.CoolSupTemp;
    1381             :             }
    1382        1406 :             if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly
    1383           0 :                 c->coilDesLvgHumRat = finalSysSizing.CoolSupHumRat;
    1384             :             }
    1385        2812 :             c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1386        1406 :                 state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1387        1406 :             c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1388        1406 :             if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOACoolCoils > 0) { // there is precooling of the OA stream
    1389          57 :                 c->oaPretreated = true;
    1390             :             }
    1391             :         }
    1392             : 
    1393         678 :     } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) {
    1394         492 :         c->zoneNum.resize(1);
    1395         492 :         c->zoneName.resize(1);
    1396         492 :         c->zoneNum[0] = curZoneEqNum;
    1397         492 :         if (allocated(state.dataZoneEquip->ZoneEquipConfig)) c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName;
    1398         492 :         auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum);
    1399         492 :         c->desDayNameAtSensPeak = thisFinalZoneSizing.CoolDesDay;
    1400         492 :         c->oaPeakTemp = thisFinalZoneSizing.OutTempAtCoolPeak;
    1401         492 :         c->oaPeakHumRat = thisFinalZoneSizing.OutHumRatAtCoolPeak;
    1402         492 :         c->raPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak;
    1403         492 :         c->raPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak;
    1404         492 :         c->rmPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak;
    1405         492 :         c->rmPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak;
    1406         984 :         c->rmPeakRelHum =
    1407         492 :             Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage
    1408         492 :         if (thisFinalZoneSizing.CoolDDNum > 0 && thisFinalZoneSizing.CoolDDNum <= state.dataEnvrn->TotDesDays) {
    1409         483 :             c->coilSensePeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax);
    1410         483 :             c->airPeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax);
    1411             :         }
    1412             : 
    1413         492 :         c->rmSensibleAtPeak = thisFinalZoneSizing.DesCoolLoad;
    1414             : 
    1415         492 :         if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) {
    1416         263 :             c->oaPeakVolFlow = ZoneEqSizing(curZoneEqNum).OAVolFlow;
    1417             :         } else {
    1418         229 :             c->oaPeakVolFlow = 0.0;
    1419             :         }
    1420             :         // coil entering conditions depend on the type of zone equipment involved
    1421             :         // set typeof_Coil integer
    1422         492 :         if (state.dataSize->TermUnitIU) { // an unpowered induction terminal unit
    1423             :             // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing
    1424             :             // c->coilDesEntTemp = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak;
    1425             :             // c->coilDesEntHumRat = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneHumRatAtCoolPeak;
    1426         484 :         } else if (state.dataSize->ZoneEqFanCoil) {
    1427             :             // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing
    1428             :             // if ( DataSizing::FinalZoneSizing( curZoneEqNum ).DesCoolMassFlow > 0.0 ) {
    1429             :             //    c->oaPeakVolFrac = min( (DataEnvironment::StdRhoAir * c->oaPeakVolFlow)/DataSizing::FinalZoneSizing( curZoneEqNum
    1430             :             //).DesCoolMassFlow, 1.0 ); } else {     c->oaPeakVolFrac = 0.0;
    1431             :             //}
    1432             :             // c->coilDesEntTemp = c->oaPeakVolFrac * DataSizing::FinalZoneSizing( curZoneEqNum ).OutTempAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) *
    1433             :             // DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak;  c->coilDesEntHumRat =  c->oaPeakVolFrac *
    1434             :             // DataSizing::FinalZoneSizing( curZoneEqNum ).OutHumRatAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) * DataSizing::FinalZoneSizing(
    1435             :             // curZoneEqNum ).ZoneHumRatAtCoolPeak;
    1436         321 :         } else if (state.dataSize->ZoneEqDXCoil) {
    1437         252 :             if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) {
    1438         202 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1439           0 :                     c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp;
    1440             :                 }
    1441         202 :                 if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1442           0 :                     c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat;
    1443             :                 }
    1444             :             } else {
    1445          50 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1446           0 :                     c->coilDesEntTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak;
    1447             :                 }
    1448          50 :                 if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1449           0 :                     c->coilDesEntHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak;
    1450             :                 }
    1451             :             }
    1452             :         } else {
    1453          69 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1454           0 :                 c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp;
    1455             :             }
    1456          69 :             if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1457           0 :                 c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat;
    1458             :             }
    1459             :         }
    1460             : 
    1461         492 :         if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp
    1462          85 :             c->coilDesLvgTemp = thisFinalZoneSizing.CoolDesTemp;
    1463             :         }
    1464         492 :         if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat
    1465          85 :             c->coilDesLvgHumRat = thisFinalZoneSizing.CoolDesHumRat;
    1466             :         }
    1467         984 :         c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1468         492 :             state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1469         492 :         c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1470         186 :     } else if (curOASysNum > 0 && c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys) {
    1471           0 :         if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) {
    1472           0 :             int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum;
    1473           0 :             c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOATemp;
    1474           0 :             c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOAHumRat;
    1475           0 :             if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) {
    1476           0 :                 c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1477           0 :                     state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1478           0 :                 c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1479             :             }
    1480           0 :             c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolTemp;
    1481           0 :             c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolHumRat;
    1482           0 :             if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) {
    1483           0 :                 c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1484           0 :                     state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity");
    1485           0 :                 c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1486             :             }
    1487           0 :             DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid;
    1488           0 :             bool sizMethodsAreTheSame = true;
    1489           0 :             for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) {
    1490           0 :                 int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum];
    1491           0 :                 if (airLoopNum == 0) {
    1492           0 :                     sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption;
    1493             :                 } else {
    1494           0 :                     if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) {
    1495           0 :                         sizMethodsAreTheSame = false;
    1496             :                     }
    1497             :                 }
    1498             :             }
    1499           0 :             if (sizMethodsAreTheSame) {
    1500           0 :                 c->coilSizingMethodConcurrence = static_cast<DataSizing::CoilSizingConcurrence>(sizMethod);
    1501             :             } else {
    1502           0 :                 c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination;
    1503             :             }
    1504             :         }
    1505             :     } else {
    1506             :         // do nothing
    1507             :     }
    1508             : 
    1509             :     // calc sensible capacity from inlet outlet
    1510        2145 :     c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesEntHumRat);
    1511        2145 : }
    1512             : 
    1513        4644 : void ReportCoilSelection::setCoilHeatingCapacity(
    1514             :     EnergyPlusData &state,
    1515             :     std::string const &coilName,       // user-defined name of the coil
    1516             :     std::string const &coilType,       // idf input object class name of coil
    1517             :     Real64 const totalHeatingCap,      // {W} coil Heating capacity
    1518             :     bool const isAutoSize,             // true if value was autosized
    1519             :     int const curSysNum,               // airloop system number index, if non zero
    1520             :     int const curZoneEqNum,            // zone equipment list index, if non-zero
    1521             :     int const curOASysNum,             // OA system equipment list index, if non-zero
    1522             :     Real64 const fanHeatGain,          // {W} fan load used in ideal loads coil sizing
    1523             :     Real64 const coilCapFunTempFac,    // {W} curve result for modification factor for capacity as a function of temperature
    1524             :     Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min
    1525             :     Real64 const DXFlowPerCapMaxRatio  // non dimensional ratio, capacity adjustment ratio max
    1526             : )
    1527             : {
    1528        4644 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1529        4644 :     auto &c(coilSelectionDataObjs[index]);
    1530        4644 :     c->capIsAutosized = isAutoSize;
    1531        4644 :     c->coilCapFTIdealPeak = coilCapFunTempFac;
    1532        4644 :     c->coilTotCapAtPeak = totalHeatingCap * c->coilCapFTIdealPeak;
    1533        4644 :     c->minRatio = DXFlowPerCapMinRatio;
    1534        4644 :     c->maxRatio = DXFlowPerCapMaxRatio;
    1535             : 
    1536        4644 :     c->fanHeatGainIdealPeak = fanHeatGain;
    1537        4644 :     c->airloopNum = curSysNum;
    1538        4644 :     doAirLoopSetup(state, index);
    1539        4644 :     c->zoneEqNum = curZoneEqNum;
    1540             :     //    if ( c->zoneEqNum > 0 ) doZoneEqSetup( index );
    1541        4644 :     if (curSysNum > 0 && c->zoneEqNum == 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) {
    1542        1594 :         auto &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum);
    1543        1594 :         c->desDayNameAtSensPeak = finalSysSizing.HeatDesDay;
    1544             : 
    1545        1594 :         c->oaPeakTemp = finalSysSizing.HeatOutTemp;
    1546        1594 :         c->oaPeakHumRat = finalSysSizing.HeatOutHumRat;
    1547        1594 :         c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow;
    1548        1594 :         c->raPeakTemp = finalSysSizing.HeatRetTemp;
    1549        1594 :         c->raPeakHumRat = finalSysSizing.HeatRetHumRat;
    1550        1594 :         c->coilSizingMethodConcurrence = static_cast<DataSizing::CoilSizingConcurrence>(finalSysSizing.SizingOption);
    1551        1594 :         c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod;
    1552        1594 :         c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod;
    1553             : 
    1554             :         // Central Heating Coils are always sized at the conditions at the peak Sensible Heating Load
    1555        1594 :         c->isCoilSizingForTotalLoad = false;
    1556             : 
    1557             :         // DesOutAirVolFlow
    1558             : 
    1559             :         // loop over heated zones attached to this airloop to find average Room condition, if none heated use cooled zones
    1560             :         // weighted average by zone supply air volume flow rate for all the zones on this coil's air system
    1561        1594 :         Real64 sumT_Vdot(0.0); // numerator for average zone temperature, zone temperature values times zone air volume
    1562        1594 :         Real64 sumW_Vdot(0.0); // numerator average zone humidity ratio, zone hum rat value times zone air volume
    1563        1594 :         Real64 sumLoad(0.0);   // straight total for zone design loads
    1564        1594 :         Real64 sumVdot(0.0);   // denominator for zone-volume weighted averages
    1565             : 
    1566        1594 :         int SysPeakDDnum = finalSysSizing.HeatDDNum;
    1567        1594 :         int SysPeakTimeStepInDay = finalSysSizing.SysHeatCoilTimeStepPk;
    1568        1594 :         if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) { // may be zero if no peak found because of zero system load
    1569        8911 :             for (auto &z : c->zoneNum) {
    1570        7320 :                 auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z);
    1571        7320 :                 auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z);
    1572        7320 :                 Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier;
    1573        7320 :                 Real64 Tz = thisCalcZoneSizing.HeatZoneTempSeq(SysPeakTimeStepInDay);
    1574        7320 :                 Real64 Vdot_z = thisCalcZoneSizing.HeatFlowSeq(SysPeakTimeStepInDay);
    1575        7320 :                 if (Vdot_z == 0.0) { // take value from final zone sizing
    1576         865 :                     Vdot_z = thisFinalZoneSizing.HeatMassFlow;
    1577         865 :                     if (Vdot_z == 0.0) {
    1578         865 :                         Vdot_z = finalSysSizing.DesHeatVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size();
    1579             :                     }
    1580             :                 }
    1581        7320 :                 Real64 Wz = thisCalcZoneSizing.HeatZoneHumRatSeq(SysPeakTimeStepInDay);
    1582        7320 :                 sumT_Vdot += Tz * Vdot_z * mult;
    1583        7320 :                 sumW_Vdot += Wz * Vdot_z * mult;
    1584        7320 :                 sumVdot += Vdot_z * mult;
    1585        7320 :                 Real64 Qdot_z = thisCalcZoneSizing.HeatLoadSeq(SysPeakTimeStepInDay);
    1586        7320 :                 if (Qdot_z > 0.0) {
    1587        6455 :                     sumLoad += Qdot_z * mult;
    1588             :                 } else {
    1589         865 :                     sumLoad += thisFinalZoneSizing.DesHeatLoad * mult;
    1590             :                 }
    1591        1591 :             }
    1592             :         }
    1593             : 
    1594        1594 :         if (c->zoneNum.size() > 0 && sumVdot > 0.0) {
    1595        1591 :             c->rmPeakTemp = (sumT_Vdot / sumVdot);
    1596        1591 :             c->rmPeakHumRat = (sumW_Vdot / sumVdot);
    1597        3182 :             c->rmPeakRelHum =
    1598        1591 :                 Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage
    1599             :         } else {
    1600           3 :             c->rmPeakTemp = -999.0;
    1601           3 :             c->rmPeakHumRat = -999.0;
    1602           3 :             c->rmPeakRelHum = -999.0;
    1603             :         }
    1604             : 
    1605        1594 :         if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) {
    1606         165 :             c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens;
    1607        1429 :         } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) {
    1608        1429 :             c->rmSensibleAtPeak = sumLoad;
    1609             :         }
    1610             : 
    1611        1594 :         if (finalSysSizing.HeatDDNum > 0 && finalSysSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) {
    1612        1591 :             c->coilSensePeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatCoilTimeStepPk);
    1613             : 
    1614        1591 :             c->airPeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatAirTimeStepPk);
    1615             : 
    1616        1591 :             c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(finalSysSizing.HeatDDNum).Title;
    1617             :         }
    1618             : 
    1619             :         // now set Coil Ent And Lvg Conditions
    1620             : 
    1621        1594 :         if (curOASysNum > 0) { // then this system coil is part of OA system
    1622          61 :             if (c->coilDesEntTemp == -999.0) c->coilDesEntTemp = finalSysSizing.HeatOutTemp;
    1623          61 :             if (c->coilDesEntHumRat == -999.0) c->coilDesEntHumRat = finalSysSizing.HeatOutHumRat;
    1624         122 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1625          61 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1626          61 :             c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1627          61 :             if (c->coilDesLvgTemp == -999.0) c->coilDesLvgTemp = finalSysSizing.PreheatTemp;
    1628          61 :             if (c->coilDesLvgHumRat == -999.0) c->coilDesLvgHumRat = finalSysSizing.PreheatHumRat;
    1629         122 :             c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1630          61 :                 state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1631          61 :             c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1632             : 
    1633             :         } else { // part of main air loop
    1634        1533 :             if (c->coilDesEntTemp == -999.0) c->coilDesEntTemp = finalSysSizing.HeatMixTemp;
    1635        1533 :             if (c->coilDesEntHumRat == -999.0) c->coilDesEntHumRat = finalSysSizing.HeatMixHumRat;
    1636        3066 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1637        1533 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1638        1533 :             c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1639        1533 :             if (c->coilDesLvgTemp == -999.0) c->coilDesLvgTemp = finalSysSizing.HeatSupTemp;
    1640        1533 :             if (c->coilDesLvgHumRat == -999.0) c->coilDesLvgHumRat = finalSysSizing.HeatSupHumRat;
    1641        3066 :             c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1642        1533 :                 state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1643        1533 :             c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1644        1533 :             if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOAHeatCoils > 0) { // there is preHeating of the OA stream
    1645          57 :                 c->oaPretreated = true;
    1646             :             }
    1647             :         }
    1648             : 
    1649        3050 :     } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) {
    1650        2723 :         auto &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum);
    1651        2723 :         c->zoneNum.resize(1);
    1652        2723 :         c->zoneName.resize(1);
    1653        2723 :         c->zoneNum[0] = curZoneEqNum;
    1654        2723 :         if (allocated(state.dataZoneEquip->ZoneEquipConfig)) c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName;
    1655        2723 :         c->desDayNameAtSensPeak = finalZoneSizing.HeatDesDay;
    1656        2723 :         c->oaPeakTemp = finalZoneSizing.OutTempAtHeatPeak;
    1657        2723 :         c->oaPeakHumRat = finalZoneSizing.OutHumRatAtHeatPeak;
    1658        2723 :         c->raPeakTemp = finalZoneSizing.ZoneRetTempAtHeatPeak;
    1659        2723 :         c->raPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak;
    1660        2723 :         c->rmPeakTemp = finalZoneSizing.ZoneTempAtHeatPeak;
    1661        2723 :         c->rmPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak;
    1662        5446 :         c->rmPeakRelHum =
    1663        2723 :             Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage
    1664        2723 :         if (finalZoneSizing.HeatDDNum > 0 && finalZoneSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) {
    1665        2723 :             c->coilSensePeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax);
    1666        2723 :             c->airPeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax);
    1667             :         }
    1668        2723 :         c->desDayNameAtAirFlowPeak = finalZoneSizing.HeatDesDay;
    1669             : 
    1670        2723 :         c->rmSensibleAtPeak = finalZoneSizing.DesHeatLoad;
    1671             : 
    1672        2723 :         auto &zoneEqSizing = state.dataSize->ZoneEqSizing(curZoneEqNum);
    1673        2723 :         if (zoneEqSizing.OAVolFlow > 0.0) {
    1674         283 :             c->oaPeakVolFlow = zoneEqSizing.OAVolFlow;
    1675        2440 :         } else if (zoneEqSizing.ATMixerVolFlow > 0.0) {
    1676          48 :             c->oaPeakVolFlow = zoneEqSizing.ATMixerVolFlow;
    1677             :         } else {
    1678        2392 :             c->oaPeakVolFlow = 0.0;
    1679             :         }
    1680             :         // coil entering conditions depend on the type of zone equipment involved
    1681             :         // set typeof_Coil integer
    1682        2723 :         if (state.dataSize->TermUnitIU) {      // an unpowered induction terminal unit
    1683           4 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1684           0 :                 auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum);
    1685           0 :                 c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU;
    1686           0 :                 c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU;
    1687             :             }
    1688        2719 :         } else if (state.dataSize->TermUnitSingDuct) {
    1689        2163 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1690          14 :                 auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum);
    1691          14 :                 c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU;
    1692          14 :                 c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU;
    1693             :             }
    1694         556 :         } else if (state.dataSize->TermUnitPIU) {
    1695          57 :             auto const &thisTermUnitSizing = state.dataSize->TermUnitSizing(state.dataSize->CurTermUnitSizingNum);
    1696          57 :             Real64 MinPriFlowFrac = thisTermUnitSizing.MinPriFlowFrac;
    1697          57 :             if (thisTermUnitSizing.InducesPlenumAir) {
    1698          19 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1699           0 :                     auto const &termUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum);
    1700           0 :                     c->coilDesEntTemp = (termUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) +
    1701           0 :                                         (termUnitFinalZoneSizing.ZoneRetTempAtHeatPeak * (1.0 - MinPriFlowFrac));
    1702           0 :                     c->coilDesEntHumRat = (termUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) +
    1703           0 :                                           (termUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac));
    1704             :                 }
    1705             :             } else {
    1706          38 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1707           0 :                     auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum);
    1708           0 :                     c->coilDesEntTemp = (thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) +
    1709           0 :                                         (thisTermUnitFinalZoneSizing.ZoneTempAtHeatPeak * (1.0 - MinPriFlowFrac));
    1710           0 :                     c->coilDesEntHumRat = (thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) +
    1711           0 :                                           (thisTermUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac));
    1712             :                 }
    1713             :             }
    1714         499 :         } else if (state.dataSize->ZoneEqFanCoil) {
    1715          82 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1716           0 :                 Real64 desOAFlowFrac = 0.0;
    1717           0 :                 if (zoneEqSizing.OAVolFlow > 0.0 && finalZoneSizing.DesHeatMassFlow > 0.0) {
    1718           0 :                     desOAFlowFrac = std::min(state.dataEnvrn->StdRhoAir * zoneEqSizing.OAVolFlow / finalZoneSizing.DesHeatMassFlow, 1.0);
    1719             :                 } else {
    1720           0 :                     desOAFlowFrac = finalZoneSizing.DesHeatOAFlowFrac;
    1721             :                 }
    1722           0 :                 c->coilDesEntTemp = desOAFlowFrac * finalZoneSizing.OutTempAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneTempAtHeatPeak;
    1723           0 :                 c->coilDesEntHumRat =
    1724           0 :                     desOAFlowFrac * finalZoneSizing.OutHumRatAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak;
    1725             :             }
    1726         417 :         } else if (state.dataSize->ZoneEqDXCoil) {
    1727         327 :             if (zoneEqSizing.OAVolFlow > 0.0) {
    1728         236 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1729          90 :                     c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp;
    1730             :                 }
    1731         236 :                 if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1732          90 :                     c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat;
    1733             :                 }
    1734             :             } else {
    1735          91 :                 if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1736          73 :                     c->coilDesEntTemp = finalZoneSizing.ZoneTempAtHeatPeak;
    1737             :                 }
    1738          91 :                 if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1739          73 :                     c->coilDesEntHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak;
    1740             :                 }
    1741             :             }
    1742             :         } else {
    1743          90 :             if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp
    1744          17 :                 c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp;
    1745             :             }
    1746          90 :             if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat
    1747          17 :                 c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat;
    1748             :             }
    1749             :         }
    1750             : 
    1751        2723 :         if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) {
    1752        5444 :             c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1753        2722 :                 state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1754        2722 :             c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1755             :         }
    1756             : 
    1757        2723 :         if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp
    1758        2190 :             c->coilDesLvgTemp = finalZoneSizing.HeatDesTemp;
    1759             :         }
    1760        2723 :         if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat
    1761        2190 :             c->coilDesLvgHumRat = finalZoneSizing.HeatDesHumRat;
    1762             :         }
    1763        5446 :         c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1764        2723 :             state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1765        2723 :         c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1766         327 :     } else if (curOASysNum > 0 && c->airloopNum > int(state.dataSize->FinalSysSizing.size())) {
    1767           7 :         if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) {
    1768           1 :             c->oASysNum = curOASysNum; // where should this get set? It's -999 here.
    1769           1 :             int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum;
    1770           1 :             c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutTemp;
    1771           1 :             c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutHumRat;
    1772           1 :             if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) {
    1773           2 :                 c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1774           1 :                     state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1775           1 :                 c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat);
    1776             :             }
    1777           1 :             c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatTemp;
    1778           1 :             c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatHumRat;
    1779           1 :             if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) {
    1780           2 :                 c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb(
    1781           1 :                     state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity");
    1782           1 :                 c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat);
    1783             :             }
    1784           1 :             DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid;
    1785           1 :             bool sizMethodsAreTheSame = true;
    1786           6 :             for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) {
    1787           5 :                 int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum];
    1788           5 :                 if (airLoopNum == 0) {
    1789           1 :                     sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption;
    1790             :                 } else {
    1791           4 :                     if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) {
    1792           0 :                         sizMethodsAreTheSame = false;
    1793             :                     }
    1794             :                 }
    1795             :             }
    1796           1 :             if (sizMethodsAreTheSame) {
    1797           1 :                 c->coilSizingMethodConcurrence = static_cast<DataSizing::CoilSizingConcurrence>(sizMethod);
    1798             :             } else {
    1799           0 :                 c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination;
    1800             :             }
    1801             :         }
    1802             :     } else {
    1803             :         // do nothing
    1804             :     }
    1805             : 
    1806        4644 :     if (state.dataSize->DataCoilIsSuppHeater) {
    1807         304 :         c->isSupplementalHeater = true;
    1808             :     }
    1809             :     // some heating coils only use this routine, so set air flow if not yet set
    1810        4644 :     if (c->coilDesVolFlow <= 0.0) {
    1811         595 :         if (state.dataSize->DataFlowUsedForSizing > 0.0) { // flow has been set in global, so use it
    1812          63 :             c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing;
    1813         532 :         } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) {
    1814         109 :             auto &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum);
    1815         109 :             if (finalZoneSizing.DesHeatMassFlow >= HVAC::SmallMassFlow) {
    1816          99 :                 c->coilDesMassFlow = finalZoneSizing.DesHeatMassFlow;
    1817          99 :                 c->coilDesVolFlow = c->coilDesMassFlow / state.dataEnvrn->StdRhoAir;
    1818             :             }
    1819         423 :         } else if (curSysNum > 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) {
    1820         134 :             auto &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum);
    1821         134 :             if (curOASysNum > 0 && allocated(state.dataSize->OASysEqSizing)) {
    1822           0 :                 auto &oASysEqSizing = state.dataSize->OASysEqSizing(curSysNum);
    1823           0 :                 if (oASysEqSizing.AirFlow) {
    1824           0 :                     c->coilDesVolFlow = oASysEqSizing.AirVolFlow;
    1825           0 :                 } else if (oASysEqSizing.HeatingAirFlow) {
    1826           0 :                     c->coilDesVolFlow = oASysEqSizing.HeatingAirVolFlow;
    1827             :                 } else {
    1828           0 :                     c->coilDesVolFlow = finalSysSizing.DesOutAirVolFlow;
    1829             :                 }
    1830             :             } else {
    1831         134 :                 if (state.dataSize->DataFlowUsedForSizing > 0.0) {
    1832           0 :                     c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing;
    1833         134 :                 } else if (curSysNum > 0 && allocated(state.dataSize->UnitarySysEqSizing)) {
    1834         134 :                     auto &unitarySysEqSizing = state.dataSize->UnitarySysEqSizing(curSysNum);
    1835         134 :                     if (unitarySysEqSizing.AirFlow) {
    1836          32 :                         c->coilDesVolFlow = unitarySysEqSizing.AirVolFlow;
    1837         102 :                     } else if (unitarySysEqSizing.HeatingAirFlow) {
    1838           0 :                         c->coilDesVolFlow = unitarySysEqSizing.HeatingAirVolFlow;
    1839             :                     }
    1840             :                 } else {
    1841           0 :                     if (state.dataSize->CurDuctType == HVAC::AirDuctType::Main) {
    1842           0 :                         if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) {
    1843           0 :                             c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesMainVolFlow;
    1844             :                         } else {
    1845           0 :                             c->coilDesVolFlow = finalSysSizing.DesMainVolFlow;
    1846             :                         }
    1847           0 :                     } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Cooling) {
    1848           0 :                         if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) {
    1849           0 :                             c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesCoolVolFlow;
    1850             :                         } else {
    1851           0 :                             c->coilDesVolFlow = finalSysSizing.DesCoolVolFlow;
    1852             :                         }
    1853           0 :                     } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Heating) {
    1854           0 :                         c->coilDesVolFlow = finalSysSizing.DesHeatVolFlow;
    1855           0 :                     } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Other) {
    1856           0 :                         c->coilDesVolFlow = finalSysSizing.DesMainVolFlow;
    1857             :                     } else {
    1858           0 :                         c->coilDesVolFlow = finalSysSizing.DesMainVolFlow;
    1859             :                     }
    1860             :                 }
    1861             :             }
    1862             :         }
    1863         595 :         c->coilDesMassFlow = c->coilDesVolFlow * state.dataEnvrn->StdRhoAir;
    1864             :     }
    1865             : 
    1866             :     // calc sensible capacity from inlet outlet
    1867        4644 :     c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesLvgHumRat);
    1868             :     // this is not generally correct but okay for heating coils
    1869        4644 :     c->coilSensCapAtPeak = std::abs(c->cpMoistAir * c->coilDesMassFlow * (c->coilDesLvgTemp - c->coilDesEntTemp));
    1870        4644 :     c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak);
    1871        4644 : }
    1872             : 
    1873         584 : void ReportCoilSelection::setCoilWaterCoolingCapacity(EnergyPlusData &state,
    1874             :                                                       std::string const &coilName,  // user-defined name of the coil
    1875             :                                                       std::string const &coilType,  // idf input object class name of coil
    1876             :                                                       Real64 const totalCoolingCap, // {W} coil cooling capacity
    1877             :                                                       bool const isAutoSize,        // true if value was autosized
    1878             :                                                       int const inletNodeNum,       // coil chw inlet node num
    1879             :                                                       int const outletNodeNum,      // coil chw outlet node num
    1880             :                                                       int const dataWaterLoopNum    // plant loop structure index
    1881             : )
    1882             : {
    1883         584 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1884         584 :     auto &c(coilSelectionDataObjs[index]);
    1885         584 :     c->coilTotCapAtPeak = totalCoolingCap;
    1886         584 :     c->capIsAutosized = isAutoSize;
    1887         584 :     if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) {
    1888         493 :         bool errorsfound = false;
    1889         493 :         c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "chilled water coil", coilName, inletNodeNum, outletNodeNum, errorsfound);
    1890             :     } else {
    1891          91 :         c->pltSizNum = -999;
    1892             :     }
    1893         584 :     c->waterLoopNum = dataWaterLoopNum;
    1894         584 : }
    1895             : 
    1896        2749 : void ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state,
    1897             :                                                              std::string const &coilName,  // user-defined name of the coil
    1898             :                                                              std::string const &coilType,  // idf input object class name of coil
    1899             :                                                              Real64 const totalHeatingCap, // {W} coil Heating capacity
    1900             :                                                              bool const isAutoSize,        // true if value was autosized
    1901             :                                                              int const inletNodeNum,       // coil chw inlet node num
    1902             :                                                              int const outletNodeNum,      // coil chw outlet node num
    1903             :                                                              int const dataWaterLoopNum    // plant loop structure index
    1904             : )
    1905             : {
    1906        2749 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1907        2749 :     auto &c(coilSelectionDataObjs[index]);
    1908        2749 :     c->coilTotCapAtPeak = totalHeatingCap;
    1909        2749 :     c->capIsAutosized = isAutoSize;
    1910        2749 :     if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) {
    1911        2473 :         bool errorsfound = false;
    1912        2473 :         c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "hot water coil", coilName, inletNodeNum, outletNodeNum, errorsfound);
    1913             :     } else {
    1914         276 :         c->pltSizNum = -999;
    1915             :     }
    1916        2749 :     c->waterLoopNum = dataWaterLoopNum;
    1917        2749 : }
    1918             : 
    1919        2031 : void ReportCoilSelection::setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state,
    1920             :                                                               std::string const &coilName,  // user-defined name of the coil
    1921             :                                                               std::string const &coilType,  // idf input object class name of coil
    1922             :                                                               Real64 const totalHeatingCap, // {W} coil Heating capacity
    1923             :                                                               bool const isAutoSize,        // true if value was autosized
    1924             :                                                               int const dataPltSizNum,      // plant sizing structure index
    1925             :                                                               int const dataWaterLoopNum    // plant loop structure index
    1926             : )
    1927             : {
    1928        2031 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1929        2031 :     auto &c(coilSelectionDataObjs[index]);
    1930        2031 :     c->coilTotCapAtPeak = totalHeatingCap;
    1931        2031 :     c->capIsAutosized = isAutoSize;
    1932        2031 :     c->pltSizNum = dataPltSizNum;
    1933        2031 :     c->waterLoopNum = dataWaterLoopNum;
    1934        2031 : }
    1935             : 
    1936        2422 : void ReportCoilSelection::setCoilUA(EnergyPlusData &state,
    1937             :                                     std::string const &coilName,            // user-defined name of the coil
    1938             :                                     std::string const &coilType,            // idf input object class name of coil
    1939             :                                     Real64 const UAvalue,                   // [W/k] UA value for coil,
    1940             :                                     Real64 const dataCapacityUsedForSizing, // [W] sizing global
    1941             :                                     bool const isAutoSize,                  // true if value was autosized
    1942             :                                     int const curSysNum,                    // airloop system number index, if non zero
    1943             :                                     int const curZoneEqNum                  // zone equipment list index, if non-zero
    1944             : )
    1945             : {
    1946        2422 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1947        2422 :     auto &c(coilSelectionDataObjs[index]);
    1948        2422 :     c->coilUA = UAvalue;
    1949        2422 :     c->coilTotCapAtPeak = dataCapacityUsedForSizing;
    1950        2422 :     c->capIsAutosized = isAutoSize;
    1951        2422 :     c->airloopNum = curSysNum;
    1952        2422 :     doAirLoopSetup(state, index);
    1953        2422 :     c->zoneEqNum = curZoneEqNum;
    1954        2422 : }
    1955             : 
    1956        5823 : void ReportCoilSelection::setCoilReheatMultiplier(EnergyPlusData &state,
    1957             :                                                   std::string const &coilName, // user-defined name of the coil
    1958             :                                                   std::string const &coilType, // idf input object class name of coil
    1959             :                                                   Real64 const multiplierReheatLoad)
    1960             : {
    1961        5823 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1962        5823 :     auto &c(coilSelectionDataObjs[index]);
    1963        5823 :     c->reheatLoadMult = multiplierReheatLoad;
    1964        5823 : }
    1965             : 
    1966        7942 : void ReportCoilSelection::setCoilSupplyFanInfo(EnergyPlusData &state,
    1967             :                                                std::string const &coilName, // user-defined name of the coil
    1968             :                                                std::string const &coilType, // idf input object class name of coil
    1969             :                                                std::string const &fanName,
    1970             :                                                HVAC::FanType fanType,
    1971             :                                                int fanIndex)
    1972             : {
    1973        7942 :     if (fanName.empty()) {
    1974         720 :         return;
    1975             :     }
    1976        7222 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1977        7222 :     auto &c(coilSelectionDataObjs[index]);
    1978        7222 :     c->fanAssociatedWithCoilName = fanName;
    1979        7222 :     c->supFanType = fanType;
    1980        7222 :     c->supFanNum = fanIndex;
    1981        7222 :     if (c->supFanNum == 0) c->supFanNum = Fans::GetFanIndex(state, fanName);
    1982             : }
    1983             : 
    1984        3313 : void ReportCoilSelection::setCoilEqNum(EnergyPlusData &state,
    1985             :                                        std::string const &coilName,
    1986             :                                        std::string const &coilType,
    1987             :                                        int const curSysNum,
    1988             :                                        int const curOASysNum,
    1989             :                                        int const curZoneEqNum)
    1990             : {
    1991        3313 :     int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType);
    1992        3313 :     auto &c(coilSelectionDataObjs[index]);
    1993        3313 :     c->airloopNum = curSysNum;
    1994        3313 :     c->oASysNum = curOASysNum;
    1995        3313 :     c->zoneEqNum = curZoneEqNum;
    1996        3313 : }
    1997             : 
    1998       17116 : std::string ReportCoilSelection::getTimeText(EnergyPlusData &state, int const timeStepAtPeak)
    1999             : {
    2000       17116 :     std::string returnString = "";
    2001             : 
    2002       17116 :     if (timeStepAtPeak == 0) {
    2003           0 :         return returnString;
    2004             :     }
    2005             : 
    2006             :     // Scan timesteps of 24-hr day to match up correct hour and minute
    2007       17116 :     int minutes(0);
    2008       17116 :     int timeStepIndex(0);
    2009             :     int hourPrint;
    2010      427900 :     for (int hourCounter = 1; hourCounter <= 24; ++hourCounter) {
    2011     2398392 :         for (int timeStepCounter = 1; timeStepCounter <= state.dataGlobal->NumOfTimeStepInHour; ++timeStepCounter) {
    2012     1987608 :             ++timeStepIndex;
    2013     1987608 :             minutes += state.dataGlobal->MinutesPerTimeStep;
    2014     1987608 :             if (minutes == 60) {
    2015      410784 :                 minutes = 0;
    2016      410784 :                 hourPrint = hourCounter;
    2017             :             } else {
    2018     1576824 :                 hourPrint = hourCounter - 1;
    2019             :             }
    2020     1987608 :             if (timeStepIndex == timeStepAtPeak) {
    2021       17116 :                 returnString = format(DataSizing::PeakHrMinFmt, hourPrint, minutes);
    2022             :             }
    2023             :         }
    2024             :     }
    2025             : 
    2026       17116 :     return returnString;
    2027           0 : }
    2028             : 
    2029        2068 : bool ReportCoilSelection::isCompTypeFan(std::string const &compType // string component type, input object class name
    2030             : )
    2031             : {
    2032             :     // if compType name is one of the fan objects, then return true
    2033        2068 :     if (Util::SameString(compType, "Fan:SystemModel")) {
    2034         229 :         return true;
    2035        1839 :     } else if (Util::SameString(compType, "Fan:ComponentModel")) {
    2036           5 :         return true;
    2037        1834 :     } else if (Util::SameString(compType, "Fan:OnOff")) {
    2038         880 :         return true;
    2039         954 :     } else if (Util::SameString(compType, "Fan:ConstantVolume")) {
    2040         524 :         return true;
    2041         430 :     } else if (Util::SameString(compType, "Fan:VariableVolume")) {
    2042         430 :         return true;
    2043             :     } else {
    2044           0 :         return false;
    2045             :     }
    2046             : }
    2047             : 
    2048         368 : bool ReportCoilSelection::isCompTypeCoil(std::string const &compType // string component type, input object class name
    2049             : )
    2050             : {
    2051             :     // if compType name is one of the coil objects, then return true
    2052         368 :     bool found(false);
    2053       11202 :     for (int loop = 1; loop <= HVAC::NumAllCoilTypes; ++loop) {
    2054       11046 :         if (Util::SameString(compType, HVAC::cAllCoilTypes(loop))) {
    2055         212 :             found = true;
    2056         212 :             break;
    2057             :         }
    2058             :     }
    2059         368 :     return found;
    2060             : }
    2061             : 
    2062         185 : void ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(int const zoneIndex, Real64 const zoneCoolingLatentLoad)
    2063             : {
    2064             :     // loop over all the coils and the zones in the coils and if this zone index is in the coil
    2065        4535 :     for (auto &c : coilSelectionDataObjs) {
    2066             : 
    2067        4350 :         if (c->isCooling) {
    2068        2545 :             for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) {
    2069        2470 :                 if (zoneIndex == c->zoneNum[zoneInd]) {
    2070         355 :                     c->rmLatentAtPeak += zoneCoolingLatentLoad;
    2071         355 :                     break;
    2072             :                 }
    2073             :             }
    2074             :         }
    2075         185 :     }
    2076         185 : }
    2077             : 
    2078         185 : void ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(int const zoneIndex, Real64 const zoneHeatingLatentLoad)
    2079             : {
    2080             :     // loop over all the coils and the zones in the coils and if this zone index is in the coil
    2081        4535 :     for (auto &c : coilSelectionDataObjs) {
    2082             : 
    2083        4350 :         if (c->isHeating) {
    2084        9305 :             for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) {
    2085        5835 :                 if (zoneIndex == c->zoneNum[zoneInd]) {
    2086         450 :                     c->rmLatentAtPeak += zoneHeatingLatentLoad;
    2087         450 :                     break;
    2088             :                 }
    2089             :             }
    2090             :         }
    2091         185 :     }
    2092         185 : }
    2093             : 
    2094             : } // namespace EnergyPlus

Generated by: LCOV version 1.14