Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions documentation/source/cost-models/cost-models.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Cost Models

Two cost models are available, determined by the switch `cost_model`.
Two cost models are available, determined by the switch `i_cost_model`.

## 1990 cost model (`cost_model = 0`)
## 1990 cost model (`i_cost_model = 0`)

This combines methods[^1] used in the TETRA code [^2] and the Generomak[^3] scheme. The costs are split into accounting categories[^4]. The best references for the algorithms used are[^5], and source file `costs.f90` in the code itself. The majority of the costed items have a unit cost associated with them. These values scale with (for example) power output, volume, component mass etc., and many are available to be changed via the input file. All costs and their algorithms correspond to 1990 dollars.

Expand All @@ -16,7 +16,7 @@ If the switch `ireactor = 0`, no cost of electricity calculation is performed. I

The net electric power is calculated in routine `POWER` It is possible that the net electric power can become negative due to a high recirculating power. Switch `ipnet` determines whether the net electric power is scaled to always remain positive (`ipnet = 0`, or whether it is allowed to become negative (`ipnet = 1`), in which case no cost of electricity calculation is performed.

## 2015 Kovari model (`cost_model = 1`)
## 2015 Kovari model (`i_cost_model = 1`)

This model[^8] provides only capital cost, and it is not currently suitable for estimating the cost of electricity. *N<sup>th</sup>*-of-a-kind factors, level of safety assurance factors, and blanket replacement costs are not included. The mean electric output is calculated using the capacity factor, which takes account of the availability and the dwell time for a pulsed reactor. The capital cost divided by the mean electric output is a useful comparison parameter.

Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_eval_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ f_t_alpha_energy_confinement_min = 5.0 * Lower limit on f_t_alpha_energy_confine
*------------------Cost Variables------------------*

f_t_plant_available = 0.80 * Total plant availability fraction; input if `i_plant_availability=0`
cost_model = 0 * Switch for cost model;
i_cost_model = 0 * Switch for cost model;
i_plant_availability = 0 * Switch for plant availability model;
output_costs = 1 * Switch for costs output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion examples/data/large_tokamak_varyrun_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion examples/data/scan_example_file_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion process/core/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ def bounds(self) -> tuple[NumberType | None, NumberType | None]:
"tf_coppera_m2_max": InputVariable(
"superconducting_tfcoil", float, range=(1.0e6, 1.0e10)
),
"cost_model": InputVariable("costs", int, choices=[0, 1, 2]),
"i_cost_model": InputVariable("costs", int, choices=[0, 1, 2]),
"i_vac_pump_dwell": InputVariable("vacuum", int, choices=[0, 1, 2]),
"i_fw_blkt_vv_shape": InputVariable("fwbs", int, range=(1, 2)),
"hcdportsize": InputVariable("fwbs", int, range=(1, 2)),
Expand Down
1 change: 1 addition & 0 deletions process/core/io/obsolete_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
"alstroh": "stress_cs_steel_max",
"i_cs_stress": None,
"f_nd_alpha_electron": "f_nd_alpha_thermal_electron",
"cost_model": "i_cost_model",
}

