Skip to content

Commit 9dd64f7

Browse files
Don't output R&C profile for SAM econ model - it's inaccurate & redundant
1 parent 5b05f3c commit 9dd64f7

File tree

2 files changed

+66
-85
lines changed

2 files changed

+66
-85
lines changed

src/geophires_x/Outputs.py

Lines changed: 64 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -684,51 +684,11 @@ def PrintOutputs(self, model: Model):
684684
model.surfaceplant.RemainingReservoirHeatContent.value[i],
685685
(model.reserv.InitialReservoirHeatContent.value-model.surfaceplant.RemainingReservoirHeatContent.value[i])*100/model.reserv.InitialReservoirHeatContent.value)+NL)
686686

687-
f.write(NL)
688-
f.write(NL)
689-
f.write(' ********************************\n')
690-
f.write(' * REVENUE & CASHFLOW PROFILE *\n')
691-
f.write(' ********************************\n')
692-
f.write(
693-
'Year Electricity | Heat | Cooling | Carbon | Project' + NL)
694-
f.write(
695-
'Since Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | OPEX Net Rev. Net Cashflow' + NL)
696-
697-
def o(output_param: OutputParameter):
698-
# TODO generalize this and/or FIXME make it unnecessary
699-
if output_param.Name in econ.OutputParameterDict:
700-
return econ.OutputParameterDict[output_param.Name]
701-
else:
702-
return output_param
703-
704-
f.write('Start ('
705-
+ o(econ.ElecPrice).CurrentUnits.value +
706-
')(' + o(econ.ElecRevenue).CurrentUnits.value +
707-
') (' + o(econ.ElecCummRevenue).CurrentUnits.value +
708-
') |(' + o(econ.HeatPrice).CurrentUnits.value +
709-
') (' + o(econ.HeatRevenue).CurrentUnits.value +
710-
') (' + o(econ.HeatCummRevenue).CurrentUnits.value +
711-
') |(' + o(econ.CoolingPrice).CurrentUnits.value +
712-
') (' + o(econ.CoolingRevenue).CurrentUnits.value +
713-
') (' + o(econ.CoolingCummRevenue).CurrentUnits.value +
714-
') |(' + o(econ.CarbonPrice).CurrentUnits.value +
715-
') (' + o(econ.CarbonRevenue).CurrentUnits.value +
716-
') (' + o(econ.CarbonCummCashFlow).CurrentUnits.value +
717-
') |(' + o(econ.Coam).CurrentUnits.value +
718-
') (' + o(econ.TotalRevenue).CurrentUnits.value +
719-
') (' + o(econ.TotalCummRevenue).CurrentUnits.value + ')\n')
720-
f.write(
721-
'________________________________________________________________________________________________________________________________________________________________________________________' + NL)
722-
# running years...
723-
for ii in range(0, (
724-
model.surfaceplant.construction_years.value + model.surfaceplant.plant_lifetime.value), 1):
725-
if ii < model.surfaceplant.construction_years.value:
726-
opex = 0.0 # zero out the OPEX during construction years
727-
else:
728-
opex = o(econ.Coam).value
729-
f.write(
730-
f'{ii:3.0f} {o(econ.ElecPrice).value[ii]:5.2f} {o(econ.ElecRevenue).value[ii]:5.2f} {o(econ.ElecCummRevenue).value[ii]:5.2f} | {o(econ.HeatPrice).value[ii]:5.2f} {o(econ.HeatRevenue).value[ii]:5.2f} {o(econ.HeatCummRevenue).value[ii]:5.2f} | {o(econ.CoolingPrice).value[ii]:5.2f} {o(econ.CoolingRevenue).value[ii]:5.2f} {o(econ.CoolingCummRevenue).value[ii]:5.2f} | {o(econ.CarbonPrice).value[ii]:5.2f} {o(econ.CarbonRevenue).value[ii]:5.2f} {o(econ.CarbonCummCashFlow).value[ii]:5.2f} | {opex:5.2f} {o(econ.TotalRevenue).value[ii]:5.2f} {o(econ.TotalCummRevenue).value[ii]:5.2f}\n')
731-
f.write(NL)
687+
if econ.econmodel.value != EconomicModel.SAM_SINGLE_OWNER_PPA:
688+
self.write_revenue_and_cashflow_profile_output(model, f)
689+
690+
if econ.econmodel.value == EconomicModel.SAM_SINGLE_OWNER_PPA:
691+
f.write(self.get_sam_cash_flow_profile_output(model))
732692

