Skip to content
Open
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
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ For a more in-depth look at the new build system, see :doc:`developing/build-sys
New Features
------------

Convective overshooting now includes a ``step+exponential`` prescription.

MESA no longer stops when reactions for which special rates are set are not in the nuclear network, only a warning is printed. This is intended to make it easier to test various network sizes without having to also change the list of special reactions.

.. _Bug Fixes main:
Expand Down
1 change: 1 addition & 0 deletions star/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ SRCS := \
private/overshoot.f90 \
private/overshoot_exp.f90 \
private/overshoot_step.f90 \
private/overshoot_step_exp.f90 \
private/overshoot_utils.f90 \
private/paquette_coeffs.f90 \
private/phase_separation.f90 \
Expand Down
32 changes: 24 additions & 8 deletions star/defaults/controls.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2681,11 +2681,8 @@
! overshooting
! ____________

! There are two schemes implemented in MESA to treat overshooting:
! a step overshoot scheme and an exponential scheme.

! Parameters for exponential diffusive overshoot are described in the paper by Falk Herwig,
! "The evolution of AGB stars with convective overshoot", A&A, 360, 952-968 (2000).
! There are three schemes implemented in MESA to treat overshooting:
! a step overshoot, an exponential scheme, and the combination of both.

! Overshooting depends on the classification of the convective zone and can be different at the top and the bottom of the zone.

Expand All @@ -2699,7 +2696,7 @@

! ::

overshoot_scheme(:) = '' ! ``exponential``, ``step``, ``other``
overshoot_scheme(:) = '' ! ``exponential``, ``step``, ``step+exponential``, ``other``
overshoot_zone_type(:) = '' ! ``burn_H``, ``burn_He``, ``burn_Z``, ``nonburn``, ``any``
overshoot_zone_loc(:) = '' ! ``core``, ``shell``, ``any``
overshoot_bdy_loc(:) = '' ! ``bottom``, ``top``, ``any``
Expand All @@ -2711,11 +2708,12 @@
! ::

overshoot_f(:) = 0d0
overshoot_f2(:) = 0d0
overshoot_f0(:) = 0d0

! The switch from convective mixing to overshooting happens at a distance f0*Hp into the convection zone
! from the estimated location where ``grad_ad = grad_rad``, where Hp is the pressure scale height at that location.
! A value <= 0 for f0 is a mistake -- you are required to set f0 as well as f.
! A value <= 0 for f0 is a mistake -- you are required to set f0 as well as f (and f2 if using step+exponential).
! take a look at the following from an email concerning this:
! Overshooting works by taking the diffusion mixing coefficient at the edge
! of the convection zone and extending it beyond the zone. But -- and here's the issue --
Expand All @@ -2736,6 +2734,25 @@
! These are arrays of size ``NUM_OVERSHOOT_PARAM_SETS`` which is defined in
! ``star_data/public/star_data_def.inc`` (currently 16)

! For exponential overshoot: Parameters for exponential diffusive overshoot are described in the paper by Falk Herwig,
! "The evolution of AGB stars with convective overshoot", A&A, 360, 952-968 (2000).

! If you use the 'step+exponential', the step is placed first, after which the exponential is placed. Note that the
! parameterizations for both parts is still evaluated at the convective boundary (as described above), the exponential part
! is just displaced by the extent of the step part.
! This approach is motivated by works from
! Michielsen, M., C. Aerts, and D. M. Bowman. “Probing the Temperature Gradient in the Core Boundary Layer of Stars with Gravito-Inertial Modes. The Case of KIC 7760680.” Astronomy & Astrophysics 650 (June 2021): A175. https://doi.org/10.1051/0004-6361/202039926.
! Anders, Evan H., Adam S. Jermyn, Daniel Lecoanet, et al. “Schwarzschild and Ledoux Are Equivalent on Evolutionary Timescales.” The Astrophysical Journal Letters 928, no. 1 (2022): L10. https://doi.org/10.3847/2041-8213/ac5cb5.
! Anders, Evan H., Adam S. Jermyn, Daniel Lecoanet, and Benjamin P. Brown. “Stellar Convective Penetration: Parameterized Theory and Dynamical Simulations.” The Astrophysical Journal 926, no. 2 (2022): 169. https://doi.org/10.3847/1538-4357/ac408d.
! Johnston, Cole, Mathias Michielsen, Evan H. Anders, et al. “Modelling Time-Dependent Convective Penetration in 1D Stellar Evolution.” The Astrophysical Journal 964 (April 2024): 170. https://doi.org/10.3847/1538-4357/ad2343.

! The step overshoot part models convective entrainment, where the a convective
! zone "eats up" a ledoux stable region (typically above a convective core).
! The exponential overshoot part then models actual overshooting where inertia
! carries material beyond the Schwarzschild boundary.
! Note however that no temperature gradients are modified, MESA's implementation of overshoot
! only extends mixing regions (through the diffusion coefficients, ``D_mix``)

! ::

overshoot_D0(:) = 0d0
Expand All @@ -2761,7 +2778,6 @@

overshoot_mass_full_off(:) = 0d0


! overshoot_D_min
! ~~~~~~~~~~~~~~~

Expand Down
4 changes: 3 additions & 1 deletion star/private/ctrls_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module ctrls_io
predictive_bdy_q_min, predictive_bdy_q_max, T_mix_limit, RSP_report_undercorrections, &
do_conv_premix, conv_premix_avoid_increase, conv_premix_time_factor, &
conv_premix_fix_pgas, conv_premix_dump_snapshots, do_premix_heating, &
overshoot_f, overshoot_f0, overshoot_D0, RSP_Qvisc_linear, dq_D_mix_zero_at_H_He_crossover, &
overshoot_f, overshoot_f2, overshoot_f0, overshoot_D0, RSP_Qvisc_linear, dq_D_mix_zero_at_H_He_crossover, &
overshoot_Delta0, overshoot_mass_full_on, overshoot_mass_full_off, dq_D_mix_zero_at_H_C_crossover, &
overshoot_scheme, overshoot_zone_type, overshoot_zone_loc, RSP_Qvisc_quadratic, &
overshoot_bdy_loc, overshoot_D_min, overshoot_brunt_B_max, mlt_gradT_fraction, max_conv_vel_div_csound, &
Expand Down Expand Up @@ -1125,6 +1125,7 @@ subroutine store_controls(s, ierr)
s% do_premix_heating = do_premix_heating

s% overshoot_f = overshoot_f
s% overshoot_f2 = overshoot_f2
s% overshoot_f0 = overshoot_f0
s% overshoot_D0 = overshoot_D0
s% overshoot_Delta0 = overshoot_Delta0
Expand Down Expand Up @@ -2848,6 +2849,7 @@ subroutine set_controls_for_writing(s, ierr)
do_premix_heating = s% do_premix_heating

overshoot_f = s% overshoot_f
overshoot_f2 = s% overshoot_f2
overshoot_f0 = s% overshoot_f0
overshoot_D0 = s% overshoot_D0
overshoot_Delta0 = s% overshoot_Delta0
Expand Down
3 changes: 3 additions & 0 deletions star/private/overshoot.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module overshoot
use overshoot_utils
use overshoot_exp
use overshoot_step
use overshoot_step_exp

implicit none

Expand Down Expand Up @@ -170,6 +171,8 @@ subroutine add_overshooting (s, ierr)
! using the appropriate scheme-dependent routine

select case (s%overshoot_scheme(j))
case ('step+exponential')
call eval_overshoot_step_exp(s, i, j, k_a, k_b, D, vc, ierr)
case ('exponential')
call eval_overshoot_exp(s, i, j, k_a, k_b, D, vc, ierr)
case ('step')
Expand Down
48 changes: 18 additions & 30 deletions star/private/overshoot_exp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ subroutine eval_overshoot_exp (s, i, j, k_a, k_b, D, vc, ierr)
ierr = 0

! Extract parameters
f = s% overshoot_f(j)
f0 = s% overshoot_f0(j)

f = s%overshoot_f(j)
f0 = s%overshoot_f0(j)

D0 = s%overshoot_D0(j)
Delta0 = s%overshoot_Delta0(j)
D0 = s% overshoot_D0(j)
Delta0 = s% overshoot_Delta0(j)

if (f <= 0._dp .OR. f0 <= 0._dp) then
write(*,*) 'ERROR: for exponential overshooting, must set f and f0 > 0'
Expand All @@ -85,11 +84,10 @@ subroutine eval_overshoot_exp (s, i, j, k_a, k_b, D, vc, ierr)
end if

! Apply mass limits

if (s%star_mass < s%overshoot_mass_full_on(j)) then
if (s%star_mass > s%overshoot_mass_full_off(j)) then
w = (s%star_mass - s%overshoot_mass_full_off(j)) / &
(s%overshoot_mass_full_on(j) - s%overshoot_mass_full_off(j))
if (s% star_mass < s% overshoot_mass_full_on(j)) then
if (s% star_mass > s% overshoot_mass_full_off(j)) then
w = (s% star_mass - s% overshoot_mass_full_off(j)) / &
(s% overshoot_mass_full_on(j) - s% overshoot_mass_full_off(j))
factor = 0.5_dp*(1._dp - cospi(w))
f = f*factor
f0 = f0*factor
Expand All @@ -100,77 +98,67 @@ subroutine eval_overshoot_exp (s, i, j, k_a, k_b, D, vc, ierr)
end if

! Evaluate convective boundary (_cb) parameters

call eval_conv_bdy_r(s, i, r_cb, ierr)
if (ierr /= 0) return

call eval_conv_bdy_Hp(s, i, Hp_cb, ierr)
if (ierr /= 0) return

! Evaluate overshoot boundary (_ob) parameters

call eval_over_bdy_params(s, i, f0, k_ob, r_ob, D_ob, vc_ob, ierr)
if (ierr /= 0) return

! Loop over cell faces, adding overshoot until D <= overshoot_D_min

outward = s%top_conv_bdy(i)

outward = s% top_conv_bdy(i)
if (outward) then
k_a = k_ob
k_b = 1
dk = -1
else
k_a = k_ob+1
k_b = s%nz
k_b = s% nz
dk = 1
end if

! Loop over cell faces, adding overshoot until D <= overshoot_D_min
face_loop : do k = k_a, k_b, dk

! Evaluate the exponential factor

r = s%r(k)

r = s% r(k)
if (outward) then
dr = r - r_ob
else
dr = r_ob - r
end if

! Evaluate the exponential factor
if (f > 0._dp) then
factor = exp(-2._dp*dr/(f*Hp_cb))
else
factor = 0._dp
end if

! Store the diffusion coefficient and velocity

D(k) = (D0 + Delta0*D_ob)*factor
if(D_ob /= 0d0) then
vc(k) = (D0/D_ob + Delta0)*vc_ob*factor
else
vc(k) = 0d0
end if
! Check for early overshoot completion

if (D(k) < s%overshoot_D_min) then
! Check for early overshoot completion
if (D(k) < s% overshoot_D_min) then
k_b = k
exit face_loop
end if

end do face_loop

if (DEBUG) then
call eval_conv_bdy_r(s, i, r_cb, ierr)
if (ierr /= 0) return
write(*,*) 'exponential overshoot:'
write(*,*) ' k_a, k_b =', k_a, k_b
write(*,*) ' r_a, r_b =', s%r(k_a), s%r(k_b)
write(*,*) ' r_a, r_b =', s% r(k_a), s% r(k_b)
write(*,*) ' r_ob, r_cb =', r_ob, r_cb
write(*,*) ' Hp_cb =', Hp_cb
end if

return

end subroutine eval_overshoot_exp

end module overshoot_exp
43 changes: 15 additions & 28 deletions star/private/overshoot_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ subroutine eval_overshoot_step (s, i, j, k_a, k_b, D, vc, ierr)
ierr = 0

! Extract parameters
f = s% overshoot_f(j)
f0 = s% overshoot_f0(j)

f = s%overshoot_f(j)
f0 = s%overshoot_f0(j)

D0 = s%overshoot_D0(j)
Delta0 = s%overshoot_Delta0(j)
D0 = s% overshoot_D0(j)
Delta0 = s% overshoot_Delta0(j)

if (f <= 0._dp .OR. f0 <= 0._dp) then
write(*,*) 'ERROR: for step overshooting, must set f and f0 > 0'
Expand All @@ -80,11 +79,10 @@ subroutine eval_overshoot_step (s, i, j, k_a, k_b, D, vc, ierr)
end if

! Apply mass limits

if (s%star_mass < s%overshoot_mass_full_on(j)) then
if (s%star_mass > s%overshoot_mass_full_off(j)) then
w = (s%star_mass - s%overshoot_mass_full_off(j)) / &
(s%overshoot_mass_full_on(j) - s%overshoot_mass_full_off(j))
if (s% star_mass < s% overshoot_mass_full_on(j)) then
if (s% star_mass > s% overshoot_mass_full_off(j)) then
w = (s% star_mass - s% overshoot_mass_full_off(j)) / &
(s% overshoot_mass_full_on(j) - s% overshoot_mass_full_off(j))
factor = 0.5_dp*(1._dp - cospi(w))
f = f*factor
f0 = f0*factor
Expand All @@ -95,68 +93,57 @@ subroutine eval_overshoot_step (s, i, j, k_a, k_b, D, vc, ierr)
end if

! Evaluate convective boundary (_cb) parameters

call eval_conv_bdy_Hp(s, i, Hp_cb, ierr)
if (ierr /= 0) return

! Evaluate overshoot boundary (_ob) parameters

call eval_over_bdy_params(s, i, f0, k_ob, r_ob, D_ob, vc_ob, ierr)
if (ierr /= 0) return

! Loop over cell faces, adding overshoot until D <= overshoot_D_min

outward = s%top_conv_bdy(i)

outward = s% top_conv_bdy(i)
if (outward) then
k_a = k_ob
k_b = 1
dk = -1
else
k_a = k_ob+1
k_b = s%nz
k_b = s% nz
dk = 1
end if

! Loop over cell faces, adding overshoot until D <= overshoot_D_min
face_loop : do k = k_a, k_b, dk

! Evaluate the step factor

r = s%r(k)

r = s% r(k)
if (outward) then
dr = r - r_ob
else
dr = r_ob - r
end if

! Evaluate the overshoot factor
if (dr < f*Hp_cb) then
factor = 1._dp
else
factor = 0._dp
end if

! Store the diffusion coefficient and velocity

D(k) = (D0 + Delta0*D_ob)*factor
if(D_ob /= 0d0) then
vc(k) = (D0/D_ob + Delta0)*vc_ob*factor
else
vc(k) = 0d0
end if
! Check for early overshoot completion

if (D(k) < s%overshoot_D_min) then
! Check for early overshoot completion
if (D(k) < s% overshoot_D_min) then
k_b = k
exit face_loop
end if

end do face_loop

ierr = 0

return

end subroutine eval_overshoot_step

end module overshoot_step
Loading