|
7 | 7 | import pytest |
8 | 8 |
|
9 | 9 | from GHEtool import GroundConstantTemperature, GroundFluxTemperature, FluidData, DoubleUTube, Borefield, \ |
10 | | - CalculationSetup, FOLDER, MultipleUTube |
| 10 | + CalculationSetup, FOLDER, MultipleUTube, EERCombined |
11 | 11 | from GHEtool.logger import ghe_logger |
12 | 12 | from GHEtool.Validation.cases import load_case |
13 | 13 | from GHEtool.VariableClasses.LoadData import MonthlyGeothermalLoadAbsolute, HourlyGeothermalLoad, HourlyBuildingLoad, \ |
@@ -521,6 +521,26 @@ def test_size_L4(): |
521 | 521 | assert borefield.calculate_quadrant() == 4 |
522 | 522 |
|
523 | 523 |
|
| 524 | +def test_calculate_temperatures_eer_combined(): |
| 525 | + eer_combined = EERCombined(20, 5, 17) |
| 526 | + borefield = Borefield() |
| 527 | + borefield.set_ground_parameters(ground_data_constant) |
| 528 | + load = HourlyBuildingLoad(efficiency_cooling=eer_combined) |
| 529 | + |
| 530 | + borefield.borefield = copy.deepcopy(borefield_gt) |
| 531 | + load.load_hourly_profile(FOLDER.joinpath("Examples/hourly_profile.csv")) |
| 532 | + borefield.load = load |
| 533 | + borefield.calculate_temperatures(hourly=True) |
| 534 | + |
| 535 | + active_cooling_array = borefield.load.eer.get_time_series_active_cooling(borefield.results.peak_injection, |
| 536 | + borefield.load.month_indices) |
| 537 | + assert np.allclose(borefield.load.hourly_cooling_load_simulation_period * active_cooling_array * |
| 538 | + (1 + 1 / 5) + borefield.load.hourly_cooling_load_simulation_period * np.invert( |
| 539 | + active_cooling_array) * |
| 540 | + (1 + 1 / 20), |
| 541 | + borefield.load.hourly_injection_load_simulation_period) |
| 542 | + |
| 543 | + |
524 | 544 | def test_investment_cost(): |
525 | 545 | borefield = Borefield() |
526 | 546 | borefield.borefield = copy.deepcopy(borefield_gt) |
@@ -1086,3 +1106,24 @@ def test_deep_sizing(case, result): |
1086 | 1106 | def test_depreciation_warning(): |
1087 | 1107 | with pytest.raises(DeprecationWarning): |
1088 | 1108 | Borefield(baseload_heating=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) |
| 1109 | + |
| 1110 | + |
| 1111 | +def test_optimise_load_borefield(): |
| 1112 | + load = HourlyBuildingLoad() |
| 1113 | + load.load_hourly_profile(FOLDER.joinpath("Examples/hourly_profile.csv")) |
| 1114 | + load.simulation_period = 10 |
| 1115 | + borefield = Borefield(load=load) |
| 1116 | + borefield.set_min_avg_fluid_temperature(2) |
| 1117 | + borefield.set_max_avg_fluid_temperature(17) |
| 1118 | + borefield.borefield = gt.boreholes.rectangle_field(20, 4, 6, 6, 150, 1, 0.07) |
| 1119 | + borefield.Rb = 0.1699 |
| 1120 | + ground_data = GroundFluxTemperature(2, 9.6, flux=0.07) |
| 1121 | + borefield.ground_data = ground_data |
| 1122 | + borefield_load, external_load = borefield.optimise_load_profile_energy(load) |
| 1123 | + assert np.isclose(borefield_load.imbalance, -228386.82055766508) |
| 1124 | + borefield.load = borefield_load |
| 1125 | + borefield.calculate_temperatures(hourly=False) |
| 1126 | + assert np.isclose(np.max(borefield.results.peak_injection), 17.044473901670603) |
| 1127 | + assert np.isclose(np.min(borefield.results.peak_extraction), 1.9471241454443655) |
| 1128 | + assert np.isclose(borefield.load.max_peak_cooling, 329.9393053) |
| 1129 | + assert np.isclose(np.sum(borefield.load.hourly_heating_load), 593385.1066074175) |
0 commit comments