1"""
2This document is an example of the different sizing methods in GHEtool.
3The example load profile is for a profile limited in the first year of operation.
4"""
5import time
6
7import numpy as np
8import pygfunction as gt
9
10# import all the relevant functions
11from GHEtool import *
12
13
14def compare():
15 # initiate ground data
16 data = GroundConstantTemperature(3, 10)
17
18 # initiate borefield
19 borefield = Borefield()
20
21 # set ground data in borefield
22 borefield.set_ground_parameters(data)
23
24 # set Rb
25 borefield.Rb = 0.12
26
27 # set the borefield
28 borefield.create_rectangular_borefield(10, 10, 6, 6, 110, 1, 0.075)
29
30 # load the hourly profile
31 load = HourlyGeothermalLoad()
32 print(FOLDER)
33 load.load_hourly_profile(FOLDER.joinpath("Examples/hourly_profile.csv"), header=True, separator=";")
34 borefield.load = load
35 borefield.simulation_period = 100
36
37 ### size the borefield
38 # according to L2
39 L2_start = time.time()
40 depth_L2 = borefield.size(100, L2_sizing=True)
41
42 L2_stop = time.time()
43
44 # according to L3
45 L3_start = time.time()
46 depth_L3 = borefield.size(100, L3_sizing=True)
47 L3_stop = time.time()
48
49 # according to L4
50 L4_start = time.time()
51 depth_L4 = borefield.size(100, L4_sizing=True)
52 L4_stop = time.time()
53
54 ### print results
55 print("The sizing according to L2 took", round((L2_stop-L2_start) * 1000, 4), "ms and was", depth_L2, "m.")
56 print("The sizing according to L3 took", round((L3_stop-L3_start) * 1000, 4), "ms and was", depth_L3, "m.")
57 print("The sizing according to L4 took", round((L4_stop-L4_start) * 1000, 4), "ms and was", depth_L4, "m.")
58
59 borefield.plot_load_duration()
60 borefield.print_temperature_profile(plot_hourly=True)
61
62
63if __name__ == '__main__': # pragma: no cover
64 compare()