Set boundary conditions. More...
#include "pluto.h"
Functions | |
void | Boundary (const Data *d, int idim, Grid *grid) |
void | OutflowBound (double ***q, RBox *box, int side, Grid *grid) |
void | FlipSign (int side, int type, int *vsign) |
void | ReflectiveBound (double ***q, RBox *box, int s, int side) |
void | PeriodicBound (double ***q, RBox *box, int side) |
The Boundary() function sets both internal and physical boundary conditions on one or more sides of the computational domain. It is used to fill ghost zones of both cell-centered and face-centered data arrays.
The type of boundary conditions at the leftmost or rightmost side of a given grid is specified by the integers grid[dir].lbound
or grid[dir].rbound
, respectively. When this value is different from zero, the local processor borders the physical boundary and the admissible values for lbound
or rbound
are OUTFLOW, REFLECTIVE, AXISYMMETRIC, EQTSYMMETRIC, PERIODIC, SHEARING or USERDEF. Conversely, when this value is zero (internal boundary), two neighboring processors that share the same side need to fill ghost zones by exchanging data values. This step is done here only for parallel computations on static grids.
Predefined physical boundary conditions are handled by the following functions:
Set boundary conditions on one or more sides of the computational domain.
[in,out] | d | pointer to PLUTO Data structure containing the solution array (including centered and staggered fields) |
[in] | idim | specifies on which side(s) of the computational domain boundary conditions must be set. Possible values are
|
[in] | grid | pointer to an array of grid structures. |
void FlipSign | ( | int | side, |
int | type, | ||
int * | vsign | ||
) |
Reverse the sign of vector components with respect to axis side. Depending on type, one needs to symmetrize or anti-symmetrize:
where (n) is the normal components, (p) and (t) are the transverse (or poloidal and toroidal for cylindrical and spherical coordinates) components.
[in] | side | boundary side |
[in] | type | boundary condition type |
[out] | vsign | an array of values (+1 or -1) giving the sign |
Impose zero-gradient boundary conditions on 'q' on the boundary side specified by box->side. The staggered component of magnetic field is assigned using the div.B = 0 condition in a different loop.
void PeriodicBound | ( | double *** | q, |
RBox * | box, | ||
int | side | ||
) |
Implements periodic boundary conditions.
void ReflectiveBound | ( | double *** | q, |
RBox * | box, | ||
int | s, | ||
int | side | ||
) |
Make symmetric (s = 1) or anti-symmetric (s=-1) variable profiles with respect to coordinate axis specified by box->side. The sign is set by the FlipSign() function.
[in,out] | q | a 3D flow quantity |
[in] | box | pointer to box structure |
[in] | s | an integer taking only the values +1 (symmetric profile) or -1 (antisymmetric profile) |