Changes between Version 14 and Version 15 of u/erica/PoissonPlusHydro


Ignore:
Timestamp:
09/16/13 12:27:12 (11 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/PoissonPlusHydro

    v14 v15  
    5151= Update Formulas =
    5252
     53To solve the first source term ODE,
    5354
     55[[latex($\frac{d}{dt}(\rho u) = - \rho \triangledown \phi$)]]
    5456
     57replace with discrete derivatives,
    5558
     59[[latex($\frac{(\rho u)_i^{n+1} - (\rho u)_i ^{n+1/2}}{dt} = -\frac{\rho_i^{n+1/2}(\phi_{i+1}^{n+1/2}- \phi_i^{n+1/2})}{dx}$)]]
    5660
     61which becomes,
     62
     63[[latex($\frac{\rho_i^{n+1}(u_i^{n+1} - u_i^{n+1/2})}{dt} = -\frac{\rho_i^{n+1/2}(\phi_{i+1}^{n+1/2}- \phi_i^{n+1/2})}{dx}$)]]
     64
     65since
     66
     67[[latex($\rho_i^{n+1} = \rho_i^{n+1/2}$)]]
     68
     69we can just cancel the rho's and solve for the updated u,
     70
     71[[latex($u_i^{n+1}=-\frac{dt}{dx}[\phi_{i+1}^{n+1/2}-\phi_i^{n+1/2} ] + u_i^{n+1/2}$)]]
     72
     73This 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
     74
     75[[latex($f(i)=4 \pi G (\rho_i^{n+1/2} - \bar{\rho})$)]]
     76
     77and boundary conditions
     78
     79[[latex($\phi(0) = \phi(mx), ~\phi(mx+1) = \phi(1)$)]]
     80
     81To solve the 2nd source term ODE,