@@ -176,6 +176,7 @@ def PrintOutputs(self, model: Model):
176176 with open (self .output_file , 'w' , encoding = 'UTF-8' ) as f :
177177
178178 econ : Economics = model .economics
179+ is_sam_econ_model = econ .econmodel .value == EconomicModel .SAM_SINGLE_OWNER_PPA
179180
180181 f .write (' *****************\n ' )
181182 f .write (' ***CASE REPORT***\n ' )
@@ -222,7 +223,7 @@ def PrintOutputs(self, model: Model):
222223 f .write (f' { model .economics .LCOE .display_name } : { model .economics .LCOE .value :10.2f} { model .economics .LCOE .CurrentUnits .value } \n ' )
223224 f .write (f' { model .economics .LCOH .display_name } : { model .economics .LCOH .value :10.2f} { model .economics .LCOH .CurrentUnits .value } \n ' )
224225
225- if econ . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
226+ if is_sam_econ_model :
226227 f .write (f' { Outputs ._field_label (econ .capex_total .display_name , 50 )} { econ .capex_total .value :10.2f} { econ .capex_total .CurrentUnits .value } \n ' )
227228
228229 f .write (f' Number of production wells: { model .wellbores .nprod .value :10.0f} ' + NL )
@@ -255,10 +256,10 @@ def PrintOutputs(self, model: Model):
255256 # https://github.com/softwareengineerprogrammer/GEOPHIRES/commit/535c02d4adbeeeca553b61e9b996fccf00016529
256257 f .write (f' { model .economics .interest_rate .Name } : { model .economics .interest_rate .value :10.2f} { model .economics .interest_rate .CurrentUnits .value } \n ' )
257258
258- elif model .economics .econmodel .value in ( EconomicModel .BICYCLE , EconomicModel . SAM_SINGLE_OWNER_PPA ) :
259+ elif is_sam_econ_model or model .economics .econmodel .value == EconomicModel .BICYCLE :
259260 f .write (f' Economic Model = { model .economics .econmodel .value .value } \n ' )
260261
261- if model . economics . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
262+ if is_sam_econ_model :
262263 sam_econ_fields : list [OutputParameter ] = [
263264 econ .real_discount_rate ,
264265 econ .nominal_discount_rate ,
@@ -282,7 +283,7 @@ def PrintOutputs(self, model: Model):
282283 f .write (f' { npv_field_label } { e_npv .value :10.2f} { e_npv .PreferredUnits .value } \n ' )
283284
284285 irr_output_param : OutputParameter = econ .ProjectIRR \
285- if econ . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA else econ .after_tax_irr
286+ if not is_sam_econ_model else econ .after_tax_irr
286287 irr_field_label = Outputs ._field_label (irr_output_param .display_name , 49 )
287288 irr_display_value = f'{ irr_output_param .value :10.2f} ' \
288289 if not math .isnan (irr_output_param .value ) else 'NaN'
@@ -485,7 +486,7 @@ def PrintOutputs(self, model: Model):
485486 f .write (f' Stimulation costs (for redrilling): { econ .Cstim .value :10.2f} { econ .Cstim .CurrentUnits .value } \n ' )
486487
487488 if model .economics .RITCValue .value :
488- if model . economics . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA :
489+ if not is_sam_econ_model :
489490 f .write (f' { model .economics .RITCValue .display_name } : { - 1 * model .economics .RITCValue .value :10.2f} { model .economics .RITCValue .CurrentUnits .value } \n ' )
490491 else :
491492 # TODO Extract value from SAM Cash Flow Profile per
@@ -496,12 +497,12 @@ def PrintOutputs(self, model: Model):
496497 # expenditure.
497498 pass
498499
499- if model . economics . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
500+ if is_sam_econ_model :
500501 # TODO calculate & display for other economic models
501502 icc_label = Outputs ._field_label (econ .inflation_cost_during_construction .display_name , 47 )
502503 f .write (f' { icc_label } { econ .inflation_cost_during_construction .value :10.2f} { econ .inflation_cost_during_construction .CurrentUnits .value } \n ' )
503504
504- capex_param = econ .CCap if econ . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA else econ .capex_total
505+ capex_param = econ .CCap if not is_sam_econ_model else econ .capex_total
505506 capex_label = Outputs ._field_label (capex_param .display_name , 50 )
506507 f .write (f' { capex_label } { capex_param .value :10.2f} { capex_param .CurrentUnits .value } \n ' )
507508
@@ -733,10 +734,10 @@ def PrintOutputs(self, model: Model):
733734 model .surfaceplant .RemainingReservoirHeatContent .value [i ],
734735 (model .reserv .InitialReservoirHeatContent .value - model .surfaceplant .RemainingReservoirHeatContent .value [i ])* 100 / model .reserv .InitialReservoirHeatContent .value )+ NL )
735736
736- if econ . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA :
737+ if not is_sam_econ_model :
737738 self .write_revenue_and_cashflow_profile_output (model , f )
738739
739- if econ . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
740+ if is_sam_econ_model :
740741 f .write (self .get_sam_cash_flow_profile_output (model ))
741742
742743 # if we are dealing with overpressure and two different reservoirs, show a table reporting the values
0 commit comments