Skip to content

Commit d0b9c0f

Browse files
authored
Merge pull request #416 from wouterpeere/issue338-planned-depreciations-for-v240
Issue338 planned depreciations for v240
2 parents d8a05d3 + f6c49d1 commit d0b9c0f

File tree

25 files changed

+258
-590
lines changed

25 files changed

+258
-590
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1616
### Changed
1717

1818
- Changed implementation of `optimise_for_energy` to make it three times faster (issue #308).
19+
- Remove FluidClass (issue #338).
20+
- Remove custom_gfunction from Borefield class initiation (issue #338).
21+
- Remove baseload extraction/injection and peak extraction/injection from Borefield class initiation (issue #338).
22+
- Remove set_ground_parameters, set_fluid_parameters, set_pipe_parameters from Borefield class (issue #338).
1923
- Add support for EPW files from PVGIS (issue #376).
2024
- Fix problem with start month in optimise for power/balance (issue #380).
2125
- Return multiyear external load if multiyear load is given as an input (issue #380).

GHEtool/Borefield.py

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ class Borefield(BaseClass):
4646

4747
def __init__(
4848
self,
49-
peak_extraction: ArrayLike = None,
50-
peak_injection: ArrayLike = None,
51-
baseload_extraction: ArrayLike = None,
52-
baseload_injection: ArrayLike = None,
5349
borefield: gt.borefield.Borefield = None,
54-
custom_gfunction: CustomGFunction = None,
5550
*,
5651
load: _LoadData = None,
5752
ground_data: _GroundData = GroundConstantTemperature(),
@@ -64,18 +59,8 @@ def __init__(
6459
6560
Parameters
6661
----------
67-
peak_extraction : list, numpy array
68-
Monthly peak extraction values [kW]
69-
peak_injection : list, numpy array
70-
Monthly peak injection values [kW]
71-
baseload_extraction : list, numpy array
72-
Monthly baseload extraction values [kWh]
73-
baseload_injection : list, numpy array
74-
Monthly baseload extraction values [kWh]
7562
borefield : pygfunction borehole/borefield object
7663
Set the borefield for which the calculations will be carried out
77-
custom_gfunction : CustomGFunction
78-
Custom gfunction dataset
7964
load : _LoadData
8065
Load data of the borefield
8166
ground_data : _GroundData
@@ -96,11 +81,6 @@ def __init__(
9681
if len(kwargs) != 0:
9782
raise ValueError('Please check your input for the Borefield class')
9883

99-
if custom_gfunction is not None:
100-
warnings.warn(
101-
'From version 2.4.0 it will no longer be possible to initiate a borefield object with a custom gfunction.'
102-
'Please use the load_custom_gfunction function.', DeprecationWarning)
103-
self.custom_gfunction: CustomGFunction = custom_gfunction
10484
self.gfunction_calculation_object: GFunction = GFunction()
10585

10686
# initialize variables for temperature plotting
@@ -133,12 +113,8 @@ def __init__(
133113
if load is not None:
134114
self.load = load
135115
else:
136-
warnings.warn('From version 2.4.0 you will need to load a load object instead of the base and peak load.',
137-
DeprecationWarning)
138-
self.load = MonthlyGeothermalLoadAbsolute(baseload_extraction,
139-
baseload_injection,
140-
peak_extraction,
141-
peak_injection)
116+
117+
self.load = MonthlyGeothermalLoadAbsolute()
142118

143119
# set investment cost
144120
self.cost_investment: list = Borefield.DEFAULT_INVESTMENT
@@ -660,24 +636,6 @@ def ground_data(self, data: _GroundData) -> None:
660636
# the stored gfunction data should be deleted
661637
self.gfunction_calculation_object.remove_previous_data()
662638

663-
def set_ground_parameters(self, data: _GroundData) -> None:
664-
"""
665-
This function sets the relevant ground parameters.
666-
667-
Parameters
668-
----------
669-
data : GroundData
670-
All the relevant ground data
671-
672-
Returns
673-
-------
674-
None
675-
"""
676-
warnings.warn(
677-
'From version 2.4.0 this function will be depreciated. Please set the ground properties by using a direct '
678-
'assignment.', DeprecationWarning)
679-
self.ground_data = data
680-
681639
@property
682640
def pipe_data(self) -> _PipeData:
683641
"""
@@ -762,42 +720,6 @@ def flow_data(self, data: _FlowData) -> None:
762720
"""
763721
self.borehole.flow_data = data
764722

765-
def set_fluid_parameters(self, data: _FluidData) -> None:
766-
"""
767-
This function sets the fluid parameters.
768-
769-
Parameters
770-
----------
771-
data : FluidData
772-
All the relevant fluid data
773-
774-
Returns
775-
-------
776-
None
777-
"""
778-
warnings.warn(
779-
'From version 2.4.0 this function will be depreciated. Please set the fluid properties by using a direct '
780-
'assignment.', DeprecationWarning)
781-
self.fluid_data = data
782-
783-
def set_pipe_parameters(self, data: _PipeData) -> None:
784-
"""
785-
This function sets the pipe parameters.
786-
787-
Parameters
788-
----------
789-
data : PipeData
790-
All the relevant pipe parameters
791-
792-
Returns
793-
-------
794-
None
795-
"""
796-
warnings.warn(
797-
'From version 2.4.0 this function will be depreciated. Please set the pipe properties by using a direct '
798-
'assignment.', DeprecationWarning)
799-
self.pipe_data = data
800-
801723
def set_Rb(self, Rb: float) -> None:
802724
"""
803725
This function sets the constant equivalent borehole thermal resistance.

GHEtool/Examples/effect_of_borehole_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def effect_borefield_configuration():
5656

5757
# set ground parameters to borefield
5858
borefield.set_borefield(borefield_gt)
59-
borefield.set_ground_parameters(data)
59+
borefield.ground_data = data
6060

6161
# set Rb
6262
borefield.Rb = 0.2

GHEtool/Examples/energy_pile.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

GHEtool/Validation/comparison_with_other_sizing_tools/test1a/test1a.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
def test_1a_6h():
2323
# initiate ground, fluid and pipe data
2424
ground_data = GroundFluxTemperature(k_s=1.8, T_g=17.5, volumetric_heat_capacity=2073600, flux=0)
25-
fluid_data = FluidData(mfr=0.440, rho=1052, Cp=3795, mu=0.0052, k_f=0.48)
25+
fluid_data = ConstantFluidData(rho=1052, cp=3795, mu=0.0052, k_f=0.48)
26+
flow_data = ConstantFlowRate(mfr=0.44)
2627
pipe_data = MultipleUTube(r_in=0.0137, r_out=0.0167, D_s=0.075 / 2, k_g=1.4, k_p=0.43, number_of_pipes=1)
2728

2829
# start test with dynamic Rb*
2930
# initiate borefield
3031
borefield = Borefield()
3132

3233
# set ground data in borefield
33-
borefield.set_ground_parameters(ground_data)
34-
borefield.set_fluid_parameters(fluid_data)
35-
borefield.set_pipe_parameters(pipe_data)
34+
borefield.ground_data = ground_data
35+
borefield.fluid_data = fluid_data
36+
borefield.pipe_data = pipe_data
37+
borefield.flow_data = flow_data
3638
borefield.create_rectangular_borefield(1, 1, 6, 6, 110, 4, 0.075)
3739

3840
# load the hourly profile
@@ -41,7 +43,7 @@ def test_1a_6h():
4143
col_extraction=1, col_injection=0)
4244
borefield.load = load
4345

44-
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.Cp * fluid_data.mfr)
46+
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.cp() * flow_data.mfr())
4547

4648
# set temperature bounds
4749
borefield.set_max_avg_fluid_temperature(35 + delta_t / 2)
@@ -120,7 +122,8 @@ def test_1a_6h():
120122
def test_1a_1h():
121123
# initiate ground, fluid and pipe data
122124
ground_data = GroundFluxTemperature(k_s=1.8, T_g=17.5, volumetric_heat_capacity=2073600, flux=0)
123-
fluid_data = FluidData(mfr=0.440, rho=1052, Cp=3795, mu=0.0052, k_f=0.48)
125+
fluid_data = ConstantFluidData(rho=1052, cp=3795, mu=0.0052, k_f=0.48)
126+
flow_data = ConstantFlowRate(mfr=0.44)
124127
pipe_data = MultipleUTube(r_in=0.0137, r_out=0.0167, D_s=0.075 / 2, k_g=1.4, k_p=0.43, number_of_pipes=1)
125128

126129
# start test with dynamic Rb*
@@ -131,6 +134,7 @@ def test_1a_1h():
131134
borefield.ground_data = ground_data
132135
borefield.fluid_data = fluid_data
133136
borefield.pipe_data = pipe_data
137+
borefield.flow_data = flow_data
134138
borefield.create_rectangular_borefield(1, 1, 6, 6, 110, 4, 0.075)
135139

136140
# load the hourly profile
@@ -140,7 +144,7 @@ def test_1a_1h():
140144
borefield.load = load
141145
borefield.load.peak_duration = 1
142146

143-
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.Cp * fluid_data.mfr)
147+
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.cp() * flow_data.mfr())
144148

145149
# set temperature bounds
146150
borefield.set_max_avg_fluid_temperature(35 + delta_t / 2)

GHEtool/Validation/comparison_with_other_sizing_tools/test1b/test1b.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
def test_1b():
2323
# initiate ground, fluid and pipe data
2424
ground_data = GroundFluxTemperature(k_s=1.8, T_g=17.5, volumetric_heat_capacity=2073600, flux=0)
25-
fluid_data = FluidData(mfr=0.5585, rho=1052, Cp=3795, mu=0.0052, k_f=0.48)
25+
fluid_data = ConstantFluidData(rho=1052, cp=3795, mu=0.0052, k_f=0.48)
26+
flow_data = ConstantFlowRate(mfr=0.5585)
2627
pipe_data = MultipleUTube(r_in=0.0137, r_out=0.0167, D_s=0.075 / 2, k_g=1.4, k_p=0.43, number_of_pipes=1)
2728

2829
# start test with dynamic Rb*
2930
# initiate borefield
3031
borefield = Borefield()
3132

3233
# set ground data in borefield
33-
borefield.set_ground_parameters(ground_data)
34-
borefield.set_fluid_parameters(fluid_data)
35-
borefield.set_pipe_parameters(pipe_data)
34+
borefield.ground_data = ground_data
35+
borefield.fluid_data = fluid_data
36+
borefield.pipe_data = pipe_data
37+
borefield.flow_data = flow_data
3638
borefield.create_rectangular_borefield(1, 1, 6, 6, 110, 4, 0.075)
3739

3840
# load the hourly profile
@@ -42,7 +44,7 @@ def test_1b():
4244
col_injection=0)
4345
borefield.load = load
4446

45-
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.Cp * fluid_data.mfr)
47+
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.cp() * flow_data.mfr())
4648

4749
# set temperature bounds
4850
borefield.set_max_avg_fluid_temperature(35 + delta_t / 2)
@@ -72,9 +74,10 @@ def test_1b():
7274
borefield = Borefield()
7375

7476
# set ground data in borefield
75-
borefield.set_ground_parameters(ground_data)
76-
borefield.set_fluid_parameters(fluid_data)
77-
borefield.set_pipe_parameters(pipe_data)
77+
borefield.ground_data = ground_data
78+
borefield.fluid_data = fluid_data
79+
borefield.pipe_data = pipe_data
80+
borefield.flow_data = flow_data
7881
borefield.create_rectangular_borefield(1, 1, 6, 6, 110, 4, 0.075)
7982
Rb_static = 0.13
8083
borefield.set_Rb(Rb_static)

GHEtool/Validation/comparison_with_other_sizing_tools/test2/test2.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
def test_2_6h():
2323
# initiate ground, fluid and pipe data
2424
ground_data = GroundFluxTemperature(k_s=2.25, T_g=12.41, volumetric_heat_capacity=2877000, flux=0)
25-
fluid_data = FluidData(mfr=0.2416667, rho=1026, Cp=4019, mu=0.003377, k_f=0.468)
25+
fluid_data = ConstantFluidData(rho=1026, cp=4019, mu=0.003377, k_f=0.468)
26+
flow_data = ConstantFlowRate(mfr=0.2416667)
2627
pipe_data = MultipleUTube(r_in=0.0137, r_out=0.0167, D_s=0.0471 / 2, k_g=1.73, k_p=0.45)
2728

2829
# start test with dynamic Rb*
2930
# initiate borefield
3031
borefield = Borefield()
3132

3233
# set ground data in borefield
33-
borefield.set_ground_parameters(ground_data)
34-
borefield.set_fluid_parameters(fluid_data)
35-
borefield.set_pipe_parameters(pipe_data)
34+
borefield.ground_data = ground_data
35+
borefield.fluid_data = fluid_data
36+
borefield.pipe_data = pipe_data
37+
borefield.flow_data = flow_data
3638
borefield.create_rectangular_borefield(12, 10, 6, 6, 110, 3, 0.054)
3739

3840
# load the hourly profile
@@ -41,7 +43,7 @@ def test_2_6h():
4143
col_extraction=1, col_injection=0)
4244
borefield.load = load
4345

44-
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.Cp * fluid_data.mfr) / 120
46+
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.cp() * flow_data.mfr()) / 120
4547

4648
# set temperature bounds
4749
borefield.set_max_avg_fluid_temperature(35 + delta_t / 2)
@@ -70,9 +72,10 @@ def test_2_6h():
7072
borefield = Borefield()
7173

7274
# set ground data in borefield
73-
borefield.set_ground_parameters(ground_data)
74-
borefield.set_fluid_parameters(fluid_data)
75-
borefield.set_pipe_parameters(pipe_data)
75+
borefield.ground_data = ground_data
76+
borefield.fluid_data = fluid_data
77+
borefield.pipe_data = pipe_data
78+
borefield.flow_data = flow_data
7679
borefield.create_rectangular_borefield(12, 10, 6, 6, 110, 3, 0.054)
7780
Rb_static = 0.113
7881
borefield.set_Rb(Rb_static)

GHEtool/Validation/comparison_with_other_sizing_tools/test3/test3.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
def test_3_6h():
2323
# initiate ground, fluid and pipe data
2424
ground_data = GroundFluxTemperature(k_s=2.25, T_g=10, volumetric_heat_capacity=2592000, flux=0)
25-
fluid_data = FluidData(mfr=33.1 / 49, rho=1026, Cp=4019, mu=0.003377, k_f=0.468)
25+
fluid_data = ConstantFluidData(rho=1026, cp=4019, mu=0.003377, k_f=0.468)
26+
flow_data = ConstantFlowRate(mfr=33.1 / 49)
2627
pipe_data = MultipleUTube(r_in=0.013, r_out=0.0167, D_s=0.075 / 2, k_g=1.73, k_p=0.4, number_of_pipes=1)
2728

2829
# start test with dynamic Rb*
2930
# initiate borefield
3031
borefield = Borefield()
3132

3233
# set ground data in borefield
33-
borefield.set_ground_parameters(ground_data)
34-
borefield.set_fluid_parameters(fluid_data)
35-
borefield.set_pipe_parameters(pipe_data)
34+
borefield.ground_data = ground_data
35+
borefield.fluid_data = fluid_data
36+
borefield.pipe_data = pipe_data
37+
borefield.flow_data = flow_data
3638
borefield.create_rectangular_borefield(7, 7, 5, 5, 110, 2.5, 0.075)
3739

3840
# load the hourly profile
@@ -41,7 +43,7 @@ def test_3_6h():
4143
col_extraction=1, col_injection=0)
4244
borefield.load = load
4345

44-
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.Cp * fluid_data.mfr) / 49
46+
delta_t = max(load.max_peak_extraction, load.max_peak_injection) * 1000 / (fluid_data.cp() * flow_data.mfr()) / 49
4547

4648
# set temperature bounds
4749
borefield.set_max_avg_fluid_temperature(35 + delta_t / 2)
@@ -77,9 +79,10 @@ def test_3_6h():
7779
borefield = Borefield()
7880

7981
# set ground data in borefield
80-
borefield.set_ground_parameters(ground_data)
81-
borefield.set_fluid_parameters(fluid_data)
82-
borefield.set_pipe_parameters(pipe_data)
82+
borefield.ground_data = ground_data
83+
borefield.fluid_data = fluid_data
84+
borefield.pipe_data = pipe_data
85+
borefield.flow_data = flow_data
8386
borefield.create_rectangular_borefield(7, 7, B, B, 110, 2.5, 0.075)
8487
Rb_static = 0.1
8588
borefield.set_Rb(Rb_static)

0 commit comments

Comments
 (0)