[Mesa-users] Missing energy generation in MESA output?
Farag, Ebraheem
ebraheem.farag at yale.edu
Thu Feb 27 18:52:31 UTC 2025
Hi Jason,
Without thinking too deeply into the information you've shared.
*
(I do see there is an advertised eps_grav parameter in MESA, but it is set to zero everywhere, which is why I'm using T ds/dt. Is there a way to get that output to "turn on"?)
I believe the energy equation in MESA is now -> 'dedt', a conservative form. The older eps_grav form (eq 11 from MESA I) is still an option "eps_grav", see https://docs.mesastar.org/en/latest/reference/controls.html#energy-eqn-option.
This might be wrong, but I think when the conservative form is chosen, you admit entropy errors to allow for energy conservation, where as when the original eps_grav form is adopted, you admit energy errors for better thermodynamic consistency. In a perfect world these would be identical, but numerically solving yields this fork in the road. The eps_grac parameter should be on when using the 'eps_grav' form of the energy equation.
On both problems, I don't just want eps_nuc but rather eps_nuc - non_nuc_neu, where non_nuc_neu are the thermal neutrino losses. This might help with problem 2, unless you already included it.
I'm still thinking on problem 1... It could be due to the fact that we use a T-tau relation for low tau, but that's something to check?
-EbF
________________________________
From: Mesa-users <mesa-users-bounces at lists.mesastar.org> on behalf of Jason Wright via Mesa-users <mesa-users at lists.mesastar.org>
Sent: Thursday, February 27, 2025 12:27 PM
To: mesa-users <mesa-users at lists.mesastar.org>
Subject: [Mesa-users] Missing energy generation in MESA output?
Hi, all. Me again teaching stellar structure with MESA.
One set of our assignments is to test the precision of MESA in computing the equations of stellar structure. This is a good way for the students to practice coding up physics and exploring which physics matters where in the Sun. We are using a solar-mass ZAMS star of solar metallicity as our example (from Ed Brown's excellent notes).
We find that the 1st 3 equations of stellar structure are obeyed extremely well, but we are struggling with the luminosity equation.
Δl/Δm = ε_nuc - T
(Eq. 11 of the first MESA instrument paper).
Problem 1:
We get reasonably good agreement for most of the star, but in the outermost cells (m/M > 0.999) there is a big divergence between these quantities. In the atmosphere of the star, Δl/Δm actually goes very slightly negative, but the reported ε_grav (calculated as -T ds/dt) is still positive there.
I'm guessing the answer is that I'm not calculating T ds/dt properly. I'm using the delta_entropy profile output, and log_dt from the history file for that timestep. Perhaps these do not correspond exactly, or that is not the quantity used in determining Δl/Δm?
(I do see there is an advertised eps_grav parameter in MESA, but it is set to zero everywhere, which is why I'm using T ds/dt. Is there a way to get that output to "turn on"?)
Below: comparison of the finite difference of Δl/Δm (red, dashed line is negative) and energy generation terms reported by MESA.
[Core is on the left, atmosphere on the right. The logit_10 function "counts nines" near m/M~1 (so 0.9999 is 4) and "counts zeros" near m~0 (so 0.0001 is -4). ]
["eps" here is "net_energy", which does not have the precision to show values below 1 erg/s/g]
[Screenshot 2025-02-24 at 1.12.43 PM.png]
Problem 2:
Another mismatch is more subtle, but suggests I'm missing physics.
It's hard to see in the above plot, but the discrepancy actually stars at about m/M=0.5 (logit_10(m/M)=0). If I integrate up (ε_nuc - T ds/dt)dm to compute luminosity and compare it to the actual luminosity, I get about a 0.1% discrepancy with a strange shape.This shape shares some qualities / features of both eps_nuc and eps_grav, but not exactly.
[Screenshot 2025-02-24 at 1.18.56 PM.png]
Any ideas what's going on? Am I misunderstanding something about neutrino losses?
Happy to share my code if it helps.
--
-
---------------
Jason T Wright
Professor of Astronomy and Astrophysics
Director, Penn State Extraterrestrial Intelligence Center
he/him/his
https://sites.psu.edu/astrowright/
https://bsky.app/profile/astrowright.bsky.social
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20250227/a06dd314/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2025-02-24 at 1.12.43?PM.png
Type: image/png
Size: 170808 bytes
Desc: Screenshot 2025-02-24 at 1.12.43?PM.png
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20250227/a06dd314/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2025-02-24 at 1.18.56?PM.png
Type: image/png
Size: 261110 bytes
Desc: Screenshot 2025-02-24 at 1.18.56?PM.png
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20250227/a06dd314/attachment-0003.png>
More information about the Mesa-users
mailing list