Pressure solvers
The discrete pressure Poisson equation
enforces divergence freeness. There are multiple options for solving this system.
default_psolver(
setup
) -> Union{IncompressibleNavierStokes.var"#psolve!#100"{Bool}, IncompressibleNavierStokes.var"#psolver#121"}
Get default Poisson solver from setup.
poisson!(psolver, p, f) -> Any
Solve the Poisson equation for the pressure (in-place version).
poisson(psolver, f) -> Any
Solve the Poisson equation for the pressure with right hand side f
at time t
. For periodic and no-slip BC, the sum of f
should be zero.
Differentiable version.
pressure!(p, u, temp, t, setup; psolver, F, div)
Compute pressure from velocity field (in-place version).
pressure(u, temp, t, setup; psolver)
Compute pressure from velocity field. This makes the pressure compatible with the velocity field, resulting in same order pressure as velocity.
Differentiable version.
project!(u, setup; psolver, div, p)
Project velocity field onto divergence-free space (in-place version).
project(u, setup; psolver)
Project velocity field onto divergence-free space (differentiable version).
psolver_cg(
setup;
abstol,
reltol,
maxiter,
preconditioner
) -> IncompressibleNavierStokes.var"#psolve!#110"{_A, _B, _C, IncompressibleNavierStokes.var"#laplace_diag#108"{ndrange, workgroupsize}} where {_A, _B, _C, ndrange, workgroupsize}
Conjugate gradients iterative Poisson solver.
psolver_cg_matrix(
setup;
kwargs...
) -> IncompressibleNavierStokes.var"#psolve!#104"{Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}}
Conjugate gradients iterative Poisson solver. The kwargs
are passed to the cg!
function from IterativeSolvers.jl.
psolver_direct(
setup
) -> IncompressibleNavierStokes.var"#psolve!#100"{Bool}
Create direct Poisson solver using an appropriate matrix decomposition.
psolver_spectral(
setup
) -> IncompressibleNavierStokes.var"#psolver#121"
Create spectral Poisson solver from setup.
psolver_spectral_lowmemory(
setup
) -> IncompressibleNavierStokes.var"#psolve!#128"
Create spectral Poisson solver from setup. This one is slower than psolver_spectral
but occupies less memory.