We carry around three different 1D radial quantities: ηρec (edge-centered), ηρcc (cell-centered), and (ηρer) (cell-centered). These notes discuss when each of these is used, and how they are computed, in both plane-parallel and spherical.

The Mixing Term, ηρ

The base state evolves in response to heating and mixing in the star. The density evolution is governed by

(116)ρ0t=(ρ0w0er)(ηρer),

with

(117)ηρ(r)=(ρU~er)=1A(ΩH)ΩH(ρU~er)dA,

designed to keep the average value of the full density, ρ, over a layer of constant radius in the star equal to ρ0. To complete the update of the base state, we need evolution equations for the pressure, p0, and velocity, w0. For spherical geometry, the derivation of w0 constraint equation is shown in the multilevel paper, resulting in the following system

(118)w0=w0+δw01r2r(r2w0)=Sr[Γ1p0r2r(r2δw0)]=gr2(r2ηρ)r4(w0+δw0)ρ0gr4πGρ0ηρ

In paper III, we introduced a mixing term, ηρ, to the density evolution equation (Eq.116), with the objective of keeping the base state density equal to the average of the density over a layer. For a spherical base state, it is best to define the average in terms of spherical coordinates,

(119)q=14πΩHq(r,θ,ϕ)dΩ

where ΩHdΩ=4π represents the integral over the spherical θ and ϕ angles at constant radius.

Recall from Paper III that if initially ρ=0, there is no guarantee that ρ=0 will hold at later time. To see this, start with the equation for the perturbational density

(120)ρt=UρρU(ρ0U~),

written in a slightly different form:

(121)ρt+(ρU)=(ρ0U~).

We integrate this over a spherical shell of thickness 2h at radius r0, i.e., ΩH×(r0h,r0+h), and normalize by the integration volume, which is 4πr022h for small h, to obtain:

(122)14πr022hr0hr0+hr2drΩH[ρt+(ρU)]dΩ=14πr022hr0hr0+hr2drΩH(ρ0U~)dΩ=14πr022hΩH[ρ0(U~er)]r2dΩ|r0hr0+h=0,

where we have used the divergence theorem in spherical coordinates to transform the volume integral on the right hand side into an area integral over ΩH. We see that the right hand side disappears since ΩHρ0(U~er)dΩ=0, which follows from the definition of U~. Now, expanding the remaining terms and taking the limit as h0, we can write

(123)0=limh014πr022hr0hr0+hr2drΩH[ρt+(ρU)]dΩ=t(limh014πr0212hr0hr0+hr2drΩHρdΩ)+limh0[14πr022hr0hr0+hr2drΩH(ρU)dΩ]=t(14πΩHρdΩ)+limh0{1r022h[14πΩHρ(Uer)dΩ]r2|r0hr0+h}=tρ+limh0{1r022h[ρ(Uer)]r2|r0hr0+h}=tρ+limh01r022hr0hr0+h[ρ(Uer)er]r2dr=tρ+[ρ(Uer)er]

again using the divergence theorem, extracting the time derivative from the spatial integral, and switching the order of operations as appropriate.

In short,

(124)tρ=[ρ(Uer)er]=(ηρer),

and thus, ηρ=(ρUer).

We need both ηρ alone and its divergence for the various terms in the construction of w0 and the correction to ρ0. The quantity ηρ is edge-centered on our grid, and for Cartesian geometries, we constructed it by averaging the appropriate fluxes through the grid boundaries. For a spherical base state, this does not work, since the spherical shells do not line up with the Cartesian grid boundaries.

Therefore, we take a different approach. We compute ηρ by constructing the quantity ρU~er in each cell, and then use our average routine to construct a 1-d, cell-centered ηρ,r (this is essentially numerically solving the integral in Eq.117. The edge-centered values of ηρ, ηρ,r+1/2 are then constructed by simple averaging:

(125)ηρ,r+1/2=ηρ,r+ηρ,r+12.

Instead of differencing ηρ,r+1/2 to construct the divergence, we instead use Eq.124 directly, by writing:

(126)[(ηρer)]n+1/2=ρn+1ρnΔt=ρn+1Δt,

where we have made use of the fact that ρn=0 by construction.

η Flow Chart

  1. Enter advance_timestep with [ηρec,ηρcc]n12.

  2. Call make_w0. The spherical version uses uses ηρec,n12 and ηρcc,n12.

  3. Call density_advance. The plane-parallel version computes ηρflux,n+12,.

  4. Call make_etarho to compute [ηρec,ηρcc]n+12,. The plane-parallel version uses ηρflux,n+12,.

  5. Call make_psi. The plane-parallel version uses ηρcc,n+12,.

  6. Call make_w0. The spherical version uses uses ηρec,n+12, and ηρcc,n+12,.

  7. Call density_advance. The plane-parallel version computes ηρflux,n+12.

  8. Call make_etarho to compute [ηρec,ηρcc]n+12. The plane-parallel version uses ηρflux,n+12.

  9. Call make_psi. The plane-parallel version uses ηρcc,n+12.

Computing ηρec and ηρcc

This is done in make_eta.f90.

Plane-Parallel

We first compute a radial edge-centered multifab, ηρflux, using

(127)ηρ,i+12erflux=[(U~i+12ern+12er)+w0,r+12n+12]ρi+12ern+12w0,r+12n+12ρ0,r+12n+12,pred

ηρec is the edge-centered “average” value of ηρflux,

(128)ηρ,r+12ec=ηρ,i+12erflux

ηρcc is a cell-centered average of ηρec,

(129)ηρ,rcc=ηρ,r+12ec+ηρ,r12ec2.

Spherical

First, construct ηρcart=[ρ(U~er)]n+12 using:

(130)[ρn+ρn+12(ρ0n+ρ0n+12)cart]d(U~i+12edn+12ed+U~i12edn+12ed2)nd.

Then, ηρcc is the cell-centered average of ηρcart,

(131)ηρcc=ηρcart.

On interior faces, ηρec is the average of ηρcc,

(132)ηρ,r12ec=ηρ,r1cc+ηρ,rcc2.

At the upper and lower boundaries, we use

(133)ηρ,12ec=0,ηρ,nr12ec=ηρ,nr1cc.

Using ηρec

Plane-Parallel

NOT USED.

Spherical

In make_w0, ηρec is used in the construction of the RHS for the δw0 equation.

Using ηρcc

Plane-Parallel

In make_psi, ψ=ηρccg.

Spherical

In make_w0, ηρcc is used in the construction of the RHS for the δw0 equation.