Skip to content
Merged
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
18 changes: 14 additions & 4 deletions torax/_src/output_tools/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ class PostProcessedOutputs:
P_icrh_e: Ion cyclotron resonance heating to electrons [W]
P_icrh_i: Ion cyclotron resonance heating to ions [W]
P_icrh_total: Total ion cyclotron resonance heating power [W]
P_LH_high_density: H-mode transition power for high density branch [W]
P_LH_min: Minimum H-mode transition power for at n_e_min_P_LH [W]
P_LH: H-mode transition power from maximum of P_LH_high_density and P_LH_min
[W]
P_LH_high_density: H-mode transition power from the Martin scaling law for
high density branch [W]
P_LH_min: Minimum H-mode transition power from the Martin scaling law for at
n_e_min_P_LH [W]
P_LH: H-mode transition power from the Martin scaling law, taken as the
maximum of P_LH_high_density and P_LH_min [W]
n_e_min_P_LH: Density corresponding to the P_LH_min [m^-3]
P_LH_delabie: H-mode transition power from the Delabie scaling law [W]
E_fusion: Total cumulative fusion energy [J]
E_aux_total: Total auxiliary heating energy absorbed by the plasma ( time
integral of P_aux_total) [J].
Expand Down Expand Up @@ -238,10 +241,12 @@ class PostProcessedOutputs:
P_icrh_e: array_typing.FloatScalar
P_icrh_i: array_typing.FloatScalar
P_icrh_total: array_typing.FloatScalar
# TODO(b/434175938) Rename to P_LH_martin_high_density etc
P_LH_high_density: array_typing.FloatScalar
P_LH_min: array_typing.FloatScalar
P_LH: array_typing.FloatScalar
n_e_min_P_LH: array_typing.FloatScalar
P_LH_delabie: array_typing.FloatScalar
E_fusion: array_typing.FloatScalar
E_aux_total: array_typing.FloatScalar
E_ohmic_e: array_typing.FloatScalar
Expand Down Expand Up @@ -353,6 +358,7 @@ def zeros(cls, geo: geometry.Geometry) -> typing_extensions.Self:
P_LH_min=jnp.array(0.0, dtype=jax_utils.get_dtype()),
P_LH=jnp.array(0.0, dtype=jax_utils.get_dtype()),
n_e_min_P_LH=jnp.array(0.0, dtype=jax_utils.get_dtype()),
P_LH_delabie=jnp.array(0.0, dtype=jax_utils.get_dtype()),
E_fusion=jnp.array(0.0, dtype=jax_utils.get_dtype()),
E_aux_total=jnp.array(0.0, dtype=jax_utils.get_dtype()),
E_ohmic_e=jnp.array(0.0, dtype=jax_utils.get_dtype()),
Expand Down Expand Up @@ -669,6 +675,9 @@ def make_post_processed_outputs(
sim_state.geometry, sim_state.core_profiles
)
)
P_LH_delabie = scaling_laws.calculate_plh_delabie(
sim_state.geometry, sim_state.core_profiles
)

# Calculate P_SOL (Power crossing separatrix) = P_sources - P_sinks - dW/dt
integrated_sources['P_SOL_i'] = (
Expand Down Expand Up @@ -933,6 +942,7 @@ def cumulative_values():
P_LH_min=P_LH_min,
P_LH_high_density=P_LH_hi_dens,
n_e_min_P_LH=n_e_min_P_LH,
P_LH_delabie=P_LH_delabie,
E_fusion=E_fusion,
E_aux_total=E_aux_total,
E_ohmic_e=E_ohmic_e,
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 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.
Loading