Skip to content

Commit 9f6ce57

Browse files
authored
Merge pull request #432 from wouterpeere/issue309-variable-mass-flow-rate
Add flow_rates in pressure drop curve function
2 parents dd041e8 + 9ebb6e4 commit 9f6ce57

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
99

1010
### Added
1111

12+
- Add flow_rates as explicit argument in PressureDrop curve function.
1213
- Inlet and outlet water temperature (issue #271).
1314
- Added 'type' attribute to temperature profile plotting so also the inlet and outlet temperatures can be shown (issue
1415
#271).

GHEtool/VariableClasses/PipeData/PressureDrop.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def calculate_total_pressure_drop(self, **kwargs) -> float:
140140
self.calculate_pressure_drop_lateral(**kwargs) + \
141141
self.calculate_pressure_drop_main(**kwargs)
142142

143-
def create_pressure_drop_curve(self, range: float = 2, datapoints: int = 30, **kwargs):
143+
def create_pressure_drop_curve(self, range: float = 2, datapoints: int = 30, flow_rates: np.ndarray = None,
144+
**kwargs):
144145
"""
145146
This function calculates the total pressure drop for different flow rates.
146147
@@ -150,6 +151,8 @@ def create_pressure_drop_curve(self, range: float = 2, datapoints: int = 30, **k
150151
Multiplier of the flow rate for the range of the data.
151152
datapoints : int
152153
Number of datapoints.
154+
flow_rates : np.ndarray
155+
Give the flow range directly.
153156
154157
Returns
155158
-------
@@ -159,9 +162,11 @@ def create_pressure_drop_curve(self, range: float = 2, datapoints: int = 30, **k
159162
# backup
160163
flow_backup = copy.copy(self.flow_data)
161164

162-
flow_rates = np.linspace(0, range * self.flow_data.vfr_borehole(fluid_data=self.fluid_data,
163-
nb_of_boreholes=self.nb_of_boreholes, **kwargs),
164-
datapoints)
165+
if flow_rates is None:
166+
flow_rates = np.linspace(0, range * self.flow_data.vfr_borehole(
167+
fluid_data=self.fluid_data,
168+
nb_of_boreholes=self.nb_of_boreholes,
169+
**kwargs), datapoints)
165170
pressure_drops_pipe = np.zeros(flow_rates.shape)
166171
pressure_drops_lateral = np.zeros(flow_rates.shape)
167172
pressure_drops_main = np.zeros(flow_rates.shape)

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.4.1.dev2
3+
version = 2.4.1.dev3
44
author = Wouter Peere
55
author_email = wouter@ghetool.eu
66
description = Python package for borefield sizing

0 commit comments

Comments
 (0)