Definition of a bore field using external text fileΒΆ
This example demonstrates the use of the borehole module to define the positions of the boreholes within a bore field from an external text file.
The following script generates a bore field with 32 boreholes. The field is then plotted on a figure.
The script is located in: ./pygfunction/examples/custom_bore_field_from_file.py
1# -*- coding: utf-8 -*-
2""" Example of definition of a bore field using custom borehole positions.
3
4"""
5import os
6
7import pygfunction as gt
8
9
10def main():
11 # -------------------------------------------------------------------------
12 # Parameters
13 # -------------------------------------------------------------------------
14
15 # File path to bore field text file
16 base_dir = os.path.dirname(os.path.abspath(__file__))
17 file_path = os.path.join(base_dir, 'data', 'custom_field_32_boreholes.txt')
18
19 # -------------------------------------------------------------------------
20 # Borehole field
21 # -------------------------------------------------------------------------
22
23 # Build list of boreholes
24 borefield = gt.borefield.Borefield.from_file(file_path)
25
26 # -------------------------------------------------------------------------
27 # Draw bore field
28 # -------------------------------------------------------------------------
29
30 borefield.visualize_field()
31
32 return
33
34
35# Main function
36if __name__ == '__main__':
37 main()