Definition of a bore field using custom borehole positionsΒΆ

This example demonstrates the use of the borehole module to define the positions of the boreholes within a bore field from a list of borehole positions.

Two borehole positions (1 and 2) are intentionally added as duplicates and are removed by calling the pygfunction.boreholes.remove_duplicates() function.

The following script generates a bore field with 5 boreholes. The field is then plotted on a figure.

The script is located in: pygfunction/examples/custom_bore_field.py

 1# -*- coding: utf-8 -*-
 2""" Example of definition of a bore field using custom borehole positions.
 3
 4"""
 5import numpy as np
 6
 7import pygfunction as gt
 8
 9
10def main():
11    # -------------------------------------------------------------------------
12    # Parameters
13    # -------------------------------------------------------------------------
14
15    # Borehole dimensions
16    D = 4.0             # Borehole buried depth (m)
17    H = 150.0           # Borehole length (m)
18    r_b = 0.075         # Borehole radius (m)
19
20    # Borehole positions
21    # Note: Two duplicate boreholes have been added to this list of positions.
22    #       Position 1 has a borehole that is directly on top of another bore
23    #       Position 2 has a borehole with radius inside of another bore
24    #       The duplicates will be removed with the remove_duplicates function
25    x = np.array([0., 0., 0.03, 5., 3.5, 1., 5.5])
26    y = np.array([0., 0., 0.00, 0., 4.0, 7., 5.5])
27
28    # -------------------------------------------------------------------------
29    # Borehole field
30    # -------------------------------------------------------------------------
31
32    # Build list of boreholes
33    borefield = gt.borefield.Borefield(H, D, r_b, x, y)
34
35    # -------------------------------------------------------------------------
36    # Find and remove duplicates from borehole field
37    # -------------------------------------------------------------------------
38    borefield = gt.borefield.Borefield.from_boreholes(
39        gt.boreholes.remove_duplicates(borefield, disp=True))
40
41    # -------------------------------------------------------------------------
42    # Draw bore field
43    # -------------------------------------------------------------------------
44
45    borefield.visualize_field()
46
47    return
48
49
50# Main function
51if __name__ == '__main__':
52    main()