Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,26 @@ class PowerScalingFormationRuntimeParams(
"""Runtime params for power scaling pedestal formation models."""

P_LH_prefactor: array_typing.FloatScalar = 1.0
rho_norm_for_P_SOL: array_typing.FloatScalar = 0.9


def _calculate_P_SOL_total(
def _calculate_P_SOL_total_up_to_rho_norm(
rho_norm_for_P_SOL: array_typing.FloatScalar,
internal_plasma_energy: state.PlasmaInternalEnergy,
core_sources: source_profiles_lib.SourceProfiles,
geo: geometry.Geometry,
) -> jax.Array:
"""Calculates the total power out of the separatrix."""
mask = geo.rho_norm <= rho_norm_for_P_SOL
P_heat_e = sum(
math_utils.volume_integration(source, geo)
math_utils.volume_integration(source * mask, geo)
for source in core_sources.T_e.values()
)
P_heat_i = sum(
math_utils.volume_integration(source, geo)
math_utils.volume_integration(source * mask, geo)
for source in core_sources.T_i.values()
)
# TODO(b/323504363): Also recompute dW_dt with the mask.
return P_heat_e + P_heat_i - internal_plasma_energy.dW_thermal_dt_smoothed


Expand Down Expand Up @@ -84,8 +88,11 @@ def __call__(
runtime_params.pedestal.formation, PowerScalingFormationRuntimeParams
)

P_SOL_total = _calculate_P_SOL_total(
core_profiles.internal_plasma_energy, core_sources, geo
P_SOL_total = _calculate_P_SOL_total_up_to_rho_norm(
runtime_params.pedestal.formation.rho_norm_for_P_SOL,
core_profiles.internal_plasma_energy,
core_sources,
geo,
)

P_LH, _ = scaling_laws.calculate_P_LH(
Expand Down
Loading