LCOV - code coverage report
Current view: top level - EnergyPlus - WindowManagerExteriorOptical.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 13 16 81.2 %
Date: 2023-01-17 19:17:23 Functions: 13 32 40.6 %

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

Generated by: LCOV version 1.13