diff --git a/torax/_src/output_tools/post_processing.py b/torax/_src/output_tools/post_processing.py index d472046d8..0ad89f609 100644 --- a/torax/_src/output_tools/post_processing.py +++ b/torax/_src/output_tools/post_processing.py @@ -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 @@ -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. """ @@ -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 @@ -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), ) @@ -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, @@ -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), ) diff --git a/torax/tests/test_data/test_all_transport_fusion_qlknn.nc b/torax/tests/test_data/test_all_transport_fusion_qlknn.nc index 46a8e9c9a..2dedbef32 100644 Binary files a/torax/tests/test_data/test_all_transport_fusion_qlknn.nc and b/torax/tests/test_data/test_all_transport_fusion_qlknn.nc differ diff --git a/torax/tests/test_data/test_bohmgyrobohm_all.nc b/torax/tests/test_data/test_bohmgyrobohm_all.nc index 9760cd085..095e52161 100644 Binary files a/torax/tests/test_data/test_bohmgyrobohm_all.nc and b/torax/tests/test_data/test_bohmgyrobohm_all.nc differ diff --git a/torax/tests/test_data/test_bremsstrahlung_time_dependent_Zimp.nc b/torax/tests/test_data/test_bremsstrahlung_time_dependent_Zimp.nc index c6f09fa22..54f0330be 100644 Binary files a/torax/tests/test_data/test_bremsstrahlung_time_dependent_Zimp.nc and b/torax/tests/test_data/test_bremsstrahlung_time_dependent_Zimp.nc differ diff --git a/torax/tests/test_data/test_changing_config_after.nc b/torax/tests/test_data/test_changing_config_after.nc index 1d7f592d4..437d658dd 100644 Binary files a/torax/tests/test_data/test_changing_config_after.nc and b/torax/tests/test_data/test_changing_config_after.nc differ diff --git a/torax/tests/test_data/test_changing_config_before.nc b/torax/tests/test_data/test_changing_config_before.nc index ef91e939b..23b400e20 100644 Binary files a/torax/tests/test_data/test_changing_config_before.nc and b/torax/tests/test_data/test_changing_config_before.nc differ diff --git a/torax/tests/test_data/test_chease.nc b/torax/tests/test_data/test_chease.nc index ef688333b..258352495 100644 Binary files a/torax/tests/test_data/test_chease.nc and b/torax/tests/test_data/test_chease.nc differ diff --git a/torax/tests/test_data/test_combined_transport.nc b/torax/tests/test_data/test_combined_transport.nc index bea3301f5..eee45f19a 100644 Binary files a/torax/tests/test_data/test_combined_transport.nc and b/torax/tests/test_data/test_combined_transport.nc differ diff --git a/torax/tests/test_data/test_fixed_dt.nc b/torax/tests/test_data/test_fixed_dt.nc index 841d5d61e..c8a7888e8 100644 Binary files a/torax/tests/test_data/test_fixed_dt.nc and b/torax/tests/test_data/test_fixed_dt.nc differ diff --git a/torax/tests/test_data/test_imas_profiles_and_geo.nc b/torax/tests/test_data/test_imas_profiles_and_geo.nc index 10a8d258b..9e060cf6c 100644 Binary files a/torax/tests/test_data/test_imas_profiles_and_geo.nc and b/torax/tests/test_data/test_imas_profiles_and_geo.nc differ diff --git a/torax/tests/test_data/test_implicit.nc b/torax/tests/test_data/test_implicit.nc index 335118cb3..1fdc18404 100644 Binary files a/torax/tests/test_data/test_implicit.nc and b/torax/tests/test_data/test_implicit.nc differ diff --git a/torax/tests/test_data/test_implicit_short_optimizer.nc b/torax/tests/test_data/test_implicit_short_optimizer.nc index b14f4184d..1d26be3b4 100644 Binary files a/torax/tests/test_data/test_implicit_short_optimizer.nc and b/torax/tests/test_data/test_implicit_short_optimizer.nc differ diff --git a/torax/tests/test_data/test_iterbaseline_mockup.nc b/torax/tests/test_data/test_iterbaseline_mockup.nc index 460423b61..b21b61e24 100644 Binary files a/torax/tests/test_data/test_iterbaseline_mockup.nc and b/torax/tests/test_data/test_iterbaseline_mockup.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_lh_transition.nc b/torax/tests/test_data/test_iterhybrid_lh_transition.nc index 5999ae0ef..cd5af7beb 100644 Binary files a/torax/tests/test_data/test_iterhybrid_lh_transition.nc and b/torax/tests/test_data/test_iterhybrid_lh_transition.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_lh_transition_adaptive_source.nc b/torax/tests/test_data/test_iterhybrid_lh_transition_adaptive_source.nc index b135bf9f5..3fcf2e374 100644 Binary files a/torax/tests/test_data/test_iterhybrid_lh_transition_adaptive_source.nc and b/torax/tests/test_data/test_iterhybrid_lh_transition_adaptive_source.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_mockup.nc b/torax/tests/test_data/test_iterhybrid_mockup.nc index b75ddb8c3..74423cb89 100644 Binary files a/torax/tests/test_data/test_iterhybrid_mockup.nc and b/torax/tests/test_data/test_iterhybrid_mockup.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector.nc index 820a16357..5f513a792 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_Lmode_combined.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_Lmode_combined.nc index fca5fefe1..4cbe16cbb 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_Lmode_combined.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_Lmode_combined.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_clip_inputs.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_clip_inputs.nc index 8483d7a0f..3d112b49c 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_clip_inputs.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_clip_inputs.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_constant_fraction_impurity_radiation.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_constant_fraction_impurity_radiation.nc index 316ac0ef4..244ca81a0 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_constant_fraction_impurity_radiation.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_constant_fraction_impurity_radiation.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_cyclotron.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_cyclotron.nc index 9848e4f46..930d19d77 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_cyclotron.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_cyclotron.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_ec_linliu.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_ec_linliu.nc index db5fd9e24..c23bb43d2 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_ec_linliu.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_ec_linliu.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_eqdsk.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_eqdsk.nc index 73c3d4290..e0067b4a1 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_eqdsk.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_eqdsk.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_imas.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_imas.nc index e48864861..499fc31bd 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_imas.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_imas.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_impurity_radiation.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_impurity_radiation.nc index fe27018c3..320ecf432 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_impurity_radiation.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_impurity_radiation.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios.nc index 458182b03..0d949c972 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_lengyel.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_lengyel.nc index 02bc84b58..ae4d7ad85 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_lengyel.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_lengyel.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_z_eff.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_z_eff.nc index d83dca91a..1af09ee46 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_z_eff.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_mavrin_n_e_ratios_z_eff.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_neoclassical.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_neoclassical.nc index 5fd2d48d8..68db16eea 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_neoclassical.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_neoclassical.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_rotation.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_rotation.nc index 480e425e1..453d5704b 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_rotation.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_rotation.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_set_pped_tpedratio_nped.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_set_pped_tpedratio_nped.nc index cd29d1d65..9fbec2b5a 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_set_pped_tpedratio_nped.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_set_pped_tpedratio_nped.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea.nc index 8929448a2..9635e5abe 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea_rotation.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea_rotation.nc index 299ec1271..ecda928a3 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea_rotation.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tglfnn_ukaea_rotation.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_timedependent_isotopes.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_timedependent_isotopes.nc index a66c53c2b..9bad68e7a 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_timedependent_isotopes.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_timedependent_isotopes.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tungsten.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tungsten.nc index ccd995cdc..858b23660 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_tungsten.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_tungsten.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_predictor_corrector_zeffprofile.nc b/torax/tests/test_data/test_iterhybrid_predictor_corrector_zeffprofile.nc index d3c26c21e..37ee53ab4 100644 Binary files a/torax/tests/test_data/test_iterhybrid_predictor_corrector_zeffprofile.nc and b/torax/tests/test_data/test_iterhybrid_predictor_corrector_zeffprofile.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_radiation_collapse.nc b/torax/tests/test_data/test_iterhybrid_radiation_collapse.nc index b36d6dce6..747920d6b 100644 Binary files a/torax/tests/test_data/test_iterhybrid_radiation_collapse.nc and b/torax/tests/test_data/test_iterhybrid_radiation_collapse.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_rampup.nc b/torax/tests/test_data/test_iterhybrid_rampup.nc index e83df6d4f..674f6b05f 100644 Binary files a/torax/tests/test_data/test_iterhybrid_rampup.nc and b/torax/tests/test_data/test_iterhybrid_rampup.nc differ diff --git a/torax/tests/test_data/test_iterhybrid_rampup_sawtooth.nc b/torax/tests/test_data/test_iterhybrid_rampup_sawtooth.nc index 151e5d5b2..d059f54b4 100644 Binary files a/torax/tests/test_data/test_iterhybrid_rampup_sawtooth.nc and b/torax/tests/test_data/test_iterhybrid_rampup_sawtooth.nc differ diff --git a/torax/tests/test_data/test_ne_qlknn_deff_veff.nc b/torax/tests/test_data/test_ne_qlknn_deff_veff.nc index e0c0aab22..516412a51 100644 Binary files a/torax/tests/test_data/test_ne_qlknn_deff_veff.nc and b/torax/tests/test_data/test_ne_qlknn_deff_veff.nc differ diff --git a/torax/tests/test_data/test_ne_qlknn_defromchie.nc b/torax/tests/test_data/test_ne_qlknn_defromchie.nc index b7b6e6591..e196b724b 100644 Binary files a/torax/tests/test_data/test_ne_qlknn_defromchie.nc and b/torax/tests/test_data/test_ne_qlknn_defromchie.nc differ diff --git a/torax/tests/test_data/test_particle_sources_cgm.nc b/torax/tests/test_data/test_particle_sources_cgm.nc index 313be442e..1e726ad3a 100644 Binary files a/torax/tests/test_data/test_particle_sources_cgm.nc and b/torax/tests/test_data/test_particle_sources_cgm.nc differ diff --git a/torax/tests/test_data/test_prescribed_generic_current_source.nc b/torax/tests/test_data/test_prescribed_generic_current_source.nc index 8ff4278c1..d51e53def 100644 Binary files a/torax/tests/test_data/test_prescribed_generic_current_source.nc and b/torax/tests/test_data/test_prescribed_generic_current_source.nc differ diff --git a/torax/tests/test_data/test_prescribed_timedependent_ne.nc b/torax/tests/test_data/test_prescribed_timedependent_ne.nc index 6e42b66ba..8902af295 100644 Binary files a/torax/tests/test_data/test_prescribed_timedependent_ne.nc and b/torax/tests/test_data/test_prescribed_timedependent_ne.nc differ diff --git a/torax/tests/test_data/test_prescribed_transport.nc b/torax/tests/test_data/test_prescribed_transport.nc index 6221101b5..56b1c57e9 100644 Binary files a/torax/tests/test_data/test_prescribed_transport.nc and b/torax/tests/test_data/test_prescribed_transport.nc differ diff --git a/torax/tests/test_data/test_psi_and_heat.nc b/torax/tests/test_data/test_psi_and_heat.nc index c64e3412a..e9a28f6b9 100644 Binary files a/torax/tests/test_data/test_psi_and_heat.nc and b/torax/tests/test_data/test_psi_and_heat.nc differ diff --git a/torax/tests/test_data/test_psi_heat_dens.nc b/torax/tests/test_data/test_psi_heat_dens.nc index 30f617098..0fb4e46cf 100644 Binary files a/torax/tests/test_data/test_psi_heat_dens.nc and b/torax/tests/test_data/test_psi_heat_dens.nc differ diff --git a/torax/tests/test_data/test_psichease_ip_chease_vloop.nc b/torax/tests/test_data/test_psichease_ip_chease_vloop.nc index c7a7e2811..f972004d4 100644 Binary files a/torax/tests/test_data/test_psichease_ip_chease_vloop.nc and b/torax/tests/test_data/test_psichease_ip_chease_vloop.nc differ diff --git a/torax/tests/test_data/test_psichease_ip_parameters_vloop_varying.nc b/torax/tests/test_data/test_psichease_ip_parameters_vloop_varying.nc index 862748a0b..dfc9c8333 100644 Binary files a/torax/tests/test_data/test_psichease_ip_parameters_vloop_varying.nc and b/torax/tests/test_data/test_psichease_ip_parameters_vloop_varying.nc differ diff --git a/torax/tests/test_data/test_psichease_prescribed_johm.nc b/torax/tests/test_data/test_psichease_prescribed_johm.nc index fd40b79c0..574ace122 100644 Binary files a/torax/tests/test_data/test_psichease_prescribed_johm.nc and b/torax/tests/test_data/test_psichease_prescribed_johm.nc differ diff --git a/torax/tests/test_data/test_psichease_prescribed_jtot.nc b/torax/tests/test_data/test_psichease_prescribed_jtot.nc index bf7d63699..e6e979a85 100644 Binary files a/torax/tests/test_data/test_psichease_prescribed_jtot.nc and b/torax/tests/test_data/test_psichease_prescribed_jtot.nc differ diff --git a/torax/tests/test_data/test_psichease_prescribed_jtot_vloop.nc b/torax/tests/test_data/test_psichease_prescribed_jtot_vloop.nc index ea176fe82..aa74887c4 100644 Binary files a/torax/tests/test_data/test_psichease_prescribed_jtot_vloop.nc and b/torax/tests/test_data/test_psichease_prescribed_jtot_vloop.nc differ diff --git a/torax/tests/test_data/test_semiimplicit_convection.nc b/torax/tests/test_data/test_semiimplicit_convection.nc index 7ecfea2a9..4b96997c4 100644 Binary files a/torax/tests/test_data/test_semiimplicit_convection.nc and b/torax/tests/test_data/test_semiimplicit_convection.nc differ diff --git a/torax/tests/test_data/test_step_flattop_bgb.nc b/torax/tests/test_data/test_step_flattop_bgb.nc index 363cf21f0..5325c162f 100644 Binary files a/torax/tests/test_data/test_step_flattop_bgb.nc and b/torax/tests/test_data/test_step_flattop_bgb.nc differ diff --git a/torax/tests/test_data/test_timedependence.nc b/torax/tests/test_data/test_timedependence.nc index 57722525d..07b0af044 100644 Binary files a/torax/tests/test_data/test_timedependence.nc and b/torax/tests/test_data/test_timedependence.nc differ