@@ -176,6 +176,7 @@ def PrintOutputs(self, model: Model):
176
176
with open (self .output_file , 'w' , encoding = 'UTF-8' ) as f :
177
177
178
178
econ : Economics = model .economics
179
+ is_sam_econ_model = econ .econmodel .value == EconomicModel .SAM_SINGLE_OWNER_PPA
179
180
180
181
f .write (' *****************\n ' )
181
182
f .write (' ***CASE REPORT***\n ' )
@@ -222,7 +223,7 @@ def PrintOutputs(self, model: Model):
222
223
f .write (f' { model .economics .LCOE .display_name } : { model .economics .LCOE .value :10.2f} { model .economics .LCOE .CurrentUnits .value } \n ' )
223
224
f .write (f' { model .economics .LCOH .display_name } : { model .economics .LCOH .value :10.2f} { model .economics .LCOH .CurrentUnits .value } \n ' )
224
225
225
- if econ . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
226
+ if is_sam_econ_model :
226
227
f .write (f' { Outputs ._field_label (econ .capex_total .display_name , 50 )} { econ .capex_total .value :10.2f} { econ .capex_total .CurrentUnits .value } \n ' )
227
228
228
229
f .write (f' Number of production wells: { model .wellbores .nprod .value :10.0f} ' + NL )
@@ -255,10 +256,10 @@ def PrintOutputs(self, model: Model):
255
256
# https://github.com/softwareengineerprogrammer/GEOPHIRES/commit/535c02d4adbeeeca553b61e9b996fccf00016529
256
257
f .write (f' { model .economics .interest_rate .Name } : { model .economics .interest_rate .value :10.2f} { model .economics .interest_rate .CurrentUnits .value } \n ' )
257
258
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 :
259
260
f .write (f' Economic Model = { model .economics .econmodel .value .value } \n ' )
260
261
261
- if model . economics . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
262
+ if is_sam_econ_model :
262
263
sam_econ_fields : list [OutputParameter ] = [
263
264
econ .real_discount_rate ,
264
265
econ .nominal_discount_rate ,
@@ -282,7 +283,7 @@ def PrintOutputs(self, model: Model):
282
283
f .write (f' { npv_field_label } { e_npv .value :10.2f} { e_npv .PreferredUnits .value } \n ' )
283
284
284
285
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
286
287
irr_field_label = Outputs ._field_label (irr_output_param .display_name , 49 )
287
288
irr_display_value = f'{ irr_output_param .value :10.2f} ' \
288
289
if not math .isnan (irr_output_param .value ) else 'NaN'
@@ -485,7 +486,7 @@ def PrintOutputs(self, model: Model):
485
486
f .write (f' Stimulation costs (for redrilling): { econ .Cstim .value :10.2f} { econ .Cstim .CurrentUnits .value } \n ' )
486
487
487
488
if model .economics .RITCValue .value :
488
- if model . economics . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA :
489
+ if not is_sam_econ_model :
489
490
f .write (f' { model .economics .RITCValue .display_name } : { - 1 * model .economics .RITCValue .value :10.2f} { model .economics .RITCValue .CurrentUnits .value } \n ' )
490
491
else :
491
492
# TODO Extract value from SAM Cash Flow Profile per
@@ -496,12 +497,12 @@ def PrintOutputs(self, model: Model):
496
497
# expenditure.
497
498
pass
498
499
499
- if model . economics . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
500
+ if is_sam_econ_model :
500
501
# TODO calculate & display for other economic models
501
502
icc_label = Outputs ._field_label (econ .inflation_cost_during_construction .display_name , 47 )
502
503
f .write (f' { icc_label } { econ .inflation_cost_during_construction .value :10.2f} { econ .inflation_cost_during_construction .CurrentUnits .value } \n ' )
503
504
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
505
506
capex_label = Outputs ._field_label (capex_param .display_name , 50 )
506
507
f .write (f' { capex_label } { capex_param .value :10.2f} { capex_param .CurrentUnits .value } \n ' )
507
508
@@ -733,10 +734,10 @@ def PrintOutputs(self, model: Model):
733
734
model .surfaceplant .RemainingReservoirHeatContent .value [i ],
734
735
(model .reserv .InitialReservoirHeatContent .value - model .surfaceplant .RemainingReservoirHeatContent .value [i ])* 100 / model .reserv .InitialReservoirHeatContent .value )+ NL )
735
736
736
- if econ . econmodel . value != EconomicModel . SAM_SINGLE_OWNER_PPA :
737
+ if not is_sam_econ_model :
737
738
self .write_revenue_and_cashflow_profile_output (model , f )
738
739
739
- if econ . econmodel . value == EconomicModel . SAM_SINGLE_OWNER_PPA :
740
+ if is_sam_econ_model :
740
741
f .write (self .get_sam_cash_flow_profile_output (model ))
741
742
742
743
# if we are dealing with overpressure and two different reservoirs, show a table reporting the values
0 commit comments