Skip to content

Commit

Permalink
Merge pull request #195 from MassimoCimmino/issue193_fixFLSShapeNoSource
Browse files Browse the repository at this point in the history
Issue193 fix fls shape no source
  • Loading branch information
MassimoCimmino authored Jan 17, 2022
2 parents 6569cef + 95878ef commit 79e0198
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
### Bug fixes

* [Issue 192](https://github.com/MassimoCimmino/pygfunction/issues/192) - Fixed comparison of `time` with `numpy.inf` in `heat_transfer.finite_line_source` that caused the function to fail when `time` is an array.
* [Issue 193](https://github.com/MassimoCimmino/pygfunction/issues/193) - Fixed `heat_transfer._finite_line_source_integrand`, `heat_transfer._finite_line_source_equivalent_boreholes_integrand`, and `heat_transfer._finite_line_source_steady_state` to return an array of zeros of the expected shape when `reaSource==False and imgSource==False`.

## Version 2.1.0 (2021-11-12)

Expand Down
9 changes: 6 additions & 3 deletions pygfunction/heat_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ def _finite_line_source_integrand(dis, H1, D1, H2, D2, reaSource, imgSource):
f = lambda s: s**-2 * np.exp(-dis**2*s**2) * np.inner(p, erfint(q*s))
else:
# No heat source
f = lambda s: 0.
f = lambda s: np.zeros(np.broadcast_shapes(
*[np.shape(arg) for arg in (dis, H1, D1, H2, D2)]))
return f


Expand Down Expand Up @@ -651,7 +652,8 @@ def _finite_line_source_equivalent_boreholes_integrand(dis, wDis, H1, D1, H2, D2
f = lambda s: s**-2 * (np.exp(-dis**2*s**2) @ wDis).T * np.inner(p, erfint(q*s))
else:
# No heat source
f = lambda s: 0.
f = lambda s: np.zeros(np.broadcast_shapes(
*[np.shape(arg) for arg in (H1, D1, H2, D2, N2)]))
return f


Expand Down Expand Up @@ -723,5 +725,6 @@ def _finite_line_source_steady_state(dis, H1, D1, H2, D2, reaSource, imgSource):
h = 0.5 / H2 * np.inner(p, q * np.log((q + np.sqrt(q**2 + dis**2)) / dis) - np.sqrt(q**2 + dis**2))
else:
# No heat source
h = 0.
h = np.zeros(np.broadcast_shapes(
*[np.shape(arg) for arg in (dis, H1, D1, H2, D2)]))
return h

0 comments on commit 79e0198

Please sign in to comment.