@@ -684,51 +684,11 @@ def PrintOutputs(self, model: Model):
684
684
model .surfaceplant .RemainingReservoirHeatContent .value [i ],
685
685
(model .reserv .InitialReservoirHeatContent .value - model .surfaceplant .RemainingReservoirHeatContent .value [i ])* 100 / model .reserv .InitialReservoirHeatContent .value )+ NL )
686
686
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 ))
732
692
733
693
# if we are dealing with overpressure and two different reservoirs, show a table reporting the values
734
694
if model .wellbores .overpressure_percentage .Provided :
@@ -738,17 +698,19 @@ def o(output_param: OutputParameter):
738
698
f .write (' ***************************************\n ' )
739
699
f .write (' YEAR PROD PUMP INJECT PUMP TOTAL PUMP\n ' )
740
700
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 ' )
742
703
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 ]))
747
711
f .write (NL )
748
712
f .write (NL )
749
713
750
- if econ .econmodel .value == EconomicModel .SAM_SINGLE_OWNER_PPA :
751
- f .write (self .get_sam_cash_flow_profile_output (model ))
752
714
753
715
except BaseException as ex :
754
716
tb = sys .exc_info ()[2 ]
@@ -763,6 +725,56 @@ def o(output_param: OutputParameter):
763
725
764
726
model .logger .info (f'Complete { __class__ !s} : { sys ._getframe ().f_code .co_name } ' )
765
727
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
+
766
778
# noinspection PyMethodMayBeStatic
767
779
def get_sam_cash_flow_profile_output (self , model ):
768
780
ret = '\n '
0 commit comments