Skip to content

Commit 8af0a87

Browse files
Merge pull request MassimoCimmino#301 from MassimoCimmino/issue282_negativeMassFlow
Issue282 negative mass flow
2 parents 9048d49 + f1faa50 commit 8af0a87

File tree

7 files changed

+1315
-418
lines changed

7 files changed

+1315
-418
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Version 2.3 (in development)
44

5+
### New features
6+
7+
* [Issue 282](https://github.com/MassimoCimmino/pygfunction/issues/282) - Enabled the use of negative mass flow rates in `Pipe` and `Network` classes to model reversed flow direction.
8+
59
## Version 2.2.3 (2024-07-01)
610

711
### New features

pygfunction/gfunction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,10 @@ def solve(self, time, alpha):
16771677
# The gFunction is equal to the effective borehole wall
16781678
# temperature
16791679
# Outlet fluid temperature
1680-
T_f_out = T_f_in - 2*pi*self.network.p[0].k_s*H_tot/(
1681-
np.sum(self.network.m_flow_network*self.network.cp_f))
1680+
T_f_out = T_f_in - 2*pi*self.network.p[0].k_s*H_tot / (
1681+
np.sum(
1682+
np.abs(self.network.m_flow_network)
1683+
* self.network.cp_f))
16821684
# Average fluid temperature
16831685
T_f = 0.5*(T_f_in + T_f_out)
16841686
# Borefield thermal resistance

0 commit comments

Comments
 (0)