SPH
Public Member Functions | Static Public Attributes | List of all members
GhostParticles Class Reference

Adds ghost particles symmetrically for each SPH particle close to boundary. More...

#include <Boundary.h>

Inheritance diagram for GhostParticles:
IBoundaryCondition Polymorphic

Public Member Functions

 GhostParticles (SharedPtr< IDomain > domain, const Float searchRadius, const Float minimalDist)
 Creates new boundary conditions. More...
 
 GhostParticles (SharedPtr< IDomain > domain, const RunSettings &settings)
 Creates new boundary conditions, using parameters specified in settings. More...
 
void setVelocityOverride (Function< Optional< Vector >(const Vector &r)> ghostVelocity)
 Specifies a functor that overrides the default velocity assinged to each ghost. More...
 
virtual void initialize (Storage &storage) override
 Applies the boundary conditions before the derivatives are computed. More...
 
virtual void finalize (Storage &storage) override
 Applies the boundary conditions after the derivatives are computed. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Static Public Attributes

static constexpr Size FLAG = Size(-1)
 Special flag denoting ghost particles. More...
 

Detailed Description

Adds ghost particles symmetrically for each SPH particle close to boundary.

All physical quantities are copied on them. This acts as a natural boundary for SPH particles without creating unphysical gradients due to discontinuity.

Definition at line 71 of file Boundary.h.

Constructor & Destructor Documentation

◆ GhostParticles() [1/2]

NAMESPACE_SPH_BEGIN GhostParticles::GhostParticles ( SharedPtr< IDomain domain,
const Float  searchRadius,
const Float  minimalDist 
)

Creates new boundary conditions.

Parameters
domainSelected computational domain; particles close to the boundary will spawn ghosts.
searchRadiusRadius of a single particle, in units of smoothing length.
minimalDistMinimal allowed distance between a particle and its ghost.

Definition at line 19 of file Boundary.cpp.

◆ GhostParticles() [2/2]

GhostParticles::GhostParticles ( SharedPtr< IDomain domain,
const RunSettings settings 
)

Creates new boundary conditions, using parameters specified in settings.

Definition at line 26 of file Boundary.cpp.

Member Function Documentation

◆ finalize()

void GhostParticles::finalize ( Storage storage)
overridevirtual

Applies the boundary conditions after the derivatives are computed.

Called every time step after equations are evaluated (finalized).

Implements IBoundaryCondition.

Definition at line 104 of file Boundary.cpp.

◆ initialize()

void GhostParticles::initialize ( Storage storage)
overridevirtual

Applies the boundary conditions before the derivatives are computed.

Called every time step after equations are initialized.

Implements IBoundaryCondition.

Definition at line 33 of file Boundary.cpp.

◆ setVelocityOverride()

void GhostParticles::setVelocityOverride ( Function< Optional< Vector >(const Vector &r)>  ghostVelocity)

Specifies a functor that overrides the default velocity assinged to each ghost.

By default, the velocity of a ghost is mirrored with a respect to the boundary; the tangential conponents of the velocities of the particle and the corresponding ghost are equal. The provided function may return a different velocity to obtain different boundary condition at different parts of the boundary, for example it may return zero velocity to create friction between the particles and the boundary.

Parameters
ghostVelocityFunctor taking ghost position as parameter and returning velocity assigned to the ghost or NOTHING to assign the default velocity.

Definition at line 100 of file Boundary.cpp.

Member Data Documentation

◆ FLAG

constexpr Size GhostParticles::FLAG = Size(-1)
staticconstexpr

Special flag denoting ghost particles.

Definition at line 74 of file Boundary.h.

◆ minimalDist

Float GhostParticles::minimalDist

Definition at line 84 of file Boundary.h.

◆ searchRadius

Float GhostParticles::searchRadius

Definition at line 83 of file Boundary.h.


The documentation for this class was generated from the following files: