Repository navigation
Place pulse-data double points from composition mu, not EOS mu - #1132
Merged
Merged
Conversation
set_segment_indices evaluated grad_mu from s%mu, which includes the free electrons supplied by the EOS. Partial ionization zones therefore triggered double points where the composition is uniform, introducing spurious density discontinuities into pulsation models, and frequencies jumped as faces crossed the threshold between models. Evaluate grad_mu from abar/(1 + zbar) instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rhdtownsend
added a commit
to rhdtownsend/em
that referenced
this pull request
Nov 21, 2026
…and probe harness - create_star now tries pre-MS central temperatures 5e5, 4e5, 6e5 K in turn (PRE_MS_T_C_DEFAULT, overridable via pre_ms_T_c), fixing initial model convergence failures for some AMP parameter sets - patches/mesa-26.04.1-double-points.patch: MESA fix placing pulse-data double points from composition mu rather than EOS mu (upstream as MESAHub/mesa#1132); without it, hot models stall evolve_star_seismic with "too many redos". CLAUDE.md documents the requirement - em_probe frontend and scripts/probe_failures.py for diagnosing initial-model failures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
This seems like a good change, and looks fine to merge to me. I guess this logic is just used for finding where to add double points from real composition jumps in the profile, so using the fully ionized mu directly from the composition is just as good if not better than relying on the mu coming out of the EOS. |
Debraheem
self-requested a review
November 26, 2026 19:49
Debraheem
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
add_double_points_to_pulse_datais enabled,set_segment_indices(star/private/pulse_utils.f90) decides where to put double points fromgrad_mu = dln(mu)/dln(P), usings%mu. Thatmuincludes the free electrons supplied by the EOS, so partial ionization zones (H/He ionization in the envelopes of hotter stars) can exceedthreshold_grad_mu_for_double_pointeven though the composition there is uniform.At a double point the density takes the per-side cell values rather than an interpolated face value, so these spurious double points put density discontinuities of a few percent into the exported pulsation model (P and T stay continuous). Faces in the ionization zone also cross the threshold back and forth from one model to the next. The point count toggles, and GYRE frequencies jump discontinuously between adjacent models (by several tenths of a µHz for radial p modes in a ~1.7 Msun, ~8600 K main-sequence model with threshold 1). Any code that tracks frequencies along a track, such as asteroseismic fitting that bisects in age on a frequency offset, can then fail to converge.
Fix
Evaluate
grad_mufrom the mean molecular weight of the composition alone, assuming full ionization:mu_comp = abar/(1 + zbar). Double points then mark only real composition discontinuities (e.g. the gradient left by a receding convective core), which is what the control is meant for. Thecontrols.defaultsdocumentation forthreshold_grad_mu_for_double_pointand the changelog are updated to match.This changes behavior outright rather than adding a new control: placing double points at ionization features is not physically meaningful.
Testing
fortitude,sphinx-lint, andcheck_defaults.pypass.Pulsation models with double points may differ from earlier versions; the changelog notes this.
🤖 Generated with Claude Code