Sizing method comparison (L2/L3/L4)

 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    load.load_hourly_profile(FOLDER.joinpath("Examples/hourly_profile.csv"), header=True, separator=";")
33    borefield.load = load
34    borefield.simulation_period = 100
35
36    ### size the borefield
37    # according to L2
38    L2_start = time.time()
39    depth_L2 = borefield.size(100, L2_sizing=True)
40
41    L2_stop = time.time()
42
43    # according to L3
44    L3_start = time.time()
45    depth_L3 = borefield.size(100, L3_sizing=True)
46    L3_stop = time.time()
47
48    # according to L4
49    L4_start = time.time()
50    depth_L4 = borefield.size(100, L4_sizing=True)
51    L4_stop = time.time()
52
53    ### print results
54    print("The sizing according to L2 took", round((L2_stop-L2_start) * 1000, 4), "ms and was", depth_L2, "m.")
55    print("The sizing according to L3 took", round((L3_stop-L3_start) * 1000, 4), "ms and was", depth_L3, "m.")
56    print("The sizing according to L4 took", round((L4_stop-L4_start) * 1000, 4), "ms and was", depth_L4, "m.")
57
58    borefield.plot_load_duration()
59    borefield.print_temperature_profile(plot_hourly=True)
60
61
62if __name__ == '__main__':   # pragma: no cover
63    compare()