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 numpy as np
 18
 19import pygfunction as gt
 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    boreholes = []
 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        boreholes.append(borehole)
 75    borefield1 = gt.borefield.Borefield.from_boreholes(boreholes)
 76
 77    # Visualize the borehole field
 78    fig1 = gt.boreholes.visualize_field(borefield1)
 79
 80    """
 81    Bore field #2
 82
 83    This field corresponds to the configuration comprised of 8 boreholes in
 84    a circle presented by Claesson and Eskilson (1987). The field is built
 85    using the `circle_field` function.
 86    """
 87    N = 8   # Number of boreholes
 88    R = 3.  # Borehole spacing from the center of the field (m)
 89
 90    # Field of 6 boreholes in a circle
 91    borefield2 = gt.borefield.Borefield.circle_field(
 92        N, R, H, D, r_b, tilt=tilt)
 93
 94    # Visualize the borehole field
 95    fig2 = gt.boreholes.visualize_field(borefield2)
 96
 97    # -------------------------------------------------------------------------
 98    # Evaluate g-functions for all fields
 99    # -------------------------------------------------------------------------
100    # Bore field #1
101    gfunc1 = gt.gfunction.gFunction(
102        borefield1, alpha, time=time, options=options, method='similarities')
103    fig3 = gfunc1.visualize_g_function()
104    fig3.suptitle('"Optimal" field of 8 boreholes')
105    fig3.tight_layout()
106    # Bore field #2
107    gfunc2 = gt.gfunction.gFunction(
108        borefield2, alpha, time=time, options=options, method='similarities')
109    fig4 = gfunc2.visualize_g_function()
110    fig4.suptitle(f'Field of {N} boreholes in a circle')
111    fig4.tight_layout()
112
113
114# Main function
115if __name__ == '__main__':
116    main()

References