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 SteamBaseboardRadiator_hh_INCLUDED
49 : #define SteamBaseboardRadiator_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 :
59 : namespace EnergyPlus {
60 :
61 : // Forward declarations
62 : struct EnergyPlusData;
63 :
64 : namespace SteamBaseboardRadiator {
65 :
66 : struct SteamBaseboardParams
67 : {
68 : // Members
69 : std::string EquipID;
70 : DataPlant::PlantEquipmentType EquipType;
71 : std::string designObjectName; // Design Object
72 : int DesignObjectPtr;
73 : std::string Schedule;
74 : Array1D_string SurfaceName;
75 : Array1D_int SurfacePtr;
76 : int ZonePtr;
77 : int SchedPtr; // Pointer to the correct schedule
78 : int SteamInletNode; // Inlet steam baseboard node
79 : int SteamOutletNode; // Outlet steam baseboard node
80 : int TotSurfToDistrib; // Total numbers of the surfaces that the radiant heat gets distributed
81 : int FluidIndex; // Fluid index for FluidProperties (Steam)
82 : int ControlCompTypeNum;
83 : int CompErrIndex;
84 : Real64 DegOfSubcooling; // Temperature differences due to subcooling of the condensate [C]
85 : Real64 SteamMassFlowRate; // Mass flow rate of steam passing through the heater [kg/s]
86 : Real64 SteamMassFlowRateMax; // Maximum mass flow rate of steam [kg/s]
87 : Real64 SteamVolFlowRateMax; // Maximum volumetric flow rate of steam [m3/s]
88 : Real64 SteamOutletTemp; // Outlet steam temperature from the heater [C]
89 : Real64 SteamInletTemp; // Inlet steam temperature [C]
90 : Real64 SteamInletEnthalpy; // Enthalpy of the steam delivered from the boiler [J/kg]
91 : Real64 SteamOutletEnthalpy; // Enthalpy of the steam leaving the heater [J/kg]
92 : Real64 SteamInletPress; // Pressure of steam at the inlet of the heater [Pa]
93 : Real64 SteamOutletPress; // Pressure of steam at the outlet of the heater [Pa]
94 : Real64 SteamInletQuality; // Quality of steam at the inlet of the heater [Pa]
95 : Real64 SteamOutletQuality; // Quality of steam at the outlet of the heater [Pa]
96 : Real64 FracRadiant; // User defined fraction for radiant heat addition
97 : Real64 FracConvect; // Fraction for convective heat addition
98 : Real64 FracDistribPerson; // Fraction for radiant heat incident on people
99 : Array1D<Real64> FracDistribToSurf;
100 : Real64 TotPower; // Convective system impact rate that the heater actually meets [W]
101 : Real64 Power; // Maximum heating rate [W]
102 : Real64 ConvPower; // Convective heating rate [W]
103 : Real64 RadPower; // Radiant heating rate [W]
104 : Real64 TotEnergy; // Convective system impact energy [J]
105 : Real64 Energy; // Maximum heating energy [J]
106 : Real64 ConvEnergy; // Convective heating energy [J]
107 : Real64 RadEnergy; // Radiant heating energy [J]
108 : PlantLocation plantLoc;
109 : int BBLoadReSimIndex;
110 : int BBMassFlowReSimIndex;
111 : int BBInletTempFlowReSimIndex;
112 : Real64 QBBSteamRadSource; // Need to keep the last value in case we are still iterating
113 : Real64 QBBSteamRadSrcAvg; // Need to keep the last value in case we are still iterating
114 : Real64 ZeroBBSteamSourceSumHATsurf; // Equal to the SumHATsurf for all the walls in a zone
115 : // with no source
116 :
117 : // Record keeping variables used to calculate QBBRadSrcAvg locally
118 : Real64 LastQBBSteamRadSrc; // Need to keep the last value in case we are still iterating
119 : Real64 LastSysTimeElapsed; // Need to keep the last value in case we are still iterating
120 : Real64 LastTimeStepSys; // Need to keep the last value in case we are still iterating
121 :
122 : Real64 ScaledHeatingCapacity; // - steam baseboard Radiator system scaled maximum heating capacity {W} or scalable variable of zone HVAC
123 : // equipment, {-}, or {W/m2}
124 :
125 : // Default Constructor
126 2 : SteamBaseboardParams()
127 8 : : EquipType(DataPlant::PlantEquipmentType::Invalid), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), SteamInletNode(0), SteamOutletNode(0),
128 2 : TotSurfToDistrib(0), FluidIndex(0), ControlCompTypeNum(0), CompErrIndex(0), DegOfSubcooling(0.0), SteamMassFlowRate(0.0),
129 2 : SteamMassFlowRateMax(0.0), SteamVolFlowRateMax(0.0), SteamOutletTemp(0.0), SteamInletTemp(0.0), SteamInletEnthalpy(0.0),
130 2 : SteamOutletEnthalpy(0.0), SteamInletPress(0.0), SteamOutletPress(0.0), SteamInletQuality(0.0), SteamOutletQuality(0.0),
131 4 : FracRadiant(0.0), FracConvect(0.0), FracDistribPerson(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0),
132 2 : Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), plantLoc{}, BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0),
133 2 : QBBSteamRadSource(0.0), QBBSteamRadSrcAvg(0.0), ZeroBBSteamSourceSumHATsurf(0.0), LastQBBSteamRadSrc(0.0), LastSysTimeElapsed(0.0),
134 2 : LastTimeStepSys(0.0), ScaledHeatingCapacity(0.0)
135 : {
136 2 : }
137 : };
138 :
139 : struct SteamBaseboardDesignData : SteamBaseboardParams
140 : {
141 : // Members
142 : std::string designName;
143 : int HeatingCapMethod; // - Method for heating capacity scaledsizing calculation (HeatingDesignCapacity, CapacityPerFloorArea,
144 : // FracOfAutosizedHeatingCapacity)
145 : Real64 DesignScaledHeatingCapacity; // - scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment, {-}, or {W/m2}
146 : Real64 Offset;
147 : Real64 FracRadiant;
148 : Real64 FracDistribPerson;
149 :
150 : // Default Constructor
151 1 : SteamBaseboardDesignData() : HeatingCapMethod(0), DesignScaledHeatingCapacity(0.0), Offset(0.0), FracRadiant(0.0), FracDistribPerson(0.0)
152 : {
153 1 : }
154 : };
155 :
156 : struct SteamBaseboardNumericFieldData
157 : {
158 : // Members
159 : Array1D_string FieldNames;
160 :
161 : // Default Constructor
162 1 : SteamBaseboardNumericFieldData()
163 1 : {
164 1 : }
165 : };
166 :
167 : struct SteamBaseboardDesignNumericFieldData
168 : {
169 : // Members
170 : Array1D_string FieldNames;
171 :
172 : // Default Constructor
173 1 : SteamBaseboardDesignNumericFieldData()
174 1 : {
175 1 : }
176 : };
177 :
178 : void SimSteamBaseboard(EnergyPlusData &state,
179 : std::string const &EquipName,
180 : int const ControlledZoneNum,
181 : bool const FirstHVACIteration,
182 : Real64 &PowerMet,
183 : int &CompIndex);
184 :
185 : void GetSteamBaseboardInput(EnergyPlusData &state);
186 :
187 : void InitSteamBaseboard(EnergyPlusData &state, int const BaseboardNum, int const ControlledZoneNum, bool const FirstHVACIteration);
188 :
189 : void SizeSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
190 :
191 : void CalcSteamBaseboard(EnergyPlusData &state, int &BaseboardNum, Real64 &LoadMet);
192 :
193 : void UpdateSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
194 :
195 : void UpdateBBSteamRadSourceValAvg(EnergyPlusData &state, bool &SteamBaseboardSysOn); // .TRUE. if the radiant system has run this zone time step
196 :
197 : void DistributeBBSteamRadGains(EnergyPlusData &state);
198 :
199 : void ReportSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
200 :
201 : void UpdateSteamBaseboardPlantConnection(EnergyPlusData &state,
202 : DataPlant::PlantEquipmentType BaseboardType, // type index
203 : std::string const &BaseboardName, // component name
204 : int const EquipFlowCtrl, // Flow control mode for the equipment
205 : int const LoopNum, // Plant loop index for where called from
206 : const DataPlant::LoopSideLocation LoopSide, // Plant loop side index for where called from
207 : int &CompIndex, // Chiller number pointer
208 : bool const FirstHVACIteration,
209 : bool &InitLoopEquip // If not zero, calculate the max load for operating conditions
210 : );
211 :
212 : } // namespace SteamBaseboardRadiator
213 :
214 : struct SteamBaseboardRadiatorData : BaseGlobalStruct
215 : {
216 :
217 : std::string const cCMO_BBRadiator_Steam = "ZoneHVAC:Baseboard:RadiantConvective:Steam";
218 : std::string const cCMO_BBRadiator_Steam_Design = "ZoneHVAC:Baseboard:RadiantConvective:Steam:Design";
219 : int NumSteamBaseboards = 0;
220 : int NumSteamBaseboardsDesign = 0;
221 : int SteamIndex = 0;
222 :
223 : Array1D_bool MySizeFlag;
224 : Array1D_bool CheckEquipName;
225 : Array1D_bool CheckDesignObjectName;
226 : Array1D_bool SetLoopIndexFlag; // get loop number flag
227 :
228 : bool GetInputFlag = true; // one time get input flag
229 : bool MyOneTimeFlag = true;
230 : bool ZoneEquipmentListChecked = false;
231 : Array1D_bool MyEnvrnFlag;
232 :
233 : Array1D<SteamBaseboardRadiator::SteamBaseboardParams> SteamBaseboard;
234 : Array1D<SteamBaseboardRadiator::SteamBaseboardDesignData> SteamBaseboardDesign;
235 : Array1D<SteamBaseboardRadiator::SteamBaseboardNumericFieldData> SteamBaseboardNumericFields;
236 : Array1D<SteamBaseboardRadiator::SteamBaseboardDesignNumericFieldData> SteamBaseboardDesignNumericFields;
237 : Array1D_string SteamBaseboardDesignNames; // Array that contains the names of Design objects
238 :
239 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
240 : {
241 796 : }
242 :
243 0 : void clear_state() override
244 : {
245 0 : NumSteamBaseboards = 0;
246 0 : SteamIndex = 0;
247 0 : MySizeFlag.clear();
248 0 : MyEnvrnFlag.clear();
249 0 : CheckEquipName.clear();
250 0 : SetLoopIndexFlag.clear();
251 0 : GetInputFlag = true;
252 0 : MyOneTimeFlag = true;
253 0 : ZoneEquipmentListChecked = false;
254 0 : SteamBaseboard.clear();
255 0 : SteamBaseboardNumericFields.clear();
256 0 : SteamBaseboardDesignNames.clear();
257 0 : }
258 :
259 : // Default Constructor
260 796 : SteamBaseboardRadiatorData() = default;
261 : };
262 : } // namespace EnergyPlus
263 :
264 : #endif
|