Skip to content

Commit

Permalink
Fixed bug AGSOutputs.py where it was interpolating electrcity-related…
Browse files Browse the repository at this point in the history
… values when it was running in heat-only mode. Issue NREL#7.
  • Loading branch information
malcolm-dsider committed Oct 10, 2023
1 parent 1056651 commit e568a72
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/geophires_x/AGSOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e568a72

Please sign in to comment.