Skip to content

Commit 9a2fca6

Browse files
committed
Add v_loop_lcfs to input mapping
1 parent 22ba6aa commit 9a2fca6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

torax/imas_tools/core_profiles.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def core_profiles_from_IMAS(
7575
#profile_conditions
7676
# Should we shift it to get psi=0 at the center ?
7777
if not read_psi_from_geo:
78-
psi = {t_initial: {rhon_array[0][rj]: 1 * (profiles_1d[0].grid.psi[rj]) for rj in range(len(rhon_array[0]))}} #To discuss either we provide it here or init it from geo
78+
psi = {t_initial: {rhon_array[0][rj]: (profiles_1d[0].grid.psi[rj]) for rj in range(len(rhon_array[0]))}} #To discuss either we provide it here or init it from geo
7979
else:
8080
psi = None
8181
#Will be overwritten anyway if Ip_from_parameters = False, when Ip is given from the equilibrium (in most cases probably).
@@ -95,6 +95,11 @@ def core_profiles_from_IMAS(
9595
n_e = {time_array[ti]: {rhon_array[ti][ri]: profiles_1d[ti].electrons.density[ri] for ri in range(len(rhon_array[ti]))} for ti in range(len(time_array))}
9696
# ne_bound_right = {time_array[ti]: profiles_1d[ti].electrons.density[-1]for ti in range(len(time_array))}
9797

98+
if len(ids.global_quantities.v_loop>0): #Map v_loop_lcfs in case it is used as bc for psi equation.
99+
v_loop_lcfs = {time_array[ti]: ids.global_quantities.v_loop[ti]for ti in range(len(time_array))} #+ or -1 ?
100+
else:
101+
v_loop_lcfs = [0.0]
102+
98103
return {"plasma_composition" :{
99104
"Z_eff": Z_eff,
100105
},
@@ -111,6 +116,7 @@ def core_profiles_from_IMAS(
111116
"nbar": None,
112117
"n_e" : n_e,
113118
"normalize_n_e_to_nbar": False,
119+
"v_loop_lcfs": v_loop_lcfs,
114120
},
115121
"numerics": {
116122
"t_initial": t_initial,

0 commit comments

Comments
 (0)