LCOV - code coverage report
Current view: top level - EnergyPlus - LowTempRadiantSystem.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 22 66 33.3 %
Date: 2024-08-24 18:31:18 Functions: 21 22 95.5 %

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

Generated by: LCOV version 1.14