From e568a7267eb4ff7ba7592ef41261c250562517e5 Mon Sep 17 00:00:00 2001 From: Malcolm Ross Date: Tue, 10 Oct 2023 15:28:17 -0500 Subject: [PATCH] Fixed bug AGSOutputs.py where it was interpolating electrcity-related values when it was running in heat-only mode. Issue #7. --- src/geophires_x/AGSOutputs.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/geophires_x/AGSOutputs.py b/src/geophires_x/AGSOutputs.py index c72e22a4..8c1c977e 100644 --- a/src/geophires_x/AGSOutputs.py +++ b/src/geophires_x/AGSOutputs.py @@ -46,14 +46,15 @@ def PrintOutputs(self, model: Model): f = scipy.interpolate.interp1d(np.arange(0, len(model.wellbores.PumpingPower.value)), model.wellbores.PumpingPower.value, fill_value="extrapolate") model.wellbores.PumpingPower.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0)) - if len(model.surfaceplant.NetElectricityProduced.value) != len(model.wellbores.ProducedTemperature.value): - f = scipy.interpolate.interp1d(np.arange(0, len(model.surfaceplant.NetElectricityProduced.value)), - model.surfaceplant.NetElectricityProduced.value, fill_value="extrapolate") - model.surfaceplant.NetElectricityProduced.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0)) - if len(model.surfaceplant.FirstLawEfficiency.value) != len(model.wellbores.ProducedTemperature.value): - f = scipy.interpolate.interp1d(np.arange(0, len(model.surfaceplant.FirstLawEfficiency.value)), - model.surfaceplant.FirstLawEfficiency.value, fill_value="extrapolate") - model.surfaceplant.FirstLawEfficiency.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0)) + if model.surfaceplant.enduseoption.value != EndUseOptions.HEAT: + if len(model.surfaceplant.NetElectricityProduced.value) != len(model.wellbores.ProducedTemperature.value): + f = scipy.interpolate.interp1d(np.arange(0, len(model.surfaceplant.NetElectricityProduced.value)), + model.surfaceplant.NetElectricityProduced.value, fill_value="extrapolate") + model.surfaceplant.NetElectricityProduced.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0)) + if len(model.surfaceplant.FirstLawEfficiency.value) != len(model.wellbores.ProducedTemperature.value): + f = scipy.interpolate.interp1d(np.arange(0, len(model.surfaceplant.FirstLawEfficiency.value)), + model.surfaceplant.FirstLawEfficiency.value, fill_value="extrapolate") + model.surfaceplant.FirstLawEfficiency.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0)) if not model.economics.econmodel.value == EconomicModel.CLGS: super().PrintOutputs(model)