|
2 | 2 | import numpy as np |
3 | 3 |
|
4 | 4 | from typing import Union |
5 | | -from GHEtool.VariableClasses import HourlyBuildingLoad, MonthlyBuildingLoadMultiYear, HourlyBuildingLoadMultiYear |
| 5 | +from GHEtool.VariableClasses import HourlyBuildingLoad, MonthlyBuildingLoadMultiYear, HourlyBuildingLoadMultiYear, \ |
| 6 | + ConstantFluidData, ConstantFlowRate |
6 | 7 |
|
7 | 8 |
|
8 | 9 | def optimise_load_profile_power( |
@@ -59,6 +60,12 @@ def optimise_load_profile_power( |
59 | 60 | if temperature_threshold < 0: |
60 | 61 | raise ValueError(f"The temperature threshold is {temperature_threshold}, but it cannot be below 0!") |
61 | 62 |
|
| 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 | + |
62 | 69 | # set load |
63 | 70 | borefield.load = copy.deepcopy(building_load) |
64 | 71 |
|
@@ -194,6 +201,12 @@ def optimise_load_profile_energy( |
194 | 201 | if temperature_threshold < 0: |
195 | 202 | raise ValueError(f"The temperature threshold is {temperature_threshold}, but it cannot be below 0!") |
196 | 203 |
|
| 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 | + |
197 | 210 | building_load_copy = copy.deepcopy(building_load) |
198 | 211 |
|
199 | 212 | # if building load is not a multi-year load, convert to multiyear |
@@ -398,6 +411,12 @@ def optimise_load_profile_balance( |
398 | 411 | if imbalance_factor > 1 or imbalance_factor < 0: |
399 | 412 | raise ValueError(f"The imbalance factor is {imbalance_factor}, but it should be between 0-1!") |
400 | 413 |
|
| 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 | + |
401 | 420 | # set load |
402 | 421 | borefield.load = copy.deepcopy(building_load) |
403 | 422 |
|
|
0 commit comments