LCOV - code coverage report
Current view: top level - EnergyPlus - ChillerExhaustAbsorption.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 5 40.0 %
Date: 2023-01-17 19:17:23 Functions: 5 8 62.5 %

          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 ChillerExhaustAbsorption_hh_INCLUDED
      49             : #define ChillerExhaustAbsorption_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/ElectricPowerServiceManager.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : #include <EnergyPlus/Plant/PlantLocation.hh>
      60             : #include <EnergyPlus/PlantComponent.hh>
      61             : 
      62             : namespace EnergyPlus {
      63             : 
      64             : // Forward declarations
      65             : struct EnergyPlusData;
      66             : 
      67             : namespace ChillerExhaustAbsorption {
      68             : 
      69           4 :     struct ExhaustAbsorberSpecs : PlantComponent
      70             :     {
      71             :         // Members
      72             :         // Parts of Type that do not correspond with IDD definition
      73             :         bool Available = false; // need an array of logicals--load identifiers of available equipment
      74             :         bool ON = false;        // simulate the machine at it's operating part load ratio
      75             :         bool InCoolingMode = false;
      76             :         bool InHeatingMode = false;
      77             :         // Part of Type that directly corresponds with IDD definition
      78             :         std::string Name;                         // user identifier
      79             :         Real64 NomCoolingCap = 0.0;               // W - design nominal capacity of Absorber
      80             :         bool NomCoolingCapWasAutoSized = false;   // true if nominal capacity was autosize on input
      81             :         Real64 NomHeatCoolRatio = 0.0;            // ratio of heating to cooling capacity
      82             :         Real64 ThermalEnergyCoolRatio = 0.0;      // ratio of thermal energy input to cooling output
      83             :         Real64 ThermalEnergyHeatRatio = 0.0;      // ratio of thermal energy input to heating output
      84             :         Real64 ElecCoolRatio = 0.0;               // ratio of electricity input to cooling output
      85             :         Real64 ElecHeatRatio = 0.0;               // ratio of electricity input to heating output
      86             :         int ChillReturnNodeNum = 0;               // Node number on the inlet side of the plant
      87             :         int ChillSupplyNodeNum = 0;               // Node number on the outlet side of the plant
      88             :         bool ChillSetPointErrDone = false;        // flag to report missing setpoint on CW outlet
      89             :         bool ChillSetPointSetToLoop = false;      // flag to use overall loop setpoint
      90             :         int CondReturnNodeNum = 0;                // Node number on the inlet side of the condenser
      91             :         int CondSupplyNodeNum = 0;                // Node number on the outlet side of the condenser
      92             :         int HeatReturnNodeNum = 0;                // absorber steam inlet node number, water side
      93             :         int HeatSupplyNodeNum = 0;                // absorber steam outlet node number, water side
      94             :         bool HeatSetPointErrDone = false;         // flag to report missing setpoint on HW outlet
      95             :         bool HeatSetPointSetToLoop = false;       // flag to use overall loop setpoint
      96             :         Real64 MinPartLoadRat = 0.0;              // min allowed operating frac full load
      97             :         Real64 MaxPartLoadRat = 0.0;              // max allowed operating frac full load
      98             :         Real64 OptPartLoadRat = 0.0;              // optimal operating frac full load
      99             :         Real64 TempDesCondReturn = 0.0;           // design secondary loop fluid temperature at the Absorber condenser side inlet
     100             :         Real64 TempDesCHWSupply = 0.0;            // design chilled water supply temperature
     101             :         Real64 EvapVolFlowRate = 0.0;             // m**3/s - design nominal water volumetric flow rate through the evaporator
     102             :         bool EvapVolFlowRateWasAutoSized = false; // true if evaporator flow rate was autosize on input
     103             :         Real64 CondVolFlowRate = 0.0;             // m**3/s - design nominal water volumetric flow rate through the condenser
     104             :         bool CondVolFlowRateWasAutoSized = false; // true if condenser flow rate was autosize on input
     105             :         Real64 HeatVolFlowRate = 0.0;             // m**3/s - design nominal water volumetric flow rate through the heater side
     106             :         bool HeatVolFlowRateWasAutoSized = false; // true if hot water flow rate was autosize on input
     107             :         Real64 SizFac = 0.0;                      // sizing factor
     108             :         int CoolCapFTCurve = 0;                   // cooling capacity as a function of temperature curve (chilled water temp,
     109             :         // condenser water temp)
     110             :         int ThermalEnergyCoolFTCurve = 0; // Thermal Energy-Input-to cooling output Ratio Function of Temperature Curve (chilled
     111             :         // water temp, condenser water temp)
     112             :         int ThermalEnergyCoolFPLRCurve = 0; // Thermal Energy-Input-to cooling output Ratio Function of Part Load Ratio Curve
     113             :         int ElecCoolFTCurve = 0;            // Electric-Input-to cooling output Ratio Function of Temperature Curve
     114             :         // (chilled water temp, condenser water temp)
     115             :         int ElecCoolFPLRCurve = 0;           // Electric-Input-to cooling output Ratio Function of Part Load Ratio Curve
     116             :         int HeatCapFCoolCurve = 0;           // Heating Capacity Function of Cooling Capacity Curve
     117             :         int ThermalEnergyHeatFHPLRCurve = 0; // Thermal Energy Input to heat output ratio during heating only function
     118             :         bool isEnterCondensTemp = false;     // if using entering conderser water temperature is TRUE, exiting is FALSE
     119             :         bool isWaterCooled = false;          // if water cooled it is TRUE
     120             :         Real64 CHWLowLimitTemp = 0.0;        // Chilled Water Lower Limit Temperature
     121             :         int ExhaustAirInletNodeNum = 0;      // Node number on Exhaust input from generator
     122             :         // Calculated design values
     123             :         Real64 DesCondMassFlowRate = 0.0; // design nominal mass flow rate of water through the condenser [kg/s]
     124             :         Real64 DesHeatMassFlowRate = 0.0; // design nominal mass flow rate of water through the hot water side [kg/s]
     125             :         Real64 DesEvapMassFlowRate = 0.0; // design nominal mass flow rate of water through chilled water side [kg/s]
     126             :         // other values used during simulation
     127             :         int DeltaTempCoolErrCount = 0;   // error count for Delta Temp = 0 while cooling
     128             :         int DeltaTempHeatErrCount = 0;   // error count for Delta Temp = 0 while heating
     129             :         int CondErrCount = 0;            // error count for poor Condenser Supply Estimate
     130             :         bool PossibleSubcooling = false; // Flag to determine whether plant is overcooled
     131             :         // loop topology variables
     132             :         PlantLocation CWPlantLoc;                            // chilled water plant loop component index
     133             :         PlantLocation CDPlantLoc;                            // condenser water plant loop component index
     134             :         PlantLocation HWPlantLoc;                            // hot water plant loop component index
     135             :         GeneratorType CompType_Num = GeneratorType::Invalid; // Numeric designator for CompType (TypeOf)
     136             :         int ExhTempLTAbsLeavingTempIndex = 0;                // index for exhaust potential less than thermal energy needed during cooling
     137             :         int ExhTempLTAbsLeavingHeatingTempIndex = 0;         // index for exhaust potential less than thermal energy needed during heating
     138             :         int lCondWaterMassFlowRate_Index = 0;                // index for condenser water mass flow rate too low recurring severe warning
     139             :         std::string TypeOf;                                  // Generator type
     140             :         std::string ExhaustSourceName;                       // Generator type Name
     141             :         bool envrnInit = true;
     142             :         Real64 oldCondSupplyTemp = 0.0; // save the last iteration value of leaving condenser water temperature
     143             : 
     144             :         // Members from old report struct
     145             :         Real64 CoolingLoad = 0.0;              // cooling load on the chiller (previously called QEvap)
     146             :         Real64 CoolingEnergy = 0.0;            // variable to track total cooling load for period (was EvapEnergy)
     147             :         Real64 HeatingLoad = 0.0;              // heating load on the chiller
     148             :         Real64 HeatingEnergy = 0.0;            // heating energy
     149             :         Real64 TowerLoad = 0.0;                // load on the cooling tower/condenser (previously called QCond)
     150             :         Real64 TowerEnergy = 0.0;              // variable to track total tower load for a period (was CondEnergy)
     151             :         Real64 ThermalEnergyUseRate = 0.0;     // instantaneous use of Exhaust for period
     152             :         Real64 ThermalEnergy = 0.0;            // variable to track total ThermalEnergy used for a period
     153             :         Real64 CoolThermalEnergyUseRate = 0.0; // instantaneous use of Exhaust for period for cooling
     154             :         Real64 CoolThermalEnergy = 0.0;        // variable to track total ThermalEnergy used for a period for cooling
     155             :         Real64 HeatThermalEnergyUseRate = 0.0; // instantaneous use of Exhaust for period for heating
     156             :         Real64 HeatThermalEnergy = 0.0;        // variable to track total ThermalEnergy used for a period for heating
     157             :         Real64 ElectricPower = 0.0;            // parasitic electric power used (was PumpingPower)
     158             :         Real64 ElectricEnergy = 0.0;           // track the total electricity used for a period (was PumpingEnergy)
     159             :         Real64 CoolElectricPower = 0.0;        // parasitic electric power used  for cooling
     160             :         Real64 CoolElectricEnergy = 0.0;       // track the total electricity used for a period for cooling
     161             :         Real64 HeatElectricPower = 0.0;        // parasitic electric power used  for heating
     162             :         Real64 HeatElectricEnergy = 0.0;       // track the total electricity used for a period for heating
     163             :         Real64 ChillReturnTemp = 0.0;          // reporting: evaporator inlet temperature (was EvapInletTemp)
     164             :         Real64 ChillSupplyTemp = 0.0;          // reporting: evaporator outlet temperature (was EvapOutletTemp)
     165             :         Real64 ChillWaterFlowRate = 0.0;       // reporting: evaporator mass flow rate (was Evapmdot)
     166             :         Real64 CondReturnTemp = 0.0;           // reporting: condenser inlet temperature (was CondInletTemp)
     167             :         Real64 CondSupplyTemp = 0.0;           // reporting: condenser outlet temperature (was CondOutletTemp)
     168             :         Real64 CondWaterFlowRate = 0.0;        // reporting: condenser mass flow rate (was Condmdot)
     169             :         Real64 HotWaterReturnTemp = 0.0;       // reporting: hot water return (inlet) temperature
     170             :         Real64 HotWaterSupplyTemp = 0.0;       // reporting: hot water supply (outlet) temperature
     171             :         Real64 HotWaterFlowRate = 0.0;         // reporting: hot water mass flow rate
     172             :         Real64 CoolPartLoadRatio = 0.0;        // operating part load ratio (load/capacity for cooling)
     173             :         Real64 HeatPartLoadRatio = 0.0;        // operating part load ratio (load/capacity for heating)
     174             :         Real64 CoolingCapacity = 0.0;          // current capacity after temperature adjustment
     175             :         Real64 HeatingCapacity = 0.0;          // current heating capacity
     176             :         Real64 FractionOfPeriodRunning = 0.0;  // fraction of the time period that the unit is operating
     177             :         Real64 ThermalEnergyCOP = 0.0;         // reporting: cooling output/ThermalEnergy input = CoolingLoad/CoolThermalEnergyUseRate
     178             :         Real64 ExhaustInTemp = 0.0;            // reporting: Exhaust inlet temperature
     179             :         Real64 ExhaustInFlow = 0.0;            // reporting: Exhaust Inlet Flow rate
     180             :         Real64 ExhHeatRecPotentialHeat = 0.0;  // reporting: Heat Recovery Potential during heating
     181             :         Real64 ExhHeatRecPotentialCool = 0.0;  // reporting: Heat Recovery Potential during cooling
     182             : 
     183             :         static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName);
     184             : 
     185             :         void
     186             :         simulate(EnergyPlusData &state, const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override;
     187             : 
     188             :         void getDesignCapacities(
     189             :             EnergyPlusData &state, const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override;
     190             : 
     191             :         void getSizingFactor(Real64 &SizFac) override;
     192             : 
     193             :         void onInitLoopEquip(EnergyPlusData &state, const PlantLocation &calledFromLocation) override;
     194             : 
     195             :         void oneTimeInit(EnergyPlusData &state) override;
     196             : 
     197             :         void oneTimeInit_new(EnergyPlusData &state) override;
     198             : 
     199             :         void getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) override;
     200             : 
     201             :         void initialize(EnergyPlusData &state);
     202             : 
     203             :         void setupOutputVariables(EnergyPlusData &state);
     204             : 
     205             :         void size(EnergyPlusData &state);
     206             : 
     207             :         void calcChiller(EnergyPlusData &state, Real64 &MyLoad);
     208             : 
     209             :         void calcHeater(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag);
     210             : 
     211             :         void updateCoolRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag);
     212             : 
     213             :         void updateHeatRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag);
     214             :     };
     215             : 
     216             :     void GetExhaustAbsorberInput(EnergyPlusData &state);
     217             : 
     218             : } // namespace ChillerExhaustAbsorption
     219             : 
     220        1542 : struct ChillerExhaustAbsorptionData : BaseGlobalStruct
     221             : {
     222             :     bool Sim_GetInput = true;
     223             :     Array1D<ChillerExhaustAbsorption::ExhaustAbsorberSpecs> ExhaustAbsorber;
     224             : 
     225           0 :     void clear_state() override
     226             :     {
     227           0 :         *this = ChillerExhaustAbsorptionData();
     228           0 :     }
     229             : };
     230             : 
     231             : } // namespace EnergyPlus
     232             : 
     233             : #endif

Generated by: LCOV version 1.13