Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👽️ PROCESS develop api changes #3636

Draft
wants to merge 20 commits into
base: develop
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .github/workflows/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ runs:
repository: "Fusion-Power-Plant-Framework/bluemira-private-data"
ssh-key: ${{ inputs.bm-private-data-key }}
path: "./bluemira-private-data"
ref: je-cook/process_develop

- name: Move bluemira-private-data
working-directory: "/home/runner/work/"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11"]
with-process: ["v3.1.0", "process_disabled"]
with-process: ["main", "process_disabled"]

fail-fast: false
runs-on: ${{ matrix.os }}
Expand Down
59 changes: 31 additions & 28 deletions bluemira/codes/process/_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ class ProcessInputs:
# Top down of PROCESS variables list

# Times
tburn: float | None = None
tdwell: float | None = None
t_burn: float | None = None
t_between_pulse: float | None = None
t_fusion_ramp: float | None = None
tohs: float | None = None
tqnch: float | None = None
tramp: float | None = None
t_current_ramp_up: float | None = None
t_ramp_down: float | None = None
t_precharge: float | None = None

# FWBS
ibkt_life: int | None = None
Expand Down Expand Up @@ -226,6 +226,7 @@ class ProcessInputs:
casthi: float | None = None
casths: float | None = None
tmargmin: float | None = None
tmargmin_cs: float | None = None
oacdcp: float | None = None
t_turn_tf: int | None = None

Expand Down Expand Up @@ -345,14 +346,14 @@ class ProcessInputs:

# Constraint variables
auxmin: float | None = None
betpmx: float | None = None
beta_poloidal_max: float | None = None
bigqmin: float | None = None
bmxlim: float | None = None
dr_tf_wp: float | None = None
fauxmn: float | None = None
fbeta: float | None = None
fbetap: float | None = None
fbetatry: float | None = None
fbeta_poloidal: float | None = None
fbeta_max: float | None = None
fbetatry_lower: float | None = None
fcwr: float | None = None
fdene: float | None = None
Expand Down Expand Up @@ -391,11 +392,11 @@ class ProcessInputs:
fstr_wp: float | None = None
fmaxvvstress: float | None = None
ftbr: float | None = None
ftburn: float | None = None
ft_burn: float | None = None
ftcycl: float | None = None
ftmargoh: float | None = None
ftmargtf: float | None = None
ftohs: float | None = None
ft_current_ramp_up: float | None = None
ftpeak: float | None = None
fvdump: float | None = None
fvs: float | None = None
Expand All @@ -415,7 +416,7 @@ class ProcessInputs:
pseprmax: float | None = None
ptfnucmax: float | None = None
tbrmin: float | None = None
tbrnmn: float | None = None
t_burn_min: float | None = None
vvhealw: float | None = None
walalw: float | None = None
taulimit: float | None = None
Expand Down Expand Up @@ -466,8 +467,8 @@ class ProcessInputs:
thshield_ib: float | None = None
thshield_ob: float | None = None
thshield_vb: float | None = None
vgap: float | None = None
vgap2: float | None = None
vgap_xpoint_divertor: float | None = None
vgap_vv_thermalshield: float | None = None
vgaptop: float | None = None
vvblgap: float | None = None
plleni: float | None = None
Expand All @@ -479,18 +480,19 @@ class ProcessInputs:

