Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue306 bug in optimise energy profile #307

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ our [project board](https://github.com/users/wouterpeere/projects/2) on GitHub.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [2.3.0] - unpublished
## [2.3.1] - unpublished

## Fixed

- Problem with optimise energy profile (issue #306).

## [2.3.0] - 2024-11-05

## Added

Expand Down Expand Up @@ -354,6 +360,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- fixed bug in interpolation

[2.3.0]: https://github.com/wouterpeere/GHEtool/compare/v2.2.2...v2.3.0

[2.2.2]: https://github.com/wouterpeere/GHEtool/compare/v2.2.1...v2.2.2

[2.2.1]: https://github.com/wouterpeere/GHEtool/compare/v2.2.0...v2.2.1
Expand Down
4 changes: 2 additions & 2 deletions GHEtool/Methods/optimise_load_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ def optimise_load_profile_energy(
borefield.load = monthly_load

# store initial monthly peak loads
peak_heating = monthly_load.monthly_peak_heating_simulation_period
peak_cooling = monthly_load.monthly_peak_cooling_simulation_period
peak_heating = copy.copy(monthly_load.monthly_peak_heating_simulation_period)
peak_cooling = copy.copy(monthly_load.monthly_peak_cooling_simulation_period)

for i in range(12 * borefield.load.simulation_period):
# set iteration criteria
Expand Down
22 changes: 18 additions & 4 deletions GHEtool/test/methods/method_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@
21.65199, 35.8583, 56.14555, 61.92114,
name='Optimise load profile (stuck in loop) (power, hourly)',
power=True, hourly=True))
list_of_test_objects.add(OptimiseLoadProfileObject(borefield, load, 146, 89.1681, 97.6848,
56.49199, 71.1038, 55.13048, 66.55643,
list_of_test_objects.add(OptimiseLoadProfileObject(borefield, load, 146, 89.31225880363472, 98.37453537405028,

Check warning on line 506 in GHEtool/test/methods/method_data.py

View check run for this annotation

Codecov / codecov/patch

GHEtool/test/methods/method_data.py#L506

Added line #L506 was not covered by tests
56.49199, 74.7635850227125, 54.86173917367975, 56.577818731384966,
name='Optimise load profile (stuck in loop) (energy)', power=False))

ground_data = GroundFluxTemperature(3, 10)
Expand Down Expand Up @@ -581,7 +581,21 @@
512.6954920945816,
name='Optimise load profile (eer combined) (power)', power=True,
hourly=False))
list_of_test_objects.add(OptimiseLoadProfileObject(borefield, load, 146, 38.165390819460434, 4.08828744800462,
75.9124206410309, 86.06503815919983, 631.1307699700886, 535.936136,
list_of_test_objects.add(OptimiseLoadProfileObject(borefield, load, 146, 50.187981717163034, 12.82812330930278,

Check warning on line 584 in GHEtool/test/methods/method_data.py

View check run for this annotation

Codecov / codecov/patch

GHEtool/test/methods/method_data.py#L584

Added line #L584 was not covered by tests
95.636899472386, 66.33595162152281, 603.0319153178363,
509.73531422797737,
name='Optimise load profile (eer combined) (energy)', power=False,
hourly=False))

data = GroundFluxTemperature(1.8, 9.7, flux=0.08)
borefield = Borefield()
borefield.set_ground_parameters(data)
borefield.Rb = 0.131
borefield.create_rectangular_borefield(3, 5, 6, 6, 100, 1, 0.07)
load = HourlyBuildingLoad(efficiency_heating=4.5, efficiency_cooling=20)
load.load_hourly_profile(FOLDER.joinpath("test\methods\hourly_data\\auditorium.csv"), header=True, separator=";",

Check warning on line 596 in GHEtool/test/methods/method_data.py

View check run for this annotation

Codecov / codecov/patch

GHEtool/test/methods/method_data.py#L590-L596

Added lines #L590 - L596 were not covered by tests
col_cooling=0, col_heating=1)
list_of_test_objects.add(OptimiseLoadProfileObject(borefield, load, 100, 100.0, 92.80988709011142,

Check warning on line 598 in GHEtool/test/methods/method_data.py

View check run for this annotation

Codecov / codecov/patch

GHEtool/test/methods/method_data.py#L598

Added line #L598 was not covered by tests
25.315, 42.463997436869896, 0.0, 64.1435824039379,
name='Optimise load profile (auditorium) (energy)', power=False,
hourly=False))
1 change: 0 additions & 1 deletion GHEtool/test/methods/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def test_optimise(input, result):
np.sum(load.hourly_heating_load_simulation_period) * 100
_percentage_injection = np.sum(borefield_load.hourly_cooling_load_simulation_period) / \
np.sum(load.hourly_cooling_load_simulation_period) * 100

assert np.isclose(_percentage_extraction, percentage_extraction)
assert np.isclose(_percentage_injection, percentage_injection)
assert np.isclose(borefield_load.max_peak_extraction, peak_extraction_geo)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = GHEtool
version = 2.3.0
version = 2.3.1.dev0
author = Wouter Peere
author_email = [email protected]
description = Python package for borefield sizing
Expand Down
Loading