MPS-Basic
Loading...
Searching...
No Matches
Particle Class Reference

Class for particle in MPS method. More...

#include <particle.hpp>

Public Member Functions

 Particle (int id, ParticleType type, Eigen::Vector3d pos, Eigen::Vector3d vel, double density, int fluidType=0)
 constructor
 
double inverseDensity () const
 calculate inverse of density for collision
 

Public Attributes

int id
 index of the particle
 
ParticleType type
 type of the particle
 
int fluidType = 0
 
Eigen::Vector3d position
 position of the particle
 
Eigen::Vector3d velocity
 velocity of the particle
 
Eigen::Vector3d acceleration = Eigen::Vector3d::Zero()
 acceleration of the particle
 
double pressure = 0
 pressure of the particle
 
double numberDensity = 0
 number density of the particle
 
double density = 0
 density of the particle. It is used only for fluid and wall particles.
 
FluidState boundaryCondition = FluidState::Ignored
 boundary condition of the particle
 
double sourceTerm = 0
 source term of the particle
 
double minimumPressure = 0
 minimum pressure of the particle
 
std::vector< Neighborneighbors
 neighbors of the particle
 

Detailed Description

Class for particle in MPS method.

Definition at line 47 of file particle.hpp.

Constructor & Destructor Documentation

◆ Particle()

Particle::Particle ( int id,
ParticleType type,
Eigen::Vector3d pos,
Eigen::Vector3d vel,
double density,
int fluidType = 0 )

constructor

Parameters
idindex of the particle
typetype of the particle
posposition of the particle
velvelocity of the particle
densitydensity of the particle
fluidTypetype of the fluid (optional). Default value is 0.

Definition at line 3 of file particle.cpp.

3 {
4 this->id = id;
5 this->type = type;
6 this->position = pos;
7 this->velocity = vel;
8 this->density = density;
9 this->fluidType = fluidType;
10}
int fluidType
Definition particle.hpp:52
Eigen::Vector3d position
position of the particle
Definition particle.hpp:55
int id
index of the particle
Definition particle.hpp:50
double density
density of the particle. It is used only for fluid and wall particles.
Definition particle.hpp:60
Eigen::Vector3d velocity
velocity of the particle
Definition particle.hpp:56
ParticleType type
type of the particle
Definition particle.hpp:51

Member Function Documentation

◆ inverseDensity()

double Particle::inverseDensity ( ) const

calculate inverse of density for collision

Returns
inverse of density
Warning
This function returns 0 for wall particles. This is because we don't want to move wall particles in the collision process. You should not use this function outside of the collision process. If you want to, you should change this function name correctly.

Definition at line 12 of file particle.cpp.

12 {
13 switch (type) {
15 return 1 / this->density;
16
20 default:
21 return 0;
22 }
23}
@ Ghost
Ghost particle (outside of the domain, not used for calculation)
@ Wall
Wall particle.
@ DummyWall
Dummy wall particle (pressure is not calculated)
@ Fluid
Fluid particle.
Here is the caller graph for this function:

Member Data Documentation

◆ id

int Particle::id

index of the particle

Definition at line 50 of file particle.hpp.

◆ type

ParticleType Particle::type

type of the particle

Definition at line 51 of file particle.hpp.

◆ fluidType

int Particle::fluidType = 0

type of the fluid. This is used for simulation of multiple fluid types. When treating only one fluid, this property is not used. Default value is 0.

Definition at line 52 of file particle.hpp.

◆ position

Eigen::Vector3d Particle::position

position of the particle

Definition at line 55 of file particle.hpp.

◆ velocity

Eigen::Vector3d Particle::velocity

velocity of the particle

Definition at line 56 of file particle.hpp.

◆ acceleration

Eigen::Vector3d Particle::acceleration = Eigen::Vector3d::Zero()

acceleration of the particle

Definition at line 57 of file particle.hpp.

◆ pressure

double Particle::pressure = 0

pressure of the particle

Definition at line 58 of file particle.hpp.

◆ numberDensity

double Particle::numberDensity = 0

number density of the particle

Definition at line 59 of file particle.hpp.

◆ density

double Particle::density = 0

density of the particle. It is used only for fluid and wall particles.

Definition at line 60 of file particle.hpp.

◆ boundaryCondition

FluidState Particle::boundaryCondition = FluidState::Ignored

boundary condition of the particle

Definition at line 62 of file particle.hpp.

◆ sourceTerm

double Particle::sourceTerm = 0

source term of the particle

Definition at line 63 of file particle.hpp.

◆ minimumPressure

double Particle::minimumPressure = 0

minimum pressure of the particle

Definition at line 64 of file particle.hpp.

◆ neighbors

std::vector<Neighbor> Particle::neighbors

neighbors of the particle

Definition at line 66 of file particle.hpp.


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