[mesa-users] Composition part of epsilon_grav

Bill Paxton paxton at kitp.ucsb.edu
Thu Apr 30 13:12:48 EDT 2015


Hi Chris and Dean,

Perhaps this can be done using a scheme similar to what we do for Brunt where we are also looking at the impact of composition changes (see last instrument paper, section 3.3).  In that case, we are doing spatial derivatives with respect to composition for Ledoux, whereas in this case we are doing time derivatives with respect to composition for eps_grav -- but the basic idea is the same: do one extra eos call with old T and Rho but with entire new set of composition variables.

For eps_grav, this would mean adding an option similar to include_dmu_dt_in_eps_grav.  It would make an extra call on the eos in order to add a term -(E - E_start)/dt to eps_grav where E = eos(T_start, Rho_start, <x>) with <x> the current composition variables and E_start, T_start, Rho_start the values at the same mass coordinate at the start of the timestep.  

I think this should work -- let me if it seems okay to you too after you carefully check details.  By making the extra eos call, it takes care of details such as partial ionization.  The calls to evaluate eps_grav are already done in parallel, so the extra calls on the eos will be done in parallel automatically.  As sketched above, we won't be taking the composition terms into account in the jacobian, so that may turn out to be a problem -- hopefully the discarded terms will be small enough that we can get away with ignoring them.  

Does this sound like it is worth doing?   

-Bill








On Apr 30, 2015, at 8:55 AM, Dean Townsley wrote:

> Hi Chris,
> 
> You are right that the mu_i*dN_i terms are missing from equation 16 and 17 in paper 2, but I'm unsure if they do or do not appear somewhere else...
> 
> I think the usual reason for them not to appear in eps_grav in stellar evolution codes is that the adjustment of hydrostatic structure and the reactions are usually operator split.  That is, during the hydrostatic adjustment operation, the composition is fixed so that dN_i is zero.  I'm unsure if this plays nice with diffusion, real or when used in convection zones.  (I think the latter is actually subtle.)  In an operator split code, the terms that you are looking for would more appropriately appear in the operation in which energy deposition is done, since that is when the     N_i actually change.  Exactly how the terms appear or are implemented depends on what one is using for fundamental thermal variables.  MESA uses T,rho (mostly) but some codes use s,rho and I think K&W mostly discuss using E,rho.  I think if E,rho are being used, there is nothing to be done, energy is just added based on reactions and the effective mu_i*dN_i terms act when one goes to use this new E along with the new N_i in the EOS to evaluate something else.  In either of the other cases in order to compute the change in T or s for a given amount of energy deposition (at constant rho, since this is operator split) one must put in the appropriate mu_i*dN_i terms in some way, possibly by computing the new E and inverting with the EOS.
> 
> However, MESA/star is not operator split...
> Translating the above into non-operator-split MESA/star language, based on equation 11 in paper 1, this means that the terms you are looking for MAY appear in eps_nuc instead.   I don't know if they actually do or not, but that would also be a reasonable place to put them since that is where the other dN_i terms related to energy deposition are.  This basically includes them in the computation of the Ds/Dt from nuclear reactions and I think provides a reasonable sidestep of the sticky issues with diffusion.  I wasn't able to put my finger on a place in the MESA papers where the computation of eps_nuc is described in detail, and I haven't looked at it carefully in the code.  Perhaps I'm just overlooking the relevant spot in the papers.
> 
> The partial ionization region is maybe a bit more subtle.  But for those I think that changes in mean molecular weight due to ionization are imbedded in the coefficients like C_P and chi_T, etc, since the EOS is phrased at constant mass fractions, with the above usage in mind.
> 
> 
> On your separate question about getting the chemical potentials from the EOS...
> 
> A typical EOS for a fully ionized electron-ion plasma (star stuff) will be phrased to give e(T,rho,Y_e,Y_i) instead of something that depends on composition.  Here Y_e is the number of (non-thermal) electrons per total baryons and Y_i is the number of ions per total baryons.  So pure hydrogen has Y_e=1 and Y_i=1 and pure He has Y_e=0.5 and Y_i=0.25.  This is also sometimes phrased as Abar and Zbar.  In any case, one typically gets mu_i thus:
>   mu_i = d e/ dN_i (const s,rho) = ds/dY_e(const s,rho,Y_i)*dY_e/dN_i + ds/dY_i(const s,rho,Y_e)*dY_i/dN_i
> Note that you will need to do the relevant transformations to get derivatives at constant s instead of constant T.  The necessary derivatives may actually be reported by the EOS, things like d s/d abar and d s / d zbar.
> 
> I'm a little unsure about one thing, though.  Depending on what mode it is used in, I think MESA's EOS may not behave quite like e(T,rho,Y_e,Y_i).  The Potekhin & Chabrier EOS I think uses something called linear mixing in which the approximation is made that 
>   F(T,rho,{X_i}) = sum_i X_i*F(T,rho,Z_i,A_i)
> where F is the Helmholtz free energy functional (the one appropriate to a T,rho basis).  Again, you can work through the various transformations to get any given mu_i.  I'm unsure if anyone has already implemented something in MESA that does this for you.  It's possible that having the d/d abar and d/d zbar derivatives is pretty much sufficient or there is some shortcut that I don't know about.
> 
> 
> For using the EOS in the partial ionization regime....
> um...
> that would more complicated :)
> 
> 
> Hopefully that helps.
> Dean
> 
> On 04/29/2015 05:55 PM, Chris Mankovich wrote:
>> Hi all,
>> 
>> I've been thinking about the calculation of epsilon_grav, which is minus the rate of change of heat per gram.  The usual procedure (e.g., Kippenhahn & Weigert section 4.1) is to use the first law of thermodynamics to write dq = du + P*dv, expand du in terms of the independent variables, and use the second law together with Maxwell relations to determine dq as a function of dT and dP, say, if T,P are taken as your independent variables.  As a result you can write epsilon_grav as in Equations 16-17 in mesa2.
>> 
>> My question is, has this ever been generalized to an EOS that also depends on composition (like any real EOS does)?  If I were to add mean molecular weight as one of my independent variables so that rho=rho(P,T,mu) and u=u(P,T,mu), then du collects an extra term, and furthermore dq collects an extra term (mu_i * dN_i) for each species i, where this time mu_i are the chemical potentials.
>> 
>> At this point I would be more or less stuck, since the usual EOS calls give me no knowledge of the chemical potentials for a given species in a given thermodynamic state.  The chemical potential is ds/dN_i at constant everything else, and if I were forced to compute these derivatives numerically I might be out of luck---I have good reason to be avoiding working with the entropy directly in the first place!
>> 
>> Word on the street is that this term is inconsequential for stars, at least in the absence of phase transitions.  (For crystallization in C/O WDs, MESA switches to the direct entropy method, which seems to work well numerically with the analytic PC EOS there).  But has it ever been worked out?
>> 
>> (I'm also aware of the option in MESA to add a term like partial(u)/partial(mu) * dmu/dt assuming ideal gas, but I've never seen where this came from, and I want to achieve the same thing for the general equation of state.)
>> 
>> 
>> Chris
>> 
>> 
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud 
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> 
>> 
>> _______________________________________________
>> mesa-users mailing list
>> mesa-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mesa-users
> 
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20150430/cbd74b5c/attachment.html>


More information about the Mesa-users mailing list