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 WindowManagerExteriorOptical_hh_INCLUDED
49 : #define WindowManagerExteriorOptical_hh_INCLUDED
50 :
51 : // C++ Headers
52 : #include <memory>
53 :
54 : // Windows-CalcEngine headers
55 : #include <WCESingleLayerOptics.hpp>
56 :
57 : // EnergyPlus Headers
58 : #include <EnergyPlus/Material.hh>
59 :
60 : namespace EnergyPlus {
61 : namespace DataHeatBalance {
62 : struct MaterialBase;
63 : struct MaterialChild;
64 : } // namespace DataHeatBalance
65 : } // namespace EnergyPlus
66 :
67 : namespace EnergyPlus {
68 :
69 : // Forward declarations
70 : struct EnergyPlusData;
71 :
72 : namespace Window {
73 :
74 : class CWCEIntegrator;
75 :
76 : // Initialize window optical properties with Windows-CalcEngine routines that are BSDF based
77 : // void InitWCE_BSDFOpticalData();
78 :
79 : void InitWCE_SimplifiedOpticalData(EnergyPlusData &state);
80 :
81 : Real64 GetSolarTransDirectHemispherical(EnergyPlusData &state, int ConstrNum);
82 : Real64 GetVisibleTransDirectHemispherical(EnergyPlusData &state, int ConstrNum);
83 :
84 : std::shared_ptr<SingleLayerOptics::CBSDFLayer>
85 : getBSDFLayer(EnergyPlusData &state, const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
86 :
87 : SingleLayerOptics::CScatteringLayer
88 : getScatteringLayer(EnergyPlusData &state, const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
89 :
90 : ///////////////////////////////////////////////////////////////////////////////
91 : // CWCEMaterialFactory
92 : ///////////////////////////////////////////////////////////////////////////////
93 : class CWCEMaterialFactory
94 : {
95 : public:
96 16 : virtual ~CWCEMaterialFactory() = default;
97 : CWCEMaterialFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
98 :
99 : std::shared_ptr<SingleLayerOptics::CMaterial> getMaterial(EnergyPlusData &state);
100 :
101 : protected:
102 : virtual void init(EnergyPlusData &state) = 0;
103 : std::shared_ptr<SingleLayerOptics::CMaterial> m_Material;
104 : Material::MaterialChild m_MaterialProperties;
105 : FenestrationCommon::WavelengthRange m_Range;
106 : bool m_Initialized;
107 : };
108 :
109 : ///////////////////////////////////////////////////////////////////////////////
110 : // CWCESpecularMaterialsFactory
111 : ///////////////////////////////////////////////////////////////////////////////
112 : class CWCESpecularMaterialsFactory : public CWCEMaterialFactory
113 : {
114 : public:
115 : CWCESpecularMaterialsFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
116 :
117 : private:
118 : void init(EnergyPlusData &state) override;
119 : };
120 :
121 : ///////////////////////////////////////////////////////////////////////////////
122 : // CWCEMaterialDualBandFactory
123 : ///////////////////////////////////////////////////////////////////////////////
124 : class CWCEMaterialDualBandFactory : public CWCEMaterialFactory
125 : {
126 : // Common interface class for devices with materials defined over visible and solar range.
127 : // It is mainly intended from shading devices.
128 : public:
129 : CWCEMaterialDualBandFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
130 :
131 : protected:
132 : void init([[maybe_unused]] EnergyPlusData &state) override;
133 : virtual std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createVisibleRangeMaterial(EnergyPlusData &state) = 0;
134 : virtual std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createSolarRangeMaterial(EnergyPlusData &state) = 0;
135 : };
136 :
137 : ///////////////////////////////////////////////////////////////////////////////
138 : // CWCEVenetianBlindMaterialsFactory
139 : ///////////////////////////////////////////////////////////////////////////////
140 : class CWCEVenetianBlindMaterialsFactory : public CWCEMaterialDualBandFactory
141 : {
142 : public:
143 : CWCEVenetianBlindMaterialsFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
144 :
145 : private:
146 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createVisibleRangeMaterial(EnergyPlusData &state) override;
147 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createSolarRangeMaterial(EnergyPlusData &state) override;
148 : };
149 :
150 : ///////////////////////////////////////////////////////////////////////////////
151 : // CWCEScreenMaterialsFactory
152 : ///////////////////////////////////////////////////////////////////////////////
153 : class CWCEScreenMaterialsFactory : public CWCEMaterialDualBandFactory
154 : {
155 : public:
156 : CWCEScreenMaterialsFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
157 :
158 : private:
159 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createVisibleRangeMaterial(EnergyPlusData &state) override;
160 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createSolarRangeMaterial(EnergyPlusData &state) override;
161 : };
162 :
163 : ///////////////////////////////////////////////////////////////////////////////
164 : // CWCEDiffuseShadeMaterialsFactory
165 : ///////////////////////////////////////////////////////////////////////////////
166 : class CWCEDiffuseShadeMaterialsFactory : public CWCEMaterialDualBandFactory
167 : {
168 : public:
169 : CWCEDiffuseShadeMaterialsFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
170 :
171 : private:
172 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createVisibleRangeMaterial(EnergyPlusData &state) override;
173 : std::shared_ptr<SingleLayerOptics::CMaterialSingleBand> createSolarRangeMaterial(EnergyPlusData &state) override;
174 : };
175 :
176 : ///////////////////////////////////////////////////////////////////////////////
177 : // CWCECellFactory
178 : ///////////////////////////////////////////////////////////////////////////////
179 : class IWCECellDescriptionFactory
180 : {
181 : public:
182 16 : virtual ~IWCECellDescriptionFactory() = default;
183 : IWCECellDescriptionFactory(const Material::MaterialChild &t_Material);
184 :
185 : virtual std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) = 0;
186 :
187 : protected:
188 : Material::MaterialChild m_Material;
189 : };
190 :
191 : ///////////////////////////////////////////////////////////////////////////////
192 : // CWCESpecularCellFactory
193 : ///////////////////////////////////////////////////////////////////////////////
194 : class CWCESpecularCellFactory : public IWCECellDescriptionFactory
195 : {
196 : public:
197 : explicit CWCESpecularCellFactory(const Material::MaterialChild &t_Material);
198 :
199 : std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) override;
200 : };
201 :
202 : ///////////////////////////////////////////////////////////////////////////////
203 : // CWCEVenetianBlindCellFactory
204 : ///////////////////////////////////////////////////////////////////////////////
205 : class CWCEVenetianBlindCellFactory : public IWCECellDescriptionFactory
206 : {
207 : public:
208 : CWCEVenetianBlindCellFactory(const Material::MaterialChild &t_Material);
209 :
210 : std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) override;
211 : };
212 :
213 : ///////////////////////////////////////////////////////////////////////////////
214 : // CWCEScreenCellFactory
215 : ///////////////////////////////////////////////////////////////////////////////
216 : class CWCEScreenCellFactory : public IWCECellDescriptionFactory
217 : {
218 : public:
219 : CWCEScreenCellFactory(const Material::MaterialChild &t_Material);
220 :
221 : std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) override;
222 : };
223 :
224 : ///////////////////////////////////////////////////////////////////////////////
225 : // CWCEDiffuseShadeCellFactory
226 : ///////////////////////////////////////////////////////////////////////////////
227 : class CWCEDiffuseShadeCellFactory : public IWCECellDescriptionFactory
228 : {
229 : public:
230 : CWCEDiffuseShadeCellFactory(const Material::MaterialChild &t_Material);
231 :
232 : std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) override;
233 : };
234 :
235 : ///////////////////////////////////////////////////////////////////////////////
236 : // CWCELayerFactory
237 : ///////////////////////////////////////////////////////////////////////////////
238 : class CWCELayerFactory
239 : {
240 : public:
241 16 : virtual ~CWCELayerFactory() = default;
242 : CWCELayerFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
243 :
244 : std::shared_ptr<SingleLayerOptics::CBSDFLayer> getBSDFLayer(EnergyPlusData &state);
245 : SingleLayerOptics::CScatteringLayer getLayer(EnergyPlusData &state);
246 :
247 : protected:
248 : // void init();
249 : std::pair<std::shared_ptr<SingleLayerOptics::CMaterial>, std::shared_ptr<SingleLayerOptics::ICellDescription>> init(EnergyPlusData &state);
250 :
251 : virtual void createMaterialFactory() = 0;
252 : std::shared_ptr<SingleLayerOptics::ICellDescription> getCellDescription(EnergyPlusData &state) const;
253 :
254 : const Material::MaterialChild m_Material;
255 : const FenestrationCommon::WavelengthRange m_Range;
256 : bool m_BSDFInitialized;
257 : bool m_SimpleInitialized;
258 :
259 : std::shared_ptr<CWCEMaterialFactory> m_MaterialFactory;
260 : std::shared_ptr<IWCECellDescriptionFactory> m_CellFactory;
261 : std::shared_ptr<SingleLayerOptics::CBSDFLayer> m_BSDFLayer;
262 : SingleLayerOptics::CScatteringLayer m_ScatteringLayer;
263 : };
264 :
265 : ///////////////////////////////////////////////////////////////////////////////
266 : // CWCESpecularLayerFactory
267 : ///////////////////////////////////////////////////////////////////////////////
268 : class CWCESpecularLayerFactory : public CWCELayerFactory
269 : {
270 : public:
271 : CWCESpecularLayerFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
272 :
273 : private:
274 : void createMaterialFactory() override;
275 : };
276 :
277 : ///////////////////////////////////////////////////////////////////////////////
278 : // CWCEVenetianBlindLayerFactory
279 : ///////////////////////////////////////////////////////////////////////////////
280 : class CWCEVenetianBlindLayerFactory : public CWCELayerFactory
281 : {
282 : public:
283 : CWCEVenetianBlindLayerFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
284 :
285 : private:
286 : void createMaterialFactory() override;
287 : };
288 :
289 : ///////////////////////////////////////////////////////////////////////////////
290 : // CWCEScreenLayerFactory
291 : ///////////////////////////////////////////////////////////////////////////////
292 : class CWCEScreenLayerFactory : public CWCELayerFactory
293 : {
294 : public:
295 : CWCEScreenLayerFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
296 :
297 : private:
298 : void createMaterialFactory() override;
299 : };
300 :
301 : ///////////////////////////////////////////////////////////////////////////////
302 : // CWCEDiffuseShadeLayerFactory
303 : ///////////////////////////////////////////////////////////////////////////////
304 : class CWCEDiffuseShadeLayerFactory : public CWCELayerFactory
305 : {
306 : public:
307 : CWCEDiffuseShadeLayerFactory(const Material::MaterialChild &t_Material, const FenestrationCommon::WavelengthRange t_Range);
308 :
309 : private:
310 : void createMaterialFactory() override;
311 : };
312 :
313 : } // namespace Window
314 :
315 : } // namespace EnergyPlus
316 :
317 : #endif
|