Skip to content

Commit b53d3fc

Browse files
Apply conversion & utilization factor when slice length = 1
1 parent f7e5aab commit b53d3fc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/geophires_x/SurfacePlant.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ def integrate_time_series_slice(
2121
# Note that len(_slice) - 1 may be less than time_steps_per_year for the last slice.
2222

2323
if len(_slice) == 1:
24-
return _slice[0]
24+
integral = _slice[0]
25+
else:
26+
dx_steps = len(_slice) - 1
2527

26-
dx_steps = len(_slice) - 1
28+
integral = np.trapz(
29+
_slice,
30+
dx=1. / dx_steps * 365. * 24.
31+
)
2732

28-
return np.trapz(
29-
_slice,
30-
dx=1. / dx_steps * 365. * 24.
31-
) * 1000. * utilization_factor
33+
return integral * 1000. * utilization_factor
3234

3335
def remaining_reservoir_heat_content(self, InitialReservoirHeatContent: np.ndarray, HeatkWhExtracted: np.ndarray) -> np.ndarray:
3436
"""

0 commit comments

Comments
 (0)