Skip to content

Commit fa87316

Browse files
authored
Merge pull request #355 from wouterpeere/update_hydraulic_separatus
Update hydraulic model separatus
2 parents 5180142 + 17b7d96 commit fa87316

File tree

4 files changed

+64
-1
lines changed

4 files changed

+64
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2121
- Remove ghe_logger since no longer used.
2222
- Make Re a property in borefield just like Rb.
2323
- Calculate Re and Rb at minimum temperature or, if there is no temperature, the Tf_min.
24+
- Hydraulic calculations of Separatus.
2425

2526
### Fixed
2627

GHEtool/VariableClasses/PipeData/Separatus.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import pygfunction as gt
2+
from math import pi
23

34
from GHEtool.VariableClasses.PipeData.SingleUTube import SingleUTube
5+
from GHEtool.VariableClasses.FluidData import _FluidData
6+
from GHEtool.VariableClasses.FlowData import _FlowData
47

58

69
class Separatus(SingleUTube):
@@ -58,6 +61,61 @@ def pipe_model(self, k_s: float, borehole: gt.boreholes.Borehole) -> gt.pipes._B
5861

5962
return single_u
6063

64+
def Re(self, fluid_data: _FluidData, flow_rate_data: _FlowData, **kwargs) -> float:
65+
"""
66+
Reynolds number.
67+
This model uses the hydraulic diameter of 25.51 mm.
68+
69+
Parameters
70+
----------
71+
fluid_data: FluidData
72+
Fluid data
73+
flow_rate_data : FlowData
74+
Flow rate data
75+
76+
Returns
77+
-------
78+
Reynolds number : float
79+
"""
80+
u = flow_rate_data.mfr(fluid_data=fluid_data, **kwargs) / fluid_data.rho(**kwargs) / \
81+
(pi * (0.02551 / 2) ** 2)
82+
return fluid_data.rho(**kwargs) * u * 0.02551 / fluid_data.mu(**kwargs)
83+
84+
def pressure_drop(self, fluid_data: _FluidData, flow_rate_data: _FlowData, borehole_length: float,
85+
**kwargs) -> float:
86+
"""
87+
Calculates the pressure drop across the entire borehole.
88+
This model uses the hydraulic diameter of 25.51 mm.
89+
90+
Parameters
91+
----------
92+
fluid_data: FluidData
93+
Fluid data
94+
flow_rate_data : FlowData
95+
Flow rate data
96+
borehole_length : float
97+
Borehole length [m]
98+
99+
Returns
100+
-------
101+
Pressure drop : float
102+
Pressure drop [kPa]
103+
"""
104+
105+
# Darcy fluid factor
106+
fd = gt.pipes.fluid_friction_factor_circular_pipe(
107+
flow_rate_data.mfr(fluid_data=fluid_data, **kwargs),
108+
(0.02551 / 2),
109+
fluid_data.mu(**kwargs),
110+
fluid_data.rho(**kwargs),
111+
self.epsilon)
112+
A = pi * (0.02551 / 2) ** 2
113+
V = (flow_rate_data.vfr(fluid_data=fluid_data, **kwargs) / 1000) / A
114+
115+
# add 0.2 for the local losses
116+
# (source: https://www.engineeringtoolbox.com/minor-loss-coefficients-pipes-d_626.html)
117+
return ((fd * (borehole_length * 2) / (0.02551) + 0.2) * fluid_data.rho(**kwargs) * V ** 2 / 2) / 1000
118+
61119
def __export__(self):
62120
return {'type': 'Separatus',
63121
'k_g [W/(m·K)]': self.k_g}

GHEtool/test/unit-tests/test_pipedata.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ def test_reynolds_number():
212212
assert np.isclose(double.Re(fluid_data=fluid_data, flow_rate_data=flow_data), 4244.131815783876)
213213
coaxial = CoaxialPipe(r_in_in, r_in_out, r_out_in, r_out_out, k_p, k_g, is_inner_inlet=True)
214214
assert np.isclose(coaxial.Re(fluid_data=fluid_data, flow_rate_data=flow_data), 1727.5977540504243)
215+
assert np.isclose(SingleUTube(1.5, 0.02551 / 2, 0.03151 / 2, 0.4, 0.035).Re(fluid_data, flow_data),
216+
Separatus(1.5).Re(fluid_data, flow_data))
215217

216218

217219
def test_pressure_drop():
@@ -223,6 +225,8 @@ def test_pressure_drop():
223225
assert np.isclose(double.pressure_drop(fluid_data, flow_data, 100), 10.347836812519452)
224226
coaxial = CoaxialPipe(r_in_in, r_in_out, r_out_in, r_out_out, k_p, k_g, is_inner_inlet=True)
225227
assert np.isclose(coaxial.pressure_drop(fluid_data, flow_data, 100), 0.1639237572210245)
228+
assert np.isclose(SingleUTube(1.5, 0.02551 / 2, 0.03151 / 2, 0.4, 0.035).pressure_drop(fluid_data, flow_data, 100),
229+
Separatus(1.5).pressure_drop(fluid_data, flow_data, 100))
226230

227231

228232
def test_repr_():

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = GHEtool
3-
version = 2.3.3.dev2
3+
version = 2.3.3.dev3
44
author = Wouter Peere
55
author_email = wouter@ghetool.eu
66
description = Python package for borefield sizing

0 commit comments

Comments
 (0)