LCOV - code coverage report
Current view: top level - EnergyPlus - SteamBaseboardRadiator.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 50.0 % 36 18
Test Date: 2025-05-22 16:09:37 Functions: 50.0 % 8 4

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

Generated by: LCOV version 2.0-1