mesa icon indicating copy to clipboard operation
mesa copied to clipboard

function of set_new_abundances control?

Open mjoyceGR opened this issue 2 years ago • 2 comments

In trying to help a user, I've come across a subsection of !! composition controls in controls.defaults where one can specify a special list of z fractions. However, these appear to be tied to a flag set_new_abundances, which does not appear anywhere else in the *.defaults documentation. It is also not understood as a valid inlist parameter.

This is tied to another issue I've been raising on and off for a while, which is the conflict between &controls settings for initial_Y, initial_Z, etc., and the set_uniform_initial_composition and related set of parameters available in &star_job

When to use what (and why) is not clear to users, and even I do not understand which takes precedent when there is a conflict between assignments or why it's necessary to have both. Does anyone know?

mjoyceGR avatar Oct 18 '22 10:10 mjoyceGR

It looks like set_new_abundances is not a flag, but a subroutine in star/private/adjust_xyz.f90 that gets called to fix things up after net changes. There's a potentially useful comment buried deep in that subroutine explaining the purpose of the temperature inlist controls that appear in controls.defaults: https://github.com/MESAHub/mesa/blob/cea84bd4b939c58a48af0e0e981838a02586876c/star/private/adjust_xyz.f90#L359-L360

evbauer avatar Oct 18 '22 21:10 evbauer

I assume by special z fractions you mean the controls z_fraction_XX? These are tied to using either initial_zfracs = 0 (for the initial composition) or accretion_zfracs = 0 (to set the accretion composition) when using set_uniform_initial_composition.

TLDR: set_uniform_initial_composition is there to alter an existing model. initial_zfracs is there to specify to the metal distribution either during set_uniform_initial_composition or create_pre_main_sequence_model.

For order of precedence: The controls initial_{Y,Z} control act first either because your loading a pre-built MS model (and need initial_Z=0.02) or your making a pre-ms model (which also depends on the choice of initial_zfracs). Once you have a model (either from the previous steps or because your loading your own) then you can alter the model with set_uniform_initial_composition.

rjfarmer avatar Oct 19 '22 10:10 rjfarmer