Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2025, 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 DataHeatBalFanSys_hh_INCLUDED
49 : #define DataHeatBalFanSys_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 :
54 : // EnergyPlus Headers
55 : #include <EnergyPlus/Data/BaseData.hh>
56 : #include <EnergyPlus/DataHVACGlobals.hh>
57 : #include <EnergyPlus/EPVector.hh>
58 : #include <EnergyPlus/EnergyPlus.hh>
59 :
60 : namespace EnergyPlus {
61 :
62 : namespace DataHeatBalFanSys {
63 :
64 : // Data
65 : // -only module should be available to other modules and routines.
66 : // Thus, all variables in this module must be PUBLIC.
67 :
68 : constexpr Real64 MaxRadHeatFlux = 4000.0; // [W/m2] max limit for radiant heat flux at a surface due to HVAC equipment
69 :
70 : enum class PredictorCorrectorCtrl
71 : {
72 : Invalid = -1,
73 : GetZoneSetPoints,
74 : PredictStep,
75 : CorrectStep,
76 : RevertZoneTimestepHistories,
77 : PushZoneTimestepHistories,
78 : PushSystemTimestepHistories,
79 : Num
80 : };
81 :
82 : struct ZoneComfortControlsFangerData
83 : {
84 : // Members
85 : int FangerType = 0; // Index for Fanger type
86 : Real64 LowPMV = 0.0; // Low PMV value
87 : Real64 HighPMV = 0.0; // High PMV Value
88 : int DualPMVErrCount = 0; // Dual PMV setpoint error count
89 : int DualPMVErrIndex = 0; // Dual PMV setpoint error index
90 : };
91 :
92 : struct SurfQRadFromHVACData
93 : {
94 : Real64 HTRadSys; // Current radiant heat flux to surface from high temperature radiant heaters
95 : Real64 HWBaseboard; // Current radiant heat flux to surface from hot water baseboard heaters
96 : Real64 SteamBaseboard; // Current radiant heat flux to surface from steam baseboard heaters
97 : Real64 ElecBaseboard; // Current radiant heat flux to surface from electric baseboard heaters
98 : Real64 CoolingPanel; // Current radiant heat flux to surface from simple cooling panels
99 : };
100 :
101 : struct ZoneTstatSetpt
102 : {
103 : Real64 setpt = 0.0;
104 : Real64 setptAdapComfortCool = 0.0;
105 : Real64 setptHi = 0.0;
106 : Real64 setptLo = 0.0;
107 : Real64 setptHiAver = 0.0;
108 : Real64 setptLoAver = 0.0;
109 : };
110 :
111 : } // namespace DataHeatBalFanSys
112 :
113 : struct HeatBalFanSysData : BaseGlobalStruct
114 : {
115 : Array1D<Real64> SumConvHTRadSys; // Sum of convection to zone air from hi temp radiant heaters
116 : Array1D<Real64> SumLatentHTRadSys; // Sum of latent gains from hi temp radiant heaters
117 : Array1D<Real64> SumConvPool; // Sum of convection to zone air from pools
118 : Array1D<Real64> SumLatentPool; // Sum of latent gains from pools
119 : Array1D<Real64> ZoneQdotRadHVACToPerson; // Sum of radiant gains to people from all radiant HVAC sources
120 : Array1D<Real64> ZoneQHTRadSysToPerson; // Sum of radiant gains to people from hi temp radiant heaters
121 : Array1D<Real64> ZoneQHWBaseboardToPerson; // Sum of radiant gains to people from hot water baseboard heaters
122 : Array1D<Real64> ZoneQSteamBaseboardToPerson; // Sum of radiant gains to people from steam baseboard heaters
123 : Array1D<Real64> ZoneQElecBaseboardToPerson; // Sum of radiant gains to people from electric baseboard heaters
124 : Array1D<Real64> ZoneQCoolingPanelToPerson; // Sum of radiant losses to people from cooling panels
125 :
126 : // Zone air drybulb conditions variables
127 : Array1D<Real64> TempTstatAir; // temperature of air near the thermo stat
128 :
129 : Array1D_bool ZoneMassBalanceFlag; // zone mass flow balance flag
130 : Array1D_bool ZoneInfiltrationFlag; // Zone Infiltration flag
131 : Array1D_int ZoneReOrder; // zone number reordered for zone mass balance
132 :
133 : // REAL Variables for the Heat Balance Simulation
134 :
135 : Array1D<Real64> QRadSysSource; // Current source/sink for a particular surface (radiant sys)
136 : Array1D<Real64> TCondFDSourceNode; // Temperature of source/sink location in surface from CondFD algo
137 : Array1D<Real64> QPVSysSource; // Current source/sink for a surface (integrated PV sys)
138 :
139 : Array1D<Real64> CTFTsrcConstPart; // Constant Outside Portion of the CTF calculation of
140 : // temperature at source
141 : Array1D<Real64> CTFTuserConstPart; // Constant Outside Portion of the CTF calculation of
142 : // temperature at the user specified location
143 : EPVector<DataHeatBalFanSys::SurfQRadFromHVACData> surfQRadFromHVAC; // Radiant heat flux to surface from radiant HVAC equipment
144 : Array1D<Real64> QRadSurfAFNDuct; // Current radiant heat flux at a surface due to radiation from AFN ducts
145 : Array1D<Real64> QPoolSurfNumerator; // Current pool heat flux impact at the surface (numerator of surface heat balance)
146 : Array1D<Real64> PoolHeatTransCoefs; // Current pool heat transfer coefficients (denominator of surface heat balance)
147 : Array1D<Real64> RadSysTiHBConstCoef; // Inside heat balance coefficient that is constant
148 : Array1D<Real64> RadSysTiHBToutCoef; // Inside heat balance coefficient that modifies Toutside
149 : Array1D<Real64> RadSysTiHBQsrcCoef; // Inside heat balance coefficient that modifies source/sink
150 : Array1D<Real64> RadSysToHBConstCoef; // Outside heat balance coefficient that is constant
151 : Array1D<Real64> RadSysToHBTinCoef; // Outside heat balance coefficient that modifies Toutside
152 : Array1D<Real64> RadSysToHBQsrcCoef; // Outside heat balance coefficient that modifies source/sink
153 :
154 : Array1D<DataHeatBalFanSys::ZoneTstatSetpt> zoneTstatSetpts;
155 :
156 : EPVector<Real64> LoadCorrectionFactor; // PH 3/3/04
157 :
158 : // Hybrid Modeling
159 : Array1D<Real64> PreviousMeasuredZT1; // Measured zone air temperature at previous timestep1
160 : Array1D<Real64> PreviousMeasuredZT2; // Measured zone air temperature at previous timestep2
161 : Array1D<Real64> PreviousMeasuredZT3; // Measured zone air temperature at previous timestep3
162 : Array1D<Real64> PreviousMeasuredHumRat1; // Hybrid model zone humidity ratio at previous timestep
163 : Array1D<Real64> PreviousMeasuredHumRat2; // Hybrid model zone humidity ratio at previous timestep
164 : Array1D<Real64> PreviousMeasuredHumRat3; // Hybrid model zone humidity ratio at previous timestep
165 : EPVector<HVAC::SetptType> TempControlType;
166 : EPVector<int> TempControlTypeRpt;
167 : EPVector<HVAC::SetptType> ComfortControlType;
168 : EPVector<int> ComfortControlTypeRpt;
169 :
170 : Array2D<bool> CrossedColdThreshRepPeriod;
171 : Array2D<bool> CrossedHeatThreshRepPeriod;
172 :
173 : Array2D<std::vector<Real64>> ZoneHeatIndexHourBinsRepPeriod;
174 : Array2D<std::vector<Real64>> ZoneHeatIndexOccuHourBinsRepPeriod;
175 : Array2D<std::vector<Real64>> ZoneHeatIndexOccupiedHourBinsRepPeriod;
176 : Array2D<std::vector<Real64>> ZoneHumidexHourBinsRepPeriod;
177 : Array2D<std::vector<Real64>> ZoneHumidexOccuHourBinsRepPeriod;
178 : Array2D<std::vector<Real64>> ZoneHumidexOccupiedHourBinsRepPeriod;
179 : Array2D<Real64> lowSETLongestHoursRepPeriod;
180 : Array2D<Real64> highSETLongestHoursRepPeriod;
181 : Array2D<int> lowSETLongestStartRepPeriod;
182 : Array2D<int> highSETLongestStartRepPeriod;
183 : Array2D<std::vector<Real64>> ZoneColdHourOfSafetyBinsRepPeriod;
184 : Array2D<std::vector<Real64>> ZoneHeatHourOfSafetyBinsRepPeriod;
185 : Array2D<std::vector<Real64>> ZoneUnmetDegreeHourBinsRepPeriod;
186 : Array2D<std::vector<Real64>> ZoneDiscomfortWtExceedOccuHourBinsRepPeriod;
187 : Array2D<std::vector<Real64>> ZoneDiscomfortWtExceedOccupiedHourBinsRepPeriod;
188 : Array2D<std::vector<Real64>> ZoneCO2LevelHourBinsRepPeriod;
189 : Array2D<std::vector<Real64>> ZoneCO2LevelOccuHourBinsRepPeriod;
190 : Array2D<std::vector<Real64>> ZoneCO2LevelOccupiedHourBinsRepPeriod;
191 : Array2D<std::vector<Real64>> ZoneLightingLevelHourBinsRepPeriod;
192 : Array2D<std::vector<Real64>> ZoneLightingLevelOccuHourBinsRepPeriod;
193 : Array2D<std::vector<Real64>> ZoneLightingLevelOccupiedHourBinsRepPeriod;
194 :
195 : Array2D<std::vector<Real64>> ZoneLowSETHoursRepPeriod;
196 : Array2D<std::vector<Real64>> ZoneHighSETHoursRepPeriod;
197 :
198 : int PierceSETerrorIndex = 0;
199 : int PMVerrorIndex = 0;
200 :
201 : EPVector<DataHeatBalFanSys::ZoneComfortControlsFangerData> ZoneComfortControlsFanger;
202 :
203 2126 : void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
204 : {
205 2126 : }
206 :
207 1152 : void init_state([[maybe_unused]] EnergyPlusData &state) override
208 : {
209 1152 : }
210 :
211 2100 : void clear_state() override
212 : {
213 2100 : new (this) HeatBalFanSysData();
214 2100 : }
215 : };
216 :
217 : } // namespace EnergyPlus
218 :
219 : #endif
|