733693
# if we are dealing with overpressure and two different reservoirs, show a table reporting the values
734694
if model.wellbores.overpressure_percentage.Provided:
@@ -738,17 +698,19 @@ def o(output_param: OutputParameter):
738698
f.write(' ***************************************\n')
739699
f.write(' YEAR PROD PUMP INJECT PUMP TOTAL PUMP\n')
740700
f.write(' POWER POWER POWER\n')
741-
f.write(' (' + model.wellbores.PumpingPowerProd.CurrentUnits.value+') (' + model.wellbores.PumpingPowerInj.CurrentUnits.value + ') (' + model.surfaceplant.NetElectricityProduced.CurrentUnits.value + ') \n')
701+
f.write(
702+
' (' + model.wellbores.PumpingPowerProd.CurrentUnits.value + ') (' + model.wellbores.PumpingPowerInj.CurrentUnits.value + ') (' + model.surfaceplant.NetElectricityProduced.CurrentUnits.value + ') \n')
742703
for i in range(0, model.surfaceplant.plant_lifetime.value):
743-
f.write(' {0:2.0f} {1:8.4f} {2:8.4f} {3:8.4f}'.format(i+1,
744-
model.wellbores.PumpingPowerProd.value[i*model.economics.timestepsperyear.value],
745-
model.wellbores.PumpingPowerInj.value[i*model.economics.timestepsperyear.value],
746-
model.wellbores.PumpingPower.value[i*model.economics.timestepsperyear.value]))
704+
f.write(' {0:2.0f} {1:8.4f} {2:8.4f} {3:8.4f}'.format(i + 1,
705+
model.wellbores.PumpingPowerProd.value[
706+
i * model.economics.timestepsperyear.value],
707+
model.wellbores.PumpingPowerInj.value[
708+
i * model.economics.timestepsperyear.value],
709+
model.wellbores.PumpingPower.value[
710+
i * model.economics.timestepsperyear.value]))
747711
f.write(NL)
748712
f.write(NL)
749713

750-
if econ.econmodel.value == EconomicModel.SAM_SINGLE_OWNER_PPA:
751-
f.write(self.get_sam_cash_flow_profile_output(model))
752714

753715
except BaseException as ex:
754716
tb = sys.exc_info()[2]
@@ -763,6 +725,56 @@ def o(output_param: OutputParameter):
763725

764726
model.logger.info(f'Complete {__class__!s}: {sys._getframe().f_code.co_name}')
765727

728+
# noinspection PyMethodMayBeStatic
729+
def write_revenue_and_cashflow_profile_output(self, model, f):
730+
econ: Economics = model.economics
731+
732+
f.write(NL)
733+
f.write(NL)
734+
f.write(' ********************************\n')
735+
f.write(' * REVENUE & CASHFLOW PROFILE *\n')
736+
f.write(' ********************************\n')
737+
f.write(
738+
'Year Electricity | Heat | Cooling | Carbon | Project' + NL)
739+
f.write(
740+
'Since Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | OPEX Net Rev. Net Cashflow' + NL)
741+
742+
def o(output_param: OutputParameter):
743+
# TODO generalize this and/or FIXME make it unnecessary
744+
if output_param.Name in econ.OutputParameterDict:
745+
return econ.OutputParameterDict[output_param.Name]
746+
else:
747+
return output_param
748+
749+
f.write('Start ('
750+
+ o(econ.ElecPrice).CurrentUnits.value +
751+
')(' + o(econ.ElecRevenue).CurrentUnits.value +
752+
') (' + o(econ.ElecCummRevenue).CurrentUnits.value +
753+
') |(' + o(econ.HeatPrice).CurrentUnits.value +
754+
') (' + o(econ.HeatRevenue).CurrentUnits.value +
755+
') (' + o(econ.HeatCummRevenue).CurrentUnits.value +
756+
') |(' + o(econ.CoolingPrice).CurrentUnits.value +
757+
') (' + o(econ.CoolingRevenue).CurrentUnits.value +
758+
') (' + o(econ.CoolingCummRevenue).CurrentUnits.value +
759+
') |(' + o(econ.CarbonPrice).CurrentUnits.value +
760+
') (' + o(econ.CarbonRevenue).CurrentUnits.value +
761+
') (' + o(econ.CarbonCummCashFlow).CurrentUnits.value +
762+
') |(' + o(econ.Coam).CurrentUnits.value +
763+
') (' + o(econ.TotalRevenue).CurrentUnits.value +
764+
') (' + o(econ.TotalCummRevenue).CurrentUnits.value + ')\n')
765+
f.write(
766+
'________________________________________________________________________________________________________________________________________________________________________________________' + NL)
767+
# running years...
768+
for ii in range(0, (
769+
model.surfaceplant.construction_years.value + model.surfaceplant.plant_lifetime.value), 1):
770+
if ii < model.surfaceplant.construction_years.value:
771+
opex = 0.0 # zero out the OPEX during construction years
772+
else:
773+
opex = o(econ.Coam).value
774+
f.write(
775+
f'{ii:3.0f} {o(econ.ElecPrice).value[ii]:5.2f} {o(econ.ElecRevenue).value[ii]:5.2f} {o(econ.ElecCummRevenue).value[ii]:5.2f} | {o(econ.HeatPrice).value[ii]:5.2f} {o(econ.HeatRevenue).value[ii]:5.2f} {o(econ.HeatCummRevenue).value[ii]:5.2f} | {o(econ.CoolingPrice).value[ii]:5.2f} {o(econ.CoolingRevenue).value[ii]:5.2f} {o(econ.CoolingCummRevenue).value[ii]:5.2f} | {o(econ.CarbonPrice).value[ii]:5.2f} {o(econ.CarbonRevenue).value[ii]:5.2f} {o(econ.CarbonCummCashFlow).value[ii]:5.2f} | {opex:5.2f} {o(econ.TotalRevenue).value[ii]:5.2f} {o(econ.TotalCummRevenue).value[ii]:5.2f}\n')
776+
f.write(NL)
777+
766778
# noinspection PyMethodMayBeStatic
767779
def get_sam_cash_flow_profile_output(self, model):
768780
ret = '\n'

