@@ -323,6 +323,28 @@ class GeophiresXResult:
323
323
'Reservoir Model' ,
324
324
)
325
325
326
+ _REVENUE_AND_CASHFLOW_PROFILE_HEADERS : ClassVar [list [str ]] = [
327
+ 'Year Since Start' ,
328
+ 'Electricity Price (cents/kWh)' ,
329
+ 'Electricity Ann. Rev. (MUSD/yr)' ,
330
+ 'Electricity Cumm. Rev. (MUSD)' ,
331
+ 'Heat Price (cents/kWh)' ,
332
+ 'Heat Ann. Rev. (MUSD/yr)' ,
333
+ 'Heat Cumm. Rev. (MUSD)' ,
334
+ 'Cooling Price (cents/kWh)' ,
335
+ 'Cooling Ann. Rev. (MUSD/yr)' ,
336
+ 'Cooling Cumm. Rev. (MUSD)' ,
337
+ 'Carbon Price (USD/tonne)' ,
338
+ 'Carbon Ann. Rev. (MUSD/yr)' ,
339
+ 'Carbon Cumm. Rev. (MUSD)' ,
340
+ 'Project OPEX (MUSD/yr)' ,
341
+ 'Project Net Rev. (MUSD/yr)' ,
342
+ 'Project Net Cashflow (MUSD)' ,
343
+ ]
344
+
345
+ CCUS_PROFILE_LEGACY_NAME : ClassVar [str ] = 'CCUS PROFILE'
346
+ CARBON_REVENUE_PROFILE_NAME : ClassVar [str ] = 'CCUS PROFILE' # FIXME WIP change to 'CARBON REVENUE PROFILE'
347
+
326
348
def __init__ (self , output_file_path , logger_name = None ):
327
349
if logger_name is None :
328
350
logger_name = __name__
@@ -369,9 +391,11 @@ def __init__(self, output_file_path, logger_name=None):
369
391
if revenue_and_cashflow_profile is not None :
370
392
self .result ['REVENUE & CASHFLOW PROFILE' ] = revenue_and_cashflow_profile
371
393
372
- ccus_profile = self ._get_ccus_profile ()
373
- if ccus_profile is not None :
374
- self .result ['CCUS PROFILE' ] = ccus_profile
394
+ carbon_revenue_or_ccus_profile_key , carbon_revenue_or_ccus_profile = (
395
+ self ._get_carbon_revenue_or_ccus_legacy_profile ()
396
+ )
397
+ if carbon_revenue_or_ccus_profile is not None :
398
+ self .result [carbon_revenue_or_ccus_profile_key ] = carbon_revenue_or_ccus_profile
375
399
376
400
sdacgt_profile = self ._get_sdacgt_profile ()
377
401
if sdacgt_profile is not None :
@@ -428,8 +452,10 @@ def __init__(self, v_u):
428
452
'POWER GENERATION PROFILE' ,
429
453
'HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE' ,
430
454
'EXTENDED ECONOMIC PROFILE' ,
431
- 'CCUS PROFILE' ,
432
455
'REVENUE & CASHFLOW PROFILE' ,
456
+ GeophiresXResult .CARBON_REVENUE_PROFILE_NAME ,
457
+ GeophiresXResult .CCUS_PROFILE_LEGACY_NAME ,
458
+ 'S-DAC-GT PROFILE' ,
433
459
):
434
460
raise RuntimeError ('unexpected category' )
435
461
@@ -543,25 +569,6 @@ def _get_heat_electricity_extraction_generation_profile(self):
543
569
profile_lines = self ._get_profile_lines ('HEAT AND/OR ELECTRICITY EXTRACTION AND GENERATION PROFILE' )
544
570
return self ._get_data_from_profile_lines (profile_lines )
545
571
546
- _REVENUE_AND_CASHFLOW_PROFILE_HEADERS : ClassVar [list [str ]] = [
547
- 'Year Since Start' ,
548
- 'Electricity Price (cents/kWh)' ,
549
- 'Electricity Ann. Rev. (MUSD/yr)' ,
550
- 'Electricity Cumm. Rev. (MUSD)' ,
551
- 'Heat Price (cents/kWh)' ,
552
- 'Heat Ann. Rev. (MUSD/yr)' ,
553
- 'Heat Cumm. Rev. (MUSD)' ,
554
- 'Cooling Price (cents/kWh)' ,
555
- 'Cooling Ann. Rev. (MUSD/yr)' ,
556
- 'Cooling Cumm. Rev. (MUSD)' ,
557
- 'Carbon Price (USD/tonne)' ,
558
- 'Carbon Ann. Rev. (MUSD/yr)' ,
559
- 'Carbon Cumm. Rev. (MUSD)' ,
560
- 'Project OPEX (MUSD/yr)' ,
561
- 'Project Net Rev. (MUSD/yr)' ,
562
- 'Project Net Cashflow (MUSD)' ,
563
- ]
564
-
565
572
def _get_revenue_and_cashflow_profile (self ):
566
573
def extract_table_header (lines : list ) -> list :
567
574
# Tried various regexy approaches to extract this programmatically but landed on hard-coding.
@@ -624,14 +631,23 @@ def extract_table_header(lines: list) -> list:
624
631
self ._logger .debug (f'Failed to get S-DAC-GT profile: { e } ' )
625
632
return None
626
633
627
- def _get_ccus_profile (self ):
634
+ def _get_carbon_revenue_or_ccus_legacy_profile (self ) -> tuple :
635
+ """
636
+ :return: tuple[profile key name, profile]
637
+ """
638
+
628
639
profile_legacy = self ._get_ccus_profile_legacy ()
629
640
if profile_legacy is not None :
630
- return profile_legacy
641
+ # Earlier versions of GEOPHIRES referred to the profile containing carbon revenue as the 'CCUS PROFILE';
642
+ # the name was changed to 'CARBON REVENUE PROFILE' for technical accuracy, as it does not include data
643
+ # for capture or storage, only revenue according to carbon avoided given a carbon price. However, we still
644
+ # check for and parse CCUS profile if it is present in order to retain backwards compatibility in terms
645
+ # of the client being able to read results from previous GEOPHIRES versions.
646
+ return GeophiresXResult .CCUS_PROFILE_LEGACY_NAME , profile_legacy
631
647
632
648
revenue_and_cashflow_profile = self ._get_revenue_and_cashflow_profile ()
633
649
if revenue_and_cashflow_profile is None :
634
- return None
650
+ return None , None
635
651
636
652
carbon_price_field_name = 'Carbon Price (USD/tonne)'
637
653
headers = [
@@ -654,7 +670,7 @@ def _get_ccus_profile(self):
654
670
)
655
671
656
672
if not has_ccus_profile_in_revenue_and_cashflow :
657
- return None
673
+ return None , None
658
674
659
675
try :
660
676
profile = [headers ]
@@ -670,10 +686,10 @@ def _get_ccus_profile(self):
670
686
ccus_entry .append (revenue_and_cashflow_profile [i ][rcp_index ])
671
687
profile .append (ccus_entry )
672
688
673
- return profile
689
+ return GeophiresXResult . CARBON_REVENUE_PROFILE_NAME , profile
674
690
except BaseException as e :
675
- self ._logger .debug (f'Failed to get CCUS profile : { e } ' )
676
- return None
691
+ self ._logger .debug (f'Failed to get { GeophiresXResult . CARBON_REVENUE_PROFILE_NAME } : { e } ' )
692
+ return None , None
677
693
678
694
def _get_ccus_profile_legacy (self ):
679
695
def extract_table_header (lines : list ) -> list :
@@ -690,12 +706,12 @@ def extract_table_header(lines: list) -> list:
690
706
]
691
707
692
708
try :
693
- lines = self ._get_profile_lines ('CCUS PROFILE' )
709
+ lines = self ._get_profile_lines (GeophiresXResult . CCUS_PROFILE_LEGACY_NAME )
694
710
profile = [extract_table_header (lines )]
695
711
profile .extend (self ._extract_addons_style_table_data (lines ))
696
712
return profile
697
713
except BaseException as e :
698
- self ._logger .debug (f'Failed to get legacy CCUS profile : { e } ' )
714
+ self ._logger .debug (f'Failed to get legacy { GeophiresXResult . CCUS_PROFILE_LEGACY_NAME } : { e } ' )
699
715
return None
700
716
701
717
def _extract_addons_style_table_data (self , lines : list ):
0 commit comments