Skip to content

Commit 991d1fc

Browse files
committed
Extrapolate chi_neo_e and V_neo_ware_e
1 parent 5477b9a commit 991d1fc

File tree

5 files changed

+37
-28
lines changed

5 files changed

+37
-28
lines changed

torax/_src/neoclassical/transport/angioni_sauter.py

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -284,52 +284,63 @@ def _calculate_angioni_sauter_transport(
284284

285285
# Q_e = - chi_e * n_e * dT/drho = B_e2 * T_e / dpsi/drho
286286
# Q_i = - chi_i * n_i * dT/drho = B_i2 * T_i / dpsi/drho
287-
chi_neo_e = -Be2 / (
288-
core_profiles.n_e.face_value()
289-
* dlnte_dpsi
290-
* (dpsi_drhon / geometry.rho_b) ** 2
287+
chi_neo_e_bulk = -Be2[1:] / (
288+
core_profiles.n_e.face_value()[1:]
289+
* dlnte_dpsi[1:]
290+
* (dpsi_drhon[1:] / geometry.rho_b) ** 2
291291
+ constants.CONSTANTS.eps
292292
)
293-
chi_neo_i = -Bi2 / (
294-
core_profiles.n_i.face_value()
295-
* dlnti_dpsi
296-
* (dpsi_drhon / geometry.rho_b) ** 2
293+
chi_neo_e_axis = jnp.array([chi_neo_e_bulk[0]])
294+
chi_neo_e = jnp.concatenate([chi_neo_e_axis, chi_neo_e_bulk])
295+
296+
chi_neo_i_bulk = -Bi2[1:] / (
297+
core_profiles.n_i.face_value()[1:]
298+
* dlnti_dpsi[1:]
299+
* (dpsi_drhon[1:] / geometry.rho_b) ** 2
297300
+ constants.CONSTANTS.eps
298301
)
302+
chi_neo_i_axis = jnp.array([chi_neo_i_bulk[0]])
303+
chi_neo_i = jnp.concatenate([chi_neo_i_axis, chi_neo_i_bulk])
299304

300305
# Decomposition of particle flux Be1 = Gamma * dpsi_drho. Page 1232+1233.
301306

302307
# Diffusive part of particle flux
303308
# D_e * dn_e/drho = - L00 *dlog(n_e)/dpsi / dpsi/drho
304-
D_neo_e = -Lmn_e[:, 0, 0] / (
305-
core_profiles.n_e.face_value() * (dpsi_drhon / geometry.rho_b) ** 2
309+
D_neo_e_bulk = -Lmn_e[1:, 0, 0] / (
310+
core_profiles.n_e.face_value()[1:] * (dpsi_drhon[1:] / geometry.rho_b) ** 2
306311
+ constants.CONSTANTS.eps
307312
)
313+
D_neo_e_axis = jnp.array([D_neo_e_bulk[0]])
314+
D_neo_e = jnp.concatenate([D_neo_e_axis, D_neo_e_bulk])
308315

309316
# Convective part of particle flux, apart from the Ware Pinch term
310317
# V*n*dpsi/rho = (L00+L01)*dlog(Te)/dpsi + (1-Rpe)/Rpe*L00*dlog(ni)/dpsi +
311318
# (1-Rpe)/Rpe * (L00+alpha*L03) *dlog(Ti)/dpsi
312-
V_neo_e = (
313-
(Lmn_e[:, 0, 0] + Lmn_e[:, 0, 1]) * dlnte_dpsi
314-
+ (1 - Rpe) / Rpe * Lmn_e[:, 0, 0] * dlnni_dpsi
315-
+ (1 - Rpe) / Rpe * (Lmn_e[:, 0, 0] + alpha * Lmn_e[:, 0, 3]) * dlnti_dpsi
319+
V_neo_e_bulk = (
320+
(Lmn_e[1:, 0, 0] + Lmn_e[1:, 0, 1]) * dlnte_dpsi[1:]
321+
+ (1 - Rpe[1:]) / Rpe[1:] * Lmn_e[1:, 0, 0] * dlnni_dpsi[1:]
322+
+ (1 - Rpe[1:]) / Rpe[1:] * (Lmn_e[1:, 0, 0] + alpha[1:] * Lmn_e[1:, 0, 3]) * dlnti_dpsi[1:]
316323
) / (
317-
dpsi_drhon / geometry.rho_b * core_profiles.n_e.face_value()
324+
dpsi_drhon[1:] / geometry.rho_b * core_profiles.n_e.face_value()[1:]
318325
+ constants.CONSTANTS.eps
319326
)
327+
V_neo_e_axis = jnp.array([V_neo_e_bulk[0]])
328+
V_neo_e = jnp.concatenate([V_neo_e_axis, V_neo_e_bulk])
320329

321330
# Ware pinch term component of particle convection
322331
# V_ware*n*dpsi/rho = L02*<E_parallel * B>/<B^2>
323-
V_neo_ware_e = (
324-
Lmn_e[:, 0, 2]
325-
* E_parallel
332+
V_neo_ware_e_bulk = (
333+
Lmn_e[1:, 0, 2]
334+
* E_parallel[1:]
326335
/ (
327336
geometry.B_0
328-
* (dpsi_drhon / geometry.rho_b)
329-
* core_profiles.n_e.face_value()
337+
* (dpsi_drhon[1:] / geometry.rho_b)
338+
* core_profiles.n_e.face_value()[1:]
330339
+ constants.CONSTANTS.eps
331340
)
332341
)
342+
V_neo_ware_e_axis = jnp.atleast_1d(V_neo_ware_e_bulk[0])
343+
V_neo_ware_e = jnp.concatenate([V_neo_ware_e_axis, V_neo_ware_e_bulk])
333344

334345
return base.NeoclassicalTransport(
335346
chi_neo_i=chi_neo_i,

torax/_src/neoclassical/transport/tests/angioni_sauter_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
186186
# generation of the Kmn matrix.
187187
_ANGIONI_SAUTER_REFERENCE_VALUES = base.NeoclassicalTransport(
188188
chi_neo_i=np.array([
189-
-0.0,
189+
0.01220085,
190190
0.01220085,
191191
0.02223608,
192192
0.03117304,
@@ -199,7 +199,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
199199
0.0591895,
200200
]),
201201
chi_neo_e=np.array([
202-
-0.0,
202+
-0.00210023,
203203
-0.00210023,
204204
-0.0030792,
205205
-0.00388683,
@@ -212,7 +212,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
212212
-0.00750323,
213213
]),
214214
D_neo_e=np.array([
215-
0.0,
215+
0.00011698,
216216
0.00011698,
217217
0.00021105,
218218
0.00028474,
@@ -225,7 +225,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
225225
0.0002924,
226226
]),
227227
V_neo_e=np.array([
228-
0.0,
228+
1.07951440e-05,
229229
1.07951440e-05,
230230
1.11015003e-05,
231231
1.54065751e-05,
@@ -238,7 +238,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
238238
1.18868626e-03,
239239
]),
240240
V_neo_ware_e=np.array([
241-
-0.0,
241+
-0.00038114,
242242
-0.00038114,
243243
-0.00041759,
244244
-0.00037123,
@@ -255,7 +255,7 @@ def test_angioni_sauter_with_shaing_against_reference_values(self):
255255
# Shaing correction only affects ions, so we can reuse the other values
256256
_ANGIONI_SAUTER_SHAING_REFERENCE_VALUES = base.NeoclassicalTransport(
257257
chi_neo_i=np.array([
258-
0.20237419,
258+
0.20382857,
259259
0.17130245,
260260
0.03031974,
261261
0.02593766,

torax/examples/step_flattop_bgb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@
164164
"transport": {
165165
"model_name": "angioni_sauter",
166166
"use_shaing_ion_correction": True,
167-
"V_e_min": -1e-6,
168-
"V_e_max": 1e-6,
169167
},
170168
},
171169
"numerics": {
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)