LCOV - code coverage report
Current view: top level - EnergyPlus - GroundHeatExchangers.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 24 47 51.1 %
Date: 2023-01-17 19:17:23 Functions: 17 29 58.6 %

          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 GroundHeatExchangers_hh_INCLUDED
      49             : #define GroundHeatExchangers_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // JSON Headers
      55             : #include <nlohmann/json.hpp>
      56             : 
      57             : // EnergyPlus Headers
      58             : #include <EnergyPlus/Data/BaseData.hh>
      59             : #include <EnergyPlus/DataGlobals.hh>
      60             : #include <EnergyPlus/EnergyPlus.hh>
      61             : #include <EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh>
      62             : #include <EnergyPlus/Plant/Enums.hh>
      63             : #include <EnergyPlus/Plant/PlantLocation.hh>
      64             : #include <EnergyPlus/PlantComponent.hh>
      65             : 
      66             : namespace EnergyPlus {
      67             : 
      68             : // Forward declarations
      69             : struct EnergyPlusData;
      70             : 
      71             : namespace GroundHeatExchangers {
      72             : 
      73             :     // Using/Aliasing
      74             :     using namespace GroundTemperatureManager;
      75             : 
      76             :     struct ThermophysicalProps // LCOV_EXCL_LINE
      77             :     {
      78             :         // Destructor
      79         113 :         virtual ~ThermophysicalProps() = default;
      80             : 
      81             :         Real64 k;           // Thermal conductivity [W/m-K]
      82             :         Real64 rho;         // Density [kg/m3]
      83             :         Real64 cp;          // Specific heat [J/kg-K]
      84             :         Real64 rhoCp;       // Specific heat capacity [J/kg-K]
      85             :         Real64 diffusivity; // Thermal diffusivity [m2/s]
      86             : 
      87         113 :         ThermophysicalProps() : k(0.0), rho(0.0), cp(0.0), rhoCp(0.0), diffusivity(0.0)
      88             :         {
      89         113 :         }
      90             :     };
      91             : 
      92             :     struct PipeProps : ThermophysicalProps // LCOV_EXCL_LINE
      93             :     {
      94             :         // Destructor
      95          45 :         ~PipeProps() override = default;
      96             : 
      97             :         // Members
      98             :         Real64 outDia;      // Outer diameter of the pipe [m]
      99             :         Real64 innerDia;    // Inner diameter of the pipe [m]
     100             :         Real64 outRadius;   // Outer radius of the pipe [m]
     101             :         Real64 innerRadius; // Inner radius of the pipe [m]
     102             :         Real64 thickness;   // Thickness of the pipe wall [m]
     103             : 
     104          45 :         PipeProps() : outDia(0.0), innerDia(0.0), outRadius(0.0), innerRadius(0.0), thickness(0.0)
     105             :         {
     106          45 :         }
     107             :     };
     108             : 
     109             :     struct GLHEVertProps
     110             :     {
     111             :         // Destructor
     112          22 :         ~GLHEVertProps() = default;
     113             : 
     114             :         // Members
     115             :         std::string const moduleName = "GroundHeatExchanger:Vertical:Properties";
     116             :         std::string name;          // Name
     117             :         Real64 bhTopDepth;         // Depth of top of borehole {m}
     118             :         Real64 bhLength;           // Length of borehole from top of borehole {m}
     119             :         Real64 bhDiameter;         // Diameter of borehole {m}
     120             :         ThermophysicalProps grout; // Grout properties
     121             :         PipeProps pipe;            // Pipe properties
     122             :         Real64 bhUTubeDist;        // U-tube, shank-to-shank spacing {m}
     123             : 
     124           0 :         GLHEVertProps() : bhTopDepth(0.0), bhLength(0.0), bhDiameter(0.0), bhUTubeDist(0.0)
     125             :         {
     126           0 :         }
     127             : 
     128             :         GLHEVertProps(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     129             :     };
     130             : 
     131             :     struct MyCartesian
     132             :     {
     133             :         // Destructor
     134             :         ~MyCartesian() = default;
     135             : 
     136             :         Real64 x;
     137             :         Real64 y;
     138             :         Real64 z;
     139             : 
     140        5304 :         MyCartesian() : x(0.0), y(0.0), z(0.0)
     141             :         {
     142        5304 :         }
     143             :     };
     144             : 
     145             :     struct GLHEVertSingle
     146             :     {
     147             :         // Destructor
     148           8 :         ~GLHEVertSingle() = default;
     149             : 
     150             :         // Members
     151             :         std::string const moduleName = "GroundHeatExchanger:Vertical:Single";
     152             :         std::string name;                     // Name
     153             :         Real64 xLoc;                          // X-direction location {m}
     154             :         Real64 yLoc;                          // Y-direction location {m}
     155             :         Real64 dl_i;                          // Discretized bh length between points
     156             :         Real64 dl_ii;                         // Discretized bh length between points
     157             :         Real64 dl_j;                          // Discretized bh length between points
     158             :         std::shared_ptr<GLHEVertProps> props; // Properties
     159             :         std::vector<MyCartesian>
     160             :             pointLocations_i; // Discretized point locations for when computing temperature response of other boreholes on this bh
     161             :         std::vector<MyCartesian> pointLocations_ii; // Discretized point locations for when computing temperature response of this bh on itself
     162             :         std::vector<MyCartesian>
     163             :             pointLocations_j; // Discretized point locations for when other bh are computing the temperature response of this bh on themselves
     164             : 
     165           8 :         GLHEVertSingle() : xLoc(0.0), yLoc(0.0), dl_i(0.0), dl_ii(0.0), dl_j(0.0)
     166             :         {
     167           8 :         }
     168             : 
     169             :         GLHEVertSingle(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     170             :     };
     171             : 
     172             :     struct GLHEVertArray
     173             :     {
     174             :         // Destructor
     175           2 :         ~GLHEVertArray() = default;
     176             : 
     177             :         // Members
     178             :         std::string const moduleName = "GroundHeatExchanger:Vertical:Array";
     179             :         std::string name;                     // Name
     180             :         int numBHinXDirection;                // Number of boreholes in X direction
     181             :         int numBHinYDirection;                // Number of boreholes in Y direction
     182             :         Real64 bhSpacing;                     // Borehole center-to-center spacing {m}
     183             :         std::shared_ptr<GLHEVertProps> props; // Properties
     184             : 
     185             :         GLHEVertArray() : numBHinXDirection(0), numBHinYDirection(0), bhSpacing(0.0)
     186             :         {
     187             :         }
     188             : 
     189             :         GLHEVertArray(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     190             :     };
     191             : 
     192             :     struct GLHEResponseFactors
     193             :     {
     194             :         // Destructor
     195          23 :         ~GLHEResponseFactors() = default;
     196             : 
     197             :         // Members
     198             :         std::string const moduleName = "GroundHeatExchanger:ResponseFactors";
     199             :         std::string name;                                        // Name
     200             :         int numBoreholes;                                        // Number of boreholes
     201             :         int numGFuncPairs;                                       // Number of g-function pairs
     202             :         Real64 gRefRatio;                                        // Reference ratio of g-function set
     203             :         Real64 maxSimYears;                                      // Maximum length of simulation in years
     204             :         Array1D<Real64> time;                                    // response time in seconds
     205             :         Array1D<Real64> LNTTS;                                   // natural log of Non Dimensional Time Ln(t/ts)
     206             :         Array1D<Real64> GFNC;                                    // G-function ( Non Dimensional temperature response factors)
     207             :         std::shared_ptr<GLHEVertProps> props;                    // Properties
     208             :         std::vector<std::shared_ptr<GLHEVertSingle>> myBorholes; // Boreholes used by this response factors object
     209             : 
     210           3 :         GLHEResponseFactors() : numBoreholes(0), numGFuncPairs(0), gRefRatio(0.0), maxSimYears(0.0)
     211             :         {
     212           3 :         }
     213             : 
     214             :         GLHEResponseFactors(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     215             :     };
     216             : 
     217             :     struct GLHEBase : PlantComponent // LCOV_EXCL_LINE
     218             :     {
     219             :         // Destructor
     220          23 :         virtual ~GLHEBase() = default;
     221             : 
     222             :         // Members
     223             :         bool available;   // need an array of logicals--load identifiers of available equipment
     224             :         bool on;          // simulate the machine at it's operating part load ratio
     225             :         std::string name; // user identifier
     226             :         PlantLocation plantLoc;
     227             :         int inletNodeNum;  // Node number on the inlet side of the plant
     228             :         int outletNodeNum; // Node number on the outlet side of the plant
     229             :         ThermophysicalProps soil;
     230             :         PipeProps pipe;
     231             :         ThermophysicalProps grout;
     232             :         std::shared_ptr<GLHEResponseFactors> myRespFactors;
     233             :         Real64 designFlow;            // Design volumetric flow rate [m3/s]
     234             :         Real64 designMassFlow;        // Design mass flow rate [kg/s]
     235             :         Real64 tempGround;            // The far field temperature of the ground [degC]
     236             :         Array1D<Real64> QnMonthlyAgg; // Monthly aggregated normalized heat extraction/rejection rate [W/m]
     237             :         Array1D<Real64> QnHr;         // Hourly aggregated normalized heat extraction/rejection rate [W/m]
     238             :         Array1D<Real64> QnSubHr; // Contains the sub-hourly heat extraction/rejection rate normalized by the total active length of bore holes [W/m]
     239             :         int prevHour;
     240             :         int AGG;               // Minimum Hourly History required
     241             :         int SubAGG;            // Minimum sub-hourly History
     242             :         Array1D_int LastHourN; // Stores the Previous hour's N for past hours until the minimum sub-hourly history
     243             :         Real64 bhTemp;         // [degC]
     244             :         Real64 massFlowRate;   // [kg/s]
     245             :         Real64 outletTemp;     // [degC]
     246             :         Real64 inletTemp;      // [degC]
     247             :         Real64 aveFluidTemp;   // [degC]
     248             :         Real64 QGLHE;          // [W] heat transfer rate
     249             :         bool myEnvrnFlag;
     250             :         bool gFunctionsExist;
     251             :         Real64 lastQnSubHr;
     252             :         Real64 HXResistance;    // The thermal resistance of the GHX, (K per W/m)
     253             :         Real64 totalTubeLength; // The total length of pipe. NumBoreholes * BoreholeDepth OR Pi * Dcoil * NumCoils
     254             :         Real64 timeSS;          // Steady state time
     255             :         Real64 timeSSFactor;    // Steady state time factor for calculation
     256             :         std::shared_ptr<BaseGroundTempsModel> groundTempModel;
     257             : 
     258             :         // some statics pulled out into member variables
     259             :         bool firstTime;
     260             :         int numErrorCalls;
     261             :         Real64 ToutNew;
     262             :         int PrevN;             // The saved value of N at previous time step
     263             :         bool updateCurSimTime; // Used to reset the CurSimTime to reset after WarmupFlag
     264             :         bool triggerDesignDayReset;
     265             :         bool needToSetupOutputVars;
     266             : 
     267          23 :         GLHEBase()
     268          23 :             : available(false), on(false), plantLoc{}, inletNodeNum(0), outletNodeNum(0), designFlow(0.0), designMassFlow(0.0), tempGround(0.0),
     269             :               prevHour(1), AGG(0), SubAGG(0), bhTemp(0.0), massFlowRate(0.0), outletTemp(0.0), inletTemp(0.0), aveFluidTemp(0.0), QGLHE(0.0),
     270             :               myEnvrnFlag(true), gFunctionsExist(false), lastQnSubHr(0.0), HXResistance(0.0), totalTubeLength(0.0), timeSS(0.0), timeSSFactor(0.0),
     271             :               firstTime(true), numErrorCalls(0), ToutNew(19.375), PrevN(1), updateCurSimTime(true), triggerDesignDayReset(false),
     272          23 :               needToSetupOutputVars(true)
     273             :         {
     274          23 :         }
     275             : 
     276             :         virtual void calcGFunctions(EnergyPlusData &state) = 0;
     277             : 
     278             :         void calcAggregateLoad(EnergyPlusData &state);
     279             : 
     280             :         void updateGHX(EnergyPlusData &state);
     281             : 
     282             :         void calcGroundHeatExchanger(EnergyPlusData &state);
     283             : 
     284             :         static inline bool isEven(int val);
     285             : 
     286             :         [[nodiscard]] Real64 interpGFunc(Real64) const;
     287             : 
     288             :         void makeThisGLHECacheAndCompareWithFileCache(EnergyPlusData &state);
     289             : 
     290             :         virtual void makeThisGLHECacheStruct() = 0;
     291             : 
     292             :         virtual void readCacheFileAndCompareWithThisGLHECache(EnergyPlusData &state) = 0;
     293             : 
     294             :         void onInitLoopEquip([[maybe_unused]] EnergyPlusData &state, const PlantLocation &calledFromLocation) override;
     295             : 
     296             :         void simulate([[maybe_unused]] EnergyPlusData &state,
     297             :                       const PlantLocation &calledFromLocation,
     298             :                       bool FirstHVACIteration,
     299             :                       Real64 &CurLoad,
     300             :                       bool RunFlag) override;
     301             : 
     302             :         static PlantComponent *factory(EnergyPlusData &state, DataPlant::PlantEquipmentType objectType, std::string const &objectName);
     303             : 
     304             :         virtual Real64 getGFunc(Real64) = 0;
     305             : 
     306             :         virtual void initGLHESimVars(EnergyPlusData &state) = 0;
     307             : 
     308             :         virtual Real64 calcHXResistance(EnergyPlusData &state) = 0;
     309             : 
     310             :         virtual void getAnnualTimeConstant() = 0;
     311             : 
     312             :         virtual void initEnvironment(EnergyPlusData &state, Real64 CurTime) = 0;
     313             : 
     314             :         void setupOutput(EnergyPlusData &state);
     315             :     };
     316             : 
     317             :     enum class GFuncCalcMethod
     318             :     {
     319             :         Invalid = -1,
     320             :         UniformHeatFlux,
     321             :         UniformBoreholeWallTemp,
     322             :         Num
     323             :     };
     324             : 
     325             :     struct GLHEVert : GLHEBase // LCOV_EXCL_LINE
     326             :     {
     327             : 
     328             :         // Destructor
     329          22 :         ~GLHEVert() override = default;
     330             : 
     331             :         // Members
     332             :         std::string const moduleName = "GroundHeatExchanger:System";
     333             :         Real64 bhDiameter;  // Diameter of borehole {m}
     334             :         Real64 bhRadius;    // Radius of borehole {m}
     335             :         Real64 bhLength;    // Length of borehole {m}
     336             :         Real64 bhUTubeDist; // Distance between u-tube legs {m}
     337             :         GFuncCalcMethod gFuncCalcMethod;
     338             : 
     339             :         // Parameters for the multipole method
     340             :         Real64 theta_1;
     341             :         Real64 theta_2;
     342             :         Real64 theta_3;
     343             :         Real64 sigma;
     344             : 
     345             :         nlohmann::json myCacheData;
     346             : 
     347             :         std::vector<Real64> GFNC_shortTimestep;
     348             :         std::vector<Real64> LNTTS_shortTimestep;
     349             : 
     350             :         GLHEVert()
     351             :             : bhDiameter(0.0), bhRadius(0.0), bhLength(0.0), bhUTubeDist(0.0), gFuncCalcMethod(GFuncCalcMethod::Invalid), theta_1(0.0), theta_2(0.0),
     352             :               theta_3(0.0), sigma(0.0)
     353             :         {
     354             :         }
     355             : 
     356             :         GLHEVert(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     357             : 
     358             :         static std::vector<Real64> distances(MyCartesian const &point_i, MyCartesian const &point_j);
     359             : 
     360             :         Real64 calcResponse(std::vector<Real64> const &dists, Real64 currTime);
     361             : 
     362             :         Real64 integral(MyCartesian const &point_i, std::shared_ptr<GLHEVertSingle> const &bh_j, Real64 currTime);
     363             : 
     364             :         Real64 doubleIntegral(std::shared_ptr<GLHEVertSingle> const &bh_i, std::shared_ptr<GLHEVertSingle> const &bh_j, Real64 currTime);
     365             : 
     366             :         void calcShortTimestepGFunctions(EnergyPlusData &state);
     367             : 
     368             :         void calcLongTimestepGFunctions(EnergyPlusData &state);
     369             : 
     370             :         void calcGFunctions(EnergyPlusData &state) override;
     371             : 
     372             :         void calcUniformHeatFluxGFunctions(EnergyPlusData &state);
     373             : 
     374             :         void calcUniformBHWallTempGFunctions(EnergyPlusData &state);
     375             : 
     376             :         Real64 calcHXResistance(EnergyPlusData &state) override;
     377             : 
     378             :         void initGLHESimVars(EnergyPlusData &state) override;
     379             : 
     380             :         void getAnnualTimeConstant() override;
     381             : 
     382             :         Real64 getGFunc(Real64 time) override;
     383             : 
     384             :         void makeThisGLHECacheStruct() override;
     385             : 
     386             :         void readCacheFileAndCompareWithThisGLHECache(EnergyPlusData &state) override;
     387             : 
     388             :         void writeGLHECacheToFile(EnergyPlusData &state) const;
     389             : 
     390             :         Real64 calcBHAverageResistance(EnergyPlusData &state);
     391             : 
     392             :         Real64 calcBHTotalInternalResistance(EnergyPlusData &state);
     393             : 
     394             :         Real64 calcBHGroutResistance(EnergyPlusData &state);
     395             : 
     396             :         Real64 calcPipeConductionResistance();
     397             : 
     398             :         Real64 calcPipeConvectionResistance(EnergyPlusData &state);
     399             : 
     400             :         static Real64 frictionFactor(Real64 reynoldsNum);
     401             : 
     402             :         Real64 calcPipeResistance(EnergyPlusData &state);
     403             : 
     404             :         void combineShortAndLongTimestepGFunctions();
     405             : 
     406             :         void initEnvironment(EnergyPlusData &state, [[maybe_unused]] Real64 CurTime) override;
     407             : 
     408             :         void oneTimeInit(EnergyPlusData &state) override;
     409             : 
     410             :         void oneTimeInit_new(EnergyPlusData &state) override;
     411             : 
     412             :         void setupTimeVectors();
     413             :     };
     414             : 
     415             :     struct GLHESlinky : GLHEBase // LCOV_EXCL_LINE
     416             :     {
     417             : 
     418             :         // Destructor
     419           1 :         ~GLHESlinky() override = default;
     420             : 
     421             :         // Members
     422             :         std::string const moduleName = "GroundHeatExchanger:Slinky";
     423             :         bool verticalConfig;  // HX Configuration Flag
     424             :         Real64 coilDiameter;  // Diameter of the slinky coils [m]
     425             :         Real64 coilPitch;     // Center-to-center slinky coil spacing [m]
     426             :         Real64 coilDepth;     // Average depth of the coil [m]
     427             :         Real64 trenchDepth;   // Trench depth from ground surface to trench bottom [m]
     428             :         Real64 trenchLength;  // Length of single trench [m]
     429             :         int numTrenches;      // Number of parallel trenches [m]
     430             :         Real64 trenchSpacing; // Spacing between parallel trenches [m]
     431             :         int numCoils;         // Number of coils
     432             :         int monthOfMinSurfTemp;
     433             :         Real64 maxSimYears;
     434             :         Real64 minSurfTemp;
     435             :         Array1D<Real64> X0;
     436             :         Array1D<Real64> Y0;
     437             :         Real64 Z0;
     438             : 
     439             :         GLHESlinky()
     440             :             : verticalConfig(false), coilDiameter(0.0), coilPitch(0.0), coilDepth(0.0), trenchDepth(0.0), trenchLength(0.0), numTrenches(0),
     441             :               trenchSpacing(0.0), numCoils(0), monthOfMinSurfTemp(0), maxSimYears(0.0), minSurfTemp(0.0), Z0(0.0)
     442             :         {
     443             :         }
     444             : 
     445             :         GLHESlinky(EnergyPlusData &state, std::string const &objName, nlohmann::json const &j);
     446             : 
     447             :         Real64 calcHXResistance(EnergyPlusData &state) override;
     448             : 
     449             :         void calcGFunctions(EnergyPlusData &state) override;
     450             : 
     451             :         void initGLHESimVars(EnergyPlusData &state) override;
     452             : 
     453             :         void getAnnualTimeConstant() override;
     454             : 
     455             :         Real64 doubleIntegral(int m, int n, int m1, int n1, Real64 t, int I0, int J0);
     456             : 
     457             :         Real64 integral(int m, int n, int m1, int n1, Real64 t, Real64 eta, Real64 J0);
     458             : 
     459             :         Real64 distance(int m, int n, int m1, int n1, Real64 eta, Real64 theta);
     460             : 
     461             :         Real64 distanceToFictRing(int m, int n, int m1, int n1, Real64 eta, Real64 theta);
     462             : 
     463             :         Real64 distToCenter(int m, int n, int m1, int n1);
     464             : 
     465             :         Real64 nearFieldResponseFunction(int m, int n, int m1, int n1, Real64 eta, Real64 theta, Real64 t);
     466             : 
     467             :         Real64 midFieldResponseFunction(int m, int n, int m1, int n1, Real64 t);
     468             : 
     469             :         Real64 getGFunc(Real64 time) override;
     470             : 
     471             :         void makeThisGLHECacheStruct() override;
     472             : 
     473             :         void readCacheFileAndCompareWithThisGLHECache(EnergyPlusData &state) override;
     474             : 
     475             :         void initEnvironment(EnergyPlusData &state, Real64 CurTime) override;
     476             : 
     477             :         void oneTimeInit(EnergyPlusData &state) override;
     478             : 
     479             :         void oneTimeInit_new(EnergyPlusData &state) override;
     480             :     };
     481             : 
     482             :     void GetGroundHeatExchangerInput(EnergyPlusData &state);
     483             : 
     484             :     std::shared_ptr<GLHEResponseFactors> BuildAndGetResponseFactorObjectFromArray(EnergyPlusData &state,
     485             :                                                                                   std::shared_ptr<GLHEVertArray> const &arrayObjectPtr);
     486             : 
     487             :     std::shared_ptr<GLHEResponseFactors>
     488             :     BuildAndGetResponseFactorsObjectFromSingleBHs(EnergyPlusData &state, std::vector<std::shared_ptr<GLHEVertSingle>> const &singleBHsForRFVect);
     489             : 
     490             :     void SetupBHPointsForResponseFactorsObject(std::shared_ptr<GLHEResponseFactors> &thisRF);
     491             : 
     492             :     std::shared_ptr<GLHEResponseFactors> GetResponseFactor(EnergyPlusData &state, std::string const &objectName);
     493             : 
     494             :     std::shared_ptr<GLHEVertSingle> GetSingleBH(EnergyPlusData &state, std::string const &objectName);
     495             : 
     496             :     std::shared_ptr<GLHEVertProps> GetVertProps(EnergyPlusData &state, std::string const &objectName);
     497             : 
     498             :     std::shared_ptr<GLHEVertArray> GetVertArray(EnergyPlusData &state, std::string const &objectName);
     499             : 
     500             :     std::vector<Real64> TDMA(std::vector<Real64> a, std::vector<Real64> b, std::vector<Real64> c, std::vector<Real64> d);
     501             : 
     502             : } // namespace GroundHeatExchangers
     503             : 
     504        1542 : struct GroundHeatExchangerData : BaseGlobalStruct
     505             : {
     506             : 
     507             :     int numVerticalGLHEs = 0;
     508             :     int numSlinkyGLHEs = 0;
     509             :     int numVertArray = 0;
     510             :     int numVertProps = 0;
     511             :     int numResponseFactors = 0;
     512             :     int numSingleBorehole = 0;
     513             :     int N = 1;                   // COUNTER OF TIME STEP
     514             :     Real64 currentSimTime = 0.0; // Current simulation time in hours
     515             :     int locHourOfDay = 0;
     516             :     int locDayOfSim = 0;
     517             :     bool GetInput = true;
     518             :     int numAutoGeneratedResponseFactors = 0;
     519             : 
     520             :     Array1D<Real64> prevTimeSteps; // This is used to store only the Last Few time step's time
     521             :     // to enable the calculation of the sub-hourly contribution..
     522             :     // Recommended size, the product of Minimum sub-hourly history required and
     523             :     // the maximum no of system time steps in an hour
     524             : 
     525             :     // Object Data
     526             :     std::vector<GroundHeatExchangers::GLHEVert> verticalGLHE;
     527             :     std::vector<GroundHeatExchangers::GLHESlinky> slinkyGLHE;
     528             :     std::vector<std::shared_ptr<GroundHeatExchangers::GLHEVertArray>> vertArraysVector;
     529             :     std::vector<std::shared_ptr<GroundHeatExchangers::GLHEVertProps>> vertPropsVector;
     530             :     std::vector<std::shared_ptr<GroundHeatExchangers::GLHEResponseFactors>> responseFactorsVector;
     531             :     std::vector<std::shared_ptr<GroundHeatExchangers::GLHEVertSingle>> singleBoreholesVector;
     532             : 
     533           0 :     void clear_state() override
     534             :     {
     535           0 :         this->numVerticalGLHEs = 0;
     536           0 :         this->numSlinkyGLHEs = 0;
     537           0 :         this->numVertArray = 0;
     538           0 :         this->numVertProps = 0;
     539           0 :         this->numResponseFactors = 0;
     540           0 :         this->numSingleBorehole = 0;
     541           0 :         this->N = 1;
     542           0 :         this->currentSimTime = 0.0;
     543           0 :         this->locHourOfDay = 0;
     544           0 :         this->locDayOfSim = 0;
     545           0 :         this->GetInput = true;
     546           0 :         this->numAutoGeneratedResponseFactors = 0;
     547           0 :         this->prevTimeSteps.deallocate();
     548           0 :         this->verticalGLHE.clear();
     549           0 :         this->slinkyGLHE.clear();
     550           0 :         this->vertArraysVector.clear();
     551           0 :         this->vertPropsVector.clear();
     552           0 :         this->responseFactorsVector.clear();
     553           0 :         this->singleBoreholesVector.clear();
     554           0 :     }
     555             : };
     556             : 
     557             : } // namespace EnergyPlus
     558             : 
     559             : #endif

Generated by: LCOV version 1.13