1"""
2This document is an example of load optimisation.
3First an hourly profile is imported and a fixed borefield size is set.
4Then, based on a load-duration curve, the heating and cooling load is altered in order to fit as much load as possible on the field.
5The results are returned.
6
7"""
8import numpy as np
9
10# import all the relevant functions
11from GHEtool import *
12
13
14def optimise():
15
16 # initiate ground data
17 data = GroundConstantTemperature(3, 10)
18
19 # initiate borefield
20 borefield = Borefield()
21
22 # set ground data in borefield
23 borefield.set_ground_parameters(data)
24
25 # set Rb
26 borefield.Rb = 0.12
27
28 # set borefield
29 borefield.create_rectangular_borefield(10, 10, 6, 6, 110, 1, 0.075)
30
31 # load the hourly profile
32 load = HourlyGeothermalLoad()
33 load.load_hourly_profile("hourly_profile.csv", header=True, separator=";")
34
35 # optimise the load for a 10x10 field (see data above) and a fixed depth of 150m.
36 borefield.optimise_load_profile(building_load=load, depth=150, print_results=True)
37
38 # calculate temperatures
39 borefield.calculate_temperatures(hourly=True)
40
41 # print resulting external peak cooling profile
42 print(borefield._external_load.max_peak_cooling)
43
44 # print resulting monthly load for an external heating source
45 print(np.sum(borefield._external_load.hourly_heating_load))
46
47
48if __name__ == "__main__": # pragma: no cover
49 optimise()