forked from NatLabRockies/GEOPHIRES-X
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEconomics.py
More file actions
3941 lines (3584 loc) · 224 KB
/
Copy pathEconomics.py
File metadata and controls
3941 lines (3584 loc) · 224 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from __future__ import annotations
import math
import sys
# noinspection PyPackageRequirements
import numpy as np
import numpy_financial as npf
from pint.facets.plain import PlainQuantity
import geophires_x.Model as Model
from geophires_x import EconomicsSam
from geophires_x.EconomicsSam import calculate_sam_economics
from geophires_x.EconomicsSamCalculations import SamEconomicsCalculations
from geophires_x.EconomicsUtils import BuildPricingModel, wacc_output_parameter, nominal_discount_rate_parameter, \
real_discount_rate_parameter, after_tax_irr_parameter, moic_parameter, project_vir_parameter, \
project_payback_period_parameter, inflation_cost_during_construction_output_parameter, \
interest_during_construction_output_parameter, total_capex_parameter_output_parameter, \
overnight_capital_cost_output_parameter, CONSTRUCTION_CAPEX_SCHEDULE_PARAMETER_NAME, \
_YEAR_INDEX_VALUE_EXPLANATION_SNIPPET, investment_tax_credit_output_parameter, expand_schedule_dsl, \
lcoh_output_parameter, lcoc_output_parameter
from geophires_x.GeoPHIRESUtils import quantity
from geophires_x.OptionList import Configuration, WellDrillingCostCorrelation, EconomicModel, EndUseOptions, PlantType, \
_WellDrillingCostCorrelationCitation
from geophires_x.Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, boolParameter, \
coerce_int_params_to_enum_values, listParameter, Parameter
from geophires_x.SurfacePlantUtils import MAX_CONSTRUCTION_YEARS
from geophires_x.Units import *
from geophires_x.WellBores import calculate_total_drilling_lengths_m
def calculate_cost_of_one_vertical_well(model: Model, depth_m: float, well_correlation: int,
vertical_drilling_cost_per_m: float,
fixed_well_cost_name: str, well_cost_adjustment_factor: float) -> float:
"""
CalculateCostOfOneWell calculates the cost of one vertical well based on the depth of the well and the cost correlation.
:param model: The model object
:type model: :class:`~geophires
:param depth_m: The depth of the well in meters
:type depth_m: float
:param well_correlation: The well correlation
:type well_correlation: int
:param vertical_drilling_cost_per_m: The vertical drilling cost per meter in $/m
:type vertical_drilling_cost_per_m: float
:param fixed_well_cost_name: The fixed well cost name
:type fixed_well_cost_name: str
:param well_cost_adjustment_factor: The well cost adjustment factor
:type well_cost_adjustment_factor: float
:return: cost_of_one_well: The cost of one well in MUSD
:rtype: float
"""
# Check if well depth is out of standard bounds for cost correlation
correlations_min_valid_depth_m = 500.
correlations_max_valid_depth_m = 7000.
cost_of_one_well = 0.0
if depth_m < correlations_min_valid_depth_m and not well_correlation is WellDrillingCostCorrelation.SIMPLE:
well_correlation = WellDrillingCostCorrelation.SIMPLE
model.logger.warning(
f'Invalid cost correlation specified ({well_correlation}) for drilling depth '
f'<{correlations_min_valid_depth_m}m ({depth_m}m). '
f'Falling back to simple user-specified cost '
f'({vertical_drilling_cost_per_m} per meter)'
)
if depth_m > correlations_max_valid_depth_m and not well_correlation is WellDrillingCostCorrelation.SIMPLE:
model.logger.warning(
f'{well_correlation} may be invalid for drilling depth '
f'>{correlations_max_valid_depth_m}m ({depth_m}m). '
f'Consider using {WellDrillingCostCorrelation.SIMPLE} (per-meter cost) or '
f'{fixed_well_cost_name} (fixed cost per well) instead.'
)
if well_correlation is WellDrillingCostCorrelation.SIMPLE:
cost_of_one_well = vertical_drilling_cost_per_m * depth_m * 1E-6
else:
cost_of_one_well = well_correlation.calculate_cost_MUSD(depth_m)
# account for adjustment factor
cost_of_one_well = well_cost_adjustment_factor * cost_of_one_well
return cost_of_one_well
def calculate_cost_of_non_vertical_section(model: Model, length_m: float, well_correlation: int,
nonvertical_drilling_cost_per_m: float,
num_nonvertical_sections: int,
fixed_well_cost_name: str, NonverticalsCased: bool,
well_cost_adjustment_factor: float) -> float:
"""
calculate_cost_of_non_vertical_section calculates the cost of the non vertical section of the well.
Assume that the cost per meter for drilling of the non-vertical section is the same as the vertical section.
:param model: The model object
:type model: :class:`~geophires
:param length_m: The depth of the well in meters
:type length_m: float
:param well_correlation: The well cost correlation
:type well_correlation: int
:param nonvertical_drilling_cost_per_m: The nonvertical drilling cost per meter in $/m
:type nonvertical_drilling_cost_per_m: float
:param num_nonvertical_sections: The number of non vertical sections
:type num_nonvertical_sections: int
:param fixed_well_cost_name: The fixed well cost name
:type fixed_well_cost_name: str
:param NonverticalsCased: Are the nonverticals cased?
:type NonverticalsCased: bool
:param well_cost_adjustment_factor: The well cost adjustment factor
:type well_cost_adjustment_factor: float
:return: cost_of_one_well: The cost of the nonvertical section in MUSD
:rtype: float
"""
# if we are drilling a vertical well, the nonvertical cost is 0
if model.wellbores.Configuration.value == Configuration.VERTICAL:
return 0.0
# Check if well length is out of standard bounds for cost correlation
length_per_section_m = length_m / num_nonvertical_sections
correlations_min_valid_length_m = 500.
correlations_max_valid_length_m = 7000.
cost_of_non_vertical_section = 0.0
cost_per_section = 0.0
if length_per_section_m < correlations_min_valid_length_m and not well_correlation is WellDrillingCostCorrelation.SIMPLE:
well_correlation = WellDrillingCostCorrelation.SIMPLE
model.logger.warning(
f'Invalid cost correlation specified ({well_correlation}) for drilling length '
f'<{correlations_min_valid_length_m}m ({length_m}m). '
f'Falling back to simple user-specified cost '
f'({nonvertical_drilling_cost_per_m} per meter)'
)
if length_per_section_m > correlations_max_valid_length_m and not well_correlation is WellDrillingCostCorrelation.SIMPLE:
model.logger.warning(
f'{well_correlation} may be invalid for drilling length '
f'>{correlations_max_valid_length_m}m ({length_m}m). '
f'Consider using {WellDrillingCostCorrelation.SIMPLE} (per-meter cost) or '
f'{fixed_well_cost_name} (fixed cost per well) instead.'
)
# assume that casing & cementing costs 50% of drilling costs
casing_factor = 1.0 if NonverticalsCased else 0.5
if model.economics.Nonvertical_drilling_cost_per_m.Provided or well_correlation is WellDrillingCostCorrelation.SIMPLE:
cost_of_non_vertical_section = casing_factor * ((num_nonvertical_sections * nonvertical_drilling_cost_per_m * length_per_section_m)) * 1E-6
else:
cost_per_section = well_correlation.calculate_cost_MUSD(length_per_section_m)
cost_of_non_vertical_section = casing_factor * num_nonvertical_sections * cost_per_section
# account for adjustment factor
cost_of_non_vertical_section = well_cost_adjustment_factor * cost_of_non_vertical_section
return cost_of_non_vertical_section
def BuildPTCModel(plantlifetime: int, duration: int, ptc_price: float,
ptc_inflation_adjusted: bool, inflation_rate: float) -> list:
"""
BuildPricingModel builds the price model array for the project lifetime. It is used to calculate the revenue
stream for the project.
:param plantlifetime: The lifetime of the project in years
:type plantlifetime: int
:param duration: The duration of the PTC in years
:type duration: int
:param ptc_price: The PTC in $/kWh
:type ptc_price: float
:param ptc_inflation_adjusted: Is the PTC is inflation?
:type ptc_inflation_adjusted: bool
:param inflation_rate: The inflation rate in %
:type inflation_rate: float
:return: Price: The price model array for the PTC in $/kWh
:rtype: list
"""
# Build the PTC price model by setting the price to the PTCPrice for the duration of the PTC
Price = [0.0] * plantlifetime
for year in range(0, duration, 1):
Price[year] = ptc_price
if ptc_inflation_adjusted and year > 0:
Price[year] = Price[year-1] * (1 + inflation_rate)
return Price
def CalculateTotalRevenue(plantlifetime: int, ConstructionYears: int, CAPEX: float, OPEX: float, AnnualRev):
"""
CalculateRevenue calculates the revenue stream for the project. It is used to calculate the revenue
stream for the project.
:param plantlifetime: The lifetime of the project in years in years (not including construction years) in years
:type plantlifetime: int
:param ConstructionYears: The number of years of construction for the project in years
:type ConstructionYears: int
:param CAPEX: The total capital cost of the project in MUSD
:type CAPEX: float
:param OPEX: The total annual operating cost of the project in MUSD
:type OPEX: float
:param AnnualRev: The annual revenue array for the project in MUSD
:type AnnualRev: list
:return: CashFlow: The annual cash flow for the project in MUSD and CummCashFlow: The cumulative cash flow for the
project in MUSD
:rtype: list
"""
# Calculate the revenue
ProjectCAPEXPerConstructionYear = CAPEX / ConstructionYears
CashFlow = [0.0] * (plantlifetime + ConstructionYears)
CummCashFlow = [0.0] * (plantlifetime + ConstructionYears)
# Insert the cost of construction into the front of the array that will be used to calculate NPV
# the convention is that the upfront CAPEX is negative
for i in range(0, ConstructionYears, 1):
CashFlow[i] = -1.0 * ProjectCAPEXPerConstructionYear
CummCashFlow[i] = -1.0 * ProjectCAPEXPerConstructionYear
for i in range(ConstructionYears, plantlifetime + ConstructionYears, 1):
CashFlow[i] = (AnnualRev[i]) - OPEX
# Calculate the cumulative revenue, skipping the first year because it is cumulative
for i in range(1, plantlifetime + ConstructionYears, 1):
CummCashFlow[i] = CummCashFlow[i - 1] + CashFlow[i]
return CashFlow, CummCashFlow
def CalculateRevenue(plantlifetime: int, ConstructionYears: int, Energy: list[float], Price: list[float]) \
-> tuple[list[float], list[float]]:
"""
CalculateRevenue calculates the revenue stream for the project. It is used to calculate the revenue
stream for the project.
# note this doesn't account for OPEX
:param plantlifetime: The lifetime of the project in years in years (not including construction years) in years
:type plantlifetime: int
:param ConstructionYears: The number of years of construction for the project in years
:type ConstructionYears: int
:param Energy: The energy production array for the project in kWh
:type Energy: list
:param Price: The price model array for the project in $/kWh
:type Price: list
:return: CashFlow: The annual cash flow for the project in MUSD and CummCashFlow: The cumulative cash flow for the
project in MUSD
:rtype: list
"""
# Calculate the revenue
CashFlow = [0.0] * (plantlifetime + ConstructionYears)
CummCashFlow = [0.0] * (plantlifetime + ConstructionYears)
# Revenue/yr in MUSD
for i in range(ConstructionYears, plantlifetime + ConstructionYears, 1):
CashFlow[i] = ((Energy[i - ConstructionYears] * Price[i - ConstructionYears]) / 1_000_000.0)
# Calculate the cumulative revenue, skipping the first year because it is cumulative
for i in range(ConstructionYears, plantlifetime + ConstructionYears, 1):
CummCashFlow[i] = CummCashFlow[i - 1] + CashFlow[i]
return CashFlow, CummCashFlow
def CalculateCarbonRevenue(model, plant_lifetime: int, construction_years: int, price_dollar_lb,
grid_CO2_intensity_lb_kwh: float, natural_gas_CO2_intensity_lb_kwh: float,
NetkWhProduced, HeatkWhProduced):
# Figure out how much carbon is being produced each year, and the amount of carbon that would have been
# produced if that energy had been made using the grid average carbon production.
# That then gives us the revenue, since we have a carbon price model
# We can also get cumulative cash flow from it.
# note this doesn't account for OPEX
cash_flow_musd = [0.0] * (plant_lifetime + construction_years)
cumm_cash_flow_musd = [0.0] * (plant_lifetime + construction_years)
carbon_that_would_have_been_produced_annually_lbs = ([0.0] * (plant_lifetime + construction_years))
carbon_that_would_have_been_produced_total_lbs = 0.0
for i in range(construction_years, plant_lifetime + construction_years, 1):
electrical_energy_kwh = 0.0
heat_energy_kwh = 0.0
elec_CO2_produced_lbs = 0.0
heat_CO2_produced_lbs = 0.0
# Carbon cashflow revenue (from both heat and elec) based net energy produced
if model.surfaceplant.enduse_option.value == EndUseOptions.ELECTRICITY: # This option has no heat component
electrical_energy_kwh = NetkWhProduced[i - construction_years]
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT: # has heat component but no electricity
heat_energy_kwh = HeatkWhProduced[i - construction_years]
else: # everything else has a component of both
electrical_energy_kwh = NetkWhProduced[i - construction_years]
heat_energy_kwh = HeatkWhProduced[i - construction_years]
elec_CO2_produced_lbs = electrical_energy_kwh * grid_CO2_intensity_lb_kwh
heat_CO2_produced_lbs = heat_energy_kwh * natural_gas_CO2_intensity_lb_kwh
# convert lbs/year to tonnes/year
carbon_that_would_have_been_produced_annually_lbs[i] = elec_CO2_produced_lbs + heat_CO2_produced_lbs
carbon_that_would_have_been_produced_total_lbs = carbon_that_would_have_been_produced_total_lbs + \
carbon_that_would_have_been_produced_annually_lbs[i]
cash_flow_musd[i] = (carbon_that_would_have_been_produced_annually_lbs[i] * price_dollar_lb[i - construction_years]) / 1_000_000.0
if i >= construction_years:
cumm_cash_flow_musd[i] = cumm_cash_flow_musd[i - 1] + cash_flow_musd[i]
return cash_flow_musd, cumm_cash_flow_musd, carbon_that_would_have_been_produced_annually_lbs, carbon_that_would_have_been_produced_total_lbs
def calculate_npv(
discount_rate_tenths: float,
cashflow_series: list,
discount_initial_year_cashflow: bool
) -> float:
# TODO warn/raise exception if discount rate > 1 (i.e. it's probably not converted from percent to tenths)
npv_cashflow_series = cashflow_series.copy() # Copy to guard against unintentional mutation of consumer field
if discount_initial_year_cashflow:
# Enable Excel-style NPV calculation - see https://github.com/NREL/GEOPHIRES-X/discussions/344
npv_cashflow_series = [0, *npv_cashflow_series]
return npf.npv(discount_rate_tenths, npv_cashflow_series)
def CalculateFinancialPerformance(plantlifetime: int,
FixedInternalRate: float,
TotalRevenue: list,
TotalCummRevenue: list,
CAPEX: float,
OPEX: float,
discount_initial_year_cashflow: bool = False):
"""
CalculateFinancialPerformance calculates the financial performance of the project. It is used to calculate the
financial performance of the project. It is used to calculate the revenue stream for the project.
:param plantlifetime: The lifetime of the project in years
:type plantlifetime: int
:param FixedInternalRate: The fixed internal rate of return for the project in %
:type FixedInternalRate: float
:param TotalRevenue: The total revenue stream for the project in MUSD
:type TotalRevenue: list
:param TotalCummRevenue: The total cumulative revenue stream for the project in MUSD
:type TotalCummRevenue: list
:param CAPEX: The total capital cost of the project in MUSD
:type CAPEX: float
:param OPEX: The total annual operating cost of the project in MUSD
:type OPEX: float
:param discount_initial_year_cashflow: Whether to discount the initial year of cashflow used to calculate NPV
:type discount_initial_year_cashflow: bool
:return: NPV: The net present value of the project in MUSD
:rtype: float
:return: IRR: The internal rate of return of the project in %
:rtype: float
:return: VIR: The value to investment ratio of the project in %
:rtype: float
:return: MOIC: The money on investment capital of the project in %
:rtype: float
:rtype: tuple
"""
# Calculate financial performance values using numpy financials
NPV = calculate_npv(FixedInternalRate / 100, TotalRevenue.copy(), discount_initial_year_cashflow)
IRR = npf.irr(TotalRevenue)
if math.isnan(IRR):
IRR = 0.0
else:
IRR *= 100. # convert from decimal to percent
VIR = 1.0 + (NPV / CAPEX)
# Calculate MOIC which depends on CumCashFlow
MOIC = TotalCummRevenue[len(TotalCummRevenue) - 1] / (CAPEX + (OPEX * plantlifetime))
return NPV, IRR, VIR, MOIC
def CalculateLCOELCOHLCOC(econ, model: Model) -> tuple[float, float, float]:
"""
CalculateLCOELCOH calculates the levelized cost of electricity and heat for the project.
:param econ: Economics object
:type econ: :class:`~geophires_x.Economics.Economics`
:param model: The model object
:type model: :class:`~geophires_x.Model.Model`
:return: LCOE: The levelized cost of electricity and LCOH: The levelized cost of heat and LCOC: The levelized cost of cooling
:rtype: tuple[float, float, float]
"""
LCOE = LCOH = LCOC = 0.0
CCap_elec = (econ.CCap.value * econ.CAPEX_heat_electricity_plant_ratio.value)
Coam_elec = (econ.Coam.value * econ.CAPEX_heat_electricity_plant_ratio.value)
CCap_heat = (econ.CCap.value * (1.0 - econ.CAPEX_heat_electricity_plant_ratio.value))
Coam_heat = (econ.Coam.value * (1.0 - econ.CAPEX_heat_electricity_plant_ratio.value))
def _capex_total_plus_construction_inflation() -> float:
# TODO should be return value instead of mutating econ
econ.inflation_cost_during_construction.value = quantity(
econ.CCap.value * econ.inflrateconstruction.value,
econ.CCap.CurrentUnits
).to(econ.inflation_cost_during_construction.CurrentUnits).magnitude
return econ.CCap.value + econ.inflation_cost_during_construction.value
def _construction_inflation_cost_elec_heat() -> tuple[float, float]:
construction_inflation_cost_elec = CCap_elec * econ.inflrateconstruction.value
construction_inflation_cost_heat = CCap_heat * econ.inflrateconstruction.value
# TODO should be return value instead of mutating econ
econ.inflation_cost_during_construction.value = quantity(
construction_inflation_cost_elec + construction_inflation_cost_heat,
econ.CCap.CurrentUnits
).to(econ.inflation_cost_during_construction.CurrentUnits).magnitude
return CCap_elec + construction_inflation_cost_elec, CCap_heat + construction_inflation_cost_heat
# Calculate LCOE/LCOH/LCOC
if econ.econmodel.value == EconomicModel.FCR:
capex_total_plus_infl = _capex_total_plus_construction_inflation()
if model.surfaceplant.enduse_option.value == EndUseOptions.ELECTRICITY:
LCOE = (econ.FCR.value * capex_total_plus_infl + econ.Coam.value) / \
np.average(model.surfaceplant.NetkWhProduced.value) * 1E8 # cents/kWh
elif (model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and
model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER, PlantType.HEAT_PUMP, PlantType.DISTRICT_HEATING]):
LCOH = (econ.FCR.value * capex_total_plus_infl + econ.Coam.value +
econ.averageannualpumpingcosts.value) / np.average(
model.surfaceplant.HeatkWhProduced.value) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
# co-gen
elif model.surfaceplant.enduse_option.value.is_cogeneration_end_use_option:
capex_elec_plus_infl, capex_heat_plus_infl = _construction_inflation_cost_elec_heat()
LCOE = (econ.FCR.value * capex_elec_plus_infl + Coam_elec) / np.average(model.surfaceplant.NetkWhProduced.value) * 1E8 # cents/kWh
LCOH = (econ.FCR.value * capex_heat_plus_infl + Coam_heat + econ.averageannualpumpingcosts.value) / np.average(model.surfaceplant.HeatkWhProduced.value) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.ABSORPTION_CHILLER:
LCOC = (econ.FCR.value * capex_total_plus_infl + econ.Coam.value + econ.averageannualpumpingcosts.value) / np.average(
model.surfaceplant.cooling_kWh_Produced.value) * 1E8 # cents/kWh
LCOC = LCOC * 2.931 # $/Million Btu
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.HEAT_PUMP:
LCOH = (econ.FCR.value * capex_total_plus_infl
+ econ.Coam.value + econ.averageannualpumpingcosts.value + econ.averageannualheatpumpelectricitycost.value) / np.average(
model.surfaceplant.HeatkWhProduced.value) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.DISTRICT_HEATING:
LCOH = (econ.FCR.value * capex_total_plus_infl
+ econ.Coam.value + econ.averageannualpumpingcosts.value + econ.averageannualngcost.value) / model.surfaceplant.annual_heating_demand.value * 1E2 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
elif econ.econmodel.value == EconomicModel.STANDARDIZED_LEVELIZED_COST:
discount_vector = 1. / np.power(1 + econ.discountrate.value,
np.linspace(0, model.surfaceplant.plant_lifetime.value - 1,
model.surfaceplant.plant_lifetime.value))
capex_total_plus_infl = _capex_total_plus_construction_inflation()
if model.surfaceplant.enduse_option.value == EndUseOptions.ELECTRICITY:
LCOE = (capex_total_plus_infl + np.sum(
econ.Coam.value * discount_vector)) / np.sum(
model.surfaceplant.NetkWhProduced.value * discount_vector) * 1E8 # cents/kWh
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and \
model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER, PlantType.HEAT_PUMP, PlantType.DISTRICT_HEATING]:
econ.averageannualpumpingcosts.value = np.average(
model.surfaceplant.PumpingkWh.value) * model.surfaceplant.electricity_cost_to_buy.value / 1E6 # M$/year
LCOH = (capex_total_plus_infl + np.sum((
econ.Coam.value + model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6) * discount_vector)) / np.sum(
model.surfaceplant.HeatkWhProduced.value * discount_vector) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/MMBTU
# co-gen
elif model.surfaceplant.enduse_option.value.is_cogeneration_end_use_option:
capex_elec_plus_infl, capex_heat_plus_infl = _construction_inflation_cost_elec_heat()
LCOE = (capex_elec_plus_infl + np.sum(Coam_elec * discount_vector)) / np.sum(model.surfaceplant.NetkWhProduced.value * discount_vector) * 1E8 # cents/kWh
LCOH = (capex_heat_plus_infl +
np.sum((Coam_heat + model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6) * discount_vector)) / np.sum(model.surfaceplant.HeatkWhProduced.value * discount_vector) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/MMBTU
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.ABSORPTION_CHILLER:
capex_total_plus_infl = _capex_total_plus_construction_inflation()
LCOC = (capex_total_plus_infl + np.sum((
econ.Coam.value + model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6) * discount_vector)) / np.sum(
model.surfaceplant.cooling_kWh_Produced.value * discount_vector) * 1E8 # cents/kWh
LCOC = LCOC * 2.931 # $/Million Btu
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.HEAT_PUMP:
capex_total_plus_infl = _capex_total_plus_construction_inflation()
LCOH = (capex_total_plus_infl + np.sum(
(econ.Coam.value + model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6 +
model.surfaceplant.heat_pump_electricity_kwh_used.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6) * discount_vector)) / np.sum(
model.surfaceplant.HeatkWhProduced.value * discount_vector) * 1E8 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.DISTRICT_HEATING:
capex_total_plus_infl = _capex_total_plus_construction_inflation()
LCOH = (capex_total_plus_infl + np.sum(
(econ.Coam.value + model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6 +
econ.annualngcost.value) * discount_vector)) / np.sum(
model.surfaceplant.annual_heating_demand.value * discount_vector) * 1E2 # cents/kWh
LCOH = LCOH * 2.931 # $/Million Btu
elif econ.econmodel.value == EconomicModel.SAM_SINGLE_OWNER_PPA:
if model.surfaceplant.enduse_option.value.has_electricity_component:
# Designated as nominal (as opposed to real) in parameter tooltip text
LCOE = econ.sam_economics_calculations.lcoe_nominal.quantity().to(
convertible_unit(econ.LCOE.CurrentUnits.value)).magnitude
if model.surfaceplant.enduse_option.value.has_direct_use_heat_component:
if econ.sam_economics_calculations.lcoh_nominal.value is not None:
# Designated as nominal (as opposed to real) in parameter tooltip text
LCOH = econ.sam_economics_calculations.lcoh_nominal.quantity().to(
convertible_unit(econ.LCOH.CurrentUnits.value)).magnitude
else:
# TODO probably should not happen; relevant to
# https://github.com/NatLabRockies/GEOPHIRES-X/issues/452?title=Deduplicate+calls+to+calculate_pre_revenue_costs_and_cashflow
pass
if econ.sam_economics_calculations.lcoc_nominal.value is not None:
# Designated as nominal (as opposed to real) in parameter tooltip text
LCOC = econ.sam_economics_calculations.lcoc_nominal.quantity().to(
convertible_unit(econ.LCOC.CurrentUnits.value)).magnitude
else:
if econ.econmodel.value != EconomicModel.BICYCLE:
model.logger.error(
f'Unrecognized economic model: {econ.econmodel.value}. '
f'Treating as {EconomicModel.BICYCLE.value} for LCOE/LCOH/LCOC calculations.'
)
# Error is logged instead of raising an exception for backwards compatibility.
# average return on investment (tax and inflation adjusted)
i_ave = econ.FIB.value * econ.BIR.value * (1 - econ.CTR.value) + (1 - econ.FIB.value) * econ.EIR.value
# capital recovery factor
CRF = i_ave / (1 - np.power(1 + i_ave, -model.surfaceplant.plant_lifetime.value))
inflation_vector = np.power(1 + econ.RINFL.value, np.linspace(1, model.surfaceplant.plant_lifetime.value, model.surfaceplant.plant_lifetime.value))
discount_vector = 1. / np.power(1 + i_ave, np.linspace(1, model.surfaceplant.plant_lifetime.value, model.surfaceplant.plant_lifetime.value))
capex_total_plus_infl = _capex_total_plus_construction_inflation()
NPV_cap = np.sum(capex_total_plus_infl * CRF * discount_vector)
NPV_fc = np.sum(capex_total_plus_infl * econ.PTR.value * inflation_vector * discount_vector)
NPV_it = np.sum(econ.CTR.value / (1 - econ.CTR.value) * (capex_total_plus_infl * CRF - econ.CCap.value / model.surfaceplant.plant_lifetime.value) * discount_vector)
NPV_itc = capex_total_plus_infl * econ.RITC.value / (1 - econ.CTR.value)
if model.surfaceplant.enduse_option.value == EndUseOptions.ELECTRICITY:
NPV_oandm = np.sum(econ.Coam.value * inflation_vector * discount_vector)
NPV_grt = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap + NPV_oandm + NPV_fc + NPV_it - NPV_itc)
LCOE = (NPV_cap + NPV_oandm + NPV_fc + NPV_it + NPV_grt - NPV_itc) / np.sum(model.surfaceplant.NetkWhProduced.value * inflation_vector * discount_vector) * 1E8
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER, PlantType.HEAT_PUMP, PlantType.DISTRICT_HEATING]:
PumpingCosts = model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6
NPV_oandm = np.sum((econ.Coam.value + PumpingCosts) * inflation_vector * discount_vector)
NPV_grt = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap + NPV_oandm + NPV_fc + NPV_it - NPV_itc)
LCOH = (NPV_cap + NPV_oandm + NPV_fc + NPV_it + NPV_grt - NPV_itc) / np.sum(model.surfaceplant.HeatkWhProduced.value * inflation_vector * discount_vector) * 1E8
LCOH = LCOH * 2.931 # $/MMBTU
# co-gen
elif model.surfaceplant.enduse_option.value.is_cogeneration_end_use_option:
capex_elec_plus_infl, capex_heat_plus_infl = _construction_inflation_cost_elec_heat()
NPVcap_elec = np.sum(capex_elec_plus_infl * CRF * discount_vector)
NPVfc_elec = np.sum(capex_elec_plus_infl * econ.PTR.value * inflation_vector * discount_vector)
NPVit_elec = np.sum(econ.CTR.value / (1 - econ.CTR.value) * (capex_elec_plus_infl * CRF - CCap_elec / model.surfaceplant.plant_lifetime.value) * discount_vector)
NPVitc_elec = capex_elec_plus_infl * econ.RITC.value / (1 - econ.CTR.value)
NPVoandm_elec = np.sum(Coam_elec * inflation_vector * discount_vector)
NPVgrt_elec = econ.GTR.value / (1 - econ.GTR.value) * (NPVcap_elec + NPVoandm_elec + NPVfc_elec + NPVit_elec - NPVitc_elec)
LCOE = ((NPVcap_elec + NPVoandm_elec + NPVfc_elec + NPVit_elec + NPVgrt_elec - NPVitc_elec) /
np.sum(model.surfaceplant.NetkWhProduced.value * inflation_vector * discount_vector) * 1E8)
NPV_cap_heat = np.sum(capex_heat_plus_infl * CRF * discount_vector)
NPV_fc_heat = np.sum((1 + econ.inflrateconstruction.value) * (econ.CCap.value * (1.0 - econ.CAPEX_heat_electricity_plant_ratio.value)) * econ.PTR.value * inflation_vector * discount_vector)
NPV_it_heat = np.sum(econ.CTR.value / (1 - econ.CTR.value) * (capex_heat_plus_infl * CRF - CCap_heat / model.surfaceplant.plant_lifetime.value) * discount_vector)
NPV_itc_heat = capex_heat_plus_infl * econ.RITC.value / (1 - econ.CTR.value)
NPV_oandm_heat = np.sum((econ.Coam.value * (1.0 - econ.CAPEX_heat_electricity_plant_ratio.value)) * inflation_vector * discount_vector)
NPV_grt_heat = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap_heat + NPV_oandm_heat + NPV_fc_heat + NPV_it_heat - NPV_itc_heat)
LCOH = ((NPV_cap_heat + NPV_oandm_heat + NPV_fc_heat + NPV_it_heat + NPV_grt_heat - NPV_itc_heat) /
np.sum(model.surfaceplant.HeatkWhProduced.value * inflation_vector * discount_vector) * 1E8)
LCOH = LCOH * 2.931 # $/MMBTU
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.ABSORPTION_CHILLER:
PumpingCosts = model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6
NPV_oandm = np.sum((econ.Coam.value + PumpingCosts) * inflation_vector * discount_vector)
NPV_grt = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap + NPV_oandm + NPV_fc + NPV_it - NPV_itc)
LCOC = (NPV_cap + NPV_oandm + NPV_fc + NPV_it + NPV_grt - NPV_itc) / np.sum(
model.surfaceplant.cooling_kWh_Produced.value * inflation_vector * discount_vector) * 1E8
LCOC = LCOC * 2.931 # $/MMBTU
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.HEAT_PUMP:
PumpingCosts = model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6
HeatPumpElecCosts = model.surfaceplant.heat_pump_electricity_kwh_used.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6
NPV_oandm = np.sum((econ.Coam.value + PumpingCosts + HeatPumpElecCosts) * inflation_vector * discount_vector)
NPV_grt = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap + NPV_oandm + NPV_fc + NPV_it - NPV_itc)
LCOH = (NPV_cap + NPV_oandm + NPV_fc + NPV_it + NPV_grt - NPV_itc) / np.sum(
model.surfaceplant.HeatkWhProduced.value * inflation_vector * discount_vector) * 1E8
LCOH = LCOH * 2.931 # $/MMBTU
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value == PlantType.DISTRICT_HEATING:
PumpingCosts = model.surfaceplant.PumpingkWh.value * model.surfaceplant.electricity_cost_to_buy.value / 1E6
NPV_oandm = np.sum(
(econ.Coam.value + PumpingCosts + econ.annualngcost.value) * inflation_vector * discount_vector)
NPV_grt = econ.GTR.value / (1 - econ.GTR.value) * (NPV_cap + NPV_oandm + NPV_fc + NPV_it - NPV_itc)
LCOH = (NPV_cap + NPV_oandm + NPV_fc + NPV_it + NPV_grt - NPV_itc) / np.sum(
model.surfaceplant.annual_heating_demand.value * inflation_vector * discount_vector) * 1E2
LCOH = LCOH * 2.931 # $/MMBTU
return LCOE, LCOH, LCOC
class Economics:
"""
Class to support the default economic calculations in GEOPHIRES
"""
def __init__(self, model: Model):
"""
The __init__ function is called automatically when a class is instantiated.
It initializes the attributes of an object, and sets default values for certain arguments that can be overridden
by user input.
The __init__ function is used to set up all the parameters in Economics.
Set up all the Parameters that will be predefined by this class using the different types of parameter classes.
Setting up includes giving it a name, a default value, The Unit Type (length, volume, temperature, etc.) and
Unit Name of that value, sets it as required (or not), sets allowable range, the error message if that range
is exceeded, the ToolTip Text, and the name of teh class that created it.
This includes setting up temporary variables that will be available to all the class but noy read in by user,
or used for Output
This also includes all Parameters that are calculated and then published using the Printouts function.
If you choose to subclass this master class, you can do so before or after you create your own parameters.
If you do, you can also choose to call this method from you class, which will effectively add and set all
these parameters to your class.
:param model: The container class of the application, giving access to everything else, including the logger
:type model: :class:`~geophires_x.Model.Model`
:return: None
"""
model.logger.info(f'Init {__class__!s}: {sys._getframe().f_code.co_name}')
# These dictionaries contain a list of all the parameters set in this object, stored as "Parameter" and
# "OutputParameter" Objects. This will allow us later to access them in a user interface and get that list,
# along with unit type, preferred units, etc.
self.ParameterDict = {}
self.OutputParameterDict = {}
# Note: setting Valid to False for any of the cost parameters forces GEOPHIRES to use it's builtin cost engine.
# This is the default.
self.econmodel = self.ParameterDict[self.econmodel.Name] = intParameter(
"Economic Model",
DefaultValue=EconomicModel.STANDARDIZED_LEVELIZED_COST.int_value,
AllowableRange=[1, 2, 3, 4, 5],
ValuesEnum=EconomicModel,
Required=True,
ErrMessage="assume default economic model (2)",
ToolTipText="Specify the economic model to calculate the levelized cost of energy. " +
'; '.join([f'{it.int_value}: {it.value}' for it in EconomicModel])
)
self.ccstimfixed = self.ParameterDict[self.ccstimfixed.Name] = floatParameter(
"Reservoir Stimulation Capital Cost",
DefaultValue=-1.0,
Min=0,
Max=1000,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText='Total reservoir stimulation capital cost, including indirect costs and contingency. '
f'For traditional hydrothermal reservoirs, this parameter should be set to $0.'
)
max_stimulation_cost_per_well_MUSD = 100
self.stimulation_cost_per_injection_well = \
self.ParameterDict[self.stimulation_cost_per_injection_well.Name] = floatParameter(
'Reservoir Stimulation Capital Cost per Injection Well',
DefaultValue=1.25,
Min=0,
Max=max_stimulation_cost_per_well_MUSD,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
ToolTipText='Reservoir stimulation capital cost per injection well before indirect costs and contingency'
)
stimulation_cost_per_production_well_default_value_MUSD = 0
stimulation_cost_per_production_well_default_value_note = \
'. By default, only the injection wells are assumed to be stimulated unless this parameter is provided.' \
if stimulation_cost_per_production_well_default_value_MUSD == 0 else ''
self.stimulation_cost_per_production_well = \
self.ParameterDict[self.stimulation_cost_per_production_well.Name] = floatParameter(
'Reservoir Stimulation Capital Cost per Production Well',
DefaultValue=stimulation_cost_per_production_well_default_value_MUSD,
Min=0,
Max=max_stimulation_cost_per_well_MUSD,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
ToolTipText=f'Reservoir stimulation capital cost per production well before indirect costs and contingency'
f'{stimulation_cost_per_production_well_default_value_note}'
)
self.ccstimadjfactor = self.ParameterDict[self.ccstimadjfactor.Name] = floatParameter(
"Reservoir Stimulation Capital Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for reservoir stimulation capital cost correlation"
)
self.stimulation_indirect_capital_cost_percentage = \
self.ParameterDict[self.stimulation_indirect_capital_cost_percentage.Name] = floatParameter(
'Reservoir Stimulation Indirect Capital Cost Percentage',
DefaultValue=5,
Min=0,
Max=100,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.PERCENT,
CurrentUnits=PercentUnit.PERCENT,
ToolTipText=f'The indirect capital cost for reservoir stimulation, '
f'calculated as a percentage of the direct cost. '
f'(Not applied if {self.ccstimfixed.Name} is provided.)'
)
self.ccexplfixed = self.ParameterDict[self.ccexplfixed.Name] = floatParameter(
"Exploration Capital Cost",
DefaultValue=-1.0,
Min=0,
Max=1000,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText="Total exploration capital cost"
)
self.ccexpladjfactor = self.ParameterDict[self.ccexpladjfactor.Name] = floatParameter(
"Exploration Capital Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in exploration capital cost correlation"
)
per_injection_well_cost_name = 'Injection Well Drilling and Completion Capital Cost'
self.per_production_well_cost = self.ParameterDict[self.per_production_well_cost.Name] = floatParameter(
"Well Drilling and Completion Capital Cost",
DefaultValue=-1,
Min=0,
Max=200,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText=f'Well drilling and completion capital cost per well including indirect costs and contingency. '
f'Applied to production wells; also applied to injection wells unless '
f'{per_injection_well_cost_name} is provided.'
)
self.per_injection_well_cost = self.ParameterDict[self.per_injection_well_cost.Name] = floatParameter(
per_injection_well_cost_name,
DefaultValue=self.per_production_well_cost.DefaultValue,
Min=0,
Max=200,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText='Injection well drilling and completion capital cost per well '
'including indirect costs and contingency'
)
inj_well_cost_adjustment_factor_name = "Injection Well Drilling and Completion Capital Cost Adjustment Factor"
self.production_well_cost_adjustment_factor = self.ParameterDict[self.production_well_cost_adjustment_factor.Name] = floatParameter(
"Well Drilling and Completion Capital Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText=f'Well Drilling and Completion Capital Cost Adjustment Factor. Applies to production wells; '
f'also applies to injection wells unless a value is provided for '
f'{inj_well_cost_adjustment_factor_name}.'
)
self.injection_well_cost_adjustment_factor = self.ParameterDict[self.injection_well_cost_adjustment_factor.Name] = floatParameter(
inj_well_cost_adjustment_factor_name,
DefaultValue=self.production_well_cost_adjustment_factor.DefaultValue,
Min=self.production_well_cost_adjustment_factor.Min,
Max=self.production_well_cost_adjustment_factor.Max,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Injection Well Drilling and Completion Capital Cost Adjustment Factor. "
f"If not provided, this value will be set automatically to the same value as "
f"{self.production_well_cost_adjustment_factor.Name}."
)
self.oamwellfixed = self.ParameterDict[self.oamwellfixed.Name] = floatParameter(
"Wellfield O&M Cost",
DefaultValue=-1.0,
Min=0,
Max=100,
UnitType=Units.CURRENCYFREQUENCY,
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
Provided=False,
Valid=False,
ToolTipText="Total annual wellfield O&M cost"
)
self.oamwelladjfactor = self.ParameterDict[self.oamwelladjfactor.Name] = floatParameter(
"Wellfield O&M Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in wellfield O&M cost correlation"
)
self.ccplantfixed = self.ParameterDict[self.ccplantfixed.Name] = floatParameter(
"Surface Plant Capital Cost",
DefaultValue=-1.0,
Min=0,
Max=10000,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText="Total surface plant capital cost"
)
self.ccplantadjfactor = self.ParameterDict[self.ccplantadjfactor.Name] = floatParameter(
"Surface Plant Capital Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in surface plant capital cost correlation"
)
self._default_Power_plant_cost_USD_per_kWe = 3000
self.Power_plant_cost_per_kWe = self.ParameterDict[self.Power_plant_cost_per_kWe.Name] = floatParameter(
"Capital Cost for Power Plant for Electricity Generation",
DefaultValue=self._default_Power_plant_cost_USD_per_kWe,
Min=0.0,
Max=10000.0,
UnitType=Units.ENERGYCOST,
PreferredUnits=EnergyCostUnit.DOLLARSPERKW,
CurrentUnits=EnergyCostUnit.DOLLARSPERKW,
ErrMessage=f'assume default Power plant capital cost per kWe '
f'({self._default_Power_plant_cost_USD_per_kWe} USD/kWe)'
)
self.ccgathfixed = self.ParameterDict[self.ccgathfixed.Name] = floatParameter(
"Field Gathering System Capital Cost",
DefaultValue=-1.0,
Min=0,
Max=100,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ToolTipText="Total field gathering system capital cost"
)
self.ccgathadjfactor = self.ParameterDict[self.ccgathadjfactor.Name] = floatParameter(
"Field Gathering System Capital Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in field gathering system capital cost correlation"
)
self.oamplantfixed = self.ParameterDict[self.oamplantfixed.Name] = floatParameter(
"Surface Plant O&M Cost",
DefaultValue=-1.0,
Min=0,
Max=100,
UnitType=Units.CURRENCYFREQUENCY,
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
Provided=False,
Valid=False,
ToolTipText="Total annual surface plant O&M cost"
)
self.oamplantadjfactor = self.ParameterDict[self.oamplantadjfactor.Name] = floatParameter(
"Surface Plant O&M Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in surface plant O&M cost correlation"
)
self.oamwaterfixed = self.ParameterDict[self.oamwaterfixed.Name] = floatParameter(
"Water Cost",
DefaultValue=-1.0,
Min=0,
Max=100,
UnitType=Units.CURRENCYFREQUENCY,
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
Provided=False,
Valid=False,
ToolTipText="Total annual make-up water cost"
)
self.oamwateradjfactor = self.ParameterDict[self.oamwateradjfactor.Name] = floatParameter(
"Water Cost Adjustment Factor",
DefaultValue=1.0,
Min=0,
Max=10,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
Provided=False,
Valid=True,
ToolTipText="Multiplier for built-in make-up water cost correlation"
)
self.totalcapcost = self.ParameterDict[self.totalcapcost.Name] = floatParameter(
"Total Capital Cost",
DefaultValue=-1.0,
Min=0,
# pint treats GUSD as billions of dollars (G for giga)
Max=quantity(100, 'GUSD').to('MUSD').magnitude,
UnitType=Units.CURRENCY,
PreferredUnits=CurrencyUnit.MDOLLARS,
CurrentUnits=CurrencyUnit.MDOLLARS,
Provided=False,
Valid=False,
ErrMessage="calculate total capital cost using user-provided costs or" +
" built-in correlations for each category.",
ToolTipText=f'Total initial capital cost. For SAM Economic Models, '
f'this is treated as the {overnight_capital_cost_output_parameter().Name}.'
)
self.oamtotalfixed = self.ParameterDict[self.oamtotalfixed.Name] = floatParameter(
"Total O&M Cost",
DefaultValue=-1.0,
Min=0,
Max=100,
UnitType=Units.CURRENCYFREQUENCY,
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
Provided=False,
Valid=False,
ErrMessage="calculate total O&M cost using user-provided costs or built-in correlations for each category.",
ToolTipText="Total initial O&M cost."
)
self.timestepsperyear = self.ParameterDict[self.timestepsperyear.Name] = intParameter(
"Time steps per year",
DefaultValue=4,
AllowableRange=list(range(1, 101, 1)),
UnitType=Units.NONE,
Required=True,
ErrMessage="assume default number of time steps per year (4)",
ToolTipText='Number of internal simulation time steps per year. GEOPHIRES assumes linear time '
'discretization with a user-provided number of time steps per year over the lifetime of the '
'plant. The default is four time steps per year, meaning a time step of 3 months. '
'At every time step, GEOPHIRES calculates the reservoir output temperature, production '
'wellhead temperature, direct-use heat and/or electricity power output (in MW), pressure '
'drops and pumping power. On an annual basis, GEOPHIRES calculates the O&M costs and '
'direct-use heat and/or electricity production. To investigate seasonal effects, e.g., to '
'assess the impact of more geothermal heat demand for district heating in winter than in '
'summer, the user can select a smaller time step, e.g., a month (or 12 time steps per year). '
'For even shorter timescale effects, e.g., to account for an hourly varying ambient '
'temperature or investigate the response in plant operation to a fluctuating revenue rate), '
'the user can select an even smaller time step, e.g., 1 h (or 8760 time steps per year).'
)
self.FCR = self.ParameterDict[self.FCR.Name] = floatParameter(
"Fixed Charge Rate",
DefaultValue=0.1,
Min=0.0,
Max=1.0,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
ErrMessage="assume default fixed charge rate (0.1)",
ToolTipText="Fixed charge rate (FCR) used in the Fixed Charge Rate Model"
)
discount_rate_default_val = 0.07
self.discountrate = self.ParameterDict[self.discountrate.Name] = floatParameter(
"Discount Rate",
DefaultValue=discount_rate_default_val,
Min=0.0,
Max=1.0,
UnitType=Units.PERCENT,
PreferredUnits=PercentUnit.TENTH,
CurrentUnits=PercentUnit.TENTH,
ErrMessage=f'assume default discount rate ({discount_rate_default_val})',