wiki:u/erica/PoissonPlusHydro

Version 13 (modified by Erica Kaminski, 11 years ago) ( diff )

Splitting Method

The non-homogenous 1D Euler equations with self-gravity are given by

which in short hand notation is

where is vector of fluid variables, is their fluxes, and is the source-term vector.

To solve this system of equations, we can employ operator splitting, which is analagous to the procedure for splitting the higher dimensional Euler equations (as I did for 2D — see wiki page).

It is basically as follows, first solve the homogenous equations,

with initial condition for the grid,

over a time-step dt (found by usual CFL condition for upwind Godunov scheme). This gives the solution,

Next, solve the equation for the source-term (again over time interval dt),

with initial condition

This gives the solution for the complete time-step,

Given the ODE's for the 'source' step only involve equations for momentum and energy, we conclude that only u and E change over this step (density does not).

Thus, a schematic is as follows,

Data time level n Hydro step

Source step

Boundary Conditions

To test my code with the Jeans instability test, I used periodic boundary conditions on the box and the poisson solver. For periodic BCs on the elliptic solver, this required subtracting off the mean density from the vector for rho, and using this as the source function.

Code Outline

  1. Sets up problem scales
  2. Initializes the grid with the prescribed perturbations for Jeans instability
  3. Sets boundary conditions on box
  4. Finds max speed and uses CFL condition to get dt
  5. Takes a hydro step; i.e. solves the local Riemann problem, gets fluxes, updates cells
  6. Takes a source step, finds the mean of the density distribution, sets up the source term vector f=4 Pi G (rho-rhoavg), sends to the Jacobi solver, finds the solution for the gravitational potential phi, using phi, updates the velocity and energy of the cells
  7. Updates time and checks whether tfinal has been reached
  8. Sets boundary conditions on box
  9. Gets dt

Update Formulas

Note: See TracWiki for help on using the wiki.