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
Update Formulas
To solve the first source term ODE,
replace with discrete derivatives,
which becomes,
since
we can just cancel the rho's and solve for the updated u,
This requires a dt (which is the same for the hydro step, solved using the CFL condition), and a gravitational potential phi. Phi is solved using the Jacobi solver, with the source function given by
and boundary conditions
To solve the 2nd source term ODE,
replace with discrete derivatives,
I am not exactly sure which time level to use for u (n+1 or n+½).
Rearranging for the updated version of the energy, we have,