[mesa-users] Quality of mass conservation

Ehsan Moravveji e.moravveji at gmail.com
Sun Oct 26 17:22:13 EDT 2014


Hi everybody,

I’ve been looking at star/private/hydro_eqns.f, and the subroutine do1_density_eqn to figure out how the equality in Eq. (5) in the first instrument paper is fulfilled.
So, I’m going to present the first few lines of this subroutine in a jumbled way:

the residual of both sides of the equality are stored in 
            equ(equR, k) = lnR(k) - res/3d0
where 
            lnR(k) = log(s% r(k))
and 
            res = log_cr(rp13 + dr3)
since “lnR" is a cell-edge quantity, then “res" must be also evaluated at cell face, if the comparison is going to be fair.
However, one of the ingredients of “res” is a cell-averaged quantity:

            dm = s% dm(k)
            rho = s% rho(k)
            ! dm/rho is cell volume
            dr3 = (dm/rho)/(pi4/3)

Indeed the cell volume is an extensive quantity, but it seems to me it is evaluated at cell center, due to the definition of s% dm and s% rho.
I would be grateful is one of the black belts explain to me why this is an allowed operation.

Cheers
Ehsan.

PS: B.t.w., for a main-sequence 5 Msun model, the equality in Eq. (5) is fulfilled up to ~ 10 decimals, as you can find out in the attached plot. 
Delta = log10((LHS-RHS)/LHS).




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141026/0d5e0ad9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: equR.png
Type: image/png
Size: 171022 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141026/0d5e0ad9/attachment.png>


More information about the Mesa-users mailing list