HomeFeaturesExamplesTutorialsHelpTheoryVerificationPricingContact
Theory manual

4. Thermal response factors (g-functions)

4.1 Definition

Eskilson (1987) defined the g-function as the dimensionless borehole-wall temperature response of a field to a unit step heat rate applied at t=0:

Tb(t)−Tm=q2πλg(tts,rbH,BH,DH)
(4.1)
ts=H29α
(4.2)

For the example, α = 1.182e-06 m²/s and ts = 2.115e+09 s = 67.1 years. Tb is the mean over all boreholes, and q the heat rate per metre of the whole field. At short times g is the response of a single borehole; the thermal interaction between boreholes makes g grow with the number of boreholes and their proximity until a steady state is reached at about ln(t/ts)>2. BoreTherm tabulates g at nodes xk=ln(tk/ts) and interpolates linearly in ln(t/ts):

g(t)=(1−w)gk+wgk+1,w=ln(t/ts)−xkxk+1−xk
(4.3)

Below the first node g is taken linear in t from g(0)=0, and beyond the last node it is held at the last value (steady state). The characteristic time uses the mean borehole length.

4.2 Finite line source with mirror image

Each borehole is represented by a line source of finite length. Following Cimmino & Bernier (2014) and Cimmino (2018), the boreholes are divided into segments; the mean temperature change on receiving segment i (length Hi, top depth Di) caused by a unit heat rate per metre on emitting segment j (Hj, Dj) at horizontal distance dij is, in units of 1/(2πλ),

hij(t)=12Hi∫1/4αt∞1s2e−dij2s2Iij(s)ds
(4.4)

with dii=rb for the self-response. The axial function Iij contains the real source and its mirror image above the ground surface, which keeps the surface at Tm:

Iij(s)=∑k=18pkerfint(qks),p=(+1,−1,+1,−1,+1,−1,+1,−1)
(4.5)
q1..4=(Di−Dj+Hi,Di−Dj,Di−Dj−Hj,Di−Dj+Hi−Hj)
(4.6)
q5..8=(Di+Dj+Hi,Di+Dj,Di+Dj+Hj,Di+Dj+Hi+Hj)
(4.7)
erfint(X)=∫0Xerf(v)dv=Xerf(X)−1−e−X2π
(4.8)

The first four terms are the real source, the last four its mirror image. The integral in (4.4) is symmetric in i and j, which gives the reciprocity relation

Hihij(t)=Hjhji(t)
(4.9)

so only one of each pair has to be evaluated. For t→∞ the integral has the closed form used by the equivalent-borehole clustering (Section 4.5):

2Hihij(∞)=∑k=18pk[qkasinh(qkdij)−qk2+dij2]
(4.10)

4.3 Numerical integration

4.3.1 Adaptive Gauss–Kronrod quadrature in ln s

With the substitution u=lns (ds=sdu) the integrand of (4.4) becomes e−d2s2I(s)/s, which is smooth over the many decades of s spanned by the time grid. The integral is split at the lower limits sk=1/4αtk of the requested times and accumulated from the steady-state end, so that every interval is integrated once:

F(tk)=∑m≤k∫lnsmlnsm−1e−d2s2I(s)sdu,s−1=6.5dmin
(4.11)

and hij=F/(2Hi). Beyond s=6.5/d the factor e−d2s2<5·10−19 is negligible. Each interval is integrated with a globally adaptive 7-point Gauss / 15-point Kronrod rule (Piessens et al. 1983): the sub-interval with the largest error estimate |K15−G7| is bisected until every component satisfies err≤max(ϵabs,10−10|F|), with ϵabs=10−11m−1 times the length of the shorter segment. All distances that share one segment-pair geometry (the same Hi,Di,Hj,Dj) are integrated on one mesh, because the expensive factor I(s) does not depend on the distance.

4.3.2 Cancellation-free evaluation of the erfint sum

For large s every term erfint(qks)≈qks−1/π grows linearly while their sum stays bounded; summing them directly loses all significant digits. BoreTherm uses erfint(x)=x−1/π+ierfc(x) for x≥0 and sums the linear and constant parts analytically (∑pk=0):

