Calculation of g-functions with inclined boreholes¶
This example demonstrates the use of the g-function module to calculate g-functions of fields of inclined boreholes using a boundary condition of uniform and equal borehole wall temperature for all boreholes. The total rate of heat extraction in the bore field is constant.
The following script generates the g-functions of two bore fields. The first field corresponds to the optimal configuration presented by Claesson and Eskilson 1. The second field corresponds to the configuration comprised of 8 boreholes in a circle presented by the same authors.
The script is located in: pygfunction/examples/inclined_boreholes.py
1# -*- coding: utf-8 -*-
2""" Example of calculation of g-functions with inclined boreholesusing uniform
3 and equal borehole wall temperatures.
4
5 The g-functions of two fields of 8 boreholes are calculated for boundary
6 condition of uniform borehole wall temperature along the boreholes, equal
7 for all boreholes. The first field corresponds to the "optimum"
8 configuration presented by Claesson and Eskilson (1987) and the second
9 field corresponds to the configuration comprised of 8 boreholes in a
10 circle.
11
12 Claesson J, and Eskilson, P. (1987). Conductive heat extraction by
13 thermally interacting deep boreholes, in "Thermal analysis of heat
14 extraction boreholes". Ph.D. Thesis, University of Lund, Lund, Sweden.
15"""
16
17import pygfunction as gt
18import numpy as np
19import matplotlib.pyplot as plt
20
21
22def main():
23 # -------------------------------------------------------------------------
24 # Simulation parameters
25 # -------------------------------------------------------------------------
26
27 # Borehole dimensions
28 D = 4.0 # Borehole buried depth (m)
29 H = 150.0 # Borehole length (m)
30 r_b = 0.075 # Borehole radius (m)
31 tilt = np.radians(20.) # Borehole inclination (rad)
32
33 # Thermal properties
34 alpha = 1.0e-6 # Ground thermal diffusivity (m2/s)
35
36 # g-Function calculation options
37 options = {'disp': True}
38
39 # Geometrically expanding time vector.
40 dt = 100*3600. # Time step
41 tmax = 3000. * 8760. * 3600. # Maximum time
42 Nt = 25 # Number of time steps
43 ts = H**2/(9.*alpha) # Bore field characteristic time
44 time = gt.utilities.time_geometric(dt, tmax, Nt)
45 lntts = np.log(time/ts)
46
47 # -------------------------------------------------------------------------
48 # Borehole fields
49 # -------------------------------------------------------------------------
50 """
51 Bore field #1
52
53 This field corresponds to the optimal configuration presented by
54 Claesson and Eskilson (1987). The field is built using the `cardinal_point`
55 function to define the orientation of each borehole, individually.
56 """
57 B = 7.5 # Borehole spacing (m)
58 # Orientation of the boreholes
59 borehole_orientations = [
60 gt.utilities.cardinal_point('W'),
61 gt.utilities.cardinal_point('NW'),
62 gt.utilities.cardinal_point('SW'),
63 gt.utilities.cardinal_point('N'),
64 gt.utilities.cardinal_point('S'),
65 gt.utilities.cardinal_point('NE'),
66 gt.utilities.cardinal_point('SE'),
67 gt.utilities.cardinal_point('E')]
68
69 # "Optimal" field of 8 boreholes
70 boreField1 = []
71 for i, orientation in enumerate(borehole_orientations):
72 borehole = gt.boreholes.Borehole(
73 H, D, r_b, i * B, 0., tilt=tilt, orientation=orientation)
74 boreField1.append(borehole)
75
76 # Visualize the borehole field
77 fig1 = gt.boreholes.visualize_field(boreField1)
78
79 """
80 Bore field #2
81
82 This field corresponds to the configuration comprised of 8 boreholes in
83 a circle presented by Claesson and Eskilson (1987). The field is built
84 using the `circle_field` function.
85 """
86 N = 8 # Number of boreholes
87 R = 3. # Borehole spacing from the center of the field (m)
88
89 # Field of 6 boreholes in a circle
90 boreField2 = gt.boreholes.circle_field(N, R, H, D, r_b, tilt=tilt)
91
92 # Visualize the borehole field
93 fig2 = gt.boreholes.visualize_field(boreField2)
94
95 # -------------------------------------------------------------------------
96 # Evaluate g-functions for all fields
97 # -------------------------------------------------------------------------
98 # Bore field #1
99 gfunc1 = gt.gfunction.gFunction(
100 boreField1, alpha, time=time, options=options, method='similarities')
101 fig3 = gfunc1.visualize_g_function()
102 fig3.suptitle('"Optimal" field of 8 boreholes')
103 fig3.tight_layout()
104 # Bore field #2
105 gfunc2 = gt.gfunction.gFunction(
106 boreField2, alpha, time=time, options=options, method='similarities')
107 fig4 = gfunc2.visualize_g_function()
108 fig4.suptitle(f'Field of {N} boreholes in a circle')
109 fig4.tight_layout()
110
111
112# Main function
113if __name__ == '__main__':
114 main()
References
- 1
Claesson J, and Eskilson, P. (1987). Conductive heat extraction by thermally interacting deep boreholes, in “Thermal analysis of heat extraction boreholes”. Ph.D. Thesis, University of Lund, Lund, Sweden.