Skip to content

Commit 03cae96

Browse files
committed
Fix normalisations following comparison with JETTO
1 parent 58486c5 commit 03cae96

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

torax/_src/constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class Constants:
5555
epsilon0: chex.Numeric
5656
mu0: chex.Numeric
5757
eps: chex.Numeric
58-
c: chex.Numeric
5958

6059

6160
CONSTANTS: Final[Constants] = Constants(
@@ -66,7 +65,6 @@ class Constants:
6665
epsilon0=8.854e-12,
6766
mu0=4 * jnp.pi * 1e-7,
6867
eps=1e-7,
69-
c=2.99792458e8,
7068
)
7169

7270
# Taken from

torax/_src/transport_model/tglf_based_transport_model.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,14 @@ def _prepare_tglf_inputs(
264264
# Gyrobohm diffusivity
265265
# https://gafusion.github.io/doc/tglf/tglf_table.html#id7
266266
# https://gafusion.github.io/doc/cgyro/outputs.html#output-normalization
267-
# - TGLF uses the same normalisation as CGYRO. This has an extra c^2 factor
268-
# compared to TORAX's calculate_chiGB
269-
# - calculate_chiGB converts to J internally, so we pass in keV
270-
chiGB = (
271-
quasilinear_transport_model.calculate_chiGB(
272-
reference_temperature=core_profiles.T_e.face_value(),
273-
reference_magnetic_field=B_unit,
274-
reference_mass=m_D_amu,
275-
reference_length=a,
276-
)
277-
* constants.c**2
267+
# - TGLF uses the same normalisation as CGYRO.
268+
# - The extra c^2 in the docs comes from CGS Gaussian units when
269+
# calculating \rho_s
270+
chiGB = quasilinear_transport_model.calculate_chiGB(
271+
reference_temperature=core_profiles.T_e.face_value(), # [keV]
272+
reference_magnetic_field=B_unit,
273+
reference_mass=m_D_amu, # [amu]
274+
reference_length=a,
278275
)
279276

280277
return TGLFInputs(

0 commit comments

Comments
 (0)