Changes between Version 5 and Version 6 of CodeExplanation/SourceTerms


Ignore:
Timestamp:
01/11/12 18:54:56 (13 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • CodeExplanation/SourceTerms

    v5 v6  
    1515* 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
    1616* For self gravity do something slightly more complicated......
    17 [[latex($\Delta p=-\frac{\Delta t}{\Delta x} \left(F_{i+1/2}-F_{i-1/2} \right )$)]]  which is just [[latex($\dot{p} = f_{grav}$)]] where [[latex($f_{grav}=-\nabla F$)]] which requires [[latex($\nabla F=\rho \nabla \phi$)]].  Since [[latex($\nabla^2 \phi = 4\pi G (\rho-\bar{\rho})$)]] we can substitute for [[latex($\rho$)]] and we have [[latex($\nabla F = (\frac{\nabla^2\phi}{4 \pi G}+\bar{\rho}) \nabla \phi$)]] which reduces to [[latex($\nabla F=\nabla\left [\frac{1}{2} \frac{\left (\nabla \phi\right )^2}{4 \pi G}  \bar{\rho} \phi \right ]$)]] where we can identify the equivalent momentum flux as [[latex($F=\frac{1}{2} \frac{\left (\nabla \phi\right )^2}{4 \pi G} + \bar{\rho} \phi$)]]
     17[[latex($\Delta p=-\frac{\Delta t}{\Delta x} \left(F_{i+1/2}-F_{i-1/2} \right )$)]]  which is just [[latex($\dot{p} = f_{grav}$)]] where [[latex($f_{grav}=-\nabla \cdot F$)]] which requires [[latex($\nabla \cdot F=\rho \nabla \phi$)]].  Since [[latex($\nabla^2 \phi = 4\pi G (\rho-\bar{\rho})$)]] we can substitute for [[latex($\rho$)]] and we have [[latex($\nabla \cdot F = (\frac{\nabla^2\phi}{4 \pi G}+\bar{\rho}) \nabla \phi$)]] which is equivalent (in 1D) to [[latex($\nabla \cdot \left [\frac{1}{2} \frac{\left (\nabla \phi\right )^2}{4 \pi G}  + \bar{\rho} \phi \right ]$)]] where we can identify the equivalent momentum flux tensor as [[latex($F=\frac{1}{2} \frac{\left (\nabla \phi\right )^2}{4 \pi G} + \bar{\rho} \phi$)]]
     18
     19* In more than 1D, [[latex($\nabla \cdot \left [\frac{1}{2} \frac{\left (\nabla \phi : \nabla \phi \right )}{4 \pi G}  + \bar{\rho} \phi I \right ]_i =\partial_j (\partial_j \phi \partial_i \phi) +\bar{\rho} \partial_i \phi$)]]
     20
    1821* But casting it this way gives you strict momentum conservation.  If the source term were just [[latex($\nabla \phi$)]] then momentum would be conserved but since in each cell there is a factor of [[latex($\rho$)]] that currently enters, it modifies the differenced quantity from cell to cell.  In theory these all cancel but only because [[latex($\nabla^2\phi=\rho$)]]...  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.
    1922