MPS-Basic
Loading...
Searching...
No Matches
PressureCalculator::Implicit Class Reference

Class for implicit pressure calculation. More...

#include <implicit.hpp>

Inheritance diagram for PressureCalculator::Implicit:
Collaboration diagram for PressureCalculator::Implicit:

Public Member Functions

std::vector< double > calc (Particles &particles) override
 calculate pressure
 
 ~Implicit () override
 
 Implicit (int dimension, double particleDistance, double re_forGradient, double re_forLaplacian, double dt, double compressibility, double relaxationCoefficient, std::unique_ptr< DirichletBoundaryConditionGenerator::Interface > &&dirichletBoundaryConditionGenerator)
 
- Public Member Functions inherited from PressureCalculator::Interface
virtual ~Interface ()
 destructor
 

Private Member Functions

void removeNegativePressure ()
 remove negative pressure for stability
 

Private Attributes

Particles particles
 
std::vector< double > pressure
 Solution of pressure calculation.
 
std::unique_ptr< DirichletBoundaryConditionGenerator::InterfacedirichletBoundaryConditionGenerator
 
PressurePoissonEquation pressurePoissonEquation
 

Detailed Description

Class for implicit pressure calculation.

This class has a Dirichlet boundary condition generator and a pressure Poisson solver. The generator is used within the pressure calculation process and the generated boundary condition is attached to the pressure Poisson equation.

Definition at line 21 of file implicit.hpp.

Constructor & Destructor Documentation

◆ ~Implicit()

Implicit::~Implicit ( )
override

Definition at line 48 of file implicit.cpp.

48 {
49}

◆ Implicit()

Implicit::Implicit ( int dimension,
double particleDistance,
double re_forGradient,
double re_forLaplacian,
double dt,
double compressibility,
double relaxationCoefficient,
std::unique_ptr< DirichletBoundaryConditionGenerator::Interface > && dirichletBoundaryConditionGenerator )

Definition at line 13 of file implicit.cpp.

22 {
23 auto refValuesForNumberDensity = RefValues(dimension, particleDistance, reForNumberDensity);
24 auto refValuesForLaplacian = RefValues(dimension, particleDistance, reForLaplacian);
26 this->pressurePoissonEquation = PressurePoissonEquation(
27 dimension,
28 dt,
29 relaxationCoefficient,
30 compressibility,
31 refValuesForNumberDensity.n0,
32 refValuesForLaplacian.n0,
33 refValuesForLaplacian.lambda,
34 reForLaplacian,
35 reForNumberDensity
36 );
37}
PressurePoissonEquation pressurePoissonEquation
Definition implicit.hpp:45
std::unique_ptr< DirichletBoundaryConditionGenerator::Interface > dirichletBoundaryConditionGenerator
Definition implicit.hpp:44
Struct for reference values of MPS method.
Definition refvalues.hpp:8

Member Function Documentation

◆ calc()

std::vector< double > Implicit::calc ( Particles & particles)
overridevirtual

calculate pressure

Parameters
particlesparticles

Implements PressureCalculator::Interface.

Definition at line 39 of file implicit.cpp.

39 {
40 auto dirichletBoundaryCondition = dirichletBoundaryConditionGenerator->generate(particles);
41 this->pressurePoissonEquation.setup(particles, dirichletBoundaryCondition);
44
45 return this->pressure;
46}
void removeNegativePressure()
remove negative pressure for stability
Definition implicit.cpp:51
std::vector< double > pressure
Solution of pressure calculation.
Definition implicit.hpp:43
std::vector< double > solve()
Solve pressure Poisson equation.
void setup(const Particles &particles, const DirichletBoundaryCondition &dirichletBoundaryCondition)
Setup pressure Poisson equation.
Here is the call graph for this function:

◆ removeNegativePressure()

void Implicit::removeNegativePressure ( )
private

remove negative pressure for stability

Definition at line 51 of file implicit.cpp.

51 {
52#pragma omp parallel for
53 for (auto& p : pressure) {
54 if (p < 0) {
55 p = 0;
56 }
57 }
58}
Here is the caller graph for this function:

Member Data Documentation

◆ particles

Particles PressureCalculator::Implicit::particles
private

Definition at line 42 of file implicit.hpp.

◆ pressure

std::vector<double> PressureCalculator::Implicit::pressure
private

Solution of pressure calculation.

Definition at line 43 of file implicit.hpp.

◆ dirichletBoundaryConditionGenerator

std::unique_ptr<DirichletBoundaryConditionGenerator::Interface> PressureCalculator::Implicit::dirichletBoundaryConditionGenerator
private

Definition at line 44 of file implicit.hpp.

◆ pressurePoissonEquation

PressurePoissonEquation PressureCalculator::Implicit::pressurePoissonEquation
private

Definition at line 45 of file implicit.hpp.


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