Loading...
Searching...
No Matches
MPMFluidConstitutiveModel.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_MPM_FLUID_CONSTITUTIVE_MODEL_HPP
12#define CUBBYFLOW_MPM_FLUID_CONSTITUTIVE_MODEL_HPP
13
16
17#include <cstddef>
18
19namespace CubbyFlow
20{
27template <size_t N>
29{
30 public:
31 static_assert(N == 2 || N == 3,
32 "MPM fluid model supports only 2-D and 3-D.");
33
35
48 double speedOfSound = 100.0,
49 double eosExponent = 7.0,
50 double negativePressureScale = 0.0);
51
53 [[nodiscard]] double GetTargetDensity() const;
54
56 [[nodiscard]] double GetSpeedOfSound() const;
57
59 [[nodiscard]] double GetEosExponent() const;
60
62 [[nodiscard]] double GetNegativePressureScale() const;
63
70 [[nodiscard]] double ComputeDensity(double mass,
71 double currentVolume) const;
72
79 [[nodiscard]] double ComputePressure(double density) const;
80
87
88 private:
89 double m_targetDensity;
90 double m_speedOfSound;
91 double m_eosExponent;
92 double m_negativePressureScale;
93 double m_eosScale;
94};
95
98} // namespace CubbyFlow
99
101
102#endif
Weakly compressible fluid constitutive model for MPM.
Definition MPMFluidConstitutiveModel.hpp:29
double GetNegativePressureScale() const
Returns the negative-pressure scale.
Definition MPMFluidConstitutiveModel-Impl.hpp:61
MatrixType ComputeCauchyStress(double pressure) const
Converts pressure to the isotropic Cauchy stress -p I.
Definition MPMFluidConstitutiveModel-Impl.hpp:108
double ComputePressure(double density) const
Computes equation-of-state pressure for a density.
Definition MPMFluidConstitutiveModel-Impl.hpp:87
double GetTargetDensity() const
Returns the target density.
Definition MPMFluidConstitutiveModel-Impl.hpp:43
double GetEosExponent() const
Returns the equation-of-state exponent.
Definition MPMFluidConstitutiveModel-Impl.hpp:55
double GetSpeedOfSound() const
Returns the speed of sound.
Definition MPMFluidConstitutiveModel-Impl.hpp:49
double ComputeDensity(double mass, double currentVolume) const
Computes density from particle mass and current volume.
Definition MPMFluidConstitutiveModel-Impl.hpp:67
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:22
constexpr double WATER_DENSITY
Definition Constants.hpp:303
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:648