Work with multiple ground layers

 1"""
 2This example sizes a borefield using the advanced option of using multiple ground layers.
 3"""
 4
 5from GHEtool import *
 6from GHEtool.Validation.cases import load_case
 7
 8
 9def multiple_ground_layers():
10    # initiate borefield model
11    borefield = Borefield()
12    borefield.create_rectangular_borefield(10, 10, 6, 6, 110, 0, 0.075)
13    borefield.set_Rb(0.12)
14
15    # set temperature boundaries
16    borefield.set_max_avg_fluid_temperature(16)  # maximum temperature
17    borefield.set_min_avg_fluid_temperature(0)  # minimum temperature
18    borefield.load = MonthlyGeothermalLoadAbsolute(*load_case(4))
19
20    # create two ground classes
21    constant_ks = GroundFluxTemperature(1.7, 10)
22
23    layer_1 = GroundLayer(k_s=1.7, thickness=4.9)
24    layer_2 = GroundLayer(k_s=2.3, thickness=1.9)
25    layer_3 = GroundLayer(k_s=2.1, thickness=3)
26    layer_4 = GroundLayer(k_s=1.5, thickness=69.7)
27    layer_5 = GroundLayer(k_s=2.1, thickness=16.1)
28    layer_6 = GroundLayer(k_s=1.7, thickness=None)
29
30    layered_ground = GroundFluxTemperature(T_g=10)
31    layered_ground.add_layer_on_bottom([layer_1, layer_2, layer_3, layer_4, layer_5, layer_6])
32
33    # size borefield according to the two different ground data variables
34    borefield.ground_data = constant_ks
35    print(
36        f'The required borehole length is {borefield.size():.3f}m if you use a constant approximation for the ground conductivity.')
37
38    borefield.ground_data = layered_ground
39    print(
40        f'The required borehole length is {borefield.size():.3f}m if you use a detailed ground model with multiple layers.')
41
42
43if __name__ == "__main__":  # pragma: no cover
44    multiple_ground_layers()