Changes between Version 66 and Version 67 of SelfGravityDevel
- Timestamp:
- 10/24/19 11:31:17 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SelfGravityDevel
v66 v67 2 2 3 3 == Physics == 4 === Poisson Equationof Self Gravity ===4 === Equations of Self Gravity === 5 5 6 6 The inclusion of self gravity involves an additional force to the momentum equation … … 8 8 [[latex($\frac{d \rho \mathbf{v}}{dt} = \mathbf{f}_g = -\rho \nabla \phi$)]] 9 9 10 and the energy equation now includes the gravitational self-energy on the left10 and the energy equation now includes the work done by gravity 11 11 12 12 [[latex($\frac{d E}{dt} = \mathbf{v} \cdot \mathbf{f}_g = -\rho \mathbf{v} \cdot \nabla \phi$)]] … … 22 22 23 23 24 == Making the equations conservative == 25 24 26 AstroBEAR 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. 25 27 26 28 Substituting the Poisson equation into the momentum equation we have after some manipulations 27 29 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 ]$)]] 30 31 31 32 where we have the momentum flux tensor 32 33 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}$)]] 36 35 37 36 … … 75 74 76 75 [[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 80 Now 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 84 or 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 88 and then use 89 90 $\dot{\phi} = \frac{\phi^{n+1} - \phi^n}{\Delta t}$ 91 92 to apply the energy correction. 93 94 == Currently what is done in AstroBEAR == 95 96 AstroBEAR'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 100 Where $\phi^{n}$ is used and everything is calculated at cell faces. 101 102 Then the energy is updated using 103 104 [[latex($E^{n+1} = E^n - \rho \mathbf{v} \cdot \nabla \phi$)]] 105 106 where each component in the sum $\rho \mathbf{v} \cdot \nabla \phi$ is averaged at the left and right face for each dimension. 107 108 Then 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 110 And a corrective momentum flux tensor is calculated 111 112 [[latex($\mathbf{T'} = \frac{1}{2} \left (T^{n+1} - T^n \right )$)]] 113 114 and applied. 115 116 77 117 78 118