I(s)=s∑kpk|qk|+∑kpkierfc(|qk|s),ierfc(x)=e−x2π−xerfc(x)
(4.12)

The remaining terms decay instead of growing. The direct form (4.5) is used where smaxk|qk|<2 (erfint is even, so |qk| may be used throughout).

4.3.3 Closed-form approximation (Cimmino 2021)

As an option the integral is evaluated in closed form. With erf approximated by a sum of exponentials, erf(x)≈∑n=0Nane−bnx2 (a0=1, b0=0; coefficients of Tanash & Riihonen 2020, N = 10 terms by default), each term of (4.4) integrates analytically. With ς=4αt, d~=d/ς and q~k=|qk|/ς:

F(t)=ς∑k=18pk[q~k2∑n=0NanE1(d~2+bnq~k2)+ierfc(d~2+q~k2)]
(4.13)

E1 is evaluated by its power series for x≤1 and by a continued fraction (modified Lentz) above. For the 10 × 10 field of Section 4.5 the closed form agrees with the quadrature to 0.006 % (Table 6).

4.4 Boundary conditions

4.4.1 Segmentation

For the uniform-temperature condition each borehole is divided into n segments (default 8), refined geometrically toward both ends so that the end segments have the length eH (end-length ratio e = 0.02; Eskilson 1987, as in an open-source g-function library). For even n the length ratios from the top are

HkH=erk,k=0…n2−1,mirrored below the middle,2∑k=0n/2−1erk=1
(4.14)

with the expansion factor r found by bisection; odd n adds a middle segment er(n−1)/2. The uniform-heat-rate condition is exact with one segment per borehole, because the FLS integral is additive over the segments of both emitter and receiver.

4.4.2 Uniform heat transfer rate (UHTR)

Every segment emits the same heat rate per metre. The segment temperatures follow without a linear solve, and g is their length-weighted mean:

Tb,i(t)=∑jhij(t),g(t)=∑iHiTb,i(t)∑iHi
(4.15)

4.4.3 Uniform borehole-wall temperature (UBWT)

Eskilson's g-functions, and hence those of the classic monthly method, assume that all boreholes share one wall temperature (equal fluid temperature) with a prescribed total heat rate. The segment heat rates Qj(t) are then unknowns. At each time step tp of the grid the segment heat rates 𝐐p and the common wall temperature Tb solve the (nS+1) system (Cimmino & Bernier 2014; Cimmino 2018)

[𝐡(Δtp)−1𝐇T0][𝐐pTb]=[−𝐓0,p∑iHi],g(tp)=Tb
(4.16)

where nS is the number of segments of the field, 𝐡(Δtp) the nS×nS matrix of response factors at the current step length Δtp=tp−tp−1 (interpolated linearly in t between grid times, with h(0)=0), 𝐇 the segment lengths and 𝐓0,p the wall temperatures caused by the heat rates of all earlier steps, evaluated with 𝐐p=0:

T0,p,i=∑j∑k=0phij(tk)ΔQ~j,p−k
(4.17)

The increments ΔQ~ come from a load-history reconstruction (the scheme of an open-source g-function library): the history Qj(t), 0<t<tp, is re-averaged onto a reversed grid whose step durations are those of the actual grid taken in reverse order. On that grid every past step ends a grid time tk before tp, so (4.17) needs h only at the grid times, already computed. The system (4.16) is solved with a dense LU factorisation with partial pivoting at every step. Because the solution superposes the segment heat rates over the grid actually requested, g depends slightly on the grid: for a 3 × 2 field the value at 20 years changes by 0.02 % between 320 and 600 grid points, and by 0.3 % on an 11-point grid.

4.4.4 Short-time handling

