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
20 changes: 15 additions & 5 deletions star/defaults/controls.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2746,11 +2746,8 @@
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

! Optional convective-turnover-time limiter for the throttle.
! When ``.true.``, multiplies the throttle excess
! ``(Gamma_factor - 1)`` by
!
! ``f_tau = 1 - exp(-dt / tau_conv)``
!
! When ``.true.``, relaxes the throttle using a fraction
! ``f_tau`` set by ``superad_reduction_turnover_limit_function``,
! where ``tau_conv = scale_height(k) / mlt_vc_old(k)`` is the
! local convective turnover time computed from the previous
! step's converged convective velocity. This reflects the
Expand All @@ -2776,6 +2773,19 @@

superad_reduction_use_turnover_limit = .false.

! superad_reduction_turnover_limit_function
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

! Functional form for the turnover-time relaxation fraction. Allowed
! values are:
!
! - ``'exponential'``: ``f_tau = 1 - exp(-dt/tau_conv)``
! - ``'linear'``: ``f_tau = min(dt/tau_conv, 1)``

! ::

superad_reduction_turnover_limit_function = 'exponential'

! superad_reduction_turnover_vc_floor_frac
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 4 additions & 1 deletion star/private/ctrls_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ module ctrls_io
gradT_excess_min_center_he4, gradT_excess_max_logT, gradT_excess_min_log_tau_full_on, gradT_excess_max_log_tau_full_off, &
use_superad_reduction, superad_reduction_gamma_limit, superad_reduction_gamma_limit_scale, D_mix_zero_region_top_q, &
superad_reduction_gamma_inv_scale, superad_reduction_diff_grads_limit, superad_reduction_limit, &
superad_reduction_use_turnover_limit, superad_reduction_turnover_vc_floor_frac, &
superad_reduction_use_turnover_limit, superad_reduction_turnover_limit_function, &
superad_reduction_turnover_vc_floor_frac, &
make_gradr_sticky_in_solver_iters, min_logT_for_make_gradr_sticky_in_solver_iters, &
max_logT_for_mlt, thermohaline_coeff, thermohaline_option, mixing_length_alpha, remove_small_D_limit, &
alt_scale_height_flag, Henyey_MLT_y_param, Henyey_MLT_nu_param, no_MLT_below_shock, mlt_make_surface_no_mixing, &
Expand Down Expand Up @@ -1080,6 +1081,7 @@ subroutine store_controls(s, ierr)
s% superad_reduction_diff_grads_limit = superad_reduction_diff_grads_limit
s% superad_reduction_limit = superad_reduction_limit
s% superad_reduction_use_turnover_limit = superad_reduction_use_turnover_limit
s% superad_reduction_turnover_limit_function = superad_reduction_turnover_limit_function
s% superad_reduction_turnover_vc_floor_frac = superad_reduction_turnover_vc_floor_frac

s% max_logT_for_mlt = max_logT_for_mlt
Expand Down Expand Up @@ -2805,6 +2807,7 @@ subroutine set_controls_for_writing(s, ierr)
superad_reduction_diff_grads_limit = s% superad_reduction_diff_grads_limit
superad_reduction_limit = s% superad_reduction_limit
superad_reduction_use_turnover_limit = s% superad_reduction_use_turnover_limit
superad_reduction_turnover_limit_function = s% superad_reduction_turnover_limit_function
superad_reduction_turnover_vc_floor_frac = s% superad_reduction_turnover_vc_floor_frac

max_logT_for_mlt = s% max_logT_for_mlt
Expand Down
7 changes: 6 additions & 1 deletion star/private/turb_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,12 @@ subroutine set_superad_reduction()
* s% csound_face(k)
vc_old_local = max(s% mlt_vc_old(k), vc_old_floor, 1d-30)
tau_conv = scale_height / vc_old_local
f_turnover = 1d0 - exp(-s% dt / tau_conv)
select case (trim(s% superad_reduction_turnover_limit_function))
case ('linear')
f_turnover = min(s% dt / tau_conv, 1d0)
case default
f_turnover = 1d0 - exp(-s% dt / tau_conv)
end select
Gamma_factor = Gamma_factor_old_local + &
f_turnover * (Gamma_factor - Gamma_factor_old_local)
end if
Expand Down
1 change: 1 addition & 0 deletions star_data/private/star_controls.inc
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
superad_reduction_diff_grads_limit, &
superad_reduction_limit
logical :: superad_reduction_use_turnover_limit
character(len=strlen) :: superad_reduction_turnover_limit_function
real(dp) :: superad_reduction_turnover_vc_floor_frac

! mixing parameters
Expand Down
Loading