Changes between Version 66 and Version 67 of SelfGravityDevel


Ignore:
Timestamp:
10/24/19 11:31:17 (5 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • SelfGravityDevel

    v66 v67  
    22
    33== Physics ==
    4 === Poisson Equation of Self Gravity ===
     4=== Equations of Self Gravity ===
    55
    66The inclusion of self gravity involves an additional force to the momentum equation
     
    88[[latex($\frac{d \rho \mathbf{v}}{dt} = \mathbf{f}_g = -\rho \nabla \phi$)]]
    99
    10 and the energy equation now includes the gravitational self-energy on the left
     10and the energy equation now includes the work done by gravity
    1111
    1212[[latex($\frac{d E}{dt} = \mathbf{v} \cdot \mathbf{f}_g = -\rho \mathbf{v} \cdot \nabla \phi$)]]
     
    2222
    2323
     24== Making the equations conservative ==
     25
    2426AstroBEAR uses hypre's linear solver to solve Poisson's equation for the potential.  However, there are two methods for including the source terms for momentum and energy.  The non-conservative approach simply includes the terms during a source update, while the conservative approach recasts the RHS of the momentum and energy equations as total divergences - so they can be differenced conservatively.
    2527
    2628Substituting the Poisson equation into the momentum equation we have after some manipulations
    2729
    28 
    29 [[latex($\frac{d \rho \mathbf{v}}{dt} = (\frac{\nabla^2\phi}{4 \pi G}+\rho_0) \nabla \phi = \nabla \cdot \left [ \frac{1}{4 \pi G} \left ( \nabla \phi \nabla \phi - \frac{1}{2} \left ( \nabla \phi \cdot \nabla \phi \right) + \rho_0 \phi \right ) \right ]$)]]
     30[[latex($\frac{d \rho \mathbf{v}}{dt} = (\frac{\nabla^2\phi}{4 \pi G}+\rho_0) \nabla \phi = \nabla \cdot \left [ \frac{1}{4 \pi G} \left ( \nabla \phi \nabla \phi - \frac{1}{2} \mathbf{I} \left ( \nabla \phi \cdot \nabla \phi \right) \right ) + \rho_0 \phi  \mathbf{I} \right ]$)]]
    3031
    3132where we have the momentum flux tensor
    3233
    33 [[latex($\mathbf{T} =  \frac{1}{4 \pi G} \left ( \nabla \phi \nabla \phi - \frac{1}{2} \left ( \nabla \phi \cdot \nabla \phi + 4 \pi G \rho_0 \phi \right) \right )$)]]
    34 
    35 
     34[[latex($\mathbf{T} =  \frac{1}{4 \pi G} \left ( \nabla \phi \nabla \phi - \frac{1}{2}\mathbf{I} \left ( \nabla \phi \cdot \nabla \phi \right) \right) + \rho_0 \phi \mathbf{I}$)]]
    3635
    3736
     
    7574
    7675[[latex($\mathbf{F_g} = \phi \rho \mathbf{v} + \frac{1}{8 \pi G} \left (\phi \nabla \dot{\phi} - \dot{\phi}\nabla \phi \right) $)]]
     76
     77== Solving for $\dot{\phi}$ ==
     78
     79
     80Now to solve for $\dot{\phi}$ we can solve directly
     81
     82$\nabla^2 \dot{\phi} = 4 \pi G \dot{\rho} = 4 \pi G \left ( \frac{\rho^{n+1} - \rho^n}{\Delta t} \right )$
     83
     84or we can simply wait until we have solved for the new potential based on the updated density
     85
     86$\nabla^2 \phi^{n+1} = 4 \pi G \rho^{n+1}$
     87
     88and then use
     89
     90$\dot{\phi} = \frac{\phi^{n+1} - \phi^n}{\Delta t}$
     91
     92to apply the energy correction.
     93
     94== Currently what is done in AstroBEAR ==
     95
     96AstroBEAR's momentum flux is first calculated using
     97
     98[[latex($\mathbf{T^n} =  \frac{1}{4 \pi G} \left ( \nabla \phi^n \nabla \phi^n - \frac{1}{2} \mathbf{I} \left ( \nabla \phi^n \cdot \nabla \phi^n \right ) + \rho_0 \phi^n \mathbf{I} \right )$)]]
     99
     100Where $\phi^{n}$ is used and everything is calculated at cell faces. 
     101
     102Then the energy is updated using
     103
     104[[latex($E^{n+1} = E^n - \rho \mathbf{v} \cdot \nabla \phi$)]]
     105
     106where each component in the sum $\rho \mathbf{v} \cdot \nabla \phi$ is averaged at the left and right face for each dimension.
     107
     108Then following the second elliptic solve, the momentum is updated again by calculating the difference between the original momentum flux tensor $\mathbf{T}$ and the time centered one $\mathbf{T}^{n+1/2} = \mathbf{T}^n + \frac{1}{2} \left ( \mathbf{T}^{n+1} - \mathbf{T}^n \right)$
     109
     110And a corrective momentum flux tensor is calculated
     111
     112[[latex($\mathbf{T'} = \frac{1}{2} \left (T^{n+1} - T^n \right )$)]]
     113
     114and applied.
     115
     116
    77117
    78118