LCOV - code coverage report
Current view: top level - EnergyPlus - MundtSimMgr.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 28 7.1 %
Date: 2024-08-24 18:31:18 Functions: 1 2 50.0 %

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

Generated by: LCOV version 1.14