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