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 MundtSimMgr_hh_INCLUDED
49 : #define MundtSimMgr_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 : #include <ObjexxFCL/Array2D.hh>
54 :
55 : // EnergyPlus Headers
56 : #include <EnergyPlus/Data/BaseData.hh>
57 : #include <EnergyPlus/DataGlobals.hh>
58 : #include <EnergyPlus/EnergyPlus.hh>
59 :
60 : namespace EnergyPlus {
61 :
62 : // Forward declarations
63 : struct EnergyPlusData;
64 :
65 : namespace MundtSimMgr {
66 :
67 : // Types
68 :
69 74 : struct DefineLinearModelNode
70 : {
71 : // Members
72 : std::string AirNodeName; // Name of air nodes
73 : DataRoomAirModel::AirNodeType ClassType; // Type of air nodes
74 : Real64 Height; // Z coordinates [m] node's Control Vol. center
75 : Real64 Temp; // Surface temperature BC
76 : Array1D_bool SurfMask; // Limit of 60 surfaces at current sizing
77 :
78 : // Default Constructor
79 2 : DefineLinearModelNode() : ClassType(DataRoomAirModel::AirNodeType::Invalid), Height(0.0), Temp(0.0)
80 : {
81 2 : }
82 : };
83 :
84 : struct DefineSurfaceSettings
85 : {
86 : // Members
87 : Real64 Area; // m2
88 : Real64 Temp; // surface temperature BC
89 : Real64 Hc; // convective film coeff BC
90 : Real64 TMeanAir; // effective near-surface air temp from air model solution
91 :
92 : // Default Constructor
93 4 : DefineSurfaceSettings() : Area(0.0), Temp(0.0), Hc(0.0), TMeanAir(0.0)
94 : {
95 4 : }
96 : };
97 :
98 20 : struct DefineZoneData
99 : {
100 : // Members
101 : int NumOfSurfs = 0; // number of surfaces in the zone
102 : int MundtZoneIndex = 0; // index for zones using Mundt model
103 : EPVector<int> HBsurfaceIndexes; // list of surface indexes in this Mundt model zone
104 : };
105 :
106 : // Functions
107 :
108 : void ManageMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone
109 :
110 : //*****************************************************************************************
111 :
112 : void InitMundtModel(EnergyPlusData &state);
113 :
114 : //*****************************************************************************************
115 :
116 : void GetSurfHBDataForMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone
117 :
118 : //*****************************************************************************************
119 :
120 : void SetupMundtModel(EnergyPlusData &state,
121 : int ZoneNum, // index number for the specified zone
122 : bool &ErrorsFound // true if problems setting up model
123 : );
124 :
125 : //*****************************************************************************************
126 :
127 : void CalcMundtModel(EnergyPlusData &state, int const ZoneNum); // index number for the specified zone
128 :
129 : //*****************************************************************************************
130 :
131 : void SetNodeResult(EnergyPlusData &state,
132 : int NodeID, // node ID
133 : Real64 TempResult // temperature for the specified air node
134 : );
135 :
136 : //*****************************************************************************************
137 :
138 : void SetSurfTmeanAir(EnergyPlusData &state,
139 : int SurfID, // surface ID
140 : Real64 TeffAir // temperature of air node adjacent to the specified surface
141 : );
142 :
143 : //*****************************************************************************************
144 :
145 : void SetSurfHBDataForMundtModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone
146 :
147 : //*****************************************************************************************
148 :
149 : } // namespace MundtSimMgr
150 :
151 1542 : struct MundtSimMgrData : BaseGlobalStruct
152 : {
153 :
154 : Array1D_int FloorSurfSetIDs; // fixed variable for floors
155 : Array1D_int TheseSurfIDs; // temporary working variable
156 : int MundtCeilAirID = 0; // air node index in AirDataManager
157 : int MundtFootAirID = 0; // air node index in AirDataManager
158 : int SupplyNodeID = 0; // air node index in AirDataManager
159 : int TstatNodeID = 0; // air node index in AirDataManager
160 : int ReturnNodeID = 0; // air node index in AirDataManager
161 : int NumRoomNodes = 0; // number of nodes connected to walls
162 : int NumFloorSurfs = 0; // total number of surfaces for floor
163 : Array1D_int RoomNodeIDs; // ids of the first NumRoomNode Air Nodes
164 : Array1D_int ID1dSurf; // numbers used to identify surfaces
165 : int MundtZoneNum = 0; // index of zones using Mundt model
166 : Real64 ZoneHeight = 0.0; // zone height
167 : Real64 ZoneFloorArea = 0.0; // zone floor area
168 : Real64 QventCool = 0.0; // heat gain due to ventilation
169 : Real64 ConvIntGain = 0.0; // heat gain due to internal gains
170 : Real64 SupplyAirTemp = 0.0; // supply air temperature
171 : Real64 SupplyAirVolumeRate = 0.0; // supply air volume flowrate
172 : Real64 ZoneAirDensity = 0.0; // zone air density
173 : Real64 QsysCoolTot = 0.0; // zone sensible cooling load
174 :
175 : // Object Data
176 : Array1D<MundtSimMgr::DefineZoneData> ZoneData; // zone data
177 : Array2D<MundtSimMgr::DefineLinearModelNode> LineNode; // air nodes
178 : Array2D<MundtSimMgr::DefineSurfaceSettings> MundtAirSurf; // surfaces
179 : Array1D<MundtSimMgr::DefineSurfaceSettings> FloorSurf; // floor
180 :
181 0 : void clear_state() override
182 : {
183 0 : this->FloorSurfSetIDs.clear(); // fixed variable for floors
184 0 : this->TheseSurfIDs.clear(); // temporary working variable
185 0 : this->MundtCeilAirID = 0; // air node index in AirDataManager
186 0 : this->MundtFootAirID = 0; // air node index in AirDataManager
187 0 : this->SupplyNodeID = 0; // air node index in AirDataManager
188 0 : this->TstatNodeID = 0; // air node index in AirDataManager
189 0 : this->ReturnNodeID = 0; // air node index in AirDataManager
190 0 : this->NumRoomNodes = 0; // number of nodes connected to walls
191 0 : this->NumFloorSurfs = 0; // total number of surfaces for floor
192 0 : this->RoomNodeIDs.clear(); // ids of the first NumRoomNode Air Nodes
193 0 : this->ID1dSurf.clear(); // numbers used to identify surfaces
194 0 : this->MundtZoneNum = 0; // index of zones using Mundt model
195 0 : this->ZoneHeight = 0.0; // zone height
196 0 : this->ZoneFloorArea = 0.0; // zone floor area
197 0 : this->QventCool = 0.0; // heat gain due to ventilation
198 0 : this->ConvIntGain = 0.0; // heat gain due to internal gains
199 0 : this->SupplyAirTemp = 0.0; // supply air temperature
200 0 : this->SupplyAirVolumeRate = 0.0; // supply air volume flowrate
201 0 : this->ZoneAirDensity = 0.0; // zone air density
202 0 : this->QsysCoolTot = 0.0; // zone sensible cooling load
203 0 : this->ZoneData.clear(); // zone data
204 0 : this->LineNode.clear(); // air nodes
205 0 : this->MundtAirSurf.clear(); // surfaces
206 0 : this->FloorSurf.clear(); // floor
207 0 : }
208 : };
209 :
210 : } // namespace EnergyPlus
211 :
212 : #endif
|