OBS_VARS_HELP = {
Expand Down
16 changes: 15 additions & 1 deletion process/data_structure/cost_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
from dataclasses import dataclass, field
from enum import IntEnum


class CostModels(IntEnum):
"""Enum for cost model selection"""

PROCESS_1990 = 0
"""Use $ 1990 PROCESS model"""

KOVARI_2014 = 1
"""Use $ 2014 Kovari model"""

USER_PROVIDED = 2
"""Use user-provided model"""


@dataclass(slots=True)
Expand Down Expand Up @@ -306,7 +320,7 @@ class CostData:
amortization: float = 13.6
"""amortization factor (fixed charge factor) "A" (years)"""

cost_model: int = 1
i_cost_model: int = 1
"""Switch for cost model:
- =0 use $ 1990 PROCESS model
- =1 use $ 2014 Kovari model
Expand Down
2 changes: 1 addition & 1 deletion process/data_structure/fwbs_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class FWBSData:
"""

i_shield_mat: int = 0
"""Switch for shield material - *currently only applied in costing routines* `cost_model = 2`
"""Switch for shield material - *currently only applied in costing routines* `i_cost_model = 2`
- =0 Tungsten (default)
- =1 Tungsten carbide
"""
Expand Down
7 changes: 4 additions & 3 deletions process/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from process.core.model import DataStructure, Model
from process.core.process_output import OutputFileManager, oheadr
from process.core.scan import Scan
from process.data_structure.cost_variables import CostModels
from process.data_structure.numerics import PROCESSRunMode
from process.models.availability import Availability
from process.models.blankets.blanket_library import BlanketLibrary
Expand Down Expand Up @@ -718,11 +719,11 @@ def __init__(self, data: DataStructure):

@property
def costs(self) -> Model:
if self.data.costs.cost_model == 0:
if CostModels(self.data.costs.i_cost_model) == CostModels.PROCESS_1990:
return self._costs_1990
if self.data.costs.cost_model == 1:
if CostModels(self.data.costs.i_cost_model) == CostModels.KOVARI_2014:
return self._costs_2015
if self.data.costs.cost_model == 2:
if CostModels(self.data.costs.i_cost_model) == CostModels.USER_PROVIDED:
if self._costs_custom is not None:
self._costs_custom.data = self.data
return self._costs_custom
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_1_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_2_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_3_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_4_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -36399,7 +36399,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/large_tokamak_eval.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ f_t_alpha_energy_confinement_min = 5.0 * Lower limit on f_t_alpha_energy_confine
*------------------Cost Variables------------------*

f_t_plant_available = 0.80 * Total plant availability fraction; input if `i_plant_availability=0`
cost_model = 0 * Switch for cost model;
i_cost_model = 0 * Switch for cost model;
i_plant_availability = 0 * Switch for plant availability model;
output_costs = 1 * Switch for costs output;

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/ref_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ p_div_bt_q_aspect_rmajor_max_mw = 9.2 * maximum ratio of Psep*Bt/qAR (MWT/m)
*------------------Cost Variables------------------*

output_costs = 0
cost_model = 0
i_cost_model = 0
abktflnc = 15 * Allowable first wall/blanket neutron
adivflnc = 20.0 * Allowable divertor heat fluence (mw-yr/m2)
f_t_plant_available = 0.75 * Total plant availability fraction;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/scan_2D_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -18000,7 +18000,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data/scan_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -9123,7 +9123,7 @@ p_div_bt_q_aspect_rmajor_max_mw = 9.2 * maximum ratio of Psep*Bt/qAR (MWT/m)
*------------------Cost Variables------------------*

output_costs = 0
cost_model = 0
i_cost_model = 0
abktflnc = 15 * Allowable first wall/blanket neutron
adivflnc = 20.0 * Allowable divertor heat fluence (mw-yr/m2)
f_t_plant_available = 0.75 * Total plant availability fraction;
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/IFE.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ f_p_blkt_multiplication = 1.26 *Energy multiplication in blanket and s
fhole = 0.0 *Area fraction taken up by other holes

*-----------------Cost Variables-------------------*
cost_model = 0 *1990 cost model
i_cost_model = 0 *1990 cost model
abktflnc = 20.0 *Allowable first wall/blanket neutron fluence (MW-yr/m2)
f_t_plant_available = 0.75 *Total plant availability fraction
fcdfuel = 0.0 *Fraction of current drive cost treated as fuel (if ifueltyp = 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/helias_5b.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ dr_tf_nose_case = 0.06 * Case thickness


*------------------Cost Variables------------------*
cost_model = 0 *0: 1990 cost module, the 2015 does not work yet for stellarators
i_cost_model = 0 *0: 1990 cost module, the 2015 does not work yet for stellarators
abktflnc = 15.0 *Allowable first wall/blanket neutron (MW-yr/m2)
adivflnc = 25.0 *Allowable divertor heat fluence (MW-yr/m2)
f_t_plant_available = 0.75 *Total plant capacity fraction
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/large_tokamak_eval.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ f_t_alpha_energy_confinement_min = 5.0 * Lower limit on f_t_alpha_energy_confine
*------------------Cost Variables------------------*

f_t_plant_available = 0.80 * Total plant availability fraction; input if `i_plant_availability=0`
cost_model = 0 * Switch for cost model;
i_cost_model = 0 * Switch for cost model;
i_plant_availability = 0 * Switch for plant availability model;
output_costs = 1 * Switch for costs output;

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/large_tokamak_nof.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ output_costs = 0
* DESCRIPTION: Switch for costs output
* JUSTIFICATION: Do not print to OUT.DAT all accounts

cost_model = 0
i_cost_model = 0
* DESCRIPTION: Switch for Cost Model
* JUSTIFICATION: Use $ 1990 PROCESS model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ p_plant_electric_net_required_mw = 100.0 * minimum net electric

*------------------Cost Variables------------------*

cost_model = 0 * Switch for cost model;
i_cost_model = 0 * Switch for cost model;
i_plant_availability = 0 * Switch for plant availability model;
ifueltyp = 0 * Switch for fuel type;
lsa = 2 * Level of safety assurance switch (generally; use 3 or 4);
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/st_regression.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ output_costs = 1
* DESCRIPTION: Switch for Costs Output (1: Write Cost-Related Outputs to File)
* JUSTIFICATION: Want to see costs

cost_model = 0
i_cost_model = 0
* DESCRIPTION: Switch for Cost Model
* JUSTIFICATION:

Expand Down
2 changes: 1 addition & 1 deletion tests/regression/input_files/stellarator_helias.IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ dx_tf_wp_insulation = 0.01 * Insulation on top of winding pack
t_tf_quench_detection = 0.5 * Quench detection+activation time (or dump delay) (s)

*------------------Cost Variables------------------*
cost_model = 0 *0: 1990 cost module, the 2015 does not work yet for stellarators
i_cost_model = 0 *0: 1990 cost module, the 2015 does not work yet for stellarators
abktflnc = 15.0 *Allowable first wall/blanket neutron (MW-yr/m2)
adivflnc = 25.0 *Allowable divertor heat fluence (MW-yr/m2)
f_t_plant_available = 0.75 *Total plant capacity fraction
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/large_tokamak_IN.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/large_tokamak_MFILE.DAT
Original file line number Diff line number Diff line change
Expand Up @@ -8128,7 +8128,7 @@ qnuc = 1.3E4
output_costs = 1

* Costs model switch
cost_model = 0
i_cost_model = 0

* Total plant availability fraction;
f_t_plant_available = 0.80
Expand Down
Loading