[mesa-users] Eq. 9 in Paxton et al. 2011

Bill Paxton paxton at kitp.ucsb.edu
Fri Sep 12 12:55:04 EDT 2014


On Sep 12, 2014, at 8:30 AM, Ehsan Moravveji wrote:

> Hi Bill,
> I'm reading through the first instrument paper again, with a goal to prepare some lab exercises. I just came across a minor point. 
> I think, based on the definition of cell-average and face quantities, P_1 and T_1 in the second line of Eq. (9) have to be \bar{P_1} and \bar{T_1}, respectively, meaning that the surface difference is carried out w.r.t. the face of the first cell.
> Do you agree with me?
> Or I am misunderstanding sth?
> 
> Cheers
> Ehsan.

Hi Ehsan,

Good catch, and a subtle point.   Take a look at the relevant code in the current mesa/star/private/hydro_eqns.f. -- PT_eqns_surf.

It gets the P and T for the outer boundary of cell 1 from the atm module -- these are called P_surf and T_surf.

Next it has to deal with the problem you point out --- it has model P and T at center of cell 1, but the comparison values from the atm are at the cell outer boundary.  Turns out that rather than deriving model P and T at boundary, we choose to offset the surface values from the atm to the center of the cell.  For P we use simple hydrostatic equilibrium to do this; for T we use gradT for cell 1.   Here's the code that does that:

         ! offset P and T from outer edge of cell 1 to center of cell 1
         dP0 = s% surf_bc_offset_factor*s% cgrav(1)*s% mstar*s% dm(1)/(8*pi*r*r*r*r)
         dT0 = dP0*s% gradT(1)*s% T(1)/s% P(1)
         
         P_bc = P_surf + dP0
         T_bc = T_surf + dT0

Now the boundary condition is that model P at center of cell 1 should equal P_bc, and similarly model T at center of cell 1 should equal T_bc.

You may have noticed the fudge factor "surf_bc_offset_factor" in the expression for dP0 -- that's a "hidden" parameter that defaults to 1.   For a laugh, you might search the star test_suite to find the one case that changes it.   Perhaps it is no longer necessary.   Let me know if you can run the test case successfully without it and we'll take it out.    

You might also check out the version of mesa from the time of the 2011 paper to see what it was doing back then about this issue of surface BC's.

Good luck with the lab exercises!  

-Bill







More information about the Mesa-users mailing list