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 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 186262 : 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 ScaledHeatingCapacity; // - steam baseboard Radiator system scaled maximum heating capacity {W} or scalable variable of zone HVAC
113 : // equipment, {-}, or {W/m2}
114 :
115 : // Default Constructor
116 2 : SteamBaseboardParams()
117 2 : : EquipType(DataPlant::PlantEquipmentType::Invalid), DesignObjectPtr(0), ZonePtr(0), SchedPtr(0), SteamInletNode(0), SteamOutletNode(0),
118 : TotSurfToDistrib(0), FluidIndex(0), ControlCompTypeNum(0), CompErrIndex(0), DegOfSubcooling(0.0), SteamMassFlowRate(0.0),
119 : SteamMassFlowRateMax(0.0), SteamVolFlowRateMax(0.0), SteamOutletTemp(0.0), SteamInletTemp(0.0), SteamInletEnthalpy(0.0),
120 : SteamOutletEnthalpy(0.0), SteamInletPress(0.0), SteamOutletPress(0.0), SteamInletQuality(0.0), SteamOutletQuality(0.0),
121 : FracRadiant(0.0), FracConvect(0.0), FracDistribPerson(0.0), TotPower(0.0), Power(0.0), ConvPower(0.0), RadPower(0.0), TotEnergy(0.0),
122 : Energy(0.0), ConvEnergy(0.0), RadEnergy(0.0), plantLoc{}, BBLoadReSimIndex(0), BBMassFlowReSimIndex(0), BBInletTempFlowReSimIndex(0),
123 2 : ScaledHeatingCapacity(0.0)
124 : {
125 2 : }
126 : };
127 :
128 186257 : struct SteamBaseboardDesignData : SteamBaseboardParams
129 : {
130 : // Members
131 : std::string designName;
132 : int HeatingCapMethod; // - Method for heating capacity scaledsizing calculation (HeatingDesignCapacity, CapacityPerFloorArea,
133 : // FracOfAutosizedHeatingCapacity)
134 : Real64 DesignScaledHeatingCapacity; // - scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment, {-}, or {W/m2}
135 : Real64 Offset;
136 : Real64 FracRadiant;
137 : Real64 FracDistribPerson;
138 :
139 : // Default Constructor
140 1 : SteamBaseboardDesignData() : HeatingCapMethod(0), DesignScaledHeatingCapacity(0.0), Offset(0.0), FracRadiant(0.0), FracDistribPerson(0.0)
141 : {
142 1 : }
143 : };
144 :
145 5 : struct SteamBaseboardNumericFieldData
146 : {
147 : // Members
148 : Array1D_string FieldNames;
149 :
150 : // Default Constructor
151 1 : SteamBaseboardNumericFieldData()
152 1 : {
153 1 : }
154 : };
155 :
156 3 : struct SteamBaseboardDesignNumericFieldData
157 : {
158 : // Members
159 : Array1D_string FieldNames;
160 :
161 : // Default Constructor
162 1 : SteamBaseboardDesignNumericFieldData()
163 1 : {
164 1 : }
165 : };
166 :
167 : void SimSteamBaseboard(EnergyPlusData &state,
168 : std::string const &EquipName,
169 : int const ControlledZoneNum,
170 : bool const FirstHVACIteration,
171 : Real64 &PowerMet,
172 : int &CompIndex);
173 :
174 : void GetSteamBaseboardInput(EnergyPlusData &state);
175 :
176 : void InitSteamBaseboard(EnergyPlusData &state, int const BaseboardNum, int const ControlledZoneNum, bool const FirstHVACIteration);
177 :
178 : void SizeSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
179 :
180 : void CalcSteamBaseboard(EnergyPlusData &state, int &BaseboardNum, Real64 &LoadMet);
181 :
182 : void UpdateSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
183 :
184 : void UpdateBBSteamRadSourceValAvg(EnergyPlusData &state, bool &SteamBaseboardSysOn); // .TRUE. if the radiant system has run this zone time step
185 :
186 : void DistributeBBSteamRadGains(EnergyPlusData &state);
187 :
188 : void ReportSteamBaseboard(EnergyPlusData &state, int const BaseboardNum);
189 :
190 : void UpdateSteamBaseboardPlantConnection(EnergyPlusData &state,
191 : DataPlant::PlantEquipmentType BaseboardType, // type index
192 : std::string const &BaseboardName, // component name
193 : int const EquipFlowCtrl, // Flow control mode for the equipment
194 : int const LoopNum, // Plant loop index for where called from
195 : const DataPlant::LoopSideLocation LoopSide, // Plant loop side index for where called from
196 : int &CompIndex, // Chiller number pointer
197 : bool const FirstHVACIteration,
198 : bool &InitLoopEquip // If not zero, calculate the max load for operating conditions
199 : );
200 :
201 : } // namespace SteamBaseboardRadiator
202 :
203 771 : struct SteamBaseboardRadiatorData : BaseGlobalStruct
204 : {
205 :
206 : std::string const cCMO_BBRadiator_Steam = "ZoneHVAC:Baseboard:RadiantConvective:Steam";
207 : std::string const cCMO_BBRadiator_Steam_Design = "ZoneHVAC:Baseboard:RadiantConvective:Steam:Design";
208 : int NumSteamBaseboards = 0;
209 : int NumSteamBaseboardsDesign = 0;
210 : int SteamIndex = 0;
211 :
212 : Array1D<Real64> QBBSteamRadSource; // Need to keep the last value in case we are still iterating
213 : Array1D<Real64> QBBSteamRadSrcAvg; // Need to keep the last value in case we are still iterating
214 : Array1D<Real64> ZeroSourceSumHATsurf; // Equal to the SumHATsurf for all the walls in a zone
215 : // with no source
216 :
217 : // Record keeping variables used to calculate QBBRadSrcAvg locally
218 : Array1D<Real64> LastQBBSteamRadSrc; // Need to keep the last value in case we are still iterating
219 : Array1D<Real64> LastSysTimeElapsed; // Need to keep the last value in case we are still iterating
220 : Array1D<Real64> LastTimeStepSys; // Need to keep the last value in case we are still iterating
221 : Array1D_bool MySizeFlag;
222 : Array1D_bool CheckEquipName;
223 : Array1D_bool CheckDesignObjectName;
224 : Array1D_bool SetLoopIndexFlag; // get loop number flag
225 :
226 : bool GetInputFlag = true; // one time get input flag
227 : bool MyOneTimeFlag = true;
228 : bool ZoneEquipmentListChecked = false;
229 : Array1D_bool MyEnvrnFlag;
230 :
231 : Array1D<SteamBaseboardRadiator::SteamBaseboardParams> SteamBaseboard;
232 : Array1D<SteamBaseboardRadiator::SteamBaseboardDesignData> SteamBaseboardDesign;
233 : Array1D<SteamBaseboardRadiator::SteamBaseboardNumericFieldData> SteamBaseboardNumericFields;
234 : Array1D<SteamBaseboardRadiator::SteamBaseboardDesignNumericFieldData> SteamBaseboardDesignNumericFields;
235 : Array1D_string SteamBaseboardDesignNames; // Array that contains the names of Design objects
236 :
237 0 : void clear_state() override
238 : {
239 0 : NumSteamBaseboards = 0;
240 0 : SteamIndex = 0;
241 0 : QBBSteamRadSource.clear();
242 0 : QBBSteamRadSrcAvg.clear();
243 0 : ZeroSourceSumHATsurf.clear();
244 0 : LastQBBSteamRadSrc.clear();
245 0 : LastSysTimeElapsed.clear();
246 0 : LastTimeStepSys.clear();
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 771 : SteamBaseboardRadiatorData() = default;
261 : };
262 : } // namespace EnergyPlus
263 :
264 : #endif
|