Details
gfs_relax ()
Apply one pass of a Jacobi relaxation to all the leaf cells of
domain with a level inferior or equal to max_depth and to all the
cells at level max_depth. The relaxation should converge (if the
right-hand-side rhs verifies the solvability conditions) toward
the solution of a Poisson equation for u at the maximum depth.
gfs_residual ()
For each cell of domain, computes the sum of the residual over
the volume of the cell for a Poisson equation with u as
left-hand-side and rhs as right-hand-side. Stores the result in
res.
gfs_poisson_coefficients ()
Initializes the face coefficients for the Poisson equation.
gfs_poisson ()
Apply one multigrid iteration to the Poisson equation defined by u
and rhs.
The initial value of GFS_RES on the leaves of root must be set to
the residual of the Poisson equation (using gfs_residual()).
The face coefficients must be set using gfs_poisson_coefficients().
The values of u on the leaf cells are updated as well as the values
of GFS_RES (i.e. the cell tree is ready for another iteration).
gfs_correct_normal_velocities ()
Corrects the velocity normal to face with the gradient of the
pressure in the corresponding direction.
Also adds half this gradient to the corresponding GFS_G variable of
the cells on either sides of the face. If this function is called
for each face of a domain, the GFS_G variables in each cell will
then contain the (interpolated) value of the pressure gradient.
This functions assumes that the face coefficients for the Poisson
problem have been initialized using gfs_poisson_coefficients().
gfs_correct_centered_velocity ()
(Half) Corrects the centered velocity in each cell on either side
of face with the pressure gradient. For the correction to be
complete, this function has to be called for each face of the
domain.
struct GfsProjectionParams
struct GfsProjectionParams {
gdouble tolerance;
guint nrelax;
guint minlevel;
guint nitermax;
guint niter;
GfsNorm residual_before, residual;
}; |
gfs_projection_params_init ()
gfs_projection_params_read ()
gfs_projection_params_write ()
Writes in fp a text representation of the projection parameters
par.
gfs_mac_projection ()
Corrects the face-centered velocity field (MAC field) on the leaf
level of domain using an exact (MAC) projection. The resulting
face-centered velocity field is (almost) exactly divergence
free. The (potential) pressure field is also obtained as a
by-product as well as its gradient at the center of the leaf cells
of the domain (the gradient is stored in the GFS_G variables and is
obtained by simple averaging from the face values to the center).
The residual field of the par projection parameters is set to the
norm of the residual after the projection. The niter field of the
par projection parameters is set to the number of iterations
performed to solve the Poisson equation. The other projection
parameters are not modified.
gfs_approximate_projection ()
Corrects the centered velocity field on the leaf level of domain
using an approximate projection. The resulting centered velocity
field is approximately divergence free. The (potential) pressure
field is also obtained as a by-product.
The residual field of the par projection parameters is set to the
norm of the residual (on the MAC grid) after the projection. The
niter field of the par projection parameters is set to the number
of iterations performed to solve the Poisson equation. The other
projection parameters are not modified.
The Poisson equation for the pressure is first solved on a MAC grid
where the MAC velocities are obtained from the centered velocities
by simple averaging. The resulting pressure gradients (defined on
the faces) are then averaged down on the center of the cells to
correct the centered velocity.
gfs_domain_norm_residual ()
Traverses the domain defined by domain using gfs_domain_cell_traverse()
and gathers norm statistics about the volume weighted relative residual
(i.e. the sum of the residual over the volume defined by each cell
divided by the total volume of the cell).