Skip to content

star: fix rotational D_mix logT and tau cutoffs - #1085

Open
pmocz wants to merge 2 commits into
mainfrom
fix-rotation-mixing-cutoff
Open

pmocz wants to merge 2 commits into
mainfrom
fix-rotation-mixing-cutoff

Conversation

@pmocz

@pmocz pmocz commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Problem

In update_rotation_mixing_info (star/private/mix_info.f90), the rotational part of D_mix is scaled by a factor f that is meant to:

  • turn rotational mixing off at high temperature (D_mix_rotation_max_logT_full_on = 9.4, D_mix_rotation_min_logT_full_off = 9.5), and
  • optionally turn it off at low optical depth (D_mix_rotation_min_tau_full_off/on, both 0 by default).

The tau block added in d3022fd (Jan 2025) assigns f unconditionally, overwriting the logT factor:

if (s% tau(k) >= full_on_tau) then
   f = 1d0                                        ! discards the logT factor
else if (s% tau(k) <= full_off_tau) then
   f = 0d0
else
   f = (lgT - full_on) / (full_off - full_on)     ! uses lgT, not tau
end if

Consequences:

  1. The logT cutoff is never applied with the default controls. tau ≥ 0 = full_on_tau, so f = 1 everywhere and rotational mixing is never suppressed above logT 9.4–9.5 as documented. This affects rotating massive stars run through late burning stages.
  2. When a tau ramp is set (e.g. dev_TDC_through_ppisn sets 1 and 10), cells in the ramp get f from the logT formula. In an envelope with lgT ≈ 5 that is (5 − 9.4)/0.1 ≈ −44, i.e. a large negative D_mix_rotation.

A separate, older issue (from the initial import): the logT ramp runs the wrong way. f = (lgT - full_on)/(full_off - full_on) goes from 0 at full_on to 1 at full_off, then jumps back to 0. It should fall from 1 to 0. The same reversed ramp is used for am_nu_factor in profile_getval.f90, and in the formula in controls.defaults.

Fix

  • Compute the logT factor f and the tau factor f_tau separately, and use f*f_tau.
  • Ramp f_tau in tau: (tau - full_off_tau)/(full_on_tau - full_off_tau).
  • Make the logT ramp decrease: (full_off - lgT)/(full_off - full_on), in mix_info.f90 and profile_getval.f90.
  • Update the documented formula in controls.defaults and describe the tau factor there.

The ramp branches are only reached when full_off_tau < tau < full_on_tau (or full_on < lgT < full_off), so the denominators are positive and the default 0/0 tau settings never divide.

Expected behaviour change

  • Rotating models that reach logT > 9.4 will again have rotational mixing reduced (fully off at logT ≥ 9.5), as before d3022fd. Late-stage results of rotating massive-star test cases may change.
  • Models that set the tau controls get a proper 0→1 ramp in tau, combined with the logT cutoff.
  • Within 9.4 < logT < 9.5 the factor now falls smoothly from 1 to 0 instead of rising and then jumping to 0.

Testing

linters/check_defaults.py passes. The code has not been compiled or run (no MESA SDK where this was written). In the test suite, ppisn is the case most likely to change: it rotates (new_omega_div_omega_crit = 0.1) and runs to Fe-core infall, so it reaches logT > 9.4. 12M_pre_ms_to_core_collapse, 20M_pre_ms_to_core_collapse, zams_to_cc_80 and pisn turn on rotation with Ω = 0, so their rotational D_mix should be essentially zero. The dev_TDC_through_ppisn dev case, which sets the tau controls, should also be checked.

🤖 Generated with Claude Code

In update_rotation_mixing_info, the tau limiter added in d3022fd
unconditionally overwrote the logT factor f. With the default
D_mix_rotation_min_tau_full_on/off = 0, tau >= 0 always gives f = 1,
so the documented logT cutoff (D_mix_rotation_max_logT_full_on = 9.4,
D_mix_rotation_min_logT_full_off = 9.5) was never applied. In the tau
ramp region f was computed from lgT instead of tau, which gives a large
negative f (and negative D_mix_rotation) in the envelope.

Compute the logT and tau factors separately and multiply them, and
ramp the tau factor in tau.

Also fix the direction of the logT ramp, here and for am_nu_factor in
profile_getval: f went from 0 at full_on to 1 at full_off, then jumped
back to 0, instead of decreasing from 1 to 0. Update the formula in
controls.defaults to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Debraheem

Copy link
Copy Markdown
Member

Thanks for fixing my errors! I half-hazardly added these controls thinking they would be useful for ppisn, and I no longer rely on them so feel they might be useless bloat. As such, I'm considering removing them entirely unless someone feels they should stay.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants