Skip to content

Commit

Permalink
Merge pull request #456 from theo-brown:add-vloop-bc
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 726935069
  • Loading branch information
Torax team committed Feb 14, 2025
2 parents 02e0c08 + d0b7503 commit a9fdd07
Show file tree
Hide file tree
Showing 74 changed files with 432 additions and 121 deletions.
15 changes: 13 additions & 2 deletions torax/config/profile_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,19 @@ class ProfileConditions(
):
"""Prescribed values and boundary conditions for the core profiles."""

# total plasma current in MA
# Total plasma current in MA
# Note that if Ip_from_parameters=False in geometry, then this Ip will be
# overwritten by values from the geometry data
# overwritten by values from the geometry data.
# If use_vloop_lcfs_boundary_condition, only used as an initial condition.
Ip_tot: interpolated_param.TimeInterpolatedInput = 15.0

# Boundary condition at LCFS for Vloop ( = dpsi_lcfs/dt )
# If use_vloop_lcfs_boundary_condition is True, then the specfied Vloop at
# the LCFS is used as the boundary condition for the psi equation; otherwise,
# Ip is used as the boundary condition.
use_vloop_lcfs_boundary_condition: bool = False
vloop_lcfs: interpolated_param.TimeInterpolatedInput = 0.0

# Temperature boundary conditions at r=Rmin. If this is `None` the boundary
# condition will instead be taken from `Ti` and `Te` at rhon=1.
Ti_bound_right: interpolated_param.TimeInterpolatedInput | None = None
Expand Down Expand Up @@ -175,6 +183,7 @@ class ProfileConditionsProvider(

runtime_params_config: ProfileConditions
Ip_tot: interpolated_param.InterpolatedVarSingleAxis
vloop_lcfs: interpolated_param.InterpolatedVarSingleAxis
Ti_bound_right: (
interpolated_param.InterpolatedVarSingleAxis
| interpolated_param.InterpolatedVarTimeRho
Expand Down Expand Up @@ -208,6 +217,8 @@ class DynamicProfileConditions:
"""Prescribed values and boundary conditions for the core profiles."""

Ip_tot: array_typing.ScalarFloat
vloop_lcfs: array_typing.ScalarFloat
use_vloop_lcfs_boundary_condition: bool
Ti_bound_right: array_typing.ScalarFloat
Te_bound_right: array_typing.ScalarFloat
# Temperature profiles defined on the cell grid.
Expand Down
1 change: 1 addition & 0 deletions torax/config/runtime_params_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def make_ip_consistent(
geo,
Ip_profile_face=geo.Ip_profile_face * Ip_scale_factor,
psi_from_Ip=geo.psi_from_Ip * Ip_scale_factor,
psi_from_Ip_face=geo.psi_from_Ip_face * Ip_scale_factor,
jtot=geo.jtot * Ip_scale_factor,
jtot_face=geo.jtot_face * Ip_scale_factor,
)
Expand Down
Loading

0 comments on commit a9fdd07

Please sign in to comment.