Skip to content

Commit

Permalink
Merge branch 'NREL:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareengineerprogrammer authored Oct 10, 2023
2 parents 021a574 + 01b9798 commit 9da3bf7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/geophires_x/AGSOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,20 @@ def PrintOutputs(self, model: Model):
if model.wellbores.IsAGS: # do a classical output display
import scipy
# Need to do some interpolating to get the arrays to be the right size for output

# FIXME TODO - determine if ignore errstate is appropriate here. Without ignore, GitHub Actions unit
# tests fail in a way that appears to be specific to their runners (processor architecture, maybe)
with np.errstate(all='ignore'):
if len(model.wellbores.PumpingPower.value) != len(model.wellbores.ProducedTemperature.value):
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 model.surfaceplant.enduseoption.value != EndUseOptions.HEAT:
if len(model.wellbores.PumpingPower.value) != len(model.wellbores.ProducedTemperature.value):
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 not model.economics.econmodel.value == EconomicModel.CLGS:
super().PrintOutputs(model)
Expand Down

0 comments on commit 9da3bf7

Please sign in to comment.