MPS-Basic
Loading...
Searching...
No Matches
SurfaceDetector::NumberDensity Class Reference

Detects free surface based on the number density. More...

#include <number_density.hpp>

Inheritance diagram for SurfaceDetector::NumberDensity:
Collaboration diagram for SurfaceDetector::NumberDensity:

Public Member Functions

bool isFreeSurface (const Particles &particles, const Particle &particle) override
 Whether the particle is on the free surface.
 
 ~NumberDensity () override
 
 NumberDensity (double thresholdRatio, double n0)
 
- Public Member Functions inherited from SurfaceDetector::Interface
virtual ~Interface ()=default
 

Private Attributes

double thresholdRatio
 threshold ratio for number density
 
double n0
 reference value for number density
 

Detailed Description

Detects free surface based on the number density.

Surface detection method for standard MPS method. When the number density of the particle is lower than the thresholdRatio * n0, the particle is considered to be on the free surface. A thresholdRatio value of 0.95 to 0.97 is recommended as a rule of thumb (Koshizuka and Oka, 1996).

Definition at line 12 of file number_density.hpp.

Constructor & Destructor Documentation

◆ ~NumberDensity()

NumberDensity::~NumberDensity ( )
override

Definition at line 9 of file number_density.cpp.

9 {
10}

◆ NumberDensity()

NumberDensity::NumberDensity ( double thresholdRatio,
double n0 )

Definition at line 12 of file number_density.cpp.

12 {
14 this->n0 = n0;
15}
double thresholdRatio
threshold ratio for number density
double n0
reference value for number density

Member Function Documentation

◆ isFreeSurface()

bool NumberDensity::isFreeSurface ( const Particles & particles,
const Particle & particle )
overridevirtual

Whether the particle is on the free surface.

Parameters
particlesparticles
particleparticle inside the particles
Returns
Whether the particle is on the free surface

Implements SurfaceDetector::Interface.

Definition at line 5 of file number_density.cpp.

5 {
6 return particle.numberDensity < thresholdRatio * n0;
7}
double numberDensity
number density of the particle
Definition particle.hpp:59

Member Data Documentation

◆ thresholdRatio

double SurfaceDetector::NumberDensity::thresholdRatio
private

threshold ratio for number density

Definition at line 19 of file number_density.hpp.

◆ n0

double SurfaceDetector::NumberDensity::n0
private

reference value for number density

Definition at line 20 of file number_density.hpp.


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