Skip to content

Commit

Permalink
Merge pull request #98 from j-c-cook/issue97_TouchUp84
Browse files Browse the repository at this point in the history
Revert back to @mitchute's logic addressing #84
  • Loading branch information
j-c-cook authored Jan 30, 2022
2 parents 3a4ad15 + 21c1fb3 commit 93d159c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ non-exhaustive list of the possible categories issues could fall in:
### Fixes

* [Issue 79](https://github.com/j-c-cook/ghedt/issues/79) - Fixes the possibility for the peak load analysis tool to determine a negative peak load duration when the first month contains no load.
* [Issue 84](https://github.com/j-c-cook/ghedt/issues/84) - Fixes the two-day peak simulation to utilize the peak load from either the 48-hour profile or the current month.
* [Issue 84](https://github.com/j-c-cook/ghedt/issues/84) - Fixes the possibility of the nominal simulation having a greater temperature change than the peak simulation when the peak day occurs on the first of a month by introducing a check to ensure the two-day peak simulation utilizes the peak load from either the 48-hour load profile or the current month.

## Version 0.1

Expand Down
16 changes: 14 additions & 2 deletions ghedt/peak_load_analysis_tool/ground_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,25 @@ def find_peak_durations(self) -> None:
current_two_day_cl_load = \
[0.] + self.two_day_hourly_peak_cl_loads[i]

# This tolerance applies to the difference between the current
# months peak load and the maximum of the two-day load. If the
# absolute value of the difference between the current months
# peak load and the current two-day peak load is within this
# tolerance, then the maximum of the two-day load is equal to the
# maximum of the current month. If the absolute difference is
# greater than the tolerance, then the two-day peak load contains
# a load greater than the current months peak load. The tolerance
# could ONLY be exceeded when the first 24 hours is located in the
# previous month.
tol = 0.1

# Ensure the peak load for the two-day load profile is the same or
# greater than the monthly peak load. This check is done in case
# the previous month contains a higher load than the current month.
load_diff = \
self.monthly_peak_cl[i] - max(current_two_day_cl_load)
# monthly peak cooling load (or heat rejection) in kW
if load_diff > 0.0:
if abs(load_diff) < tol:
current_month_peak_cl = self.monthly_peak_cl[i]
else:
current_month_peak_cl = max(current_two_day_cl_load)
Expand Down Expand Up @@ -492,7 +504,7 @@ def find_peak_durations(self) -> None:
load_diff = \
self.monthly_peak_hl[i] - max(current_two_day_hl_load)
# monthly peak cooling load (or heat rejection) in kW
if load_diff > 0.0:
if abs(load_diff) < tol:
current_month_peak_hl = self.monthly_peak_hl[i]
else:
current_month_peak_hl = max(current_two_day_hl_load)
Expand Down

0 comments on commit 93d159c

Please sign in to comment.