Skip to content

Commit

Permalink
Implement example
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterpeere committed Aug 21, 2024
1 parent 93d971b commit 0c1d22c
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 32,549 deletions.
8,761 changes: 0 additions & 8,761 deletions GHEtool/Examples/hourly_profile_comma.csv

This file was deleted.

8,761 changes: 0 additions & 8,761 deletions GHEtool/Examples/hourly_profile_comma_as_sep.csv

This file was deleted.

8,761 changes: 0 additions & 8,761 deletions GHEtool/Examples/hourly_profile_same.csv

This file was deleted.

6,264 changes: 0 additions & 6,264 deletions GHEtool/Examples/hourly_profile_wrong.csv

This file was deleted.

102 changes: 102 additions & 0 deletions GHEtool/Examples/separatus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
"""
This file contains a design example with the Separatus probe, in comparison with a single and double U-tube.
A borehole diameter of DN90 was chosen for the Separatus probe whereas for the single and double U-tube a DN140 was assumed.
A mass flow rate of 0.3 kg/s was assumed for all cases and no glycol was taken into account.
The grout thermal conductivity is 2 W/(mK), and the borehole dimensions where 1x4 with a depth of 110m.
The building heating and cooling demand was obtained from a residential building in Belgium.
It is shown that both single U and Separatus have similar performance, whilst the double U-tube has a somewhat better
performance. These results have to be placed next to an economic evaluation of the different borefield designs.
"""

import numpy as np
import pygfunction as gt

from GHEtool import *

# set general parameters
ground_data = GroundFluxTemperature(1.9, 9.6, flux=0.07)
fluid_data = FluidData(mfr=0.3)
fluid_data.import_fluid_from_pygfunction(gt.media.Fluid('MPG', 0, 6))

# set building load
load = MonthlyBuildingLoadAbsolute(
baseload_heating=np.array([2105, 2081, 1686, 1196, 550, 0, 0, 0, 144, 777, 1471, 1961]),
baseload_cooling=np.array([0, 0, 0, 0, 682, 1248, 1650, 1608, 907, 0, 0, 0]),
peak_heating=np.array([9.2, 9.12, 7.38, 5.21, 2.43, 0, 0, 0, 0.61, 3.39, 6.42, 8.59]),
peak_cooling=np.array([0, 0, 0, 0, 3.61, 6.58, 8.7, 8.49, 4.78, 0, 0, 0]),
simulation_period=40,
dhw=2800,
efficiency_heating=5.03,
efficiency_cooling=20,
efficiency_dhw=3.93
)


def design_with_single_U():
"""
This function plots the temperature profile for a system with a single U-tube.
Returns
-------
None
"""
pipe_data = SingleUTube(2, 0.013, 0.016, 0.42, 0.035)

borefield = Borefield(load=load)
borefield.set_ground_parameters(ground_data)
borefield.set_fluid_parameters(fluid_data)
borefield.set_pipe_parameters(pipe_data)
borefield.set_min_avg_fluid_temperature(6)
borefield.set_max_avg_fluid_temperature(17)

borefield.create_rectangular_borefield(1, 4, 6, 6, 110, 0.7, 0.07)
borefield.print_temperature_profile()


def design_with_double_U():
"""
This function plots the temperature profile for a system with a double U-tube.
Returns
-------
None
"""
pipe_data = DoubleUTube(2, 0.013, 0.016, 0.42, 0.035)

borefield = Borefield(load=load)
borefield.set_ground_parameters(ground_data)
borefield.set_fluid_parameters(fluid_data)
borefield.set_pipe_parameters(pipe_data)
borefield.set_min_avg_fluid_temperature(6)
borefield.set_max_avg_fluid_temperature(17)

borefield.create_rectangular_borefield(1, 4, 6, 6, 110, 0.7, 0.07)
borefield.print_temperature_profile()


def design_with_separatus():
"""
This function plots the temperature profile for a system with a Separatus probe.
Returns
-------
None
"""
pipe_data = Separatus(2)