Two short-time limits apply. Below tlin=rb2/(25α) (2.8 minutes for the example) the line source is not valid, and g is taken linear in t from g(0)=0 to g(tlin), as in an open-source g-function library. Second, the UBWT time stepping (4.16)–(4.17) is unstable when it starts at Fourier numbers αt/rb2 below about 0.2: the segment self-response is then so small that the segment heat rates oscillate, and g oscillates and can even turn negative (down to −25 for H = 20 m on fine grids). The same behaviour is found with that open-source library on such grids. BoreTherm therefore starts the UBWT solver no earlier than

tsolve=rb22α(Fo=0.5)
(4.18)

(35 minutes for the example), 2.5 times the observed stability limit. Between tlin and tsolve the boreholes do not yet interact and the heat rate along them is still uniform, so g follows the length-weighted self-response of the boreholes, scaled to the solver value:

g(t)=g(tsolve)S(t)S(tsolve),S(t)=∑iHiSi(t)∑iHi,Si(t)=12E1(rb,i24αt)
(4.19)

with the CHS − ILS difference (4.22) added to Si when the cylindrical correction is on (Section 4.6). This keeps g positive and increasing on any time grid. In verification computations on grids starting at 60 s, a single borehole and a 3 × 3 field agree with the open-source library within 1.2·10−7 above tsolve and within 8·10−5 of its valid solution between 5tlin and tsolve, and a 20 m borehole stays positive and increasing with every method and option on 1-second grids. UHTR has no time stepping and is solved down to tlin.

g-function of a 10 × 10 field (B = 6 m, H = 150 m) under the two boundary conditions, and with the equivalent-borehole method.
Figure 1. g-function of a 10 × 10 field (B = 6 m, H = 150 m) under the two boundary conditions, and with the equivalent-borehole method.

Figure 1 shows the difference between the two conditions for a 10 × 10 field: with a uniform heat rate the central boreholes become much warmer than the outer ones, and the steady-state g is 106.0 instead of 70.2 at ln(t/ts) = 2. UBWT is the default and the choice consistent with the classic monthly method. A third condition, a uniform mean fluid temperature with a local resistance per segment (UFT), lies between the two and is described in Section 11.4.

4.5 Detailed, Similarities and Equivalent methods

The cost of a g-function is dominated by the number of distinct response factors. BoreTherm evaluates only the distinct entries of 𝐡:

Table 6. g-function of a 10 × 10 field with different options (computed with BoreTherm at 50 times from 1 h to ln(t/ts) = 3). The deviation is the largest relative difference from the default over all 50 times; UHTR and the CHS correction change g by design (at long and at short times respectively).
Variant (10 × 10, B = 6 m, H = 150 m)Time [s]g at ln(t/ts) = −6−202Max. dev. [%]
UBWT, Similarities (default)0.1724.19730.58459.97270.2310.000
UBWT, Detailed0.2944.19730.58459.97070.2290.003
UBWT, Equivalent0.0054.19730.69460.15870.4190.367
UBWT, Similarities, closed-form FLS0.2304.19730.58459.97270.2350.006
UHTR, Similarities0.0014.20035.30783.094106.02952.141
UBWT, 12 segments0.3644.19730.56759.86970.0690.236
UBWT, Similarities + CHS0.1774.19930.58459.97270.23162.693

For a 20 × 20 field (400 boreholes, 3200 segments) the default method takes 3.5 s and the equivalent-borehole method 0.011 s, with a largest deviation of 2.0 %. Refining the segmentation from 8 to 12 segments changes g by at most 0.24 % for the 10 × 10 field. The equivalent method is therefore used for fast screening (the optimizer, Section 9.5) and for very large fields, and the detailed or similarities method for final results.

4.6 Short-time behaviour and the cylindrical-source correction

At short times a single borehole behaves like an infinite line source (ILS):

gILS(t)=12E1(rb24αt)≈12[ln(4αtrb2)−γ]
(4.20)

