diff --git a/CHANGELOG.md b/CHANGELOG.md index 470f712d..9ae505c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pygfunction/heat_transfer.py b/pygfunction/heat_transfer.py index 2cdd0138..2eead48a 100644 --- a/pygfunction/heat_transfer.py +++ b/pygfunction/heat_transfer.py @@ -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 @@ -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 @@ -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