LCOV - code coverage report
Current view: top level - EnergyPlus - LowTempRadiantSystem.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 68 68
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 23 23

            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 LowTempRadiantSystem_hh_INCLUDED
      49              : #define LowTempRadiantSystem_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              : #include <EnergyPlus/Plant/Enums.hh>
      60              : #include <EnergyPlus/Plant/PlantLocation.hh>
      61              : 
      62              : namespace EnergyPlus {
      63              : 
      64              : // Forward declarations
      65              : struct EnergyPlusData;
      66              : 
      67              : namespace LowTempRadiantSystem {
      68              : 
      69              :     // Using/Aliasing
      70              : 
      71              :     // Data
      72              :     // MODULE PARAMETER DEFINITIONS:
      73              :     // System types:
      74              : 
      75              :     enum class SystemType
      76              :     {
      77              :         Invalid = -1,
      78              :         Hydronic,     // Variable flow hydronic radiant system
      79              :         ConstantFlow, // Constant flow, variable (controlled) temperature radiant system
      80              :         Electric,     // Electric resistance radiant heating system
      81              :         Num
      82              :     };
      83              : 
      84              :     enum class OpMode
      85              :     {
      86              :         Cool = -1, // Ok for this to be -1 because this isn't coming from the IDF so there is no Invalid
      87              :         None,
      88              :         Heat,
      89              :     };
      90              : 
      91              :     // Control types:
      92              :     enum class CtrlType
      93              :     {
      94              :         Invalid = -1,
      95              :         MAT,            // Controls system using mean air temperature
      96              :         MRT,            // Controls system using mean radiant temperature
      97              :         Operative,      // Controls system using operative temperature
      98              :         ODB,            // Controls system using outside air dry-bulb temperature
      99              :         OWB,            // Controls system using outside air wet-bulb temperature
     100              :         SurfFaceTemp,   // Controls system using the surface inside face temperature
     101              :         SurfIntTemp,    // Controls system using a temperature inside the radiant system construction as defined by the Construction +
     102              :                         // ConstructionProperty:InternalHeatSource inputs
     103              :         RunningMeanODB, // Controls system using the running mean outdoor dry-bulb temperature
     104              :         Num
     105              :     };
     106              : 
     107              :     // Setpoint Types:
     108              :     enum class SetpointType
     109              :     {
     110              :         Invalid = -1,
     111              :         HalfFlowPower, // Controls system where the setpoint is at the 50% flow/power point
     112              :         ZeroFlowPower, // Controls system where the setpoint is at the 0% flow/power point
     113              :         Num
     114              :     };
     115              : 
     116              :     // Fluid to Slab Heat Transfer Types:
     117              :     enum class FluidToSlabHeatTransferType
     118              :     {
     119              :         Invalid = -1,
     120              :         ConvectionOnly, // Convection only model (legacy code, original model)
     121              :         ISOStandard,    // Using ISO Standard 1185-2 (convection, conduction through pipe, contact resistance)
     122              :         Num
     123              :     };
     124              : 
     125              :     enum class CondCtrlType
     126              :     {
     127              :         Invalid = -1,
     128              :         None,      // Condensation control--none, so system never shuts down
     129              :         SimpleOff, // Condensation control--simple off, system shuts off when condensation predicted
     130              :         VariedOff, // Condensation control--variable off, system modulates to keep running if possible
     131              :         Num
     132              :     };
     133              : 
     134              :     // Number of Circuits per Surface Calculation Method
     135              :     enum class CircuitCalc
     136              :     {
     137              :         Invalid = -1,
     138              :         OneCircuit,          // there is 1 circuit per surface
     139              :         CalculateFromLength, // The number of circuits is TubeLength*SurfaceFlowFrac / CircuitLength
     140              :         Num
     141              :     };
     142              : 
     143              :     struct RadiantSystemBaseData
     144              :     {
     145              :         // Members
     146              :         std::string Name;                      // name of hydronic radiant system
     147              :         Sched::Schedule *availSched = nullptr; // index to schedule
     148              :         std::string ZoneName;                  // Name of zone the system is serving
     149              :         int ZonePtr = 0;                       // Point to this zone in the Zone derived type
     150              :         std::string SurfListName;              // Name of surface/surface list that is the radiant system
     151              :         int NumOfSurfaces = 0;                 // Number of surfaces included in this radiant system (coordinated control)
     152              :         Array1D_int SurfacePtr;                // Pointer to the surface(s) in the Surface derived type
     153              :         Array1D_string SurfaceName;            // Name of surfaces that are the radiant system (can be one or more)
     154              :         Array1D<Real64> SurfaceFrac;           // Fraction of flow/pipe length or electric power for a particular surface
     155              :         Real64 TotalSurfaceArea = 0.0;         // Total surface area for all surfaces that are part of this radiant system
     156              :         Real64 ZeroLTRSourceSumHATsurf = 0.0;  // Equal to SumHATsurf for all the walls in a zone with no source
     157              :         Array1D<Real64> QRadSysSrcAvg;         // Average source over the time step for a particular radiant surface
     158              :         // Record keeping variables used to calculate QRadSysSrcAvg locally
     159              :         Array1D<Real64> LastQRadSysSrc;                          // Need to keep the last value in case we are still iterating
     160              :         Real64 LastSysTimeElapsed;                               // Need to keep the last value in case we are still iterating
     161              :         Real64 LastTimeStepSys;                                  // Need to keep the last value in case we are still iterating
     162              :         CtrlType controlType = CtrlType::MAT;                    // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     163              :                                                                  // Surface Face Temp, Surface Interior Temp, Running Mean
     164              :                                                                  // Temp for Constant Flow systems only)
     165              :         SetpointType setpointType = SetpointType::HalfFlowPower; // Setpoint type for the syste, (HalfFlowPower or ZeroFlowPower)
     166              :         OpMode opMode = OpMode::None;                            // Operating mode currently being used (NotOperating, Heating, Cooling)
     167              :         Real64 HeatPower;                                        // heating sent to panel in Watts
     168              :         Real64 HeatEnergy;                                       // heating sent to panel in Joules
     169              :         Real64 runningMeanOutdoorAirTemperatureWeightingFactor =
     170              :             0.0;                                                    // Weighting factor for running mean outdoor air temperature equation (user input)
     171              :         Real64 todayRunningMeanOutdoorDryBulbTemperature = 0.0;     // Current running mean outdoor air dry-bulb temperature
     172              :         Real64 yesterdayRunningMeanOutdoorDryBulbTemperature = 0.0; // Running mean outdoor air dry-bulb temperature from yesterday
     173              :         Real64 todayAverageOutdoorDryBulbTemperature = 0.0;         // Average outdoor dry-bulb temperature for today
     174              :         Real64 yesterdayAverageOutdoorDryBulbTemperature = 0.0;     // Average outdoor dry-bulb temperature for yesterday
     175              : 
     176              :         void errorCheckZonesAndConstructions(EnergyPlusData &state, bool &errorsFound);
     177              : 
     178              :         Real64 setRadiantSystemControlTemperature(EnergyPlusData &state, CtrlType TempControlType);
     179              : 
     180              :         Real64 calculateOperationalFraction(Real64 const offTemperature, Real64 const controlTemperature, Real64 const throttlingRange);
     181              : 
     182              :         virtual void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet) = 0;
     183              : 
     184              :         Real64 setOffTemperatureLowTemperatureRadiantSystem(EnergyPlusData &state,
     185              :                                                             Sched::Schedule const *sched,
     186              :                                                             Real64 const throttlingRange,
     187              :                                                             SetpointType SetpointControlType);
     188              : 
     189              :         void updateLowTemperatureRadiantSystemSurfaces(EnergyPlusData &state);
     190              : 
     191              :         virtual void updateLowTemperatureRadiantSystem(EnergyPlusData &state) = 0;
     192              : 
     193              :         virtual void reportLowTemperatureRadiantSystem(EnergyPlusData &state) = 0;
     194              : 
     195              :         // Default Constructor
     196          110 :         RadiantSystemBaseData() = default;
     197          128 :         ~RadiantSystemBaseData() = default;
     198              :     };
     199              : 
     200              :     struct HydronicSystemBaseData : RadiantSystemBaseData
     201              :     {
     202              :         // Members
     203              :         Array1D<Real64> NumCircuits; // Number of fluid circuits in the surface
     204              :         Real64 TubeLength = 0.0;     // tube length embedded in radiant surface (meters)
     205              :         bool HeatingSystem = false;  // .TRUE. when the system is able to heat (parameters are valid)
     206              :         int HotWaterInNode = 0;      // hot water inlet node
     207              :         int HotWaterOutNode = 0;     // hot water outlet node
     208              :         PlantLocation HWPlantLoc{};
     209              :         bool CoolingSystem = false; // .TRUE. when the system is able to cool (parameters are valid)
     210              :         int ColdWaterInNode = 0;    // cold water inlet node
     211              :         int ColdWaterOutNode = 0;   // cold water outlet node
     212              :         PlantLocation CWPlantLoc{};
     213              :         Fluid::GlycolProps *water = nullptr; // Water properties
     214              : 
     215              :         int CondErrIndex = 0;            // Error index for recurring warning messages
     216              :         Real64 CondCausedTimeOff = 0.0;  // Amount of time condensation did or could have turned system off
     217              :         bool CondCausedShutDown = false; // .TRUE. when condensation predicted at surface
     218              :         CircuitCalc NumCircCalcMethod =
     219              :             CircuitCalc::Invalid; // Calculation method for number of circuits per surface; 1=1 per surface, 2=use cicuit length
     220              :         Real64 CircLength = 0.0;  // Circuit length {m}
     221              :         Sched::Schedule *changeoverDelaySched = nullptr; // schedule for the changeover delay in hours
     222              :         OpMode lastOpMode = OpMode::None;                // Last mode of operation (heating or cooling)
     223              :         int lastDayOfSim = 1;                            // Last day of simulation radiant system operated in lastOperatingMode
     224              :         int lastHourOfDay = 1;                           // Last hour of the day radiant system operated in lastOperatingMode
     225              :         int lastTimeStep = 1;                            // Last time step radiant system operated in lastOperatingMode
     226              :         // Other parameters
     227              :         bool EMSOverrideOnWaterMdot = false;
     228              :         Real64 EMSWaterMdotOverrideValue = 0.0;
     229              :         // Report data
     230              :         Real64 WaterInletTemp = 0.0;  // water inlet temperature
     231              :         Real64 WaterOutletTemp = 0.0; // water outlet temperature
     232              :         Real64 CoolPower = 0.0;       // cooling sent to panel in Watts
     233              :         Real64 CoolEnergy = 0.0;      // cooling sent to panel in Joules
     234              :         int OutRangeHiErrorCount = 0; // recurring errors for crazy results too high fluid temperature
     235              :         int OutRangeLoErrorCount = 0; // recurring errors for crazy results too low fluid temperature
     236              : 
     237              :         void updateOperatingModeHistory(EnergyPlusData &state);
     238              : 
     239              :         void setOperatingModeBasedOnChangeoverDelay(EnergyPlusData &state);
     240              : 
     241              :         Real64 calculateHXEffectivenessTerm(EnergyPlusData &state,
     242              :                                             int const SurfNum,          // Surface Number
     243              :                                             Real64 const Temperature,   // Temperature of water entering the radiant system, in C
     244              :                                             Real64 const WaterMassFlow, // Mass flow rate of water in the radiant system, in kg/s
     245              :                                             Real64 const FlowFraction,  // Mass flow rate fraction for this surface in the radiant system
     246              :                                             Real64 const NumCircs,      // Number of fluid circuits in this surface
     247              :                                             int const DesignObjPtr,     // Design Object Pointer,
     248              :                                             SystemType typeOfRadiantSystem
     249              : 
     250              :         );
     251              : 
     252              :         Real64 calculateUFromISOStandard(EnergyPlusData &state,
     253              :                                          int const SurfNum,
     254              :                                          Real64 const WaterMassFlow,
     255              :                                          SystemType typeOfRadiantSystem,
     256              :                                          int const DesignObjPtr // Design Object Pointer
     257              :         );
     258              : 
     259              :         Real64 sizeRadiantSystemTubeLength(EnergyPlusData &state);
     260              : 
     261              :         void checkForOutOfRangeTemperatureResult(EnergyPlusData &state, Real64 const outletTemp, Real64 const inletTemp);
     262              : 
     263              :         // Default Constructor
     264           82 :         HydronicSystemBaseData() = default;
     265          100 :         ~HydronicSystemBaseData() = default;
     266              :     };
     267              : 
     268              :     struct VariableFlowRadiantSystemData : HydronicSystemBaseData
     269              :     {
     270              :         // Members
     271              :         std::string designObjectName; // Design Object
     272              :         int DesignObjectPtr = 0;
     273              :         int HeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaled sizing calculation (HeatingDesignCapacity,
     274              :         // CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     275              :         Real64 ScaledHeatingCapacity =
     276              :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     277              :         Real64 WaterVolFlowMaxHeat = 0.0; // maximum water flow rate for heating, m3/s
     278              :         Real64 WaterFlowMaxHeat = 0.0;    // maximum water flow rate for heating, kg/s
     279              :         Real64 WaterVolFlowMaxCool = 0.0; // maximum water flow rate for cooling, m3/s
     280              :         Real64 WaterFlowMaxCool = 0.0;    // maximum water flow rate for cooling, kg/s
     281              :         Real64 WaterMassFlowRate = 0.0;   // water mass flow rate
     282              :         int CoolingCapMethod = 0;         // - Method for Low Temp Radiant system cooling capacity scaled sizing calculation (CoolingDesignCapacity,
     283              :         // CapacityPerFloorArea, FracOfAutosizedCoolingCapacity)
     284              :         Real64 ScaledCoolingCapacity =
     285              :             0.0; // -  Low Temp Radiant system scaled maximum cooling capacity {W} or scalable variable of zone HVAC equipment,
     286              :         // {-}, or {W/m2}
     287              : 
     288              :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     289              : 
     290              :         void calculateLowTemperatureRadiantSystemComponents(EnergyPlusData &state, Real64 &LoadMet, SystemType typeOfRadiantSystem);
     291              : 
     292              :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     293              : 
     294              :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     295              : 
     296              :         // Default Constructor
     297           38 :         VariableFlowRadiantSystemData() = default;
     298           46 :         ~VariableFlowRadiantSystemData() = default;
     299              :     };
     300              : 
     301              :     struct VarFlowRadDesignData : VariableFlowRadiantSystemData
     302              :     {
     303              :         // Members
     304              :         // This data could be shared between multiple Var flow LowTempRad Systems
     305              :         std::string designName;         // name of the design object+
     306              :         Real64 TubeDiameterInner = 0.0; // inside tube diameter for embedded tubing (meters)
     307              :         Real64 TubeDiameterOuter = 0.0; // outside tube diameter for embedded tubing (meters)
     308              :         FluidToSlabHeatTransferType FluidToSlabHeatTransfer =
     309              :             FluidToSlabHeatTransferType::ConvectionOnly; // Model used for calculating heat transfer between fluid and slab
     310              :         Real64 VarFlowTubeConductivity = 0.0;            // tube conductivity in W/m-K
     311              :         CtrlType VarFlowControlType = CtrlType::MAT;     // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     312              :         // Surface Face Temp, Surface Interior Temp, Running Mean Temp
     313              :         // for Constant Flow systems only)
     314              :         SetpointType VarFlowSetpointType = SetpointType::HalfFlowPower; // Setpoint type for the syste, (HalfFlowPower or ZeroFlowPower)
     315              :         std::string DesignHeatingCapMethodInput;
     316              :         int DesignHeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaledsizing calculation (HeatingDesignCapacity,
     317              :         // CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     318              :         Real64 DesignScaledHeatingCapacity =
     319              :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     320              :         // {-}, or {W/m2}
     321              :         Real64 HotThrottlRange = 0.0;              // Throttling range for heating [C]
     322              :         Sched::Schedule *heatSetptSched = nullptr; // Schedule index for the zone setpoint temperature
     323              :         Real64 ColdThrottlRange = 0.0;             // Throttling range for cooling [C]
     324              :         Array1D_string FieldNames;
     325              :         CondCtrlType condCtrlType = CondCtrlType::SimpleOff; // Condensation control type (initialize to simple off)
     326              :         Real64 CondDewPtDeltaT = 1.0;                        // Diff between surface temperature and dew point for cond. shut-off
     327              :         Sched::Schedule *coolSetptSched = nullptr;           // Schedule index for the zone setpoint temperature
     328              :         std::string DesignCoolingCapMethodInput;
     329              :         int DesignCoolingCapMethod = 0; // - Method for Low Temp Radiant system cooling capacity scaledsizing calculation (CoolingDesignCapacity,
     330              :                                         // CapacityPerFloorArea, FracOfAutosizedCoolingCapacity)
     331              :         Real64 DesignScaledCoolingCapacity =
     332              :             0.0; // -  Low Temp Radiant system scaled maximum cooling capacity {W} or scalable variable of zone HVAC equipment,
     333              :                  // {-}, or {W/m2}
     334              : 
     335              :         // Default Constructor
     336            6 :         VarFlowRadDesignData() = default;
     337           14 :         ~VarFlowRadDesignData() = default;
     338              :     };
     339              : 
     340              :     struct ConstantFlowRadiantSystemData : HydronicSystemBaseData
     341              :     {
     342              :         // Members
     343              :         Real64 WaterVolFlowMax; // design nominal capacity of constant flow pump (volumetric flow rate)
     344              :         Real64 ColdDesignWaterMassFlowRate;
     345              :         Real64 HotDesignWaterMassFlowRate;
     346              :         Real64 WaterMassFlowRate = 0.0;    // current flow rate through system (calculated)
     347              :         Real64 HotWaterMassFlowRate = 0.0; // current hot water flow rate through heating side of system (calculated)
     348              :         Real64 ChWaterMassFlowRate = 0.0;  // current chilled water flow rate through cooling side of system (calculated)
     349              :         std::string designObjectName;      // Design Object
     350              :         int DesignObjectPtr = 0;
     351              :         Sched::Schedule *volFlowSched = nullptr;        // index to the volumetric flow schedule
     352              :         Real64 NomPumpHead = 0.0;                       // nominal head of the constant flow pump
     353              :         Real64 NomPowerUse = 0.0;                       // nominal power use of the constant flow pump
     354              :         Real64 PumpEffic = 0.0;                         // overall efficiency of the pump (calculated)
     355              :         Sched::Schedule *hotWaterHiTempSched = nullptr; // Schedule for the highest water temperature
     356              :         Sched::Schedule *hotWaterLoTempSched = nullptr; // Schedule for the lowest water temperature
     357              :         Sched::Schedule *hotCtrlHiTempSched = nullptr;  // Schedule for the highest control temperature
     358              :         // (where the lowest water temperature is requested)
     359              :         Sched::Schedule *hotCtrlLoTempSched = nullptr; // Schedule for the lowest control temperature
     360              :         // (where the highest water temperature is requested)
     361              :         Sched::Schedule *coldWaterHiTempSched = nullptr; // Schedule for the highest water temperature
     362              :         Sched::Schedule *coldWaterLoTempSched = nullptr; // Schedule for the lowest water temperature
     363              :         Sched::Schedule *coldCtrlHiTempSched = nullptr;  // Schedule for the highest control temperature
     364              :         // (where the lowest water temperature is requested)
     365              :         Sched::Schedule *coldCtrlLoTempSched = nullptr; // Schedule for the lowest control temperature
     366              :         // (where the highest water temperature is requested)
     367              :         Real64 WaterInjectionRate = 0.0;    // water injection mass flow rate from main loop
     368              :         Real64 WaterRecircRate = 0.0;       // water recirculation rate (outlet from radiant system recirculated)
     369              :         Real64 PumpPower = 0.0;             // pump power in Watts
     370              :         Real64 PumpEnergy = 0.0;            // pump energy consumption in Joules
     371              :         Real64 PumpMassFlowRate = 0.0;      // mass flow rate through the radiant system in kg/sec
     372              :         Real64 PumpHeattoFluid = 0.0;       // heat transfer rate from pump motor to fluid in Watts
     373              :         Real64 PumpHeattoFluidEnergy = 0.0; // Pump Energy dissipated into fluid stream in Joules
     374              :         Real64 PumpInletTemp = 0.0;         // inlet temperature of pump (inlet temperature from loop)
     375              :         bool setRunningMeanValuesAtBeginningOfDay =
     376              :             true; // flag to help certain variables only being set once per day (running mean temperature variables)
     377              : 
     378              :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     379              : 
     380              :         void
     381              :         calculateLowTemperatureRadiantSystemComponents(EnergyPlusData &state,
     382              :                                                        int const MainLoopNodeIn, // Node number on main loop of the inlet node to the radiant system
     383              :                                                        bool const Iteration,     // FALSE for the regular solution, TRUE when we had to loop back
     384              :                                                        Real64 &LoadMet,          // Load met by the low temperature radiant system, in Watts
     385              :                                                        SystemType typeOfRadiantSystem);
     386              : 
     387              :         void calculateRunningMeanAverageTemperature(EnergyPlusData &state, int const RadSysNum);
     388              : 
     389              :         Real64 calculateCurrentDailyAverageODB(EnergyPlusData &state);
     390              : 
     391              :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     392              : 
     393              :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     394              : 
     395              :         // Default Constructor
     396           44 :         ConstantFlowRadiantSystemData() = default;
     397           54 :         ~ConstantFlowRadiantSystemData() = default;
     398              :     };
     399              : 
     400              :     struct ConstantFlowRadDesignData : ConstantFlowRadiantSystemData
     401              :     {
     402              :         // Members
     403              :         // This data could be shared between multiple constant flow LowTempRad Systems
     404              :         std::string designName; // name of the design object
     405              :         Real64 runningMeanOutdoorAirTemperatureWeightingFactor =
     406              :             0.8;                                       // Weighting factor for running mean outdoor air temperature equation (user input)
     407              :         CtrlType ConstFlowControlType = CtrlType::MAT; // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     408              :                                                        // Surface Face Temp, Surface Interior Temp, Running Mean Temp
     409              :                                                        // for Constant Flow systems only)
     410              :         Real64 TubeDiameterInner = 0.0;                // inside tube diameter for embedded tubing (meters)
     411              :         Real64 TubeDiameterOuter = 0.0;                // outside tube diameter for embedded tubing (meters)
     412              :         FluidToSlabHeatTransferType FluidToSlabHeatTransfer =
     413              :             FluidToSlabHeatTransferType::ConvectionOnly; // Model used for calculating heat transfer between fluid and slab
     414              :         Real64 ConstFlowTubeConductivity = 0.0;          // tube conductivity in W/m-K
     415              :         Real64 MotorEffic = 0.0;                         // efficiency of the pump motor
     416              :         Real64 FracMotorLossToFluid = 0.0;               // amount of heat generated by pump motor that is added to the fluid
     417              : 
     418              :         Array1D_string FieldNames;
     419              :         CondCtrlType condCtrlType = CondCtrlType::SimpleOff; // Condensation control type (initialize to simple off)
     420              :         Real64 CondDewPtDeltaT = 1.0;                        // Diff between surface temperature and dew point for cond. shut-off
     421              : 
     422           10 :         ConstantFlowRadDesignData() = default;
     423           20 :         ~ConstantFlowRadDesignData() = default;
     424              :     };
     425              : 
     426              :     struct ElectricRadiantSystemData : RadiantSystemBaseData
     427              :     {
     428              :         // Members
     429              :         // Input data
     430              :         Real64 MaxElecPower = 0.0;             // Maximum electric power that can be supplied to surface, Watts
     431              :         Real64 ThrottlRange = 0.0;             // Throttling range for heating [C]
     432              :         Sched::Schedule *setptSched = nullptr; // Schedule for the zone setpoint temperature
     433              :         // Other parameters
     434              :         // Report data
     435              :         Real64 ElecPower = 0.0;   // heating sent to panel in Watts
     436              :         Real64 ElecEnergy;        // heating sent to panel in Joules
     437              :         int HeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaledsizing calculation
     438              :         //- (HeatingDesignCapacity, CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     439              :         Real64 ScaledHeatingCapacity =
     440              :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     441              :                  // {-}, or {W/m2}
     442              : 
     443              :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     444              : 
     445              :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     446              : 
     447              :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     448              : 
     449              :         // Default Constructor
     450           28 :         ElectricRadiantSystemData() = default;
     451           28 :         ~ElectricRadiantSystemData() = default;
     452              :     };
     453              : 
     454              :     struct RadSysTypeData
     455              :     {
     456              :         // Members
     457              :         // This type used to track different components/types for efficiency
     458              :         std::string Name;                            // name of radiant system
     459              :         SystemType systemType = SystemType::Invalid; // Type of System (see System Types in Parameters)
     460              :         int CompIndex = 0;                           // Index in specific system types
     461              : 
     462              :         // Default Constructor
     463            8 :         RadSysTypeData() = default;
     464            8 :         ~RadSysTypeData() = default;
     465              :     };
     466              : 
     467              :     struct ElecRadSysNumericFieldData
     468              :     {
     469              :         // Members
     470              :         Array1D_string FieldNames;
     471              : 
     472              :         // Default Constructor
     473           28 :         ElecRadSysNumericFieldData() = default;
     474           28 :         ~ElecRadSysNumericFieldData() = default;
     475              :     };
     476              : 
     477              :     struct HydronicRadiantSysNumericFieldData
     478              :     {
     479              :         // Members
     480              :         Array1D_string FieldNames;
     481              : 
     482              :         // Default Constructor
     483           26 :         HydronicRadiantSysNumericFieldData() = default;
     484           26 :         ~HydronicRadiantSysNumericFieldData() = default;
     485              :     };
     486              : 
     487              :     // Functions
     488              : 
     489              :     void SimLowTempRadiantSystem(EnergyPlusData &state,
     490              :                                  std::string_view CompName,     // name of the low temperature radiant system
     491              :                                  bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     492              :                                  Real64 &LoadMet,               // load met by the radiant system, in Watts
     493              :                                  int &CompIndex);
     494              : 
     495              :     void GetLowTempRadiantSystem(EnergyPlusData &state);
     496              : 
     497              :     void InitLowTempRadiantSystem(EnergyPlusData &state,
     498              :                                   bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     499              :                                   int const RadSysNum, // Index for the low temperature radiant system under consideration within the derived types
     500              :                                   SystemType const systemType, // Type of radiant system: hydronic, constant flow, or electric
     501              :                                   bool &InitErrorFound         // Set to true when a severe or worse error is discovered during initialization
     502              :     );
     503              : 
     504              :     void SizeLowTempRadiantSystem(EnergyPlusData &state,
     505              :                                   int const RadSysNum, // Index for the low temperature radiant system under consideration within the derived types
     506              :                                   SystemType const systemType // Type of radiant system: hydronic, constant flow, or electric
     507              :     );
     508              : 
     509              :     void UpdateRadSysSourceValAvg(EnergyPlusData &state,
     510              :                                   bool &LowTempRadSysOn); // .TRUE. if the radiant system has run this zone time step
     511              : 
     512              : } // namespace LowTempRadiantSystem
     513              : 
     514              : struct LowTempRadiantSystemData : BaseGlobalStruct
     515              : {
     516              : 
     517              :     // DERIVED TYPE DEFINITIONS:
     518              : 
     519              :     // MODULE VARIABLE DECLARATIONS:
     520              :     // Standard, run-of-the-mill variables...
     521              :     int NumOfHydrLowTempRadSys = 0;    // Number of hydronic low tempererature radiant systems
     522              :     int NumOfHydrLowTempRadSysDes = 0; // Number of hydronic low tempererature radiant design systems
     523              :     int NumOfCFloLowTempRadSys = 0;    // Number of constant flow (hydronic) low tempererature radiant systems
     524              :     int NumOfCFloLowTempRadSysDes = 0; // Number of constant flow (hydronic) low tempererature radiant design systems
     525              :     int NumOfElecLowTempRadSys = 0;    // Number of electric low tempererature radiant systems
     526              :     int TotalNumOfRadSystems = 0;      // Total number of low temperature radiant systems
     527              : 
     528              :     bool GetInputFlag = true;
     529              :     int CFloCondIterNum = 0;     // Number of iterations for a constant flow radiant system--controls variable cond sys ctrl
     530              :     int MaxCloNumOfSurfaces = 0; // Used to set allocate size in CalcClo routine
     531              :     bool VarOffCond = false;     // Set to true when in cooling for constant flow system + variable off condensation predicted
     532              :     bool FirstTimeInit = true;   // Set to true for first pass through init routine then set to false
     533              :     bool anyRadiantSystemUsingRunningMeanAverage =
     534              :         false;                // Set to true when there is at least one constant flow radiant system that uses the running mean average
     535              :     Real64 LoopReqTemp = 0.0; // Temperature required at the inlet of the pump (from the loop) to meet control logic
     536              :     std::unordered_map<std::string, std::string> LowTempRadUniqueNames;
     537              :     bool FirstTimeFlag = true; // for setting size of Ckj, Cmj, WaterTempOut arrays // state
     538              :     bool MyEnvrnFlagGeneral = true;
     539              :     bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     540              :     bool MyOneTimeFlag = true;             // Initialization flag
     541              :     bool warnTooLow = false;
     542              :     bool warnTooHigh = false;
     543              : 
     544              :     // Limit temperatures to indicate that a system cannot heat or cannot cool
     545              :     Real64 LowTempHeating = -200.0; // Used to indicate that a user does not have a heating control temperature
     546              :     Real64 HighTempCooling = 200.0; // Used to indicate that a user does not have a cooling control temperature
     547              : 
     548              :     Array1D<Real64> Ckj; // Coefficients for individual surfaces within a radiant system
     549              :     Array1D<Real64> Cmj;
     550              :     Array1D<Real64> WaterTempOut; // Array of outlet water temperatures for
     551              :     // each surface in the radiant system
     552              : 
     553              :     // For Init:
     554              :     Array1D_bool MyEnvrnFlagHydr;
     555              :     Array1D_bool MyEnvrnFlagCFlo;
     556              :     Array1D_bool MyEnvrnFlagElec;
     557              :     Array1D_bool MyPlantScanFlagHydr;
     558              :     Array1D_bool MyPlantScanFlagCFlo;
     559              :     // Autosizing variables
     560              :     Array1D_bool MySizeFlagHydr;
     561              :     Array1D_bool MySizeFlagCFlo;
     562              :     Array1D_bool MySizeFlagElec;
     563              :     Array1D_bool CheckEquipName;
     564              : 
     565              :     // Object Data
     566              :     Array1D<LowTempRadiantSystem::VariableFlowRadiantSystemData> HydrRadSys;
     567              :     Array1D<LowTempRadiantSystem::ConstantFlowRadiantSystemData> CFloRadSys;
     568              :     Array1D<LowTempRadiantSystem::ElectricRadiantSystemData> ElecRadSys;
     569              :     Array1D<LowTempRadiantSystem::RadSysTypeData> RadSysTypes;
     570              :     Array1D<LowTempRadiantSystem::ElecRadSysNumericFieldData> ElecRadSysNumericFields;
     571              :     Array1D<LowTempRadiantSystem::HydronicRadiantSysNumericFieldData> HydronicRadiantSysNumericFields;
     572              :     Array1D<LowTempRadiantSystem::ConstantFlowRadDesignData> CflowRadiantSysDesign;
     573              :     Array1D<LowTempRadiantSystem::VarFlowRadDesignData> HydronicRadiantSysDesign;
     574              : 
     575         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     576              :     {
     577         2126 :     }
     578              : 
     579         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     580              :     {
     581         1152 :     }
     582              : 
     583         2107 :     void clear_state() override
     584              :     {
     585         2107 :         LowTempHeating = -200.0;
     586         2107 :         HighTempCooling = 200.0;
     587         2107 :         NumOfHydrLowTempRadSys = 0;
     588         2107 :         NumOfHydrLowTempRadSysDes = 0;
     589         2107 :         NumOfCFloLowTempRadSys = 0;
     590         2107 :         NumOfCFloLowTempRadSysDes = 0;
     591         2107 :         NumOfElecLowTempRadSys = 0;
     592         2107 :         TotalNumOfRadSystems = 0;
     593              : 
     594              :         // These are in the state space for Unit tests to work properly
     595         2107 :         CFloCondIterNum = 0;
     596         2107 :         MaxCloNumOfSurfaces = 0;
     597         2107 :         VarOffCond = false;
     598         2107 :         FirstTimeInit = true;
     599         2107 :         anyRadiantSystemUsingRunningMeanAverage = false;
     600         2107 :         LoopReqTemp = 0.0;
     601         2107 :         LowTempRadUniqueNames.clear();
     602         2107 :         GetInputFlag = true;
     603         2107 :         FirstTimeFlag = true;
     604         2107 :         MyEnvrnFlagGeneral = true;
     605         2107 :         ZoneEquipmentListChecked = false;
     606         2107 :         MyOneTimeFlag = true;
     607         2107 :         warnTooLow = false;
     608         2107 :         warnTooHigh = false;
     609              :         //
     610              : 
     611         2107 :         Ckj.clear();
     612         2107 :         Cmj.clear();
     613         2107 :         WaterTempOut.clear();
     614         2107 :         MyEnvrnFlagHydr.clear();
     615         2107 :         MyEnvrnFlagCFlo.clear();
     616         2107 :         MyEnvrnFlagElec.clear();
     617         2107 :         MyPlantScanFlagHydr.clear();
     618         2107 :         MyPlantScanFlagCFlo.clear();
     619         2107 :         MySizeFlagHydr.clear();
     620         2107 :         MySizeFlagCFlo.clear();
     621         2107 :         MySizeFlagElec.clear();
     622         2107 :         CheckEquipName.clear();
     623         2107 :         HydrRadSys.clear(); //
     624         2107 :         CFloRadSys.clear();
     625         2107 :         ElecRadSys.clear();
     626         2107 :         RadSysTypes.clear();
     627         2107 :         ElecRadSysNumericFields.clear();
     628         2107 :         HydronicRadiantSysNumericFields.clear();
     629         2107 :         HydronicRadiantSysDesign.clear();
     630         2107 :         CflowRadiantSysDesign.clear();
     631         2107 :     }
     632              : };
     633              : 
     634              : } // namespace EnergyPlus
     635              : 
     636              : #endif
        

Generated by: LCOV version 2.0-1