Skip to content

Commit

Permalink
Add Vloop boundary condition for the psi equation
Browse files Browse the repository at this point in the history
Vloop (= dpsi_edge/dt) can be a useful BC for scenarios where the voltage swing of the central solenoid is directly controlled (e.g. in a fully non-inductive scenario, Vloop = 0).

Summary of changes:
- Added new BC for the psi equation, set by profile_conditions.use_vloop_lcfs_boundary_condition and profile_conditions.vloop_lcfs.
  - Supports the theta method
  - Can be combined with any of the psi initialisation methods:
    - Prescribed psi + Ip_tot rescaling
    - Psi from geometry file
    - Psi from geometry file + Ip_tot rescaling
    - Psi from nu formula + Ip_tot rescaling
  - Added vloop_lcfs to state.CoreProfiles, which is a direct copy from psidot.face_value()[-1].
  - The Vloop BC required minor modifications to compute_boundary_conditions:
    - Renamed to compute_boundary_conditions_for_t_plus_dt
    - Pass in dynamic_runtime_params_slice for t and t_plus_dt
    - Pass in core_profiles_t
- Added psi_right_bc and vloop_lcfs to output.
  • Loading branch information
theo-brown committed Feb 12, 2025
1 parent 1d52656 commit f82d9d0
Show file tree
Hide file tree
Showing 21 changed files with 366 additions and 98 deletions.
14 changes: 12 additions & 2 deletions torax/config/profile_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,18 @@ 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.
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 +182,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 +216,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
Loading

0 comments on commit f82d9d0

Please sign in to comment.