LCOV - code coverage report
Current view: top level - EnergyPlus - LowTempRadiantSystem.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 31 80 38.8 %
Date: 2023-01-17 19:17:23 Functions: 32 43 74.4 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef 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     1673183 :     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             :         LowTempRadiantControlTypes controlType = LowTempRadiantControlTypes::MATControl; // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     154             :                                                                                          // Surface Face Temp, Surface Interior Temp, Running Mean
     155             :                                                                                          // Temp for Constant Flow systems only)
     156             :         LowTempRadiantSetpointTypes SetpointType =
     157             :             LowTempRadiantSetpointTypes::HalfFlowPower; // Setpoint type for the syste, (HalfFlowPower or ZeroFlowPower)
     158             :         int OperatingMode = NotOperating;               // Operating mode currently being used (NotOperating, Heating, Cooling)
     159             :         Real64 HeatPower;                               // heating sent to panel in Watts
     160             :         Real64 HeatEnergy;                              // heating sent to panel in Joules
     161             :         Real64 runningMeanOutdoorAirTemperatureWeightingFactor =
     162             :             0.0;                                                    // Weighting factor for running mean outdoor air temperature equation (user input)
     163             :         Real64 todayRunningMeanOutdoorDryBulbTemperature = 0.0;     // Current running mean outdoor air dry-bulb temperature
     164             :         Real64 yesterdayRunningMeanOutdoorDryBulbTemperature = 0.0; // Running mean outdoor air dry-bulb temperature from yesterday
     165             :         Real64 todayAverageOutdoorDryBulbTemperature = 0.0;         // Average outdoor dry-bulb temperature for today
     166             :         Real64 yesterdayAverageOutdoorDryBulbTemperature = 0.0;     // Average outdoor dry-bulb temperature for yesterday
     167             : 
     168             :         LowTempRadiantControlTypes processRadiantSystemControlInput(EnergyPlusData &state,
     169             :                                                                     std::string const &controlInput,
     170             :                                                                     std::string const &controlInputField,
     171             :                                                                     LowTempRadiantSystem::SystemType typeOfRadiantSystem);
     172             : 
     173             :         LowTempRadiantSetpointTypes
     174             :         processRadiantSystemSetpointInput(EnergyPlusData &state, std::string const &controlInput, std::string const &controlInputField);
     175             : 
     176             :         void errorCheckZonesAndConstructions(EnergyPlusData &state, bool &errorsFound);
     177             : 
     178             :         Real64 setRadiantSystemControlTemperature(EnergyPlusData &state, LowTempRadiantControlTypes 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             :                                                             int const scheduleIndex,
     186             :                                                             Real64 const throttlingRange,
     187             :                                                             LowTempRadiantSetpointTypes 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         145 :         RadiantSystemBaseData() = default;
     197     1673328 :         ~RadiantSystemBaseData() = default;
     198             :     };
     199             : 
     200     1673174 :     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             :         int GlycolIndex = 0;             // Index to Glycol (Water) Properties
     214             :         int CondErrIndex = 0;            // Error index for recurring warning messages
     215             :         Real64 CondCausedTimeOff = 0.0;  // Amount of time condensation did or could have turned system off
     216             :         bool CondCausedShutDown = false; // .TRUE. when condensation predicted at surface
     217             :         CircuitCalc NumCircCalcMethod =
     218             :             CircuitCalc::Invalid;             // Calculation method for number of circuits per surface; 1=1 per surface, 2=use cicuit length
     219             :         Real64 CircLength = 0.0;              // Circuit length {m}
     220             :         std::string schedNameChangeoverDelay; // changeover delay schedule
     221             :         int schedPtrChangeoverDelay = 0;      // Pointer to the schedule for the changeover delay in hours
     222             :         int lastOperatingMode = NotOperating; // 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             :         FluidToSlabHeatTransferTypes getFluidToSlabHeatTransferInput(EnergyPlusData &state, std::string const &userInput);
     242             : 
     243             :         Real64 calculateHXEffectivenessTerm(EnergyPlusData &state,
     244             :                                             int const SurfNum,          // Surface Number
     245             :                                             Real64 const Temperature,   // Temperature of water entering the radiant system, in C
     246             :                                             Real64 const WaterMassFlow, // Mass flow rate of water in the radiant system, in kg/s
     247             :                                             Real64 const FlowFraction,  // Mass flow rate fraction for this surface in the radiant system
     248             :                                             Real64 const NumCircs,      // Number of fluid circuits in this surface
     249             :                                             int const DesignObjPtr,     // Design Object Pointer,
     250             :                                             LowTempRadiantSystem::SystemType typeOfRadiantSystem
     251             : 
     252             :         );
     253             : 
     254             :         Real64 calculateUFromISOStandard(EnergyPlusData &state,
     255             :                                          int const SurfNum,
     256             :                                          Real64 const WaterMassFlow,
     257             :                                          SystemType typeOfRadiantSystem,
     258             :                                          int const DesignObjPtr // Design Object Pointer
     259             :         );
     260             : 
     261             :         Real64 sizeRadiantSystemTubeLength(EnergyPlusData &state);
     262             : 
     263             :         void checkForOutOfRangeTemperatureResult(EnergyPlusData &state, Real64 const outletTemp, Real64 const inletTemp);
     264             : 
     265             :         // Default Constructor
     266         116 :         HydronicSystemBaseData() = default;
     267     1673290 :         ~HydronicSystemBaseData() = default;
     268             :     };
     269             : 
     270     1015116 :     struct VariableFlowRadiantSystemData : HydronicSystemBaseData
     271             :     {
     272             :         // Members
     273             :         std::string designObjectName; // Design Object
     274             :         int DesignObjectPtr = 0;
     275             :         int HeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaled sizing calculation (HeatingDesignCapacity,
     276             :         // CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     277             :         Real64 ScaledHeatingCapacity =
     278             :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     279             :         Real64 WaterVolFlowMaxHeat = 0.0; // maximum water flow rate for heating, m3/s
     280             :         Real64 WaterFlowMaxHeat = 0.0;    // maximum water flow rate for heating, kg/s
     281             :         Real64 WaterVolFlowMaxCool = 0.0; // maximum water flow rate for cooling, m3/s
     282             :         Real64 WaterFlowMaxCool = 0.0;    // maximum water flow rate for cooling, kg/s
     283             :         Real64 WaterMassFlowRate = 0.0;   // water mass flow rate
     284             :         int CoolingCapMethod = 0;         // - Method for Low Temp Radiant system cooling capacity scaled sizing calculation (CoolingDesignCapacity,
     285             :         // CapacityPerFloorArea, FracOfAutosizedCoolingCapacity)
     286             :         Real64 ScaledCoolingCapacity =
     287             :             0.0; // -  Low Temp Radiant system scaled maximum cooling capacity {W} or scalable variable of zone HVAC equipment,
     288             :         // {-}, or {W/m2}
     289             : 
     290             :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     291             : 
     292             :         void
     293             :         calculateLowTemperatureRadiantSystemComponents(EnergyPlusData &state, Real64 &LoadMet, LowTempRadiantSystem::SystemType typeOfRadiantSystem);
     294             : 
     295             :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     296             : 
     297             :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     298             : 
     299             :         // Default Constructor
     300          58 :         VariableFlowRadiantSystemData() = default;
     301     1015174 :         ~VariableFlowRadiantSystemData() = default;
     302             :     };
     303             : 
     304     1015070 :     struct VarFlowRadDesignData : VariableFlowRadiantSystemData
     305             :     {
     306             :         // Members
     307             :         // This data could be shared between multiple Var flow LowTempRad Systems
     308             :         std::string designName;         // name of the design object+
     309             :         Real64 TubeDiameterInner = 0.0; // inside tube diameter for embedded tubing (meters)
     310             :         Real64 TubeDiameterOuter = 0.0; // outside tube diameter for embedded tubing (meters)
     311             :         FluidToSlabHeatTransferTypes FluidToSlabHeatTransfer =
     312             :             FluidToSlabHeatTransferTypes::ConvectionOnly; // Model used for calculating heat transfer between fluid and slab
     313             :         Real64 VarFlowTubeConductivity = 0.0;             // tube conductivity in W/m-K
     314             :         LowTempRadiantControlTypes VarFlowControlType =
     315             :             LowTempRadiantControlTypes::MATControl; // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     316             :         // Surface Face Temp, Surface Interior Temp, Running Mean Temp
     317             :         // for Constant Flow systems only)
     318             :         LowTempRadiantSetpointTypes VarFlowSetpointType =
     319             :             LowTempRadiantSetpointTypes::HalfFlowPower; // Setpoint type for the syste, (HalfFlowPower or ZeroFlowPower)
     320             :         std::string DesignHeatingCapMethodInput;
     321             :         int DesignHeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaledsizing calculation (HeatingDesignCapacity,
     322             :         // CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     323             :         Real64 DesignScaledHeatingCapacity =
     324             :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     325             :         // {-}, or {W/m2}
     326             :         Real64 HotThrottlRange = 0.0;  // Throttling range for heating [C]
     327             :         std::string HotSetptSched;     // Schedule name for the zone setpoint temperature
     328             :         int HotSetptSchedPtr = 0;      // Schedule index for the zone setpoint temperature
     329             :         Real64 ColdThrottlRange = 0.0; // Throttling range for cooling [C]
     330             :         Array1D_string FieldNames;
     331             :         CondContrlType CondCtrlType = CondContrlType::CondCtrlSimpleOff; // Condensation control type (initialize to simple off)
     332             :         Real64 CondDewPtDeltaT = 1.0;                                    // Diff between surface temperature and dew point for cond. shut-off
     333             :         std::string ColdSetptSched;                                      // Schedule name for the zone setpoint temperature
     334             :         int ColdSetptSchedPtr = 0;                                       // Schedule index for the zone setpoint temperature
     335             :         std::string DesignCoolingCapMethodInput;
     336             :         int DesignCoolingCapMethod = 0; // - Method for Low Temp Radiant system cooling capacity scaledsizing calculation (CoolingDesignCapacity,
     337             :                                         // CapacityPerFloorArea, FracOfAutosizedCoolingCapacity)
     338             :         Real64 DesignScaledCoolingCapacity =
     339             :             0.0; // -  Low Temp Radiant system scaled maximum cooling capacity {W} or scalable variable of zone HVAC equipment,
     340             :                  // {-}, or {W/m2}
     341             : 
     342             :         // Default Constructor
     343          29 :         VarFlowRadDesignData() = default;
     344     1015099 :         ~VarFlowRadDesignData() = default;
     345             :     };
     346             : 
     347      658058 :     struct ConstantFlowRadiantSystemData : HydronicSystemBaseData
     348             :     {
     349             :         // Members
     350             :         Real64 WaterVolFlowMax; // design nominal capacity of constant flow pump (volumetric flow rate)
     351             :         Real64 ColdDesignWaterMassFlowRate;
     352             :         Real64 HotDesignWaterMassFlowRate;
     353             :         Real64 WaterMassFlowRate = 0.0;    // current flow rate through system (calculated)
     354             :         Real64 HotWaterMassFlowRate = 0.0; // current hot water flow rate through heating side of system (calculated)
     355             :         Real64 ChWaterMassFlowRate = 0.0;  // current chilled water flow rate through cooling side of system (calculated)
     356             :         std::string VolFlowSched;          // schedule of maximum flow at the current time
     357             :         std::string designObjectName;      // Design Object
     358             :         int DesignObjectPtr = 0;
     359             :         int VolFlowSchedPtr = 0;         // index to the volumetric flow schedule
     360             :         Real64 NomPumpHead = 0.0;        // nominal head of the constant flow pump
     361             :         Real64 NomPowerUse = 0.0;        // nominal power use of the constant flow pump
     362             :         Real64 PumpEffic = 0.0;          // overall efficiency of the pump (calculated)
     363             :         std::string HotWaterHiTempSched; // Schedule name for the highest water temperature
     364             :         int HotWaterHiTempSchedPtr = 0;  // Schedule index for the highest water temperature
     365             :         std::string HotWaterLoTempSched; // Schedule name for the lowest water temperature
     366             :         int HotWaterLoTempSchedPtr = 0;  // Schedule index for the lowest water temperature
     367             :         std::string HotCtrlHiTempSched;  // Schedule name for the highest control temperature
     368             :         // (where the lowest water temperature is requested)
     369             :         int HotCtrlHiTempSchedPtr = 0; // Schedule index for the highest control temperature
     370             :         // (where the lowest water temperature is requested)
     371             :         std::string HotCtrlLoTempSched; // Schedule name for the lowest control temperature
     372             :         // (where the highest water temperature is requested)
     373             :         int HotCtrlLoTempSchedPtr = 0; // Schedule index for the lowest control temperature
     374             :         // (where the highest water temperature is requested)
     375             :         std::string ColdWaterHiTempSched; // Schedule name for the highest water temperature
     376             :         int ColdWaterHiTempSchedPtr = 0;  // Schedule index for the highest water temperature
     377             :         std::string ColdWaterLoTempSched; // Schedule name for the lowest water temperature
     378             :         int ColdWaterLoTempSchedPtr = 0;  // Schedule index for the lowest water temperature
     379             :         std::string ColdCtrlHiTempSched;  // Schedule name for the highest control temperature
     380             :         // (where the lowest water temperature is requested)
     381             :         int ColdCtrlHiTempSchedPtr = 0; // Schedule index for the highest control temperature
     382             :         // (where the lowest water temperature is requested)
     383             :         std::string ColdCtrlLoTempSched; // Schedule name for the lowest control temperature
     384             :         // (where the highest water temperature is requested)
     385             :         int ColdCtrlLoTempSchedPtr = 0; // Schedule index for the lowest control temperature
     386             :         // (where the highest water temperature is requested)
     387             :         Real64 WaterInjectionRate = 0.0;    // water injection mass flow rate from main loop
     388             :         Real64 WaterRecircRate = 0.0;       // water recirculation rate (outlet from radiant system recirculated)
     389             :         Real64 PumpPower = 0.0;             // pump power in Watts
     390             :         Real64 PumpEnergy = 0.0;            // pump energy consumption in Joules
     391             :         Real64 PumpMassFlowRate = 0.0;      // mass flow rate through the radiant system in kg/sec
     392             :         Real64 PumpHeattoFluid = 0.0;       // heat transfer rate from pump motor to fluid in Watts
     393             :         Real64 PumpHeattoFluidEnergy = 0.0; // Pump Energy dissipated into fluid stream in Joules
     394             :         Real64 PumpInletTemp = 0.0;         // inlet temperature of pump (inlet temperature from loop)
     395             :         bool setRunningMeanValuesAtBeginningOfDay =
     396             :             true; // flag to help certain variables only being set once per day (running mean temperature variables)
     397             : 
     398             :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     399             : 
     400             :         void
     401             :         calculateLowTemperatureRadiantSystemComponents(EnergyPlusData &state,
     402             :                                                        int const MainLoopNodeIn, // Node number on main loop of the inlet node to the radiant system
     403             :                                                        bool const Iteration,     // FALSE for the regular solution, TRUE when we had to loop back
     404             :                                                        Real64 &LoadMet,          // Load met by the low temperature radiant system, in Watts
     405             :                                                        LowTempRadiantSystem::SystemType typeOfRadiantSystem);
     406             : 
     407             :         void calculateRunningMeanAverageTemperature(EnergyPlusData &state, int const RadSysNum);
     408             : 
     409             :         Real64 calculateCurrentDailyAverageODB(EnergyPlusData &state);
     410             : 
     411             :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     412             : 
     413             :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     414             : 
     415             :         // Default Constructor
     416          58 :         ConstantFlowRadiantSystemData() = default;
     417      658116 :         ~ConstantFlowRadiantSystemData() = default;
     418             :     };
     419             : 
     420      658031 :     struct ConstantFlowRadDesignData : ConstantFlowRadiantSystemData
     421             :     {
     422             :         // Members
     423             :         // This data could be shared between multiple constant flow LowTempRad Systems
     424             :         std::string designName; // name of the design object
     425             :         Real64 runningMeanOutdoorAirTemperatureWeightingFactor =
     426             :             0.8; // Weighting factor for running mean outdoor air temperature equation (user input)
     427             :         LowTempRadiantControlTypes ConstFlowControlType =
     428             :             LowTempRadiantControlTypes::MATControl; // Control type for the system (MAT, MRT, Op temp, ODB, OWB,
     429             :                                                     // Surface Face Temp, Surface Interior Temp, Running Mean Temp
     430             :                                                     // for Constant Flow systems only)
     431             :         Real64 TubeDiameterInner = 0.0;             // inside tube diameter for embedded tubing (meters)
     432             :         Real64 TubeDiameterOuter = 0.0;             // outside tube diameter for embedded tubing (meters)
     433             :         FluidToSlabHeatTransferTypes FluidToSlabHeatTransfer =
     434             :             FluidToSlabHeatTransferTypes::ConvectionOnly; // Model used for calculating heat transfer between fluid and slab
     435             :         Real64 ConstFlowTubeConductivity = 0.0;           // tube conductivity in W/m-K
     436             :         Real64 MotorEffic = 0.0;                          // efficiency of the pump motor
     437             :         Real64 FracMotorLossToFluid = 0.0;                // amount of heat generated by pump motor that is added to the fluid
     438             : 
     439             :         Array1D_string FieldNames;
     440             :         CondContrlType CondCtrlType = CondContrlType::CondCtrlSimpleOff; // Condensation control type (initialize to simple off)
     441             :         Real64 CondDewPtDeltaT = 1.0;                                    // Diff between surface temperature and dew point for cond. shut-off
     442             : 
     443          29 :         ConstantFlowRadDesignData() = default;
     444      658060 :         ~ConstantFlowRadDesignData() = default;
     445             :     };
     446             : 
     447           9 :     struct ElectricRadiantSystemData : RadiantSystemBaseData
     448             :     {
     449             :         // Members
     450             :         // Input data
     451             :         Real64 MaxElecPower = 0.0; // Maximum electric power that can be supplied to surface, Watts
     452             :         Real64 ThrottlRange = 0.0; // Throttling range for heating [C]
     453             :         std::string SetptSched;    // Schedule name for the zone setpoint temperature
     454             :         int SetptSchedPtr = 0;     // Schedule index for the zone setpoint temperature
     455             :         // Other parameters
     456             :         // Report data
     457             :         Real64 ElecPower = 0.0;   // heating sent to panel in Watts
     458             :         Real64 ElecEnergy;        // heating sent to panel in Joules
     459             :         int HeatingCapMethod = 0; // - Method for Low Temp Radiant system heating capacity scaledsizing calculation
     460             :         //- (HeatingDesignCapacity, CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     461             :         Real64 ScaledHeatingCapacity =
     462             :             0.0; // -  Low Temp Radiant system scaled maximum heating capacity {W} or scalable variable of zone HVAC equipment,
     463             :                  // {-}, or {W/m2}
     464             : 
     465             :         void calculateLowTemperatureRadiantSystem(EnergyPlusData &state, Real64 &LoadMet);
     466             : 
     467             :         void updateLowTemperatureRadiantSystem(EnergyPlusData &state);
     468             : 
     469             :         void reportLowTemperatureRadiantSystem(EnergyPlusData &state);
     470             : 
     471             :         // Default Constructor
     472          29 :         ElectricRadiantSystemData() = default;
     473          38 :         ~ElectricRadiantSystemData() = default;
     474             :     };
     475             : 
     476          82 :     struct RadSysTypeData
     477             :     {
     478             :         // Members
     479             :         // This type used to track different components/types for efficiency
     480             :         std::string Name;                                                                        // name of radiant system
     481             :         LowTempRadiantSystem::SystemType SystemType = LowTempRadiantSystem::SystemType::Invalid; // Type of System (see System Types in Parameters)
     482             :         int CompIndex = 0;                                                                       // Index in specific system types
     483             : 
     484             :         // Default Constructor
     485          29 :         RadSysTypeData() = default;
     486         111 :         ~RadSysTypeData() = default;
     487             :     };
     488             : 
     489           9 :     struct ElecRadSysNumericFieldData
     490             :     {
     491             :         // Members
     492             :         Array1D_string FieldNames;
     493             : 
     494             :         // Default Constructor
     495          29 :         ElecRadSysNumericFieldData() = default;
     496          38 :         ~ElecRadSysNumericFieldData() = default;
     497             :     };
     498             : 
     499          46 :     struct HydronicRadiantSysNumericFieldData
     500             :     {
     501             :         // Members
     502             :         Array1D_string FieldNames;
     503             : 
     504             :         // Default Constructor
     505          29 :         HydronicRadiantSysNumericFieldData() = default;
     506          75 :         ~HydronicRadiantSysNumericFieldData() = default;
     507             :     };
     508             : 
     509             :     // Functions
     510             : 
     511             :     void SimLowTempRadiantSystem(EnergyPlusData &state,
     512             :                                  std::string_view CompName,     // name of the low temperature radiant system
     513             :                                  bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     514             :                                  Real64 &LoadMet,               // load met by the radiant system, in Watts
     515             :                                  int &CompIndex);
     516             : 
     517             :     void GetLowTempRadiantSystem(EnergyPlusData &state);
     518             : 
     519             :     void InitLowTempRadiantSystem(EnergyPlusData &state,
     520             :                                   bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     521             :                                   int const RadSysNum, // Index for the low temperature radiant system under consideration within the derived types
     522             :                                   LowTempRadiantSystem::SystemType const SystemType, // Type of radiant system: hydronic, constant flow, or electric
     523             :                                   bool &InitErrorFound // Set to true when a severe or worse error is discovered during initialization
     524             :     );
     525             : 
     526             :     void SizeLowTempRadiantSystem(EnergyPlusData &state,
     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             :     );
     530             : 
     531             :     void UpdateRadSysSourceValAvg(EnergyPlusData &state,
     532             :                                   bool &LowTempRadSysOn); // .TRUE. if the radiant system has run this zone time step
     533             : 
     534             : } // namespace LowTempRadiantSystem
     535             : 
     536        1542 : struct LowTempRadiantSystemData : BaseGlobalStruct
     537             : {
     538             : 
     539             :     // DERIVED TYPE DEFINITIONS:
     540             : 
     541             :     // MODULE VARIABLE DECLARATIONS:
     542             :     // Standard, run-of-the-mill variables...
     543             :     int NumOfHydrLowTempRadSys = 0;    // Number of hydronic low tempererature radiant systems
     544             :     int NumOfHydrLowTempRadSysDes = 0; // Number of hydronic low tempererature radiant design systems
     545             :     int NumOfCFloLowTempRadSys = 0;    // Number of constant flow (hydronic) low tempererature radiant systems
     546             :     int NumOfCFloLowTempRadSysDes = 0; // Number of constant flow (hydronic) low tempererature radiant design systems
     547             :     int NumOfElecLowTempRadSys = 0;    // Number of electric low tempererature radiant systems
     548             :     int TotalNumOfRadSystems = 0;      // Total number of low temperature radiant systems
     549             : 
     550             :     bool GetInputFlag = true;
     551             :     int CFloCondIterNum = 0;     // Number of iterations for a constant flow radiant system--controls variable cond sys ctrl
     552             :     int MaxCloNumOfSurfaces = 0; // Used to set allocate size in CalcClo routine
     553             :     bool VarOffCond = false;     // Set to true when in cooling for constant flow system + variable off condensation predicted
     554             :     bool FirstTimeInit = true;   // Set to true for first pass through init routine then set to false
     555             :     bool anyRadiantSystemUsingRunningMeanAverage =
     556             :         false;                // Set to true when there is at least one constant flow radiant system that uses the running mean average
     557             :     Real64 LoopReqTemp = 0.0; // Temperature required at the inlet of the pump (from the loop) to meet control logic
     558             :     std::unordered_map<std::string, std::string> LowTempRadUniqueNames;
     559             :     bool FirstTimeFlag = true; // for setting size of Ckj, Cmj, WaterTempOut arrays // state
     560             :     bool MyEnvrnFlagGeneral = true;
     561             :     bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     562             :     bool MyOneTimeFlag = true;             // Initialization flag
     563             :     bool warnTooLow = false;
     564             :     bool warnTooHigh = false;
     565             : 
     566             :     // Limit temperatures to indicate that a system cannot heat or cannot cool
     567             :     Real64 LowTempHeating = -200.0; // Used to indicate that a user does not have a heating control temperature
     568             :     Real64 HighTempCooling = 200.0; // Used to indicate that a user does not have a cooling control temperature
     569             : 
     570             :     Array1D<Real64> QRadSysSrcAvg;        // Average source over the time step for a particular radiant surface
     571             :     Array1D<Real64> ZeroSourceSumHATsurf; // Equal to SumHATsurf for all the walls in a zone with no source
     572             :     // Record keeping variables used to calculate QRadSysSrcAvg locally
     573             :     Array1D<Real64> LastQRadSysSrc;     // Need to keep the last value in case we are still iterating
     574             :     Array1D<Real64> LastSysTimeElapsed; // Need to keep the last value in case we are still iterating
     575             :     Array1D<Real64> LastTimeStepSys;    // Need to keep the last value in case we are still iterating
     576             : 
     577             :     Array1D<Real64> Ckj; // Coefficients for individual surfaces within a radiant system
     578             :     Array1D<Real64> Cmj;
     579             :     Array1D<Real64> WaterTempOut; // Array of outlet water temperatures for
     580             :     // each surface in the radiant system
     581             : 
     582             :     // For Init:
     583             :     Array1D_bool MyEnvrnFlagHydr;
     584             :     Array1D_bool MyEnvrnFlagCFlo;
     585             :     Array1D_bool MyEnvrnFlagElec;
     586             :     Array1D_bool MyPlantScanFlagHydr;
     587             :     Array1D_bool MyPlantScanFlagCFlo;
     588             :     // Autosizing variables
     589             :     Array1D_bool MySizeFlagHydr;
     590             :     Array1D_bool MySizeFlagCFlo;
     591             :     Array1D_bool MySizeFlagElec;
     592             :     Array1D_bool CheckEquipName;
     593             : 
     594             :     // Object Data
     595             :     Array1D<LowTempRadiantSystem::VariableFlowRadiantSystemData> HydrRadSys;
     596             :     Array1D<LowTempRadiantSystem::ConstantFlowRadiantSystemData> CFloRadSys;
     597             :     Array1D<LowTempRadiantSystem::ElectricRadiantSystemData> ElecRadSys;
     598             :     Array1D<LowTempRadiantSystem::RadSysTypeData> RadSysTypes;
     599             :     Array1D<LowTempRadiantSystem::ElecRadSysNumericFieldData> ElecRadSysNumericFields;
     600             :     Array1D<LowTempRadiantSystem::HydronicRadiantSysNumericFieldData> HydronicRadiantSysNumericFields;
     601             :     Array1D<LowTempRadiantSystem::ConstantFlowRadDesignData> CflowRadiantSysDesign;
     602             :     Array1D<LowTempRadiantSystem::VarFlowRadDesignData> HydronicRadiantSysDesign;
     603             : 
     604           0 :     void clear_state() override
     605             :     {
     606           0 :         LowTempHeating = -200.0;
     607           0 :         HighTempCooling = 200.0;
     608           0 :         NumOfHydrLowTempRadSys = 0;
     609           0 :         NumOfHydrLowTempRadSysDes = 0;
     610           0 :         NumOfCFloLowTempRadSys = 0;
     611           0 :         NumOfCFloLowTempRadSysDes = 0;
     612           0 :         NumOfElecLowTempRadSys = 0;
     613           0 :         TotalNumOfRadSystems = 0;
     614             : 
     615             :         // These are in the state space for Unit tests to work properly
     616           0 :         CFloCondIterNum = 0;
     617           0 :         MaxCloNumOfSurfaces = 0;
     618           0 :         VarOffCond = false;
     619           0 :         FirstTimeInit = true;
     620           0 :         anyRadiantSystemUsingRunningMeanAverage = false;
     621           0 :         LoopReqTemp = 0.0;
     622           0 :         LowTempRadUniqueNames.clear();
     623           0 :         GetInputFlag = true;
     624           0 :         FirstTimeFlag = true;
     625           0 :         MyEnvrnFlagGeneral = true;
     626           0 :         ZoneEquipmentListChecked = false;
     627           0 :         MyOneTimeFlag = true;
     628           0 :         warnTooLow = false;
     629           0 :         warnTooHigh = false;
     630             :         //
     631             : 
     632           0 :         QRadSysSrcAvg.clear();
     633           0 :         ZeroSourceSumHATsurf.clear();
     634           0 :         LastQRadSysSrc.clear();
     635           0 :         LastSysTimeElapsed.clear();
     636           0 :         LastTimeStepSys.clear();
     637           0 :         Ckj.clear();
     638           0 :         Cmj.clear();
     639           0 :         WaterTempOut.clear();
     640           0 :         MyEnvrnFlagHydr.clear();
     641           0 :         MyEnvrnFlagCFlo.clear();
     642           0 :         MyEnvrnFlagElec.clear();
     643           0 :         MyPlantScanFlagHydr.clear();
     644           0 :         MyPlantScanFlagCFlo.clear();
     645           0 :         MySizeFlagHydr.clear();
     646           0 :         MySizeFlagCFlo.clear();
     647           0 :         MySizeFlagElec.clear();
     648           0 :         CheckEquipName.clear();
     649           0 :         HydrRadSys.clear(); //
     650           0 :         CFloRadSys.clear();
     651           0 :         ElecRadSys.clear();
     652           0 :         RadSysTypes.clear();
     653           0 :         ElecRadSysNumericFields.clear();
     654           0 :         HydronicRadiantSysNumericFields.clear();
     655           0 :         HydronicRadiantSysDesign.clear();
     656           0 :         CflowRadiantSysDesign.clear();
     657           0 :     }
     658             : };
     659             : 
     660             : } // namespace EnergyPlus
     661             : 
     662             : #endif

Generated by: LCOV version 1.13