Loading...
Searching...
No Matches

N-D explicit weakly compressible material point method solver. More...

#include <Core/Solver/Particle/MPM/MPMFluidSolver.hpp>

Inheritance diagram for CubbyFlow::MPMFluidSolver< N >:

Classes

class  Builder
 Front-end to create MPMFluidSolver objects step by step. More...
 

Public Types

using Base = std::conditional_t< N==2, ParticleSystemSolver2, ParticleSystemSolver3 >
 
using MatrixType = Matrix< double, N, N >
 
using VectorType = Vector< double, N >
 
using SizeType = Vector< size_t, N >
 

Public Member Functions

 MPMFluidSolver (const SizeType &resolution=SizeType::MakeConstant(32), const VectorType &gridSpacing=VectorType::MakeConstant(1.0), const VectorType &gridOrigin=VectorType{}, double radius=1e-3, double mass=1e-3, double targetDensity=WATER_DENSITY, double speedOfSound=100.0, double eosExponent=7.0, double negativePressureScale=0.0)
 Constructs an empty weakly compressible MPM fluid solver.
 
std::shared_ptr< MPMFluidSystemData< N > > GetMPMSystemData () const
 Returns the owned MPM fluid particle and grid state.
 
const MPMFluidConstitutiveModel< N > & GetConstitutiveModel () const
 Returns the immutable weakly compressible constitutive model.
 
double GetTimeStepLimitScale () const
 Returns the scale applied to adaptive time-step limits.
 
void SetTimeStepLimitScale (double newScale)
 Sets the adaptive time-step scale in (0, 1].
 
int GetClosedDomainBoundaryFlag () const
 Returns the closed domain boundary flag.
 
void SetClosedDomainBoundaryFlag (int flag)
 Sets the closed domain boundary flag.
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns a builder for MPMFluidSolver.
 

Protected Member Functions

void OnInitialize () override
 Initializes particle-grid state before the first adaptive step query.
 
unsigned int GetNumberOfSubTimeSteps (double timeIntervalInSeconds) const override
 Returns the number of adaptive sub-time-steps.
 
void AccumulateForces (double timeStepInSeconds) override
 Fluid forces are integrated on the background grid.
 
void OnBeginAdvanceTimeStep (double timeStepInSeconds) override
 Advances particle-grid fluid state before base particle integration.
 
void OnEndAdvanceTimeStep (double timeStepInSeconds) override
 Projects particles back into selected closed domain boundaries.
 

Detailed Description

template<size_t N>
class CubbyFlow::MPMFluidSolver< N >

N-D explicit weakly compressible material point method solver.

Uses the Tait equation of state with existing MPM particle-grid transfers and particle-solver collision lifecycle.

Note
Choose the artificial speed of sound high enough to keep the maximum relative density error near or below 3%; ten times the expected peak flow speed is a common starting point. Adaptive stepping limits each step to timeStepLimitScale * minGridSpacing / (speedOfSound + maxParticleSpeed). This explicit limit assumes weak compression; reduce the scale or increase the sound speed when density error or pressure oscillation is excessive.

Member Typedef Documentation

◆ Base

template<size_t N>
using CubbyFlow::MPMFluidSolver< N >::Base = std::conditional_t<N == 2, ParticleSystemSolver2, ParticleSystemSolver3>

◆ MatrixType

template<size_t N>
using CubbyFlow::MPMFluidSolver< N >::MatrixType = Matrix<double, N, N>

◆ SizeType

template<size_t N>
using CubbyFlow::MPMFluidSolver< N >::SizeType = Vector<size_t, N>

◆ VectorType

template<size_t N>
using CubbyFlow::MPMFluidSolver< N >::VectorType = Vector<double, N>

Constructor & Destructor Documentation

◆ MPMFluidSolver()

template<size_t N>
CubbyFlow::MPMFluidSolver< N >::MPMFluidSolver ( const SizeType resolution = SizeType::MakeConstant(32),
const VectorType gridSpacing = VectorType::MakeConstant(1.0),
const VectorType gridOrigin = VectorType{},
double  radius = 1e-3,
double  mass = 1e-3,
double  targetDensity = WATER_DENSITY,
double  speedOfSound = 100.0,
double  eosExponent = 7.0,
double  negativePressureScale = 0.0 
)
explicit

Constructs an empty weakly compressible MPM fluid solver.

Member Function Documentation

◆ AccumulateForces()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::AccumulateForces ( double  timeStepInSeconds)
overrideprotected

Fluid forces are integrated on the background grid.

◆ GetBuilder()

template<size_t N>
MPMFluidSolver< N >::Builder CubbyFlow::MPMFluidSolver< N >::GetBuilder ( )
static

Returns a builder for MPMFluidSolver.

◆ GetClosedDomainBoundaryFlag()

template<size_t N>
int CubbyFlow::MPMFluidSolver< N >::GetClosedDomainBoundaryFlag ( ) const

Returns the closed domain boundary flag.

◆ GetConstitutiveModel()

template<size_t N>
const MPMFluidConstitutiveModel< N > & CubbyFlow::MPMFluidSolver< N >::GetConstitutiveModel ( ) const

Returns the immutable weakly compressible constitutive model.

◆ GetMPMSystemData()

template<size_t N>
std::shared_ptr< MPMFluidSystemData< N > > CubbyFlow::MPMFluidSolver< N >::GetMPMSystemData ( ) const

Returns the owned MPM fluid particle and grid state.

◆ GetNumberOfSubTimeSteps()

template<size_t N>
unsigned int CubbyFlow::MPMFluidSolver< N >::GetNumberOfSubTimeSteps ( double  timeIntervalInSeconds) const
overrideprotected

Returns the number of adaptive sub-time-steps.

◆ GetTimeStepLimitScale()

template<size_t N>
double CubbyFlow::MPMFluidSolver< N >::GetTimeStepLimitScale ( ) const

Returns the scale applied to adaptive time-step limits.

◆ OnBeginAdvanceTimeStep()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::OnBeginAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotected

Advances particle-grid fluid state before base particle integration.

◆ OnEndAdvanceTimeStep()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::OnEndAdvanceTimeStep ( double  timeStepInSeconds)
overrideprotected

Projects particles back into selected closed domain boundaries.

◆ OnInitialize()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::OnInitialize ( )
overrideprotected

Initializes particle-grid state before the first adaptive step query.

◆ SetClosedDomainBoundaryFlag()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::SetClosedDomainBoundaryFlag ( int  flag)

Sets the closed domain boundary flag.

◆ SetTimeStepLimitScale()

template<size_t N>
void CubbyFlow::MPMFluidSolver< N >::SetTimeStepLimitScale ( double  newScale)

Sets the adaptive time-step scale in (0, 1].


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