2-D single-phase pressure solver. More...
#include <Core/Solver/Grid/GridSinglePhasePressureSolver2.h>
Public Member Functions | |
GridSinglePhasePressureSolver2 () | |
Default constructor. More... | |
virtual | ~GridSinglePhasePressureSolver2 () |
Default destructor. More... | |
void | Solve (const FaceCenteredGrid2 &input, double timeIntervalInSeconds, FaceCenteredGrid2 *output, const ScalarField2 &boundarySDF=ConstantScalarField2(std::numeric_limits< double >::max()), const VectorField2 &boundaryVelocity=ConstantVectorField2({ 0, 0 }), const ScalarField2 &fluidSDF=ConstantScalarField2(-std::numeric_limits< double >::max()), bool useCompressed=false) override |
Solves the pressure term and apply it to the velocity field. More... | |
GridBoundaryConditionSolver2Ptr | SuggestedBoundaryConditionSolver () const override |
Returns the best boundary condition solver for this solver. More... | |
const FDMLinearSystemSolver2Ptr & | GetLinearSystemSolver () const |
Returns the linear system solver. More... | |
void | SetLinearSystemSolver (const FDMLinearSystemSolver2Ptr &solver) |
Sets the linear system solver. More... | |
const FDMVector2 & | GetPressure () const |
Returns the pressure field. More... | |
Public Member Functions inherited from CubbyFlow::GridPressureSolver2 | |
GridPressureSolver2 () | |
Default constructor. More... | |
virtual | ~GridPressureSolver2 () |
Default destructor. More... | |
Detailed Description
2-D single-phase pressure solver.
This class implements 2-D single-phase pressure solver. This solver encodes the boundaries like Lego blocks – if a grid cell center is inside or outside the boundaries, it is either marked as occupied or not. In addition, this class solves single-phase flow, solving the pressure for selected fluid region only and treat other area as an atmosphere region. Thus, the pressure outside the fluid will be set to a constant value and velocity field won't be altered. This solver also computes the fluid boundary in block-like manner; If a grid cell is inside or outside the fluid, it is marked as either fluid or atmosphere. Thus, this solver in general, does not compute sub-grid structure.
Constructor & Destructor Documentation
◆ GridSinglePhasePressureSolver2()
CubbyFlow::GridSinglePhasePressureSolver2::GridSinglePhasePressureSolver2 | ( | ) |
Default constructor.
◆ ~GridSinglePhasePressureSolver2()
|
virtual |
Default destructor.
Member Function Documentation
◆ GetLinearSystemSolver()
const FDMLinearSystemSolver2Ptr& CubbyFlow::GridSinglePhasePressureSolver2::GetLinearSystemSolver | ( | ) | const |
Returns the linear system solver.
◆ GetPressure()
const FDMVector2& CubbyFlow::GridSinglePhasePressureSolver2::GetPressure | ( | ) | const |
Returns the pressure field.
◆ SetLinearSystemSolver()
void CubbyFlow::GridSinglePhasePressureSolver2::SetLinearSystemSolver | ( | const FDMLinearSystemSolver2Ptr & | solver | ) |
Sets the linear system solver.
◆ Solve()
|
overridevirtual |
Solves the pressure term and apply it to the velocity field.
This function takes input velocity field and outputs pressure-applied velocity field. It also accepts extra arguments such as boundarySDF
and fluidSDF
that represent signed-distance representation of the boundary and fluid area. The negative region of boundarySDF
means it is occupied by solid object. Also, the positive / negative area of the fluidSDF
means it is occupied by fluid / atmosphere. If not specified, constant scalar field with std::numeric_limits<double>::max() will be used for boundarySDF
meaning that no boundary at all. Similarly, a constant field with -std::numeric_limits<double>::max() will be used for fluidSDF
which means it's fully occupied with fluid without any atmosphere.
- Parameters
-
[in] input The input velocity field. [in] timeIntervalInSeconds The time interval for the sim. [in,out] output The output velocity field. [in] boundarySDF The SDF of the boundary. [in] boundaryVelocity The velocity of the boundary. [in] fluidSDF The SDF of the fluid/atmosphere. [in] useCompressed True if it uses compressed system.
Implements CubbyFlow::GridPressureSolver2.
◆ SuggestedBoundaryConditionSolver()
|
overridevirtual |
Returns the best boundary condition solver for this solver.
This function returns the best boundary condition solver that works well with this pressure solver. Depending on the pressure solver implementation, different boundary condition solver might be used. For this particular class, an instance of GridBlockedBoundaryConditionSolver2 will be returned since this pressure solver encodes boundaries like pixelated Lego blocks.
Implements CubbyFlow::GridPressureSolver2.
The documentation for this class was generated from the following file:
- Core/Solver/Grid/GridSinglePhasePressureSolver2.h