Jet
v1.3.3
|
2-D fractional single-phase pressure solver. More...
#include <jet/grid_fractional_single_phase_pressure_solver2.h>
Public Member Functions | |
GridFractionalSinglePhasePressureSolver2 () | |
Default constructor. More... | |
virtual | ~GridFractionalSinglePhasePressureSolver2 () |
Default destructor. More... | |
void | solve (const FaceCenteredGrid2 &input, double timeIntervalInSeconds, FaceCenteredGrid2 *output, const ScalarField2 &boundarySdf=ConstantScalarField2(kMaxD), const VectorField2 &boundaryVelocity=ConstantVectorField2({0, 0}), const ScalarField2 &fluidSdf=ConstantScalarField2(-kMaxD), 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 & | linearSystemSolver () const |
Returns the linear system solver. More... | |
void | setLinearSystemSolver (const FdmLinearSystemSolver2Ptr &solver) |
Sets the linear system solver. More... | |
const FdmVector2 & | pressure () const |
Returns the pressure field. More... | |
![]() | |
GridPressureSolver2 () | |
Default constructor. More... | |
virtual | ~GridPressureSolver2 () |
Default destructor. More... | |
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 apporach 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 subgrid structures. This class uses ghost fluid method for such calculation.
jet::GridFractionalSinglePhasePressureSolver2::GridFractionalSinglePhasePressureSolver2 | ( | ) |
Default constructor.
|
virtual |
Default destructor.
const FdmLinearSystemSolver2Ptr& jet::GridFractionalSinglePhasePressureSolver2::linearSystemSolver | ( | ) | const |
Returns the linear system solver.
const FdmVector2& jet::GridFractionalSinglePhasePressureSolver2::pressure | ( | ) | const |
Returns the pressure field.
void jet::GridFractionalSinglePhasePressureSolver2::setLinearSystemSolver | ( | const FdmLinearSystemSolver2Ptr & | solver | ) |
Sets the linear system solver.
|
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 kMaxD will be used for boundarySdf
meaning that no boundary at all. Similarly, a constant field with -kMaxD will be used for fluidSdf
which means it's fully occupied with fluid without any atmosphere.
[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] | fluidSdf | The SDF of the fluid/atmosphere. |
[in] | useCompressed | True if it uses compressed system. |
Implements jet::GridPressureSolver2.
|
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 jet::GridPressureSolver2.