Skip to content

Commit cef51e4

Browse files
committed
- Add test in optimisation methods to use fixed Rb when constant fluid and flow rate data
1 parent 5133120 commit cef51e4

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

GHEtool/Methods/optimise_load_profile.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import numpy as np
33

44
from typing import Union
5-
from GHEtool.VariableClasses import HourlyBuildingLoad, MonthlyBuildingLoadMultiYear, HourlyBuildingLoadMultiYear
5+
from GHEtool.VariableClasses import HourlyBuildingLoad, MonthlyBuildingLoadMultiYear, HourlyBuildingLoadMultiYear, \
6+
ConstantFluidData, ConstantFlowRate
67

78

89
def optimise_load_profile_power(
@@ -59,6 +60,12 @@ def optimise_load_profile_power(
5960
if temperature_threshold < 0:
6061
raise ValueError(f"The temperature threshold is {temperature_threshold}, but it cannot be below 0!")
6162

63+
# since the depth does not change, the Rb* value is constant, if there is no temperature dependent fluid data
64+
if isinstance(borefield.borehole.fluid_data, ConstantFluidData) \
65+
and isinstance(borefield.borehole.flow_data, ConstantFlowRate):
66+
borefield.Rb = borefield.borehole.get_Rb(borefield.H, borefield.D, borefield.r_b,
67+
borefield.ground_data.k_s(borefield.depth, borefield.D))
68+
6269
# set load
6370
borefield.load = copy.deepcopy(building_load)
6471

@@ -194,6 +201,12 @@ def optimise_load_profile_energy(
194201
if temperature_threshold < 0:
195202
raise ValueError(f"The temperature threshold is {temperature_threshold}, but it cannot be below 0!")
196203

204+
# since the depth does not change, the Rb* value is constant, if there is no temperature dependent fluid data
205+
if isinstance(borefield.borehole.fluid_data, ConstantFluidData) \
206+
and isinstance(borefield.borehole.flow_data, ConstantFlowRate):
207+
borefield.Rb = borefield.borehole.get_Rb(borefield.H, borefield.D, borefield.r_b,
208+
borefield.ground_data.k_s(borefield.depth, borefield.D))
209+
197210
building_load_copy = copy.deepcopy(building_load)
198211

199212
# if building load is not a multi-year load, convert to multiyear
@@ -398,6 +411,12 @@ def optimise_load_profile_balance(
398411
if imbalance_factor > 1 or imbalance_factor < 0:
399412
raise ValueError(f"The imbalance factor is {imbalance_factor}, but it should be between 0-1!")
400413

414+
# since the depth does not change, the Rb* value is constant, if there is no temperature dependent fluid data
415+
if isinstance(borefield.borehole.fluid_data, ConstantFluidData) \
416+
and isinstance(borefield.borehole.flow_data, ConstantFlowRate):
417+
borefield.Rb = borefield.borehole.get_Rb(borefield.H, borefield.D, borefield.r_b,
418+
borefield.ground_data.k_s(borefield.depth, borefield.D))
419+
401420
# set load
402421
borefield.load = copy.deepcopy(building_load)
403422

0 commit comments

Comments
 (0)