Version 6 (modified by 13 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,
- 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.
- Also athena stores combined kinetic/thermal/magnetic with gravitational… So . This results in so the energy source term for self gravity can be written as a total divergence. We need at cell edges, but is available from the mass flux and can be averaged using adjacent cells.
- 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
Note:
See TracWiki
for help on using the wiki.