borefield = Borefield(load=load)
borefield.set_ground_parameters(ground_data)
borefield.set_fluid_parameters(fluid_data)
borefield.set_pipe_parameters(pipe_data)
borefield.set_min_avg_fluid_temperature(6)
borefield.set_max_avg_fluid_temperature(17)

borefield.create_rectangular_borefield(1, 4, 6, 6, 110, 0.7, 0.045)
borefield.print_temperature_profile()


if __name__ == "__main__":
design_with_single_U()
design_with_double_U()
design_with_separatus()
4 changes: 2 additions & 2 deletions GHEtool/VariableClasses/PipeData/Separatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def __init__(self, k_g: float = None):
Grout thermal conductivity [W/mK]
"""
super().__init__(k_g=k_g,
r_in=(35.74 / 2 - 1.5) * 0.001,
r_in=(35.74 / 2 - 3) * 0.001,
r_out=(35.74 / 2) * 0.001,
k_p=0.44,
D_s=36 / 2)
D_s=36 / 2 * 0.001)

def pipe_model(self, fluid_data: FluidData, k_s: float, borehole: gt.boreholes.Borehole) -> gt.pipes._BasePipe:
"""
Expand Down
Binary file modified GHEtool/test/test.gvalues
Binary file not shown.
8 changes: 8 additions & 0 deletions GHEtool/test/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,11 @@ def test_sizing_with_building_load_hourly(monkeypatch):
from GHEtool.Examples.sizing_with_building_load_hourly import L3_sizing, L4_sizing
assert np.allclose(L3_sizing(), (127.05154931011464, 6.131588043404349))
assert np.allclose(L4_sizing(), (153.26361812264668, 6.237959315069309))


def test_separatus(monkeypatch):
monkeypatch.setattr(plt, 'show', lambda: None)
from GHEtool.Examples.separatus import design_with_single_U, design_with_double_U, design_with_separatus
design_with_single_U()
design_with_double_U()
design_with_separatus()
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ Concretely, the classes you can use are:
* _Single U-tubes (special case of multiple U-tubes)_
* _Double U-tubes (special case of multiple U-tubes)_
* _Coaxial pipe_
* _Separatus tube_: The Separatus geothermal heat exchanger is an innovation in the geothermal domain. It consists of a
single, DN50 pipe with a unique 'splitpipe'-technology that separates the cold and the hot side of the fluid. For
design purposes, it is advised to use this with rather small borehole diameters of DN90. For more information visit
the [Separatus website]('https://separatus.ch/en/').

Please note that it is possible to add your own pipe types by inheriting the attributes from the abstract _PipeData
class.
Expand Down
7 changes: 7 additions & 0 deletions docs/sources/code/Examples/separatus.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
***********************************************************
Separatus
***********************************************************

.. literalinclude:: ../../../../GHEtool/Examples/separatus.py
:language: python
:linenos:
1 change: 1 addition & 0 deletions docs/sources/code/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Examples/effect_of_borehole_configuration.rst
Examples/import_data.rst
Examples/main_functionalities.rst
Examples/optimise_load_profile.rst
Examples/separatus.rst
Examples/sizing_with_building_load.rst
Examples/sizing_with_building_load_hourly.rst
Examples/sizing_with_Rb_calculation.rst
Expand Down
4 changes: 4 additions & 0 deletions docs/sources/code/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Concretely, the classes you can use are:
* _Single U-tubes (special case of multiple U-tubes)_
* _Double U-tubes (special case of multiple U-tubes)_
* _Coaxial pipe_
* _Separatus tube_: The Separatus geothermal heat exchanger is an innovation in the geothermal domain. It consists of a
single, DN50 pipe with a unique 'splitpipe'-technology that separates the cold and the hot side of the fluid. For
design purposes, it is advised to use this with rather small borehole diameters of DN90. For more information visit
the [Separatus website]('https://separatus.ch/en/').

Please note that it is possible to add your own pipe types by inheriting the attributes from the abstract _PipeData
class.
Expand Down

0 comments on commit 0c1d22c

Please sign in to comment.