functiongFunction

Evaluate the g-function of a bore field

Extends from Modelica.Icons.Function (Icon for functions).

Information

This function implements the g-function evaluation method introduced by Cimmino and Bernier (see: Cimmino and Bernier (2014), Cimmino (2018), and Prieto and Cimmino (2021)) based on the g-function function concept first introduced by Eskilson (1987). The g-function gives the relation between the variation of the borehole wall temperature at a time t and the heat extraction and injection rates at all times preceding time t as

image

where Tb is the borehole wall temperature, Tg is the undisturbed ground temperature, Q is the heat injection rate into the ground through the borehole wall per unit borehole length, ks is the soil thermal conductivity and g is the g-function.

The g-function is constructed from the combination of the combination of the finite line source (FLS) solution (see Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.finiteLineSource), the cylindrical heat source (CHS) solution (see Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.cylindricalHeatSource), and the infinite line source (ILS) solution (see Buildings.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.infiniteLineSource). To obtain the g-function of a bore field, the bore field is first divided into nClu groups of similarly behaving boreholes. Each group is represented by a single equivalent borehole. Each equivalent borehole is then divided into a series of nSeg segments of equal length, each modeled as a line source of finite length. The finite line source solution is superimposed in space to obtain a system of equations that gives the relation between the heat injection rate at each of the segments and the borehole wall temperature at each of the segments. The system is solved to obtain the uniform borehole wall temperature required at any time to maintain a constant total heat injection rate (Qtot = 2πksHtot) into the bore field. The uniform borehole wall temperature is then equal to the finite line source based g-function.

Since this g-function is based on line sources of heat, rather than cylinders, the g-function is corrected to consider the cylindrical geometry. The correction factor is then the difference between the cylindrical heat source solution and the infinite line source solution, as proposed by Li et al. (2014) as

g(t) = gFLS + (gCHS - gILS)

Implementation

The calculation of the g-function is separated into two regions: the short-time region and the long-time region. In the short-time region, corresponding to times t < 1 hour, heat interaction between boreholes and axial variations of heat injection rate are not considered. The g-function is calculated using only one borehole and one segment. In the long-time region, corresponding to times t > 1 hour, all boreholes are represented as series of nSeg line segments and the g-function is evaluated as described above.

References

Cimmino, M. and Bernier, M. 2014. A semi-analytical method to generate g-functions for geothermal bore fields. International Journal of Heat and Mass Transfer 70: 641-650.

Cimmino, M. 2018. Fast calculation of the g-functions of geothermal borehole fields using similarities in the evaluation of the finite line source solution. Journal of Building Performance Simulation 11(6): 655-668.

Eskilson, P. 1987. Thermal analysis of heat extraction boreholes. Ph.D. Thesis. Department of Mathematical Physics. University of Lund. Sweden.

Li, M., Li, P., Chan, V. and Lai, A.C.K. 2014. Full-scale temperature response function (G-function) for heat transfer by borehole heat exchangers (GHEs) from sub-hour to decades. Applied Energy 136: 197-205.

Prieto, C. and Cimmino, M. 2021. Thermal interactions in large irregular fields of geothermal boreholes: the method of equivalent boreholes. Journal of Building Performance Simulation 14(4): 446-460. doi:10.1080/19401493.2021.1968953.

Inputs

TypeNameDefaultDescription
IntegernBorNumber of boreholes
Modelica.Units.SI.Position[nBor,2]cooBorCoordinates of boreholes
Modelica.Units.SI.HeighthBorBorehole length
Modelica.Units.SI.HeightdBorBorehole buried depth
Modelica.Units.SI.RadiusrBorBorehole radius
Modelica.Units.SI.ThermalDiffusivityaSoiGround thermal diffusivity used in g-function evaluation
IntegernSegNumber of line source segments per borehole
IntegernTimShoNumber of time steps in short time region
IntegernTimLonNumber of time steps in long time region
RealttsMaxMaximum adimensional time for gfunc calculation
IntegernCluNumber of clusters
Integer[nBor]labelsCluster label associated with each data point
Integer[nClu]cluSizSize of the clusters
RealrelTol0.02Relative tolerance on distance between boreholes

Outputs

TypeNameDefaultDescription
Modelica.Units.SI.Time[nTimSho + nTimLon]tGFunTime of g-function evaluation
Real[nTimSho + nTimLon]gg-function

Revisions

  • September 3, 2026, by Michael Wetter:
    Initialized variables A and B.
    This is for Buildings, #4707.
  • June 9, 2022 by Massimo Cimmino:
    Updated the function to use the more efficient method of Prieto and Cimmino (2021).
  • November 16, 2022, by Michael Wetter:
    Initialized variable Done.
    See OpenModelica, #9707.
  • March 22, 2018 by Massimo Cimmino:
    First implementation.