Skip to content
Open
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
14 changes: 14 additions & 0 deletions torax/_src/output_tools/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from torax._src.orchestration import sim_state as sim_state_lib
from torax._src.output_tools import impurity_radiation
from torax._src.output_tools import safety_factor_fit
from torax._src.physics import collisions
from torax._src.physics import formulas
from torax._src.physics import psi_calculations
from torax._src.physics import rotation
Expand Down Expand Up @@ -203,6 +204,8 @@ class PostProcessedOutputs:
impurity_species: Dictionary of outputs for each impurity species.
poloidal_velocity: Poloidal velocity [m/s]
radial_electric_field: Radial electric field [V/m]
nu_star: Electron-ion collisionality (collision frequency normalized by
bounce frequency) on the face grid [dimensionless].
first_step: Whether the outputs are from the first step of the simulation.
"""

Expand Down Expand Up @@ -319,6 +322,7 @@ class PostProcessedOutputs:
impurity_species: dict[str, impurity_radiation.ImpuritySpeciesOutput]
poloidal_velocity: array_typing.FloatVector
radial_electric_field: array_typing.FloatVector
nu_star: array_typing.FloatVector
first_step: array_typing.BoolScalar
# pylint: enable=invalid-name

Expand Down Expand Up @@ -432,6 +436,7 @@ def zeros(cls, geo: geometry.Geometry) -> typing_extensions.Self:
impurity_species={},
poloidal_velocity=jnp.zeros(geo.rho_face.shape),
radial_electric_field=jnp.zeros(geo.rho_face.shape),
nu_star=jnp.zeros(geo.rho_face.shape),
first_step=jnp.array(True),
)

Expand Down Expand Up @@ -931,6 +936,14 @@ def cumulative_values():
sim_state.core_profiles, sim_state.geometry
)

# Use collisionality_multiplier=1.0 for the physical value. The non-unity
# multiplier in QLKNN is a model-specific calibration factor, not physics.
nu_star = collisions.calc_nu_star(
geo=sim_state.geometry,
core_profiles=sim_state.core_profiles,
collisionality_multiplier=1.0,
)

rotation_output = rotation.calculate_rotation(
T_i=sim_state.core_profiles.T_i,
psi=sim_state.core_profiles.psi,
Expand Down Expand Up @@ -1021,6 +1034,7 @@ def cumulative_values():
impurity_species=impurity_radiation_outputs,
poloidal_velocity=rotation_output.poloidal_velocity.face_value(),
radial_electric_field=rotation_output.Er.face_value(),
nu_star=nu_star,
first_step=jnp.array(False),
)

Expand Down
Binary file modified torax/tests/test_data/test_all_transport_fusion_qlknn.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_bohmgyrobohm_all.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_bremsstrahlung_time_dependent_Zimp.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_changing_config_after.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_changing_config_before.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_chease.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_combined_transport.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_fixed_dt.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_imas_profiles_and_geo.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_implicit.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_implicit_short_optimizer.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterbaseline_mockup.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_lh_transition.nc
Binary file not shown.
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_mockup.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_predictor_corrector.nc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_radiation_collapse.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_rampup.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_iterhybrid_rampup_sawtooth.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_ne_qlknn_deff_veff.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_ne_qlknn_defromchie.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_particle_sources_cgm.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_prescribed_generic_current_source.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_prescribed_timedependent_ne.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_prescribed_transport.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_psi_and_heat.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_psi_heat_dens.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_psichease_ip_chease_vloop.nc
Binary file not shown.
Binary file not shown.
Binary file modified torax/tests/test_data/test_psichease_prescribed_johm.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_psichease_prescribed_jtot.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_psichease_prescribed_jtot_vloop.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_semiimplicit_convection.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_step_flattop_bgb.nc
Binary file not shown.
Binary file modified torax/tests/test_data/test_timedependence.nc
Binary file not shown.