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 DesiccantDehumidifiers_hh_INCLUDED
49 : #define DesiccantDehumidifiers_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 : #include <ObjexxFCL/Optional.hh>
54 :
55 : // EnergyPlus Headers
56 : #include <EnergyPlus/Data/BaseData.hh>
57 : #include <EnergyPlus/DataGlobals.hh>
58 : #include <EnergyPlus/EnergyPlus.hh>
59 : #include <EnergyPlus/Plant/Enums.hh>
60 : #include <EnergyPlus/Plant/PlantLocation.hh>
61 :
62 : namespace EnergyPlus {
63 :
64 : // Forward declarations
65 : struct EnergyPlusData;
66 :
67 : namespace DesiccantDehumidifiers {
68 :
69 : enum class DesicDehumType // Desiccant dehumidifier type
70 : {
71 : Invalid = -1,
72 : Solid,
73 : Generic,
74 : Num
75 : };
76 :
77 : enum class DesicDehumCtrlType
78 : {
79 : Invalid = -1,
80 : FixedHumratBypass, // FIXED LEAVING HUMRAT SETPOINT:BYPASS
81 : NodeHumratBypass, // NODE LEAVING HUMRAT SETPOINT:BYPASS
82 : Num
83 : };
84 :
85 : enum class Selection
86 : {
87 : Invalid = -1,
88 : No, // Condenser waste heat NOT reclaimed for desiccant regeneration
89 : Yes, // Condenser waste heat reclaimed for desiccant regeneration
90 : Num
91 : };
92 :
93 : enum class PerformanceModel
94 : {
95 : Invalid = -1,
96 : Default,
97 : UserCurves,
98 : Num
99 : };
100 :
101 : // Desiccant heat exchanger type
102 : int constexpr BalancedHX(1); // HeatExchanger:Desiccant:BalancedFlow = 1
103 :
104 25 : struct DesiccantDehumidifierData
105 : {
106 : // Members
107 : // User Input data
108 : std::string Name; // unique name of component
109 : std::string Sched; // name of availability schedule
110 : std::string RegenCoilType; // type of regen coil
111 : std::string RegenCoilName; // name of regen coil
112 : std::string RegenFanType; // type of regen fan
113 : std::string RegenFanName; // name of regen fan
114 : PerformanceModel PerformanceModel_Num; // type of performance model, default or user curves
115 : int ProcAirInNode; // process air inlet node of dehumidifier
116 : int ProcAirOutNode; // process air outlet node of dehumidifier
117 : int RegenAirInNode; // regen air inlet node of dehumidifier
118 : // (initially set to conditions entering regen heating coil)
119 : int RegenAirOutNode; // regen air outlet node of dehumidifier
120 : int RegenFanInNode; // regen fan inlet node
121 : DesicDehumCtrlType controlType; // type of controls
122 : Real64 HumRatSet; // humidity ratio setpoint [kg water / kg air]
123 : Real64 NomProcAirVolFlow; // nominal process air flow rate [m3/s]
124 : Real64 NomProcAirVel; // nominal process air velocity [m/s]
125 : Real64 NomRotorPower; // rotor power consumption at full output [W]
126 : int RegenCoilIndex; // Index for regen coil
127 : int RegenFanIndex; // Index for regen fan
128 : int regenFanType_Num; // Fan type number (see DataHVACGlobals)
129 : int ProcDryBulbCurvefTW; // number of process leaving dry bulb f(edb,ew) curve
130 : int ProcDryBulbCurvefV; // number of process leaving dry bulb f(v) curve
131 : int ProcHumRatCurvefTW; // number of process leaving humidity ratio f(edb,ew) curve
132 : int ProcHumRatCurvefV; // number of process leaving humidity ratio f(v) curve
133 : int RegenEnergyCurvefTW; // number of regen energy f(edb,ew) curve
134 : int RegenEnergyCurvefV; // number of regen energy f(v) curve
135 : int RegenVelCurvefTW; // number of regen velocity f(edb,ew) curve
136 : int RegenVelCurvefV; // number of regen velocity f(v) curve
137 : Real64 NomRegenTemp; // nominal regen temperature for regen energy curve [C]
138 : // Possible future inputs, hardwired for now depending on which performance model is in use, unit off if out of bounds
139 : Real64 MinProcAirInTemp; // min allowable process inlet air temperature [C]
140 : Real64 MaxProcAirInTemp; // max allowable process inlet air temperature [C]
141 : Real64 MinProcAirInHumRat; // min allowable process inlet air humidity ratio [kg water / kg air]
142 : Real64 MaxProcAirInHumRat; // max allowable process inlet air humidity ratio [kg water / kg air]
143 : // Internal Data
144 : int SchedPtr; // index of availability schedule
145 : Real64 NomProcAirMassFlow; // nominal process air mass flow rate [kg/s]
146 : Real64 NomRegenAirMassFlow; // nominal regeneration air mass flow rate [kg/s]
147 : Real64 ProcAirInTemp; // process inlet air temperature [C]
148 : Real64 ProcAirInHumRat; // process inlet air humidity ratio [kg water / kg air]
149 : Real64 ProcAirInEnthalpy; // process inlet air specific enthalpy [J/kg]
150 : Real64 ProcAirInMassFlowRate; // process inlet air mass flow rate [kg/s]
151 : Real64 ProcAirOutTemp; // process outlet air temperature [C]
152 : Real64 ProcAirOutHumRat; // process outlet air humidity ratio [kg water / kg air]
153 : Real64 ProcAirOutEnthalpy; // process outlet air specific enthalpy [J/kg]
154 : Real64 ProcAirOutMassFlowRate; // process outlet air mass flow rate [kg/s]
155 : Real64 RegenAirInTemp; // regen inlet air temperature [C]
156 : Real64 RegenAirInHumRat; // regen inlet air humidity ratio [kg water / kg air]
157 : Real64 RegenAirInEnthalpy; // regen inlet air specific enthalpy [J/kg]
158 : Real64 RegenAirInMassFlowRate; // regen inlet air mass flow rate [kg/s]
159 : Real64 RegenAirVel; // regen air velocity [m/s]
160 : std::string DehumType; // Type of desiccant dehumidifier
161 : DesicDehumType DehumTypeCode; // Type of desiccant dehumidifier, integer code
162 : Real64 WaterRemove; // water removed [kg]
163 : Real64 WaterRemoveRate; // water removal rate [kg/s]
164 : Real64 SpecRegenEnergy; // specific regen energy [J/kg of water removed]
165 : Real64 QRegen; // regen energy rate requested from regen coil [W]
166 : Real64 RegenEnergy; // regen energy requested from regen coil [J]
167 : Real64 ElecUseEnergy; // electricity consumption [J]
168 : Real64 ElecUseRate; // electricity consumption rate [W]
169 : Real64 PartLoad; // fraction of dehumidification capacity required to meet setpoint
170 : int RegenCapErrorIndex1; // recurring error message index for insufficient regen coil capacity
171 : int RegenCapErrorIndex2; // recurring error message index for insufficient regen coil capacity
172 : int RegenCapErrorIndex3; // recurring error message index for insufficient regen coil capacity
173 : int RegenCapErrorIndex4; // recurring error message index for insufficient regen coil capacity
174 : int RegenFanErrorIndex1; // recurring error message index for incorrect regen fan flow
175 : int RegenFanErrorIndex2; // recurring error message index for incorrect regen fan flow
176 : int RegenFanErrorIndex3; // recurring error message index for incorrect regen fan flow
177 : int RegenFanErrorIndex4; // recurring error message index for incorrect regen fan flow
178 : // structure elements unique to generic desiccant dehumidifier
179 : std::string HXType; // type of desiccant heat exchanger
180 : std::string HXName; // name of desiccant heat exchanger
181 : int HXTypeNum; // parameter number of desiccant heat exchanger
182 : std::string ExhaustFanCurveObject; // exhaust fan curve object
183 : std::string CoolingCoilType; // type of cooling coil used with desiccant heat exchanger
184 : std::string CoolingCoilName; // name of cooling coil used with desiccant heat exchanger
185 : int coolingCoil_TypeNum; // type of cooling coil, DataHVACGlobals coil type constants
186 : Selection Preheat; // determine condenser waste heat usage for pre heating regen air
187 : Real64 RegenSetPointTemp; // heating set-point for regeneration air [C]
188 : Real64 ExhaustFanMaxVolFlowRate; // exhaust fan maximum allowable air flow rate [m3/s]
189 : Real64 ExhaustFanMaxMassFlowRate; // exhaust fan maximum allowable air mass flow rate [kg/s]
190 : Real64 ExhaustFanMaxPower; // exhaust fan maximum allowable power [W]
191 : Real64 ExhaustFanPower; // exhaust fan power for reporting [W]
192 : Real64 ExhaustFanElecConsumption; // exhaust fan electric consumption for reporting [J]
193 : Real64 CompanionCoilCapacity; // DX coil capacity for dehumidifier companion cooling coil [W]
194 : int RegenFanPlacement; // placement of the fan used for regeneration air flow
195 : int ControlNodeNum; // node number of control node
196 : int ExhaustFanCurveIndex; // exhaust fan curve object index
197 : int CompIndex; // index of HX component to call simheatrecovery
198 : int CoolingCoilOutletNode; // node number of cooling coil outlet node
199 : int RegenFanOutNode; // fan outlet node number mined from regen fan object
200 : int RegenCoilInletNode; // regen heating coil inlet node number mined from regen heater object
201 : int RegenCoilOutletNode; // regen heating coil outlet node number mined from regen heater object
202 : int HXProcInNode; // process inlet node num mined from desiccant heat exchanger object
203 : int HXProcOutNode; // process outlet node num mined from desiccant heat exchanger object
204 : int HXRegenInNode; // regen inlet node number mined from desiccant heat exchanger object
205 : int HXRegenOutNode; // regen outlet node number mined from desiccant heat exchanger object
206 : int CondenserInletNode; // regen outlet node number mined from desiccant heat exchanger object
207 : int DXCoilIndex; // DX Coil index mined from coil object
208 : int ErrCount; // error count
209 : int ErrIndex1; // error index
210 : Selection CoilUpstreamOfProcessSide; // used to determine if process inlet is pre-cooled
211 : bool RegenInletIsOutsideAirNode; // regen inlet is connected to an outside air node
212 : int RegenCoilType_Num; // type number of regen coil
213 : int CoilControlNode; // heating coil hot water or steam inlet node
214 : int CoilOutletNode; // outlet node for water coil
215 : PlantLocation plantLoc; // plant loop component location for water heating coil
216 : int HotWaterCoilMaxIterIndex; // Index to recurring warning message
217 : int HotWaterCoilMaxIterIndex2; // Index to recurring warning message
218 : Real64 MaxCoilFluidFlow; // hot water or steam mass flow rate regen. heating coil [kg/s]
219 : Real64 RegenCoilCapacity; // hot water or steam coil operating capacity [W]
220 :
221 : // Default Constructor
222 7 : DesiccantDehumidifierData()
223 7 : : PerformanceModel_Num(PerformanceModel::Invalid), ProcAirInNode(0), ProcAirOutNode(0), RegenAirInNode(0), RegenAirOutNode(0),
224 : RegenFanInNode(0), controlType(DesicDehumCtrlType::Invalid), HumRatSet(0.0), NomProcAirVolFlow(0.0), NomProcAirVel(0.0),
225 : NomRotorPower(0.0), RegenCoilIndex(0), RegenFanIndex(0), regenFanType_Num(0), ProcDryBulbCurvefTW(0), ProcDryBulbCurvefV(0),
226 : ProcHumRatCurvefTW(0), ProcHumRatCurvefV(0), RegenEnergyCurvefTW(0), RegenEnergyCurvefV(0), RegenVelCurvefTW(0), RegenVelCurvefV(0),
227 : NomRegenTemp(121.0), MinProcAirInTemp(-73.3), MaxProcAirInTemp(65.6), MinProcAirInHumRat(0.0), MaxProcAirInHumRat(0.21273), SchedPtr(0),
228 : NomProcAirMassFlow(0.0), NomRegenAirMassFlow(0.0), ProcAirInTemp(0.0), ProcAirInHumRat(0.0), ProcAirInEnthalpy(0.0),
229 : ProcAirInMassFlowRate(0.0), ProcAirOutTemp(0.0), ProcAirOutHumRat(0.0), ProcAirOutEnthalpy(0.0), ProcAirOutMassFlowRate(0.0),
230 : RegenAirInTemp(0.0), RegenAirInHumRat(0.0), RegenAirInEnthalpy(0.0), RegenAirInMassFlowRate(0.0), RegenAirVel(0.0),
231 : DehumTypeCode(DesicDehumType::Invalid), WaterRemove(0.0), WaterRemoveRate(0.0), SpecRegenEnergy(0.0), QRegen(0.0), RegenEnergy(0.0),
232 : ElecUseEnergy(0.0), ElecUseRate(0.0), PartLoad(0.0), RegenCapErrorIndex1(0), RegenCapErrorIndex2(0), RegenCapErrorIndex3(0),
233 : RegenCapErrorIndex4(0), RegenFanErrorIndex1(0), RegenFanErrorIndex2(0), RegenFanErrorIndex3(0), RegenFanErrorIndex4(0), HXTypeNum(0),
234 : coolingCoil_TypeNum(0), Preheat(Selection::Invalid), RegenSetPointTemp(0.0), ExhaustFanMaxVolFlowRate(0.0),
235 : ExhaustFanMaxMassFlowRate(0.0), ExhaustFanMaxPower(0.0), ExhaustFanPower(0.0), ExhaustFanElecConsumption(0.0),
236 : CompanionCoilCapacity(0.0), RegenFanPlacement(0), ControlNodeNum(0), ExhaustFanCurveIndex(0), CompIndex(0), CoolingCoilOutletNode(0),
237 : RegenFanOutNode(0), RegenCoilInletNode(0), RegenCoilOutletNode(0), HXProcInNode(0), HXProcOutNode(0), HXRegenInNode(0),
238 : HXRegenOutNode(0), CondenserInletNode(0), DXCoilIndex(0), ErrCount(0), ErrIndex1(0), CoilUpstreamOfProcessSide(Selection::Invalid),
239 : RegenInletIsOutsideAirNode(false), RegenCoilType_Num(0), CoilControlNode(0), CoilOutletNode(0), HotWaterCoilMaxIterIndex(0),
240 7 : HotWaterCoilMaxIterIndex2(0), MaxCoilFluidFlow(0.0), RegenCoilCapacity(0.0)
241 : {
242 7 : }
243 : };
244 :
245 : // Functions
246 :
247 : void SimDesiccantDehumidifier(EnergyPlusData &state,
248 : std::string const &CompName, // name of the dehumidifier unit
249 : bool FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
250 : int &CompIndex);
251 :
252 : void GetDesiccantDehumidifierInput(EnergyPlusData &state);
253 :
254 : void InitDesiccantDehumidifier(EnergyPlusData &state,
255 : int DesicDehumNum, // number of the current dehumidifier being simulated
256 : bool FirstHVACIteration // TRUE if 1st HVAC simulation of system timestep
257 : );
258 :
259 : void ControlDesiccantDehumidifier(EnergyPlusData &state,
260 : int DesicDehumNum, // number of the current dehumidifier being simulated
261 : Real64 &HumRatNeeded, // process air leaving humidity ratio set by controller [kg water/kg air]
262 : bool FirstHVACIteration // TRUE if 1st HVAC simulation of system timestep !unused1208
263 : );
264 :
265 : void CalcSolidDesiccantDehumidifier(EnergyPlusData &state,
266 : int DesicDehumNum, // number of the current dehumidifier being simulated
267 : Real64 HumRatNeeded, // process air leaving humidity ratio set by controller [kgWater/kgDryAir]
268 : bool FirstHVACIteration // TRUE if 1st HVAC simulation of system timestep
269 : );
270 :
271 : void CalcGenericDesiccantDehumidifier(EnergyPlusData &state,
272 : int DesicDehumNum, // number of the current dehumidifier being simulated
273 : Real64 HumRatNeeded, // process air leaving humidity ratio set by controller [kg water/kg air]
274 : bool FirstHVACIteration // TRUE if 1st HVAC simulation of system timestep
275 : );
276 :
277 : void UpdateDesiccantDehumidifier(EnergyPlusData &state, int DesicDehumNum); // number of the current dehumidifier being simulated
278 :
279 : void ReportDesiccantDehumidifier(EnergyPlusData &state, int DesicDehumNum); // number of the current dehumidifier being simulated
280 :
281 : void CalcNonDXHeatingCoils(EnergyPlusData &state,
282 : int DesicDehumNum, // Desiccant dehumidifier unit index
283 : bool FirstHVACIteration, // flag for first HVAC iteration in the time step
284 : Real64 RegenCoilLoad, // heating coil load to be met (Watts)
285 : Optional<Real64> RegenCoilLoadmet = _ // heating load met
286 : );
287 :
288 : int GetProcAirInletNodeNum(EnergyPlusData &state, std::string const &DesicDehumName, bool &ErrorsFound);
289 :
290 : int GetProcAirOutletNodeNum(EnergyPlusData &state, std::string const &DesicDehumName, bool &ErrorsFound);
291 :
292 : int GetRegAirInletNodeNum(EnergyPlusData &state, std::string const &DesicDehumName, bool &ErrorsFound);
293 :
294 : int GetRegAirOutletNodeNum(EnergyPlusData &state, std::string const &DesicDehumName, bool &ErrorsFound);
295 :
296 : } // namespace DesiccantDehumidifiers
297 :
298 1542 : struct DesiccantDehumidifiersData : BaseGlobalStruct
299 : {
300 :
301 : int NumDesicDehums = 0; // number of desiccant dehumidifiers of all types
302 : int NumSolidDesicDehums = 0; // number of solid desiccant dehumidifiers
303 : int NumGenericDesicDehums = 0; // number of generic desiccant dehumidifiers
304 : Real64 TempSteamIn = 100.0; // steam coil steam inlet temperature
305 : bool GetInputDesiccantDehumidifier = true; // First time, input is "gotten"
306 : bool InitDesiccantDehumidifierOneTimeFlag = true;
307 : bool MySetPointCheckFlag = true; // I think this actually needs to be a vector or a member variable on the struct, not just a single bool
308 : bool CalcSolidDesiccantDehumidifierMyOneTimeFlag = true; // one time flag
309 : bool CalcGenericDesiccantDehumidifierMyOneTimeFlag = true;
310 : Array1D<DesiccantDehumidifiers::DesiccantDehumidifierData> DesicDehum;
311 : std::unordered_map<std::string, std::string> UniqueDesicDehumNames;
312 :
313 : int MaxNums = 0; // Maximum number of numeric input fields
314 : int MaxAlphas = 0; // Maximum number of alpha input fields
315 : int TotalArgs = 0; // Total number of alpha and numeric arguments (max) for a certain object in the input file
316 : Real64 SteamDensity = 0.0; // density of steam at 100C
317 : Array1D_bool MyEnvrnFlag;
318 : Array1D_bool MyPlantScanFlag; // Used for init plant component for heating coils
319 : Real64 RhoAirStdInit = 0.0;
320 : Real64 QRegen = 0.0; // required coil load passed to sim heating coil routine (W)
321 : Real64 RhoAirStdInitCGDD = 0.0; // standard air density (kg/m3)
322 :
323 0 : void clear_state() override
324 : {
325 0 : new (this) DesiccantDehumidifiersData();
326 0 : }
327 : };
328 :
329 : } // namespace EnergyPlus
330 :
331 : #endif
|