PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
Boundaries and boundary conditions

Objects handling boundary conditions with ghost point schemes. More...

Collaboration diagram for Boundaries and boundary conditions:

Namespaces

namespace  petibm::boundary
 A collection of all boundary-related objects and functions.
 

Classes

class  petibm::boundary::BoundaryBase
 Base (abstract) class for the whole boundary. More...
 
class  petibm::boundary::BoundarySimple
 An implementation of petibm::boundary::BoundaryBase. More...
 
class  petibm::boundary::SingleBoundaryBase
 Base (abstract) class for ghost points & BC on a single boundary. More...
 
class  petibm::boundary::SingleBoundaryConvective
 An implementation of SingleBoundaryBase for convective BC. More...
 
class  petibm::boundary::SingleBoundaryDirichlet
 An implementation of SingleBoundaryBase for Dirichlet BC. More...
 
class  petibm::boundary::SingleBoundaryNeumann
 An implementation of SingleBoundaryBase for Neumann BC. More...
 
class  petibm::boundary::SingleBoundaryPeriodic
 An implementation of SingleBoundaryBase for periodic BC. More...
 

Typedefs

typedef std::shared_ptr< boundary::BoundaryBasepetibm::type::Boundary
 Type definition of petibm::type::Boundary. More...
 
typedef std::shared_ptr< boundary::SingleBoundaryBasepetibm::type::SingleBoundary
 Definition of type petibm::type::SingleBoundary. More...
 

Functions

PetscErrorCode petibm::boundary::createBoundary (const type::Mesh &mesh, const YAML::Node &node, type::Boundary &boundary)
 Create a Boundary object. More...
 
PetscErrorCode petibm::boundary::createSingleBoundary (const type::Mesh &mesh, const type::BCLoc &loc, const type::Field &field, const PetscReal &value, const type::BCType &bcType, type::SingleBoundary &singleBd)
 Factory function for creating a SingleBoundary object. More...
 

Detailed Description

Objects handling boundary conditions with ghost point schemes.

This module contains objects handling boundary conditions using ghost point schemes. The concept is that each petibm::type::SingleBoundary holds the information of the ghost points and corresponding boundary points on a geometrical boundary. A petibm::type::SingleBoundary also holds the information of the relationship between a ghost point and its corresponding target point. The so called "relationship" means the coefficients of the math equation connecting ghost points and the corresponding points. If we denote the u velocity of a ghost point as $u_g$ and that of the corresponding boundary point as $u_b$, then the relationship at time step $t$ between these two can be written as

\[u_g^t = a_0 \times u_b^t + a_1\]

$a_0$ and $a_1$ are coefficients that depends on the types of boundary conditions and also the location of the boundaries. For example, on a staggered grid, the relationship of a ghost point and its corresponding boundary point on XPLUS with Dirichlet boundary condition at time step $t$ is

\[u_g^t = 0 \times u_b^t + U_{Dirichlet}(t, y, z)\]

Or for a convective boundary condition on YPLUS, the relationship will be

\[ u_g^t = -1.0 \times u_b^t + \left(u_g^{t-1} + u_b^{t-1} - 2.0 * \Delta t * U_c\frac{u_g^{t-1} - u_b^{t-1}}{\Delta L}\right) \]

The data in a petibm::type::SingleBoundary are only distributed to the processes owing ghost points on this boundary. And a member function of a petibm::type::SingleBoundary is called only on these processes. Except the corners, different petibm::type::SingleBoundary are normally owned by different process sets, so their member functions can be called concurrently.

While a petibm::type::SingleBoundary represents a single geometric boundary, a petibm::type::Boundary represents a collection of all petibm::type::SingleBoundary in a domain. For example, a petibm::type::Boundary of a 2D Cartesian mesh will have 4 petibm::type::SingleBoundary in it. The design is, API users should use the member functions in a petibm::type::Boundary to launch the functions of all petibm::type::SingleBoundary in parallel. This can reduce the idle time of CPU cores when doing something regarding boundaries.

See also
petibm::type::Boundary, petibm::boundary::createBoundary

Typedef Documentation

◆ Boundary

◆ SingleBoundary

Function Documentation

◆ createBoundary()

PetscErrorCode petibm::boundary::createBoundary ( const type::Mesh mesh,
const YAML::Node &  node,
type::Boundary boundary 
)

Create a Boundary object.

Parameters
mesh[in] Structured Cartesian mesh object.
node[in] YAML configurations.
boundary[out] Data object with boundary conditions.
See also
Boundaries and boundary conditions, petibm::type::Boundary

Definition at line 41 of file boundary.cpp.

◆ createSingleBoundary()

PetscErrorCode petibm::boundary::createSingleBoundary ( const type::Mesh mesh,
const type::BCLoc loc,
const type::Field field,
const PetscReal &  value,
const type::BCType bcType,
type::SingleBoundary singleBd 
)

Factory function for creating a SingleBoundary object.

Parameters
mesh[in] a Mesh instance.
loc[in] the location of the target boundary.
field[in] the target field.
value[in] BC value.
bcType[in] Type of the BC.
singleBd[out] resulting SingleBoundary object.
Returns
PetscErrorCode.
See also
Boundaries and boundary conditions, petibm::type::SingleBoundarym petibm::boundary::createBoundary

This is generally not used by API users. API users normally only need to use petibm::boundary::createBoundary.

Definition at line 19 of file singleboundary.cpp.