Self Gravity
Physics
Equations of Self Gravity
The inclusion of self gravity involves an additional force to the momentum equation
and the energy equation now includes the work done by gravity
and requires the solution for the gas potential
where
- for periodic boundary conditions
- otherwise.
Making the equations conservative
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.
Substituting the Poisson equation into the momentum equation we have after some manipulations
where we have the momentum flux tensor
For the energy equation, we can only find a conservative approach - if we consider the evolution of the total combined energy (hydro + gravitational).
Combining this with the our previous energy equation we arrive at
Expanding the time derivative and using the continuity equation, we arrive at
Now from time differencing the poisson equation, we arrive at
and multiplying both sides by
gives
Adding the LHS and subtracting the RHS and substituting
into the divergence equation gives us
Now we can use the relationship
to arrive at
Solving for
Now to solve for
we can solve directly
or we can simply wait until we have solved for the new potential based on the updated density
and then use
to apply the energy correction.
Currently what is done in AstroBEAR
AstroBEAR's momentum flux is first calculated using
Where
is used and everything is calculated at cell faces.Then the energy is updated using
where each component in the sum
is averaged at the left and right face for each dimension.Then following the second elliptic solve, the momentum is updated again by calculating the difference between the original momentum flux tensor
and the time centered oneAnd a corrective momentum flux tensor is calculated
and applied.
Likewise, a energy source term correction is applied
Notes
The electric field generated by a point charge
isOn the other hand, the gravitational acceleration by a point mass of
is
The Poisson equation for electrostatic potential
is
Analytically we can get the Poisson equation for the gravity
where
is the mass density. This equation describes how the potential is determined by the mass density distribution.
For example, consider the uniform density distribution
Use spherical coordinates, the Poisson equation for the density distribution Equation (1) can be written as
Or
Solving Equation (3) with the density Equation (2), we obtain the solution for the potential for the uniform density sphere:
Free-fall Time
The free-fall time is the characteristic time that would take a body to collapse under its own gravitational attraction, if no other forces existed to oppose the collapse. Using Gauss's theorem, the gravitational acceleration
is given bywhere
is the mass insideSo the equation of motion for a gas molecule under a control of the self-gravity can be written as
Equation (7) can be written as the form of the conservation of mechanical energy
Suppose the gas molecule is initially located at
. So the total energyNow consider gas collapse. So
. Equation (8) gives
Let
From the initial state we have
. So Equation (10) reduces toSolve Equation (12) we have
Let
or . we have the free-fall timewhere
is the average density of the gas.
Implementation
Uniform Density Cloud
In this section we consider the problem of the collapse of a pressureless (
), uniform, initially motionless cloud which has an analytic solution.
The definition of
in Equation (11) can also be written asFrom Equations (13) and (14) we have
Equation (17) describes the time it takes for the cloud to collapse to a density
.
Boundary Conditions
Present Considerations
Some notes on periodic BC's and particles
With periodic boundary conditions, we would like the total potential to be unchanged under the conversion of gas to particle. This requires adjusting the particle potential so that it has the same constant of integration as well as being periodic. When hypre solves for the potential, the constant of integration is a free parameter and I believe hypre adjusts it so that
. To calculate the potential of a point charge, we need the Greens function corresponding towhere D is the dimenesion of the problem. For 3D,
and for 2D,
and for 1D,
Now with periodic BC's, the solution to the gas potential is given by
, so the solution to the potential would actually be given by where is the mass of the particle. Note this is not the same as using mirror versions of the particle… An easier way to solve this however, is to use fourier transforms.
with . Now is just the fourier transform of a delta function times the mass, which is , so and
This can be discretized as
This still requires summation over many wave numbers - although the higher wave numbers have less impact because of the
dependence. However in 2D this is lessened because there are more wave vectors in each anuli, and in 3D there is equal power in each shell. This then, becomes an order N6 operation![]()
Solutions:
- Don't ever use sink potential?
- Don't use sink potential to update gas potential
- Solve for gas potential after accretion?