LCOV - code coverage report
Current view: top level - EnergyPlus - PlantCentralGSHP.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 26 39 66.7 %
Date: 2023-01-17 19:17:23 Functions: 15 19 78.9 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef PlantCentralGSHP_hh_INCLUDED
      49             : #define PlantCentralGSHP_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/DataGlobals.hh>
      57             : #include <EnergyPlus/EnergyPlus.hh>
      58             : #include <EnergyPlus/PlantComponent.hh>
      59             : 
      60             : namespace EnergyPlus {
      61             : 
      62             : // Forward declarations
      63             : struct EnergyPlusData;
      64             : 
      65             : namespace PlantCentralGSHP {
      66             : 
      67             :     enum class CondenserType
      68             :     {
      69             :         Invalid = -1,
      70             :         WaterCooled,
      71             :         SmartMixing,
      72             :         Num
      73             :     };
      74             : 
      75             :     struct CGSHPNodeData
      76             :     {
      77             :         // Members
      78             :         Real64 Temp;                 // {C}
      79             :         Real64 TempMin;              // {C}
      80             :         Real64 TempSetPoint;         // SensedNodeFlagValue ! {C}
      81             :         Real64 MassFlowRate;         // {kg/s}
      82             :         Real64 MassFlowRateMin;      // {kg/s}
      83             :         Real64 MassFlowRateMax;      // SensedNodeFlagValue ! {kg/s}
      84             :         Real64 MassFlowRateMinAvail; // {kg/s}
      85             :         Real64 MassFlowRateMaxAvail; // {kg/s}
      86             :         Real64 MassFlowRateSetPoint; // {kg/s}
      87             :         Real64 MassFlowRateRequest;  // {kg/s}
      88             : 
      89          28 :         CGSHPNodeData()
      90          28 :             : Temp(0.0), TempMin(0.0), TempSetPoint(0.0), MassFlowRate(0.0), MassFlowRateMin(0.0), MassFlowRateMax(0.0), MassFlowRateMinAvail(0.0),
      91          28 :               MassFlowRateMaxAvail(0.0), MassFlowRateSetPoint(0.0), MassFlowRateRequest(0.0)
      92             :         {
      93          28 :         }
      94             :     };
      95             : 
      96           8 :     struct WrapperComponentSpecs
      97             :     {
      98             :         std::string WrapperPerformanceObjectType; // Component type
      99             :         std::string WrapperComponentName;         // Component name
     100             :         int WrapperPerformanceObjectIndex;        // Component index in the input array
     101             :         int WrapperIdenticalObjectNum;            // Number of identical objects
     102             :         int CHSchedPtr;                           // Index to schedule
     103             : 
     104           2 :         WrapperComponentSpecs() : WrapperPerformanceObjectIndex(0), WrapperIdenticalObjectNum(0), CHSchedPtr(0)
     105             :         {
     106           2 :         }
     107             :     };
     108             : 
     109             :     struct CHReportVars
     110             :     {
     111             :         int CurrentMode;                  // 0-off; 1-cooling only; 2-heating-only; 3-simutaneouls heat/cool
     112             :         Real64 ChillerPartLoadRatio;      // Chiller PLR (Load/Capacity)
     113             :         Real64 ChillerCyclingRatio;       // Chiller cycling ratio (time on/time step)
     114             :         Real64 ChillerFalseLoad;          // Chiller false load over and above water side load [J]
     115             :         Real64 ChillerFalseLoadRate;      // Chiller false load rate over and above water side load [W]
     116             :         Real64 CoolingPower;              // Chiller power, W
     117             :         Real64 HeatingPower;              // Chiller power, W
     118             :         Real64 QEvap;                     // Evaporator heat transfer rate [W]
     119             :         Real64 QCond;                     // Condenser heat transfer rate [W]
     120             :         Real64 CoolingEnergy;             // Chiller electric consumption [J]
     121             :         Real64 HeatingEnergy;             // Chiller electric consumption [J]
     122             :         Real64 EvapEnergy;                // Evaporator heat transfer energy [J]
     123             :         Real64 CondEnergy;                // Condenser heat transfer energy [J]
     124             :         Real64 CondInletTemp;             // Condenser inlet temperature [C]
     125             :         Real64 EvapInletTemp;             // Evaporator inlet temperature [C]
     126             :         Real64 CondOutletTemp;            // Condenser outlet temperature [C]
     127             :         Real64 EvapOutletTemp;            // Evaporator outlet temperature [C]
     128             :         Real64 Evapmdot;                  // Evaporator mass flow rate [kg/s]
     129             :         Real64 Condmdot;                  // Condenser mass flow rate [kg/s]
     130             :         Real64 ActualCOP;                 // Coefficient of performance
     131             :         Real64 ChillerCapFT;              // Chiller capacity curve output value
     132             :         Real64 ChillerEIRFT;              // Chiller EIRFT curve output value
     133             :         Real64 ChillerEIRFPLR;            // Chiller EIRFPLR curve output value
     134             :         Real64 CondenserFanPowerUse;      // Air-cooled condenser fan power [W]
     135             :         Real64 CondenserFanEnergy;        // Air-cooled condenser fan energy [J]
     136             :         Real64 ChillerPartLoadRatioSimul; // Chiller PLR (Load/Capacity) for simul clg/htg mode
     137             :         Real64 ChillerCyclingRatioSimul;  // Chiller cycling ratio (time on/time step) for simul clg/htg mode
     138             :         Real64 ChillerFalseLoadSimul;     // Chiller false load for simul clg/htg mode [J]
     139             :         Real64 ChillerFalseLoadRateSimul; // Chiller false load rate for simul clg/htg mode [W]
     140             :         Real64 CoolingPowerSimul;         // Chiller power for simul clg/htg mode [W]
     141             :         Real64 QEvapSimul;                // Evaporator heat transfer rate for simul clg/htg mode [W]
     142             :         Real64 QCondSimul;                // Evaporator heat transfer rate for simul clg/htg mode [W]
     143             :         Real64 CoolingEnergySimul;        // Chiller electric consumption for simul clg/htg mode [J]
     144             :         Real64 EvapEnergySimul;           // Evaporator heat transfer energy for simul clg/htg mode [J]
     145             :         Real64 CondEnergySimul;           // Condenser heat transfer energy for simul clg/htg mode [J]
     146             :         Real64 EvapInletTempSimul;        // Evaporator inlet temperature for simul clg/htg mode [C]
     147             :         Real64 EvapOutletTempSimul;       // Evaporator outlet temperature for simul clg/htg mode [C]
     148             :         Real64 EvapmdotSimul;             // Evaporator mass flow rate for simul clg/htg mode [kg/s]
     149             :         Real64 CondInletTempSimul;        // Condenser inlet temperature for simul clg/htg mode [C]
     150             :         Real64 CondOutletTempSimul;       // Condenser outlet temperature for simul clg/htg mode [C]
     151             :         Real64 CondmdotSimul;             // Condenser mass flow rate for simul clg/htg mode [kg/s]
     152             :         Real64 ChillerCapFTSimul;         // Chiller capacity curve output value for simul clg/htg mode
     153             :         Real64 ChillerEIRFTSimul;         // Chiller EIRFT curve output value for simul clg/htg mode
     154             :         Real64 ChillerEIRFPLRSimul;       // Chiller EIRFPLR curve output value for simul clg/htg mode
     155             : 
     156           7 :         CHReportVars()
     157           7 :             : CurrentMode(0), ChillerPartLoadRatio(0.0), ChillerCyclingRatio(0.0), ChillerFalseLoad(0.0), ChillerFalseLoadRate(0.0),
     158             :               CoolingPower(0.0), HeatingPower(0.0), QEvap(0.0), QCond(0.0), CoolingEnergy(0.0), HeatingEnergy(0.0), EvapEnergy(0.0), CondEnergy(0.0),
     159             :               CondInletTemp(0.0), EvapInletTemp(0.0), CondOutletTemp(0.0), EvapOutletTemp(0.0), Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0),
     160             :               ChillerCapFT(0.0), ChillerEIRFT(0.0), ChillerEIRFPLR(0.0), CondenserFanPowerUse(0.0), CondenserFanEnergy(0.0),
     161             :               ChillerPartLoadRatioSimul(0.0), ChillerCyclingRatioSimul(0.0), ChillerFalseLoadSimul(0.0), ChillerFalseLoadRateSimul(0.0),
     162             :               CoolingPowerSimul(0.0), QEvapSimul(0.0), QCondSimul(0.0), CoolingEnergySimul(0.0), EvapEnergySimul(0.0), CondEnergySimul(0.0),
     163             :               EvapInletTempSimul(0.0), EvapOutletTempSimul(0.0), EvapmdotSimul(0.0), CondInletTempSimul(0.0), CondOutletTempSimul(0.0),
     164           7 :               CondmdotSimul(0.0), ChillerCapFTSimul(0.0), ChillerEIRFTSimul(0.0), ChillerEIRFPLRSimul(0.0)
     165             :         {
     166           7 :         }
     167             :     };
     168             : 
     169          31 :     struct ChillerHeaterSpecs
     170             :     {
     171             :         std::string Name;                 // Name of the Chiller Heater object
     172             :         std::string CondModeCooling;      // Cooling mode temperature curve input variable
     173             :         std::string CondModeHeating;      // Clg/Htg mode temperature curve input variable
     174             :         std::string CondMode;             // Current mode temperature curve input variable
     175             :         bool ConstantFlow;                // True if this is a Constant Flow Chiller
     176             :         bool VariableFlow;                // True if this is a Variable Flow Chiller
     177             :         bool CoolSetPointSetToLoop;       // True if the setpoint is missing at the outlet node
     178             :         bool HeatSetPointSetToLoop;       // True if the setpoint is missing at the outlet node
     179             :         bool CoolSetPointErrDone;         // true if setpoint warning issued
     180             :         bool HeatSetPointErrDone;         // true if setpoint warning issued
     181             :         bool PossibleSubcooling;          // flag to indicate chiller is doing less cooling that requested
     182             :         int ChillerHeaterNum;             // Chiller heater number
     183             :         CondenserType condenserType;      // Type of Condenser - only water cooled is allowed
     184             :         int ChillerCapFTCoolingIDX;       // Cooling capacity function of temperature curve index
     185             :         int ChillerEIRFTCoolingIDX;       // Elec Input to Cooling Output ratio function of temperature curve index
     186             :         int ChillerEIRFPLRCoolingIDX;     // Elec Input to cooling output ratio function of PLR curve index
     187             :         int ChillerCapFTHeatingIDX;       // Clg/Htg capacity function of temperature curve index
     188             :         int ChillerEIRFTHeatingIDX;       // Elec Input to Clg/Htg Output ratio function of temperature curve index
     189             :         int ChillerEIRFPLRHeatingIDX;     // Elec Input to Clg/Htg output ratio function of PLR curve index
     190             :         int ChillerCapFTIDX;              // Capacity function of temperature curve index
     191             :         int ChillerEIRFTIDX;              // Elec Input to demand output ratio function of temperature curve index
     192             :         int ChillerEIRFPLRIDX;            // Elec Input to demand output ratio function of PLR curve index
     193             :         int EvapInletNodeNum;             // Node number on the inlet side of the plant (evaporator side)
     194             :         int EvapOutletNodeNum;            // Node number on the outlet side of the plant (evaporator side)
     195             :         int CondInletNodeNum;             // Node number on the inlet side of the condenser
     196             :         int CondOutletNodeNum;            // Node number on the outlet side of the condenser
     197             :         int ChillerCapFTError;            // Used for negative capacity as a function of temp warnings
     198             :         int ChillerCapFTErrorIndex;       // Used for negative capacity as a function of temp warnings
     199             :         int ChillerEIRFTError;            // Used for negative EIR as a function of temp warnings
     200             :         int ChillerEIRFTErrorIndex;       // Used for negative EIR as a function of temp warnings
     201             :         int ChillerEIRFPLRError;          // Used for negative EIR as a function of PLR warnings
     202             :         int ChillerEIRFPLRErrorIndex;     // Used for negative EIR as a function of PLR warnings
     203             :         int ChillerEIRRefTempErrorIndex;  // Used for reference temperature problems
     204             :         int DeltaTErrCount;               // Evaporator delta T equals 0 for variable flow chiller warning messages
     205             :         int DeltaTErrCountIndex;          // Index to evaporator delta T = 0 for variable flow chiller warning messages
     206             :         int CondMassFlowIndex;            // Index to condenser mass flow rate
     207             :         Real64 RefCapCooling;             // Reference cooling-mode evaporator capacity [W]
     208             :         bool RefCapCoolingWasAutoSized;   // true if reference cooling capacity was autosize on input
     209             :         Real64 RefCOPCooling;             // Reference cooling-mode COP
     210             :         Real64 TempRefEvapOutCooling;     // Reference cooling-mode evaporator leaving temperature [C]
     211             :         Real64 TempRefCondInCooling;      // Reference cooling-mode condenser entering temperature [C]
     212             :         Real64 TempRefCondOutCooling;     // Reference cooling-mode condenser leaving temperature [C]
     213             :         Real64 MaxPartLoadRatCooling;     // Maximum Part load ratio in cooling mode
     214             :         Real64 OptPartLoadRatCooling;     // Optimum Part load ratio in cooling mode
     215             :         Real64 MinPartLoadRatCooling;     // minimum Part load ratio in cooling mode
     216             :         Real64 ClgHtgToCoolingCapRatio;   // ratio of clg/htg-mode evaporator capacity to cooling-mode evap. cap
     217             :         Real64 ClgHtgtoCogPowerRatio;     // ratio of clg/htg-mode evaporator power to cooling-mode evap. power
     218             :         Real64 RefCapClgHtg;              // Reference clg/htg-mode evaporator capacity [W]
     219             :         Real64 RefCOPClgHtg;              // Reference clg/htg-mode COP
     220             :         Real64 RefPowerClgHtg;            // Reference clg/htg-mode evaporator power [W]
     221             :         Real64 TempRefEvapOutClgHtg;      // Reference clg/htg-mode evaporator leaving temperature [C]
     222             :         Real64 TempRefCondInClgHtg;       // Reference clg/htg-mode condenser entering temperature [C]
     223             :         Real64 TempRefCondOutClgHtg;      // Reference clg/htg-mode condenser leaving temperature [C]
     224             :         Real64 TempLowLimitEvapOut;       // Low temperature shut off [C]
     225             :         Real64 MaxPartLoadRatClgHtg;      // Maximum Part load ratio in simultaneous heating/cooling mode
     226             :         Real64 OptPartLoadRatClgHtg;      // Optimum Part load ratio in simultaneous heating/cooling mode
     227             :         Real64 MinPartLoadRatClgHtg;      // minimum Part load ratio in simultaneous heating/cooling mode
     228             :         CGSHPNodeData EvapInletNode;      // Chiller heater evaperator inlet node
     229             :         CGSHPNodeData EvapOutletNode;     // Chiller heater evaperator outlet node
     230             :         CGSHPNodeData CondInletNode;      // Chiller heater condenser inlet node
     231             :         CGSHPNodeData CondOutletNode;     // Chiller heater condenser outlet node
     232             :         Real64 EvapVolFlowRate;           // Reference water volumetric flow rate through the evaporator [m3/s]
     233             :         bool EvapVolFlowRateWasAutoSized; // true if evaporator flow rate was autosize on input
     234             :         Real64 tmpEvapVolFlowRate;        // temporary ref water vol flow rate for intermediate sizing [m3/s]
     235             :         Real64 CondVolFlowRate;           // Reference water volumetric flow rate through the condenser [m3/s]
     236             :         bool CondVolFlowRateWasAutoSized; // true if condenser flow rate was autosize on input
     237             :         Real64 tmpCondVolFlowRate;        // temporary ref water vol flow rate for intermediate sizing [m3/s]
     238             :         Real64 CondMassFlowRateMax;       // Reference water mass flow rate through condenser [kg/s]
     239             :         Real64 EvapMassFlowRateMax;       // Reference water mass flow rate through evaporator [kg/s]
     240             :         Real64 Evapmdot;                  // Evaporator mass flow rate [kg/s]
     241             :         Real64 Condmdot;                  // Condenser mass flow rate [kg/s]
     242             :         Real64 DesignHotWaterVolFlowRate; // Design hot water volumetric flow rate through the condenser [m3/s]
     243             :         Real64 OpenMotorEff;              // Open chiller motor efficiency [fraction, 0 to 1]
     244             :         Real64 SizFac;                    // sizing factor
     245             :         Real64 RefCap;                    // Reference evaporator capacity [W]
     246             :         Real64 RefCOP;                    // Reference COP
     247             :         Real64 TempRefEvapOut;            // Reference evaporator leaving temperature [C]
     248             :         Real64 TempRefCondIn;             // Reference condenser entering temperature [C]
     249             :         Real64 TempRefCondOut;            // Reference condenser leaving temperature [C]
     250             :         Real64 OptPartLoadRat;            // Optimal operating fraction of full load
     251             :         Real64 ChillerEIRFPLRMin;         // Minimum value of PLR from EIRFPLR curve
     252             :         Real64 ChillerEIRFPLRMax;         // Maximum value of PLR from EIRFPLR curve
     253             :         CHReportVars Report;
     254             : 
     255           7 :         ChillerHeaterSpecs()
     256           7 :             : ConstantFlow(false), VariableFlow(false), CoolSetPointSetToLoop(false), HeatSetPointSetToLoop(false), CoolSetPointErrDone(false),
     257             :               HeatSetPointErrDone(false), PossibleSubcooling(false), ChillerHeaterNum(1), condenserType(CondenserType::Invalid),
     258             :               ChillerCapFTCoolingIDX(0), ChillerEIRFTCoolingIDX(0), ChillerEIRFPLRCoolingIDX(0), ChillerCapFTHeatingIDX(0), ChillerEIRFTHeatingIDX(0),
     259             :               ChillerEIRFPLRHeatingIDX(0), ChillerCapFTIDX(0), ChillerEIRFTIDX(0), ChillerEIRFPLRIDX(0), EvapInletNodeNum(0), EvapOutletNodeNum(0),
     260             :               CondInletNodeNum(0), CondOutletNodeNum(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), ChillerEIRFTError(0),
     261             :               ChillerEIRFTErrorIndex(0), ChillerEIRFPLRError(0), ChillerEIRFPLRErrorIndex(0), ChillerEIRRefTempErrorIndex(0), DeltaTErrCount(0),
     262             :               DeltaTErrCountIndex(0), CondMassFlowIndex(0), RefCapCooling(0.0), RefCapCoolingWasAutoSized(false), RefCOPCooling(0.0),
     263             :               TempRefEvapOutCooling(0.0), TempRefCondInCooling(0.0), TempRefCondOutCooling(0.0), MaxPartLoadRatCooling(0.0),
     264             :               OptPartLoadRatCooling(0.0), MinPartLoadRatCooling(0.0), ClgHtgToCoolingCapRatio(0.0), ClgHtgtoCogPowerRatio(0.0), RefCapClgHtg(0.0),
     265             :               RefCOPClgHtg(0.0), RefPowerClgHtg(0.0), TempRefEvapOutClgHtg(0.0), TempRefCondInClgHtg(0.0), TempRefCondOutClgHtg(0.0),
     266             :               TempLowLimitEvapOut(0.0), MaxPartLoadRatClgHtg(0.0), OptPartLoadRatClgHtg(0.0), MinPartLoadRatClgHtg(0.0), EvapVolFlowRate(0.0),
     267             :               EvapVolFlowRateWasAutoSized(false), tmpEvapVolFlowRate(0.0), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false),
     268             :               tmpCondVolFlowRate(0.0), CondMassFlowRateMax(0.0), EvapMassFlowRateMax(0.0), Evapmdot(0.0), Condmdot(0.0),
     269             :               DesignHotWaterVolFlowRate(0.0), OpenMotorEff(0.0), SizFac(0.0), RefCap(0.0), RefCOP(0.0), TempRefEvapOut(0.0), TempRefCondIn(0.0),
     270           7 :               TempRefCondOut(0.0), OptPartLoadRat(0.0), ChillerEIRFPLRMin(0.0), ChillerEIRFPLRMax(0.0)
     271             :         {
     272           7 :         }
     273             :     };
     274             : 
     275             :     struct WrapperReportVars
     276             :     {
     277             :         Real64 Power;                  // Wrapper power, W
     278             :         Real64 QCHW;                   // Chilled water heat transfer rate [W]
     279             :         Real64 QHW;                    // Hot Water heat transfer rate [W]
     280             :         Real64 QGLHE;                  // Geo-field heat transfer rate [W]
     281             :         Real64 TotElecCooling;         // Wrapper cooling electric consumption [J]
     282             :         Real64 TotElecHeating;         // Wrapper heating electric consumption [J]
     283             :         Real64 CoolingEnergy;          // Chilled water heat transfer energy [J]
     284             :         Real64 HeatingEnergy;          // Hot Water heat transfer energy [J]
     285             :         Real64 GLHEEnergy;             // Geo-field heat transfer energy [J]
     286             :         Real64 TotElecCoolingPwr;      // Wrapper cooling electric consumption rate [W]
     287             :         Real64 TotElecHeatingPwr;      // Wrapper heating electric consumption rate [W]
     288             :         Real64 CoolingRate;            // Chilled water heat transfer rate [W]
     289             :         Real64 HeatingRate;            // Hot Water heat transfer rate [W]
     290             :         Real64 GLHERate;               // Geo-field heat transfer rate [W]
     291             :         Real64 CHWInletTemp;           // Chilled water inlet temperature [C]
     292             :         Real64 HWInletTemp;            // Hot water inlet temperature [C]
     293             :         Real64 GLHEInletTemp;          // Geo-field inlet temperature [C]
     294             :         Real64 CHWOutletTemp;          // Chilled water Outlet temperature [C]
     295             :         Real64 HWOutletTemp;           // Hot water Outlet temperature [C]
     296             :         Real64 GLHEOutletTemp;         // Geo-field Outlet temperature [C]
     297             :         Real64 CHWmdot;                // Chilled water mass flow rate [kg/s]
     298             :         Real64 HWmdot;                 // Hot water mass flow rate [kg/s]
     299             :         Real64 GLHEmdot;               // Geo-field mass flow rate [kg/s]
     300             :         Real64 TotElecCoolingSimul;    // Wrapper cooling electric consumption [J]
     301             :         Real64 CoolingEnergySimul;     // Chilled water heat transfer energy [J]
     302             :         Real64 TotElecCoolingPwrSimul; // Wrapper cooling electric consumption rate [W]
     303             :         Real64 CoolingRateSimul;       // Chilled water heat transfer rate [W]
     304             :         Real64 CHWInletTempSimul;      // Chilled water inlet temperature [C]
     305             :         Real64 GLHEInletTempSimul;     // Geo-field inlet temperature [C]
     306             :         Real64 CHWOutletTempSimul;     // Chilled water Outlet temperature [C]
     307             :         Real64 GLHEOutletTempSimul;    // Geo-field Outlet temperature [C]
     308             :         Real64 CHWmdotSimul;           // Chilled water mass flow rate [kg/s]
     309             :         Real64 GLHEmdotSimul;          // Geo-field mass flow rate [kg/s]
     310             : 
     311           4 :         WrapperReportVars()
     312           4 :             : Power(0.0), QCHW(0.0), QHW(0.0), QGLHE(0.0), TotElecCooling(0.0), TotElecHeating(0.0), CoolingEnergy(0.0), HeatingEnergy(0.0),
     313             :               GLHEEnergy(0.0), TotElecCoolingPwr(0.0), TotElecHeatingPwr(0.0), CoolingRate(0.0), HeatingRate(0.0), GLHERate(0.0), CHWInletTemp(0.0),
     314             :               HWInletTemp(0.0), GLHEInletTemp(0.0), CHWOutletTemp(0.0), HWOutletTemp(0.0), GLHEOutletTemp(0.0), CHWmdot(0.0), HWmdot(0.0),
     315             :               GLHEmdot(0.0), TotElecCoolingSimul(0.0), CoolingEnergySimul(0.0), TotElecCoolingPwrSimul(0.0), CoolingRateSimul(0.0),
     316             :               CHWInletTempSimul(0.0), GLHEInletTempSimul(0.0), CHWOutletTempSimul(0.0), GLHEOutletTempSimul(0.0), CHWmdotSimul(0.0),
     317           4 :               GLHEmdotSimul(0.0)
     318             :         {
     319           4 :         }
     320             :     };
     321             : 
     322           6 :     struct WrapperSpecs : PlantComponent
     323             :     {
     324             :         std::string Name;           // User identifier
     325             :         bool VariableFlowCH;        // True if all chiller heaters are variable flow control
     326             :         int SchedPtr;               // Schedule value for ancillary power control
     327             :         int CHSchedPtr;             // Schedule value for individual chiller heater control
     328             :         CondenserType ControlMode;  // SmartMixing or FullyMixing
     329             :         int CHWInletNodeNum;        // Node number on the inlet side of the plant (Chilled Water side)
     330             :         int CHWOutletNodeNum;       // Node number on the outlet side of the plant (Chilled Water side)
     331             :         int HWInletNodeNum;         // Node number on the inlet side of the plant (Hot Water side)
     332             :         int HWOutletNodeNum;        // Node number on the outlet side of the plant (Hot Water side)
     333             :         int GLHEInletNodeNum;       // Node number on the inlet side of the plant (GLHE Water side)
     334             :         int GLHEOutletNodeNum;      // Node number on the outlet side of the plant (GLHE Water side)
     335             :         int NumOfComp;              // Number of Components under the wrapper
     336             :         Real64 CHWMassFlowRate;     // Chilled water mass flow rate
     337             :         Real64 HWMassFlowRate;      // Hot water mass flow rate
     338             :         Real64 GLHEMassFlowRate;    // Condenser water mass flow rate
     339             :         Real64 CHWMassFlowRateMax;  // Maximum chilled water mass flow rate
     340             :         Real64 HWMassFlowRateMax;   // Maximum hot water mass flow rate
     341             :         Real64 GLHEMassFlowRateMax; // Maximum condenser water mass flow rate
     342             :         Real64 WrapperCoolingLoad;  // Cooling demand for the central heat pump system
     343             :         Real64 WrapperHeatingLoad;  // Heating demand for the central heat pump system
     344             :         Real64 AncillaryPower;      // Wrapper Ancillary Power
     345             :         Array1D<WrapperComponentSpecs> WrapperComp;
     346             :         Array1D<ChillerHeaterSpecs> ChillerHeater; // Dimension to number of machines
     347             :         bool CoolSetPointErrDone;                  // true if setpoint warning issued
     348             :         bool HeatSetPointErrDone;                  // true if setpoint warning issued
     349             :         bool CoolSetPointSetToLoop;                // True if the setpoint is missing at the outlet node
     350             :         bool HeatSetPointSetToLoop;                // True if the setpoint is missing at the outlet node
     351             :         int ChillerHeaterNums;                     // Total number of chiller heater units
     352             :         PlantLocation CWPlantLoc;                  // Chilled water plant loop component index
     353             :         PlantLocation HWPlantLoc;                  // Hot water plant loop component index
     354             :         PlantLocation GLHEPlantLoc;                // Geo-field water plant loop component index
     355             :         int CHWMassFlowIndex;                      // Chilled water flow index
     356             :         int HWMassFlowIndex;                       // Hot water flow index
     357             :         int GLHEMassFlowIndex;                     // Condenser side flow index
     358             :         Real64 SizingFactor;                       // Sizing factor to adjust the capacity
     359             :         Real64 CHWVolFlowRate;                     // Chilled water volume flow rate [kg/s]
     360             :         Real64 HWVolFlowRate;                      // Hot water volume flow rate [kg/s]
     361             :         Real64 GLHEVolFlowRate;                    // Geo-field volume flow rate [kg/s]
     362             :         bool MyWrapperFlag;
     363             :         bool MyWrapperEnvrnFlag;
     364             :         bool SimulClgDominant;
     365             :         bool SimulHtgDominant;
     366             :         WrapperReportVars Report;
     367             :         bool setupOutputVarsFlag;
     368             :         bool mySizesReported;
     369             : 
     370           4 :         WrapperSpecs()
     371           4 :             : VariableFlowCH(false), SchedPtr(0), CHSchedPtr(0), ControlMode(CondenserType::Invalid), CHWInletNodeNum(0), CHWOutletNodeNum(0),
     372             :               HWInletNodeNum(0), HWOutletNodeNum(0), GLHEInletNodeNum(0), GLHEOutletNodeNum(0), NumOfComp(0), CHWMassFlowRate(0.0),
     373             :               HWMassFlowRate(0.0), GLHEMassFlowRate(0.0), CHWMassFlowRateMax(0.0), HWMassFlowRateMax(0.0), GLHEMassFlowRateMax(0.0),
     374             :               WrapperCoolingLoad(0.0), WrapperHeatingLoad(0.0), AncillaryPower(0.0), CoolSetPointErrDone(false), HeatSetPointErrDone(false),
     375             :               CoolSetPointSetToLoop(false), HeatSetPointSetToLoop(false), ChillerHeaterNums(0), CWPlantLoc{}, HWPlantLoc{}, GLHEPlantLoc{},
     376             :               CHWMassFlowIndex(0), HWMassFlowIndex(0), GLHEMassFlowIndex(0), SizingFactor(1.0), CHWVolFlowRate(0.0), HWVolFlowRate(0.0),
     377             :               GLHEVolFlowRate(0.0), MyWrapperFlag(true), MyWrapperEnvrnFlag(true), SimulClgDominant(false), SimulHtgDominant(false),
     378           4 :               setupOutputVarsFlag(true), mySizesReported(false)
     379             :         {
     380           4 :         }
     381             : 
     382             :         static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName);
     383             : 
     384             :         void getSizingFactor(Real64 &SizFac) override;
     385             : 
     386             :         void getDesignCapacities(
     387             :             EnergyPlusData &state, const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override;
     388             : 
     389             :         void setupOutputVars(EnergyPlusData &state);
     390             : 
     391             :         void initialize(EnergyPlusData &state,
     392             :                         Real64 MyLoad, // Demand Load
     393             :                         int LoopNum    // Loop Number Index
     394             :         );
     395             : 
     396             :         void simulate([[maybe_unused]] EnergyPlusData &state,
     397             :                       const PlantLocation &calledFromLocation,
     398             :                       bool FirstHVACIteration,
     399             :                       Real64 &CurLoad,
     400             :                       bool RunFlag) override;
     401             : 
     402             :         void SizeWrapper(EnergyPlusData &state);
     403             : 
     404             :         void CalcWrapperModel(EnergyPlusData &state, Real64 &MyLoad, int LoopNum);
     405             : 
     406             :         void CalcChillerModel(EnergyPlusData &state);
     407             : 
     408             :         void CalcChillerHeaterModel(EnergyPlusData &state);
     409             : 
     410             :         void UpdateChillerHeaterRecords(EnergyPlusData &state);
     411             : 
     412             :         void UpdateChillerRecords(EnergyPlusData &state);
     413             : 
     414             :         void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation) override;
     415             : 
     416             :         void oneTimeInit_new(EnergyPlusData &state) override;
     417             : 
     418             :         void oneTimeInit(EnergyPlusData &state) override;
     419             :     };
     420             : 
     421             :     void GetWrapperInput(EnergyPlusData &state);
     422             : 
     423             :     void GetChillerHeaterInput(EnergyPlusData &state);
     424             : 
     425             : } // namespace PlantCentralGSHP
     426             : 
     427        1542 : struct PlantCentralGSHPData : BaseGlobalStruct
     428             : {
     429             : 
     430             :     bool getWrapperInputFlag = true;   // When TRUE, calls subroutine to read input file.
     431             :     int numWrappers = 0;               // Number of Wrappers specified in input
     432             :     int numChillerHeaters = 0;         // Number of Chiller/heaters specified in input
     433             :     Real64 ChillerCapFT = 0.0;         // Chiller/heater capacity fraction (evaluated as a function of temperature)
     434             :     Real64 ChillerEIRFT = 0.0;         // Chiller/heater electric input ratio (EIR = 1 / COP) as a function of temperature
     435             :     Real64 ChillerEIRFPLR = 0.0;       // Chiller/heater EIR as a function of part-load ratio (PLR)
     436             :     Real64 ChillerPartLoadRatio = 0.0; // Chiller/heater part-load ratio (PLR)
     437             :     Real64 ChillerCyclingRatio = 0.0;  // Chiller/heater cycling ratio
     438             :     Real64 ChillerFalseLoadRate = 0.0; // Chiller/heater false load over and above the water-side load [W]
     439             :     EPVector<PlantCentralGSHP::WrapperSpecs> Wrapper;
     440             :     EPVector<PlantCentralGSHP::ChillerHeaterSpecs> ChillerHeater;
     441             : 
     442           0 :     void clear_state() override
     443             :     {
     444           0 :         this->getWrapperInputFlag = true;
     445           0 :         this->numWrappers = 0;
     446           0 :         this->numChillerHeaters = 0;
     447           0 :         this->ChillerCapFT = 0.0;
     448           0 :         this->ChillerEIRFT = 0.0;
     449           0 :         this->ChillerEIRFPLR = 0.0;
     450           0 :         this->ChillerPartLoadRatio = 0.0;
     451           0 :         this->ChillerCyclingRatio = 0.0;
     452           0 :         this->ChillerFalseLoadRate = 0.0;
     453           0 :         this->Wrapper.deallocate();
     454           0 :         this->ChillerHeater.deallocate();
     455           0 :     }
     456             : };
     457             : 
     458             : } // namespace EnergyPlus
     459             : 
     460             : #endif

Generated by: LCOV version 1.13