From f47f6aec56253dc34f09cca962acb81f9e75c925 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Sat, 22 Jan 2022 19:35:06 -0700 Subject: [PATCH 1/3] updates monthly peak loads based on the max of the two-day peak load period --- .gitignore | 6 ++++++ ghedt/peak_load_analysis_tool/ground_loads.py | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8a22379..cab69c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ Create_Branch.sh ghedt/ghedt-examples/ + +# pycharm +.idea/ + +*.egg-info/ +*__pycache__/ diff --git a/ghedt/peak_load_analysis_tool/ground_loads.py b/ghedt/peak_load_analysis_tool/ground_loads.py index 5aa4bbf..9d18a1d 100644 --- a/ghedt/peak_load_analysis_tool/ground_loads.py +++ b/ghedt/peak_load_analysis_tool/ground_loads.py @@ -259,7 +259,7 @@ def split_heat_and_cool(hourly_heat_extraction, units='W'): if l_hour >= 0.0: # Heat is extracted from ground when > 0 hourly_extraction_loads[i] = l_hour / scale - elif l_hour < 0.0: + else: # Heat is rejected to ground when < 0 hourly_rejection_loads[i] = l_hour / -scale @@ -455,8 +455,15 @@ def find_peak_durations(self) -> None: # two day cooling loads (or heat rejection) in kWh current_two_day_cl_load = \ [0.] + self.two_day_hourly_peak_cl_loads[i] + # monthly peak cooling load (or heat rejection) in kW + # check if the max monthly load is the same as the max load in the two-day data + if abs(self.monthly_peak_cl[i] - max(current_two_day_cl_load)) > 0.1: + # loads do not match with tolerance - update peak load accordingly + self.monthly_peak_cl[i] = max(current_two_day_cl_load) + current_month_peak_cl = self.monthly_peak_cl[i] + # monthly average cooling load (or heat rejection) in kW current_month_avg_cl = self.monthly_avg_cl[i] @@ -475,8 +482,15 @@ def find_peak_durations(self) -> None: # two day heating loads (or heat extraction) in kWh current_two_day_hl_load = \ [0.] + self.two_day_hourly_peak_hl_loads[i] + # monthly peak heating load (or heat extraction) in kW + # check if the max monthly load is the same as the max load in the two-day data + if abs(self.monthly_peak_hl[i] - max(current_two_day_hl_load)) > 0.1: + # loads do not match with tolerance - update peak load accordingly + self.monthly_peak_hl[i] = max(current_two_day_hl_load) + current_month_peak_hl = self.monthly_peak_hl[i] + # monthly average heating load (or heat extraction) in kW current_month_avg_hl = self.monthly_avg_hl[i] From d07fdeb0f88e5811af1b5dec516ebb790a9b9bde Mon Sep 17 00:00:00 2001 From: j-c-cook Date: Sat, 22 Jan 2022 20:58:22 -0600 Subject: [PATCH 2/3] Update local variables only and check for positive --- ghedt/peak_load_analysis_tool/ground_loads.py | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/ghedt/peak_load_analysis_tool/ground_loads.py b/ghedt/peak_load_analysis_tool/ground_loads.py index 9d18a1d..a7e3b8d 100644 --- a/ghedt/peak_load_analysis_tool/ground_loads.py +++ b/ghedt/peak_load_analysis_tool/ground_loads.py @@ -456,13 +456,16 @@ def find_peak_durations(self) -> None: current_two_day_cl_load = \ [0.] + self.two_day_hourly_peak_cl_loads[i] + # 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 - # check if the max monthly load is the same as the max load in the two-day data - if abs(self.monthly_peak_cl[i] - max(current_two_day_cl_load)) > 0.1: - # loads do not match with tolerance - update peak load accordingly - self.monthly_peak_cl[i] = max(current_two_day_cl_load) - - current_month_peak_cl = self.monthly_peak_cl[i] + if load_diff > 0.0: + current_month_peak_cl = self.monthly_peak_cl[i] + else: + current_month_peak_cl = max(current_two_day_cl_load) # monthly average cooling load (or heat rejection) in kW current_month_avg_cl = self.monthly_avg_cl[i] @@ -483,13 +486,16 @@ def find_peak_durations(self) -> None: current_two_day_hl_load = \ [0.] + self.two_day_hourly_peak_hl_loads[i] - # monthly peak heating load (or heat extraction) in kW - # check if the max monthly load is the same as the max load in the two-day data - if abs(self.monthly_peak_hl[i] - max(current_two_day_hl_load)) > 0.1: - # loads do not match with tolerance - update peak load accordingly - self.monthly_peak_hl[i] = max(current_two_day_hl_load) - - current_month_peak_hl = self.monthly_peak_hl[i] + # 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_hl[i] - max(current_two_day_hl_load) + # monthly peak cooling load (or heat rejection) in kW + if load_diff > 0.0: + current_month_peak_hl = self.monthly_peak_hl[i] + else: + current_month_peak_hl = max(current_two_day_hl_load) # monthly average heating load (or heat extraction) in kW current_month_avg_hl = self.monthly_avg_hl[i] From f93c82e004cdd668ee12d78089cb6a6f1ec9da2e Mon Sep 17 00:00:00 2001 From: j-c-cook Date: Sun, 23 Jan 2022 07:28:15 -0600 Subject: [PATCH 3/3] Document changes --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 789b0e1..41ef1ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,11 +18,12 @@ non-exhaustive list of the possible categories issues could fall in: ### Enhances -* [Issue 81](https://github.com/j-c-cook/ghedt/issues/81) - The `near-square` design option in the `Design` object now requires the user to specify a land length which computes a maximum number of boreholes rather. This functionality replaces a hard-coded 32x32 maximum. +* [Issue 81](https://github.com/j-c-cook/ghedt/issues/81) - The `near-square` design option in the `Design` object now requires the user to specify a land length which computes a maximum number of boreholes rather. This functionality replaces a hard-coded 32x32 maximum. ### 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 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. ## Version 0.1