Utilities Module

pygfunction.utilities.cardinal_point(direction)
pygfunction.utilities.erfint(x)

Integral of the error function.

Parameters
xfloat or array

Argument.

Returns
float or array

Integral of the error function.

pygfunction.utilities.exp1(x)

Exponential integral E1.

Parameters
xfloat or array

Argument.

Returns
E1float or array

Exponential integral.

References

1

Barry, D.A., Parlange, J.-Y. & Li, L. (2000). Approximation for the exponential integral (Theis well function). Journal of Hydrology, 227 (1-4): 287-291.

pygfunction.utilities.segment_ratios(nSegments, end_length_ratio=0.02)

Discretize a borehole into segments of different lengths using a geometrically expanding mesh from the provided end-length-ratio towards the middle of the borehole. Eskilson (1987) 2 proposed that segment lengths increase with a factor of sqrt(2) towards the middle of the borehole. Here, the expansion factor is inferred from the provided number of segments and end-length-ratio.

Parameters
nSegmentsint

Number of line segments along the borehole.

end_length_ratio: float, optional

The ratio of the height of the borehole that accounts for the end segment lengths. Default is 0.02.

Returns
segment_ratiosarray

The segment ratios along the borehole, from top to bottom.

References

2

Eskilson, P. (1987). Thermal analysis of heat extraction boreholes. PhD Thesis. University of Lund, Department of Mathematical Physics. Lund, Sweden.

Examples

>>> gt.utilities.segment_ratios(5)
array([0.02, 0.12, 0.72, 0.12, 0.02])
pygfunction.utilities.time_ClaessonJaved(dt, tmax, cells_per_level=5)

Build a time vector of expanding cell width following the method of Claesson and Javed 3.

Parameters
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

cells_per_levelint, optional

Number of time steps cells per level. Cell widths double every cells_per_level cells. Default is 5.

Returns
timearray

Time vector.

References

3

Claesson, J., & Javed, S. (2012). A load-aggregation method to calculate extraction temperatures of borehole heat exchangers. ASHRAE Transactions, 118 (1): 530-539.

Examples

>>> time = gt.utilities.time_ClaessonJaved(3600., 12*3600.)
array([3600.0, 7200.0, 10800.0, 14400.0, 18000.0, 25200.0, 32400.0,
       39600.0, 46800.0])
pygfunction.utilities.time_MarcottePasquier(dt, tmax, non_expanding_cells=48)

Build a time vector of expanding cell width following the method of Marcotte and Pasquier 4.

Parameters
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

non_expanding_cellsint, optional

Number of cells before geomteric expansion starts. Default is 48.

Returns
timearray

Time vector.

References

4

Marcotte, D., & Pasquier, P. (2008). Fast fluid and ground temperature computation for geothermal ground-loop heat exchanger systems. Geothermics, 37: 651-665.

Examples

>>> time = gt.utilities.time_MarcottePasquier(3600., 13*3600.,
                                              non_expanding_cells=6)
array([3600., 7200., 10800., 14400., 18000., 21600., 28800., 43200.,
       72000.])
pygfunction.utilities.time_geometric(dt, tmax, Nt)

Build a time vector of geometrically expanding cell width.

Parameters
dtfloat

Simulation time step (in seconds).

tmaxfloat

Maximum simulation time (in seconds).

Ntint

Total number of time steps.

Returns
timearray

Time vector.

Examples

>>> time = gt.utilities.time_geometric(3600., 13*3600., 5)
array([3600., 8971.99474335, 16988.19683297, 28950.14002383, 46800.])