Functions

gravity/selfg.c File Reference

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.

Detailed Description

Contains functions to control solution of Poisson's equation for self-gravity.

CONTAINS PUBLIC FUNCTIONS:

Definition in file selfg.c.


Function Documentation

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.

  • dM/dt = -Div(G); G = (gg - 0.5g^2)/4; g=-Grad(Phi);

The source terms for the energy are added using the mass fluxes at cell faces, to improve conservation.

  • S_{E} = -( v)^{n+1/2} Grad{Phi}

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().

Here is the caller graph for this function:

VDFun_t selfg_init ( MeshS pM  ) 

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().

Here is the call graph for this function:

Here is the caller graph for this function: