CubbyFlow::GridFractionalSinglePhasePressureSolver2 Class Referencefinal

2-D fractional single-phase pressure solver. More...

#include <Core/Solver/Grid/GridFractionalSinglePhasePressureSolver2.hpp>

Inheritance diagram for CubbyFlow::GridFractionalSinglePhasePressureSolver2:
CubbyFlow::GridPressureSolver2

Public Member Functions

 GridFractionalSinglePhasePressureSolver2 ()
 Default constructor. More...
 
 GridFractionalSinglePhasePressureSolver2 (const GridFractionalSinglePhasePressureSolver2 &)=delete
 Deleted copy constructor. More...
 
 GridFractionalSinglePhasePressureSolver2 (GridFractionalSinglePhasePressureSolver2 &&) noexcept=delete
 Deleted move constructor. More...
 
 ~GridFractionalSinglePhasePressureSolver2 () override=default
 Default virtual destructor. More...
 
GridFractionalSinglePhasePressureSolver2operator= (const GridFractionalSinglePhasePressureSolver2 &)=delete
 Deleted copy assignment operator. More...
 
GridFractionalSinglePhasePressureSolver2operator= (GridFractionalSinglePhasePressureSolver2 &&) noexcept=delete
 Deleted move assignment operator. 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 FDMLinearSystemSolver2PtrGetLinearSystemSolver () const
 Returns the linear system solver. More...
 
void SetLinearSystemSolver (const FDMLinearSystemSolver2Ptr &solver)
 Sets the linear system solver. More...
 
const FDMVector2GetPressure () const
 Returns the pressure field. More...
 
- Public Member Functions inherited from CubbyFlow::GridPressureSolver2
 GridPressureSolver2 ()=default
 Default constructor. More...
 
 GridPressureSolver2 (const GridPressureSolver2 &)=delete
 Deleted copy constructor. More...
 
 GridPressureSolver2 (GridPressureSolver2 &&) noexcept=delete
 Deleted move constructor. More...
 
virtual ~GridPressureSolver2 ()=default
 Default virtual destructor. More...
 
GridPressureSolver2operator= (const GridPressureSolver2 &)=delete
 Deleted copy assignment operator. More...
 
GridPressureSolver2operator= (GridPressureSolver2 &&) noexcept=delete
 Deleted move assignment operator. More...
 

Detailed Description

2-D fractional single-phase pressure solver.

This class implements 2-D fractional (or variational) single-phase pressure solver. It is called fractional because the solver encodes the boundaries to the grid cells like anti-aliased pixels, meaning that a grid cell will record the partially overlapping boundary as a fractional number. Alternative approach is to represent boundaries like Lego blocks which is the case for GridSinglePhasePressureSolver2. 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 fractional manner, meaning that the solver tries to capture the sub-grid structures. This class uses ghost fluid method for such calculation.

See also
Batty, Christopher, Florence Bertails, and Robert Bridson. "A fast variational framework for accurate solid-fluid coupling." ACM Transactions on Graphics (TOG). Vol. 26. No. 3. ACM, 2007.
Enright, Doug, et al. "Using the particle level set method and a second order accurate pressure boundary condition for free surface flows." ASME/JSME 2003 4th Joint Fluids Summer Engineering Conference. American Society of Mechanical Engineers, 2003.

Constructor & Destructor Documentation

◆ GridFractionalSinglePhasePressureSolver2() [1/3]

CubbyFlow::GridFractionalSinglePhasePressureSolver2::GridFractionalSinglePhasePressureSolver2 ( )

Default constructor.

◆ GridFractionalSinglePhasePressureSolver2() [2/3]

CubbyFlow::GridFractionalSinglePhasePressureSolver2::GridFractionalSinglePhasePressureSolver2 ( const GridFractionalSinglePhasePressureSolver2 )
delete

Deleted copy constructor.

◆ GridFractionalSinglePhasePressureSolver2() [3/3]

CubbyFlow::GridFractionalSinglePhasePressureSolver2::GridFractionalSinglePhasePressureSolver2 ( GridFractionalSinglePhasePressureSolver2 &&  )
deletenoexcept

Deleted move constructor.

◆ ~GridFractionalSinglePhasePressureSolver2()

CubbyFlow::GridFractionalSinglePhasePressureSolver2::~GridFractionalSinglePhasePressureSolver2 ( )
overridedefault

Default virtual destructor.

Member Function Documentation

◆ GetLinearSystemSolver()

const FDMLinearSystemSolver2Ptr& CubbyFlow::GridFractionalSinglePhasePressureSolver2::GetLinearSystemSolver ( ) const

Returns the linear system solver.

◆ GetPressure()

const FDMVector2& CubbyFlow::GridFractionalSinglePhasePressureSolver2::GetPressure ( ) const

Returns the pressure field.

◆ operator=() [1/2]

GridFractionalSinglePhasePressureSolver2& CubbyFlow::GridFractionalSinglePhasePressureSolver2::operator= ( const GridFractionalSinglePhasePressureSolver2 )
delete

Deleted copy assignment operator.

◆ operator=() [2/2]

GridFractionalSinglePhasePressureSolver2& CubbyFlow::GridFractionalSinglePhasePressureSolver2::operator= ( GridFractionalSinglePhasePressureSolver2 &&  )
deletenoexcept

Deleted move assignment operator.

◆ SetLinearSystemSolver()

void CubbyFlow::GridFractionalSinglePhasePressureSolver2::SetLinearSystemSolver ( const FDMLinearSystemSolver2Ptr solver)

Sets the linear system solver.

◆ Solve()

void CubbyFlow::GridFractionalSinglePhasePressureSolver2::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 
)
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]inputThe input velocity field.
[in]timeIntervalInSecondsThe time interval for the sim.
[in,out]outputThe output velocity field.
[in]boundarySDFThe SDF of the boundary.
[in]boundaryVelocityThe velocity of the boundary.
[in]fluidSDFThe SDF of the fluid/atmosphere.
[in]useCompressedTrue if it uses compressed system.

Implements CubbyFlow::GridPressureSolver2.

◆ SuggestedBoundaryConditionSolver()

GridBoundaryConditionSolver2Ptr CubbyFlow::GridFractionalSinglePhasePressureSolver2::SuggestedBoundaryConditionSolver ( ) const
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 GridFractionalBoundaryConditionSolver2 will be returned.

Implements CubbyFlow::GridPressureSolver2.


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