Skip to content

Commit 01b9071

Browse files
committed
Fix small mistakes in 403
1 parent e0b7960 commit 01b9071

File tree

6 files changed

+60
-7
lines changed

6 files changed

+60
-7
lines changed

GHEtool/Borefield.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from scipy.signal import convolve
1717

1818
from GHEtool.VariableClasses import FluidData, Borehole, GroundConstantTemperature, ResultsMonthly, ResultsHourly, \
19-
TemperatureDependentFluidData
19+
TemperatureDependentFluidData, SCOP, SEER
2020
from GHEtool.VariableClasses import CustomGFunction, load_custom_gfunction, GFunction, CalculationSetup, Cluster, \
2121
EERCombined
2222
from GHEtool.VariableClasses.LoadData import *
@@ -1769,7 +1769,11 @@ def calculate_temperatures(H, hourly=hourly, results_temperature=ResultsMonthly(
17691769
results = None
17701770

17711771
def get_rb(temperature, limit=None):
1772-
if self.USE_SPEED_UP_IN_SIZING and sizing:
1772+
variable_efficiency = isinstance(self.load, _LoadDataBuilding) and not (
1773+
isinstance(self.load.cop, SCOP) and isinstance(self.load.cop_dhw, SCOP) and isinstance(
1774+
self.load.eer, SEER))
1775+
if self.USE_SPEED_UP_IN_SIZING and sizing and not variable_efficiency:
1776+
# use only extreme temperatures when sizing
17731777
if limit is not None:
17741778
if len(temperature) == 0:
17751779
return self.borehole.get_Rb(H, self.D, self.r_b, self.ground_data.k_s(depth, self.D), depth,

GHEtool/Validation/enhanced_sizing_method.py

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ def test_case_auditorium():
210210
hourly_load = HourlyGeothermalLoad()
211211
hourly_load.simulation_period = 20
212212
hourly_load.load_hourly_profile(FOLDER.joinpath("test\methods\hourly_data\\auditorium.csv"), header=True,
213-
separator=";",
214-
col_injection=0, col_extraction=1)
213+
separator=";", col_injection=0, col_extraction=1)
215214
borefield.load = hourly_load
216215
borefield.create_rectangular_borefield(5, 4, 6, 6, 110, 4, 0.075)
217216

@@ -247,8 +246,7 @@ def test_case_swimming_pool():
247246
hourly_load.simulation_period = 20
248247

249248
hourly_load.load_hourly_profile(FOLDER.joinpath("test\methods\hourly_data\\swimming_pool.csv"), header=True,
250-
separator=";",
251-
col_injection=0, col_extraction=1)
249+
separator=";", col_injection=0, col_extraction=1)
252250
borefield.load = hourly_load
253251
borefield.create_rectangular_borefield(15, 20, 6, 6, 110, 4, 0.075)
254252
start = time.time()
@@ -267,3 +265,38 @@ def test_case_swimming_pool():
267265
assert np.isclose(borefield.results.min_temperature, 3.0001877071926537)
268266
assert np.isclose(borefield.results.max_temperature, 12.919492619924261)
269267
print(f'Simulation time without speed up {time.time() - start}s')
268+
269+
270+
def test_case_auditorium_active_passive():
271+
borefield = Borefield()
272+
borefield.create_rectangular_borefield(10, 10, 6, 6, 110, 4, 0.075)
273+
borefield.ground_data = GroundFluxTemperature(3, 10)
274+
borefield.fluid_data = TemperatureDependentFluidData('MPG', 25, mass_percentage=False)
275+
borefield.flow_data = ConstantFlowRate(vfr=0.3)
276+
borefield.pipe_data = DoubleUTube(1, 0.015, 0.02, 0.4, 0.05)
277+
borefield.calculation_setup(use_constant_Rb=False)
278+
borefield.set_max_avg_fluid_temperature(25)
279+
borefield.set_min_avg_fluid_temperature(3)
280+
hourly_load = HourlyBuildingLoad()
281+
hourly_load.simulation_period = 20
282+
hourly_load.load_hourly_profile(FOLDER.joinpath("test\methods\hourly_data\\auditorium.csv"), header=True,
283+
separator=";", col_cooling=0, col_heating=1)
284+
hourly_load.eer = EERCombined(20, 5, 17)
285+
borefield.load = hourly_load
286+
borefield.create_rectangular_borefield(5, 4, 6, 6, 110, 4, 0.075)
287+
start = time.time()
288+
289+
borefield.size_L4()
290+
assert np.isclose(borefield.H, 51.676740693499106)
291+
assert np.isclose(borefield.results.min_temperature, 3.0002733156958086)
292+
assert np.isclose(borefield.results.max_temperature, 23.824518064283197)
293+
print(f'Simulation time with speed up {time.time() - start}s')
294+
295+
borefield.USE_SPEED_UP_IN_SIZING = False
296+
start = time.time()
297+
298+
borefield.size_L4()
299+
assert np.isclose(borefield.H, 51.676740693499106)
300+
assert np.isclose(borefield.results.min_temperature, 3.0002733156958086)
301+
assert np.isclose(borefield.results.max_temperature, 23.824518064283197)
302+
print(f'Simulation time without speed up {time.time() - start}s')
80 Bytes
Binary file not shown.

GHEtool/test/test_validation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ def test_validation_ANN():
6969
def test_faster_sizing():
7070
from GHEtool.Validation.enhanced_sizing_method import test_monthly_quadrant_1, \
7171
test_monthly_quadrant_1_more_data_points, test_monthly_quadrant_2, test_monthly_quadrant_4, test_case_office, \
72-
test_case_auditorium, test_case_swimming_pool
72+
test_case_auditorium, test_case_swimming_pool, test_case_auditorium_active_passive
7373
test_monthly_quadrant_1()
7474
test_monthly_quadrant_2()
7575
test_monthly_quadrant_4()
7676
test_monthly_quadrant_1_more_data_points()
7777
test_case_auditorium()
7878
test_case_office()
7979
test_case_swimming_pool()
80+
test_case_auditorium_active_passive()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
***********************************************************
2+
Enhanced sizing method
3+
***********************************************************
4+
5+
.. literalinclude:: ../../../../GHEtool/Validation/enhanced_sizing_method.py
6+
:language: python
7+
:linenos:

docs/sources/code/validation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,12 @@ The validation of the artificial neural network, used in GHEtool, can be found h
5656
:maxdepth: 1
5757
5858
Validation/artificial_neural_network.rst
59+
```
60+
61+
The validation for the enhanced and faster sizing method, can be found here.
62+
63+
```{toctree}
64+
:maxdepth: 1
65+
66+
Validation/enhanced_sizing_method.rst
5967
```

0 commit comments

Comments
 (0)