(γ = 0.5772 is Euler's constant), which Eskilson wrote in terms of ts as

gshort(t)=ln(H2rb)+12ln(tts)
(4.21)

valid for 5rb2/α<t<ts/10. The classic monthly method uses (4.21) for its peak pulses (Section 8.2). The line source places the heat on the borehole axis; at times of the order of rb2/α (hours) the real borehole behaves like a cylindrical surface source (CHS). The optional cylindrical-source correction adds the difference CHS − ILS to the self-response of every segment (Carslaw & Jaeger 1959, §13.7):

Δg(t)=2πG(Fo)−12E1(14Fo),Fo=αtrb2
(4.22)
G(Fo)=2π3∫0∞1−e−β2Foβ3[J12(β)+Y12(β)]dβ
(4.23)

The integral is evaluated by adaptive quadrature in lnβ; Δg vanishes at long times. Figure 2 compares the options for a single borehole of the example.

Single-borehole g-function at short times: finite line source with and without the cylindrical-source correction, and Eskilson's asymptote (4.21) (H = 150 m, rb = 70 mm).
Figure 2. Single-borehole g-function at short times: finite line source with and without the cylindrical-source correction, and Eskilson's asymptote (4.21) (H = 150 m, rb = 70 mm).

At a 6-hour peak (ln(tp/ts) = −11.49) the field g-function of the 4 × 4 example is 1.253 (identical to the single borehole: there is no interaction yet), the asymptote (4.21) gives 1.231 and the ILS 1.254. The corresponding difference in a peak fluid temperature is a few hundredths of a kelvin (Section 8.2). The CHS correction raises g by 0.14 at about 6 h and is off by default, as in the classic monthly method.

4.7 Layouts

Layout generators build the field from a prototype borehole (H, D, rb) and the parameters n1, n2, B1 (along x) and B2 (along y). The borehole order follows that of an open-source g-function library so that reference data can be compared borehole by borehole; shared corners appear once.

Table 7. Layout generators.
TypeDefinitionBoreholes
Singleone borehole1
Linen1 boreholes along xn1
LShapen1 along x and n2 along y, sharing the cornern1+n2−1
L2ShapeL plus the same L shifted inward by one spacing (the classic L2 layout)about 2(n1+n2)−6
UShapen1 along x, two legs of n2 along y including the cornersn1+2n2−2
OpenRectangleperimeter of an n1×n2 rectangle2(n1+n2)−4
Rectanglefilled n1×n2 rectanglen1n2
Circlen1 boreholes on a circle of radius B1n1
InclinedRingn1 heads on a circle of radius B1, tilted outwards (Chapter 13)n1
CustomCSV file with x, y [, H, D, rb, tilt, azimuth], drawn in the field view, or a fill of a site plan (Chapter 16)any
UBWT g-functions of six layouts computed with BoreTherm (B = 6 m, H = 150 m, D = 4 m, rb = 70 mm).
Figure 3. UBWT g-functions of six layouts computed with BoreTherm (B = 6 m, H = 150 m, D = 4 m, rb = 70 mm).
Table 8. Values of the g-functions of Figure 3 (linear interpolation in ln(t/ts) between the 50 computed times) and computing time.
LayoutNg at ln(t/ts) = −6−4−202Time [s]
Single borehole13.964.925.796.436.670.002
Line, 10104.056.2610.6215.4217.280.005
L, 6 + 5114.056.3611.2516.6618.690.006
U, 6 × 4124.066.4411.8117.7519.930.006
Rectangle 4 × 4164.138.1217.2025.4028.240.009
Rectangle 10 × 101004.179.5730.3659.8770.230.179

Figure 3 and Table 8 show the expected ordering: at short times every field follows the single-borehole curve; the more compact the field, the earlier and stronger the interaction. A line of 10 boreholes interacts less than an L or U with a similar count, and the 10 × 10 field reaches g≈71.

4.8 g-function times used by the simulation

The simulation computes g at n times spaced evenly in lnt from half an e-fold below the shortest time needed (tmin, the shortest peak duration or 1 h) to half an e-fold above the simulation period tend:

lntk=lntmin−0.5+kn−1(lntend−lntmin+1),k=0…n−1
(4.24)
n=min(60,max(40,⌈4(lntend−lntmin+1)⌉+1))
(4.25)

that is about four points per e-fold. Monthly and hourly responses are then interpolated with (4.3).