PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
|
Objects handling boundary conditions with ghost point schemes. More...
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::BoundaryBase > | petibm::type::Boundary |
Type definition of petibm::type::Boundary. More... | |
typedef std::shared_ptr< boundary::SingleBoundaryBase > | petibm::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... | |
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 and that of the corresponding boundary point as , then the relationship at time step between these two can be written as
and 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 is
Or for a convective boundary condition on YPLUS, the relationship will be
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.
typedef std::shared_ptr<boundary::BoundaryBase> petibm::type::Boundary |
Type definition of petibm::type::Boundary.
Please use petibm::boundary::createBoundary to create a Mesh object.
Definition at line 175 of file boundary.h.
typedef std::shared_ptr<boundary::SingleBoundaryBase> petibm::type::SingleBoundary |
Definition of type petibm::type::SingleBoundary.
Please use petibm::boundary::createSingleBoundary to create a Mesh object.
Definition at line 178 of file singleboundary.h.
PetscErrorCode petibm::boundary::createBoundary | ( | const type::Mesh & | mesh, |
const YAML::Node & | node, | ||
type::Boundary & | boundary | ||
) |
Create a Boundary object.
mesh | [in] Structured Cartesian mesh object. |
node | [in] YAML configurations. |
boundary | [out] Data object with boundary conditions. |
Definition at line 41 of file boundary.cpp.
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.
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. |
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.