mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Consolidate timestep controls for changes in abundances of a given species

Open warrickball opened this issue 4 years ago • 0 comments

The timestep controls currently offer the following options, which are all particular cases of the same thing:

    dH_limit_min_H = 1d99
    dH_limit = 1d99
    dH_hard_limit = 1d99
    dH_decreases_only = .true.
    dH_div_H_limit_min_H = 1d-3
    dH_div_H_limit = 0.9d0
    dH_div_H_hard_limit = 1d99

    dHe_limit_min_He = 1d99
    dHe_limit = 1d99
    dHe_hard_limit = 1d99
    dHe_decreases_only = .true.
    dHe_div_He_limit_min_He = 1d-3
    dHe_div_He_limit = 0.9d0
    dHe_div_He_hard_limit = 1d99

    dHe3_limit_min_He3 = 1d99
    dHe3_limit = 1d99
    dHe3_hard_limit = 1d99
    dHe3_decreases_only = .true.
    dHe3_div_He3_limit_min_He3 = 1d99
    dHe3_div_He3_limit = 1d99
    dHe3_div_He3_hard_limit = 1d99

    dX_limit_min_X = 1d99
    dX_limit = 1d99
    dX_hard_limit = 1d99
    dX_decreases_only = .true.
    dX_div_X_limit_min_X = 1d99
    dX_div_X_limit = 1d99
    dX_div_X_hard_limit = 1d99

First, the X in the last set of controls refers to any non-H, non-He abundance (i.e., metals), which conflicts with the usual notation Z. But these controls could all be consolidated into arrays with a scheme something like:

    dX_limit_species(1) = 'h1' ! or any valid species
    dX_limit_min_X(1) = 1d99
    dX_limit(1) = 1d99
    dX_hard_limit(1) = 1d99
    dX_decreases_only(1) = .true.
    dX_div_X_limit_min_X(1) = 1d-3
    dX_div_X_limit(1) = 0.9d0
    dX_div_X_hard_limit(1) = 1d99

We could allow the special cases for species 'X', 'Y' and 'Z' for all H, all He and everything else (assuming that no-one will ever want to limit the timestep by changes in the Yttrium abundance).

warrickball avatar Sep 16 '21 08:09 warrickball