Start simulation in a different month

 1"""
 2This example illustrates the importance of when a borefield is 'started' (i.e. when the first month of operation is).
 3"""
 4
 5from GHEtool import *
 6from GHEtool.Validation.cases import load_case
 7
 8import matplotlib.pyplot as plt
 9
10
11def start_in_different_month():
12    # set data
13    ground_data = GroundTemperatureGradient(2.5, 10)
14    load = MonthlyGeothermalLoadAbsolute(*load_case(1))
15
16    # create borefield object
17    borefield = Borefield(load=load)
18    borefield.ground_data = ground_data
19    borefield.create_rectangular_borefield(10, 8, 6, 6, 100)
20
21    borefield.set_max_avg_fluid_temperature(17)
22    borefield.set_min_avg_fluid_temperature(3)
23    borefield.calculation_setup(max_nb_of_iterations=100)
24
25    depth_list = []
26
27    # iterate over all the start months
28    for month in range(1, 13, 1):
29        borefield.load.start_month = month
30        depth_list.append(borefield.size_L3())
31
32    plt.figure()
33    plt.bar(range(1, 13, 1), depth_list)
34    plt.ylabel('Required depth [m]')
35    plt.xlabel('First month of operation')
36    plt.xlim(0)
37    plt.ylim(0)
38    plt.title('Required depth as a function of the first month of operation')
39    plt.show()
40
41
42if __name__ == "__main__":  # pragma: no cover
43    start_in_different_month()