# Current drive
beamwd: float | None = None
bscfmax: float | None = None
bootstrap_current_fraction_max: float | None = None
cboot: float | None = None
harnum: float | None = None
enbeam: float | None = None
beam_energy: float | None = None
etaech: float | None = None
etanbi: float | None = None
feffcd: float | None = None
frbeam: float | None = None
ftritbm: float | None = None
f_tritium_beam: float | None = None
gamma_ecrh: float | None = None
xi_ebw: float | None = None
iefrf: int | None = None
wave_mode: int | None = None
irfcf: int | None = None
nbshield: float | None = None
pheat: float | None = None # Listed as an output
Expand Down Expand Up @@ -597,6 +599,7 @@ class ProcessInputs:
isumatoh: int | None = None
isumatpf: int | None = None
i_pf_current: int | None = None
i_sup_pf_shape: int | None = None
ncls: list[int] | None = None
nfxfh: int | None = None
ngrp: int | None = None
Expand Down Expand Up @@ -629,32 +632,32 @@ class ProcessInputs:
cvol: float | None = None
cwrmax: float | None = None
dene: float | None = None
dnbeta: float | None = None
beta_norm_max: float | None = None
epbetmax: float | None = None
falpha: float | None = None
fdeut: float | None = None
f_alpha_plasma: float | None = None
f_deuterium: float | None = None
ftar: float | None = None
ffwal: float | None = None
fgwped: float | None = None
fgwsep: float | None = None
fkzohm: float | None = None
fpdivlim: float | None = None
fne0: float | None = None
ftrit: float | None = None
f_tritium: float | None = None
f_helium3: float | None = None
fvsbrnni: float | None = None
gamma: float | None = None
hfact: float | None = None
taumax: float | None = None
ibss: int | None = None
iculbl: int | None = None # listed as an output...
icurr: int | None = None
idensl: int | None = None
idia: int | None = None
ifalphap: int | None = None
i_bootstrap_current: int | None = None
i_beta_component: int | None = None # listed as an output...
i_plasma_current: int | None = None
i_density_limit: int | None = None
i_diamagnetic_current: int | None = None
i_beta_fast_alpha: int | None = None
iinvqd: int | None = None
ipedestal: int | None = None
ieped: int | None = None # listed as an output...
ips: int | None = None
i_pfirsch_schluter_current: int | None = None
eped_sf: float | None = None
neped: float | None = None
nesep: float | None = None
Expand Down
7 changes: 1 addition & 6 deletions bluemira/codes/process/_teardown.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,7 @@ def _derive_radial_build_params(self, data: dict) -> dict[str, float]:
length) of the TF coil, so this must be taken into consideration
when translating the geometry into the mid-plane.
"""
try:
shield_th = data["thshield"]
except KeyError:
# PROCESS updated their parameter names in v2.4.0, splitting
# 'thshield' into 'thshield_ib', 'thshield_ob', and 'thshield_vb'
shield_th = data["thshield_ib"]
shield_th = data["thshield_ib"]

try:
rtfin = data["bore"] + data["ohcth"] + data["precomp"] + data["gapoh"]
Expand Down
16 changes: 8 additions & 8 deletions bluemira/codes/process/equation_variable_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class Constraint(ConstraintSelection, Model):
PF_ENERGY_RATE_UPPER_LIMIT = (
66,
(65, 113),
("tohs",),
("t_current_ramp_up",),
"Limit on rate of change of energy in poloidal field",
)
WALL_RADIATION_UPPER_LIMIT = (
Expand Down Expand Up @@ -562,11 +562,11 @@ class Constraint(ConstraintSelection, Model):
"fwalld": 14,
"fvs": 15,
"ohcth": 16,
"tdwell": 17,
"t_between_pulse": 17,
"q": 18,
"enbeam": 19,
"beam_energy": 19,
"tcpav": 20,
"ftburn": 21,
"ft_burn": 21,
# 22 NOT USED
"fcoolcp": 23,
# 24 NOT USED
Expand All @@ -581,7 +581,7 @@ class Constraint(ConstraintSelection, Model):
"fportsz": 33,
"fdivcol": 34,
"fpeakb": 35,
"fbetatry": 36,
"fbeta_max": 36,
"coheof": 37,
"fjohc": 38,
"fjohc0": 39,
Expand Down Expand Up @@ -610,8 +610,8 @@ class Constraint(ConstraintSelection, Model):
"fdtmp": 62,
"ftpeak": 63,
"fauxmn": 64,
"tohs": 65,
"ftohs": 66,
"t_current_ramp_up": 65,
"ft_current_ramp_up": 66,
"ftcycl": 67,
"fptemp": 68,
"rcool": 69,
Expand All @@ -622,7 +622,7 @@ class Constraint(ConstraintSelection, Model):
"scraplo": 74,
"tfootfi": 75,
# 76, 77, 78 NOT USED
"fbetap": 79,
"fbeta_poloidal": 79,
# 80 NOT USED
"edrive": 81,
"drveff": 82,
Expand Down
20 changes: 10 additions & 10 deletions bluemira/codes/process/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"n_TF": ("n_tf", "dimensionless"),
"TF_ripple_limit": ("ripmax", "%"),
"C_Ejima": ("gamma", "dimensionless"),
"e_nbi": ("enbeam", "keV"),
"e_nbi": ("beam_energy", "keV"),
"P_hcd_ss": ("pinjalw", "MW"),
"eta_nb": ("etanbi", "dimensionless"),
"e_mult": ("emult", "dimensionless"),
Expand Down Expand Up @@ -44,20 +44,20 @@
"kappa": ("kappa", "dimensionless"),
"delta_95": ("triang95", "dimensionless"),
"delta": ("triang", "dimensionless"),
"I_p": ("plascur/1d6", "MA"),
"P_fus": ("powfmw", "MW"),
"P_fus_DT": ("pdt", "MW"),
"P_fus_DD": ("pdd", "MW"),
"I_p": ("plasma_current_ma", "MA"),
"P_fus": ("fusion_power", "MW"),
"P_fus_DT": ("dt_power", "MW"),
"P_fus_DD": ("dd_power", "MW"),
"H_star": ("hfact", "dimensionless"),
"P_sep": ("pdivt", "MW"),
"P_rad_core": ("pinnerzoneradmw", "MW"),
"P_rad_edge": ("pouterzoneradmw", "MW"),
"P_rad": ("pradmw", "MW"),
"P_line": ("plinepv*vol", "MW"),
"P_sync": ("psyncpv*vol", "MW"),
"P_brehms": ("pbrempv*vol", "MW"),
"f_bs": ("bootipf", "dimensionless"),
"beta_p": ("betap", "dimensionless"),
"P_brehms": ("pbrempv*plasma_volume", "MW"),
"f_bs": ("bootstrap_current_fraction", "dimensionless"),
"beta_p": ("beta_poloidal", "dimensionless"),
"beta": ("beta", "dimensionless"),
"tau_e": ("taueff", "s"),
"v_burn": ("vburn", "V"),
Expand Down Expand Up @@ -92,7 +92,7 @@

IO_mappings = {
"A": ("aspect", "dimensionless"),
"tau_flattop": (("tbrnmn", "tburn"), "s"),
"tau_flattop": (("t_burn_min", "t_burn"), "s"),
"P_el_net": (("pnetelin", "pnetelmw"), "MW"),
"tk_bb_ib": ("blnkith", "m"),
"tk_bb_ob": ("blnkoth", "m"),
Expand All @@ -108,7 +108,7 @@
"B_tf_peak": ("bmaxtfrp", "T"),
"T_e": ("te", "keV"),
"Z_eff": ("zeff", "amu"),
"V_p": ("vol", "m^3"),
"V_p": ("plasma_volume", "m^3"),
"l_i": ("rli", "dimensionless"),
"f_ni": ("faccd", "dimensionless"),
"tk_tf_outboard": ("tfthko", "m"),
Expand Down
Loading
Loading