tests/examples/example_SAM-single-owner-PPA.out

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Simulation Metadata
66
----------------------
77
GEOPHIRES Version: 3.8.18
88
Simulation Date: 2025-04-14
9-
Simulation Time: 10:04
10-
Calculation Time: 0.874 sec
9+
Simulation Time: 10:16
10+
Calculation Time: 0.924 sec
1111

1212
***SUMMARY OF RESULTS***
1313

@@ -186,37 +186,6 @@ Simulation Metadata
186186
19 3194.1 22167.7 25733.34 5.56
187187
20 3194.4 22168.7 25653.53 5.85
188188

189-
190-
********************************
191-
* REVENUE & CASHFLOW PROFILE *
192-
********************************
193-
Year Electricity | Heat | Cooling | Carbon | Project
194-
Since Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | Price Ann. Rev. Cumm. Rev. | OPEX Net Rev. Net Cashflow
195-
Start (cents/kWh)(MUSD/yr) (MUSD) |(cents/kWh) (MUSD/yr) (MUSD) |(cents/kWh) (MUSD/yr) (MUSD) |(USD/lb) (MUSD/yr) (MUSD) |(MUSD/yr) (MUSD/yr) (MUSD)
196-
________________________________________________________________________________________________________________________________________________________________________________________
197-
0 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 0.00 0.00 | 0.00 -1072.95 -1072.95
198-
1 15.00 474.16 474.16 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 447.20 -625.75
199-
2 15.00 476.35 950.51 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 449.39 -176.36
200-
3 15.41 489.93 1440.44 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 462.97 286.61
201-
4 15.81 503.25 1943.69 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 476.29 762.90
202-
5 16.22 516.46 2460.16 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 489.50 1252.40
203-
6 16.62 529.61 2989.77 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 502.65 1755.05
204-
7 17.03 542.73 3532.50 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 515.77 2270.82
205-
8 17.43 555.82 4088.32 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 528.86 2799.68
206-
9 17.84 568.89 4657.21 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 541.93 3341.61
207-
10 18.24 581.95 5239.17 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 554.99 3896.60
208-
11 18.65 595.00 5834.17 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 568.04 4464.64
209-
12 19.05 608.04 6442.21 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 581.08 5045.72
210-
13 19.46 621.08 7063.29 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 594.12 5639.84
211-
14 19.86 634.11 7697.40 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 607.15 6246.98
212-
15 20.27 647.14 8344.53 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 620.17 6867.16
213-
16 20.67 660.16 9004.69 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 633.20 7500.35
214-
17 21.08 673.18 9677.87 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 646.22 8146.57
215-
18 21.49 686.20 10364.07 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 659.23 8805.81
216-
19 21.89 699.21 11063.28 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 672.25 9478.06
217-
20 22.30 712.22 11775.50 | 2.50 0.00 0.00 | 2.50 0.00 0.00 | 0.00 0.00 0.00 | 26.96 685.26 10163.32
218-
219-
220189
***************************
221190
* SAM CASH FLOW PROFILE *
222191
***************************

0 commit comments

Comments
 (0)