Contains functions to control solution of Poisson's equation for self-gravity. More...
Go to the source code of this file.
Functions | |
void | selfg_fc (DomainS *pD) |
Adds flux-correction to make the integration algorithms for the source terms in the momentum and energy equations second-order. | |
VDFun_t | selfg_init (MeshS *pM) |
Initialize pointer to appropriate self-gravity f'n, allocates memory for dPhi array used for flux correction. |
Contains functions to control solution of Poisson's equation for self-gravity.
CONTAINS PUBLIC FUNCTIONS:
Definition in file selfg.c.
void selfg_fc | ( | DomainS * | pD | ) |
Adds flux-correction to make the integration algorithms for the source terms in the momentum and energy equations second-order.
This requires subtracting 1/2 the source terms computed with the old potential, and adding 1/2 the source terms computed with the new potential.
The source terms for momentum are computed using the divergence of the gravitational stress tensor to conserve momentum exactly.
The source terms for the energy are added using the mass fluxes at cell faces, to improve conservation.
Definition at line 39 of file selfg.c.
References dim, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, four_pi_G, grav_mean_rho, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, GridS::Nx, GridS::Phi, GridS::Phi_old, GridS::U, GridS::x1MassFlux, GridS::x2MassFlux, and GridS::x3MassFlux.
Referenced by main().
Initialize pointer to appropriate self-gravity f'n, allocates memory for dPhi array used for flux correction.
Definition at line 507 of file selfg.c.
References ath_error(), dim, four_pi_G, grav_mean_rho, MeshS::Nx, selfg_fft_2d_init(), selfg_fft_3d_init(), selfg_fft_obc_3d_init(), and selfg_multig_3d_init().
Referenced by main().