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