Version 8 (modified by 12 years ago) ( diff ) | ,
---|
Source terms in AstroBEAR. All source terms are currently handled in a strang split way. That is - each hydro advance step is bracketed by two source steps of a half time step. Out of curiosity I browsed the athena source code to see how their CTU implementation handles source terms (since I couldn't find it in their CTU paper)
1D CTU
- Reconstruct left and right states (wr,wl)
- Add gradphi to normal velocity components at interface states
- wr(i)+=phi(i)-phi(i-1)
- wl(i)+=phi(i)-phi(i-1)
- Add other source terms using the reconstructed left and right states
- wl+=s(wl)
- wr+=s(wr)
- get fluxes
- calculate cell centered time centered values of density, momentum, and energy using original values and fluxes
- Update time centered momentum with gravo-source terms using original density and phi (no energy source term) pdV work done in fluxes??? - not sure what is going on here??? and calculate the time centered cell centered pressure
- For a static potential update the momentum using the time centered density and the energy using the mass fluxes times grad phi at the cell edges
- For self gravity do something slightly more complicated……
which is just where which requires . Since we can substitute for and we have which is equivalent (in 1D) to where we can identify the equivalent momentum flux tensor as
- In more than 1D we have
- But casting it this way gives you strict momentum conservation. If the source term were just then momentum would be conserved but since in each cell there is a factor of that currently enters, it modifies the differenced quantity from cell to cell. In theory these all cancel but only because … In the above treatment - the density used in the source term is derived from the actual potential which allows the source term to be cast as a flux difference. This allows for the strict momentum conservation.
- As as the energy is concerned…
Currently the energy added is
Which is equivalent to
If we try to express the energy source term as a total flux we get
The presence of the v will make it impossible to right this as a total flux.
What if we store the potential in E? Then
We now have a flux as well as a source term. However, the integral of the source term would need to be zero. So our elliptic equation would have a constraint
We can conserve total energy before and after the hydro step if we add source terms to the Energy
Consider the difference in gravitational energy…
As well as kinetic energy
For the sum to be zero we need to have
The first term
so we could identify a gravitational energy flux term- Add cooling terms using time centered density and pressure
- Add fluxes and store fluxes at edges as well as mass flux everywhere
- After calculating new modify momentum and energy by effectively using time centered . This allows for second order without storing .
I'm still puzzled about the time centered cell centered pressure being calculated without subtracting off the gravitational energy - and if
is subtracted off earlier - then why no potential heating? Seems like this would underestimate the cooling strength… Possible bug?2D CTU
- First 4 steps are identical as in 1D but now for both directinos
- Next calculate cell centered emf using initial values - and integrate to corner (upwind or otherwise) and update the interface magnetic field using CT
- Update interface states with transverse flux gradients
- Add source terms from transverse flux gradients
- Add source terms for self gravity arising from x2-flux gradient ie at left interface state…
- calculate cell centered time centered values of density, momentum, and energy using original values and fluxes
- Update time centered momentum with gravo-source terms using original density and phi (no energy source term) pdV work done in fluxes??? - not sure what is going on here??? and calculate the time centered cell centered pressure
- Calculate new fluxes from corrected interface states
- For a static potential update the momentum using the time centered density and the energy using the mass fluxes times grad phi at the cell edges