Open
Conversation
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.
This branch was birthed out of doing some testing with tdc pulsations, where I was benchmarking where TDC decoupled versus RSP.
At the moment, TDC and mlt used P and kap and other quantites which are averaged onto cell faces. Probably more thermodynamically consistent is to use the face averaged T and rho to recalculate the opacity or eos, which is what
use_face_values_eos_and_kap_mlt_tdcdoes in this pr.Claim: using
use_face_values_eos_and_kap_mlt_tdcallows mesa to converge significantly better on courser mesh, when the opacity or other eos quantity is not well resolved at the cell face.Example:
Below i show a 9M cepheid which would be fine in RSP, because RSP is cell centered, but in MESA-TDC features in the mesh from a poorly interpolated opacity cause ringing in kappa -> gradr -> L -> Lc -> (unphysical oscillations in the pulsations). By using
use_face_values_eos_and_kap_mlt_tdc, these features are eliminated. The only other solution I could find was to double or triple the mesh resolution in MESA to get similar smoothness to RSP at this particular resolution, and sometimes that wasn't enough.With
use_face_values_eos_and_kap_mlt_tdcthe face_averaged primitives T and rho etc, are used to computes the face eos and kap quantities using an additional eos call, instead of averaging the Pressure and opacity and other thermodynamic quantities on cell faces. This generates a more accurate reconstruction at the cost of an extra eos call. I refactored things such that we minimize the number of times eos calls are made though. This is done by storing the face values in global star pointers.This is a dev control for now, but if it is useful for low resolution meshes, it could be potentially useful as a global default, pending testing and time.
The TDC_Cepheid_9M test case can be removed before this branch is merged, but it serves as a test case for now. (We can squash this pr as well, if we merge.)