Pressure solvers
The discrete pressure Poisson equation
\[L p = W M F(u)\]
enforces divergence freeness. There are multiple options for solving this system.
IncompressibleNavierStokes.default_psolver
— Functiondefault_psolver(setup)
Get default Poisson solver from setup.
IncompressibleNavierStokes.psolver_direct
— Functionpoisson_direct(setup)
Create direct Poisson solver using an appropriate matrix decomposition.
IncompressibleNavierStokes.psolver_cg
— Functionpsolver_cg(
setup;
abstol = zero(eltype(setup.grid.x[1])),
reltol = sqrt(eps(eltype(setup.grid.x[1]))),
maxiter = prod(setup.grid.Np),
preconditioner = create_laplace_diag(setup),
)
Conjugate gradients iterative Poisson solver.
IncompressibleNavierStokes.psolver_cg_matrix
— Functionpsolver_cg_matrix(setup; kwargs...)
Conjugate gradients iterative Poisson solver. The kwargs
are passed to the cg!
function from IterativeSolvers.jl.
IncompressibleNavierStokes.psolver_spectral
— Functionpsolver_spectral(setup)
Create spectral Poisson solver from setup.
IncompressibleNavierStokes.psolver_spectral_lowmemory
— Functionpsolver_spectral_lowmemory(setup)
Create spectral Poisson solver from setup. This one is slower than psolver_spectral
but occupies less memory.
IncompressibleNavierStokes.pressure
— Functionpressure(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.
IncompressibleNavierStokes.pressure!
— Functionpressure!(p, u, temp, t, setup; psolver, F, div)
Compute pressure from velocity field. This makes the pressure compatible with the velocity field, resulting in same order pressure as velocity.
IncompressibleNavierStokes.poisson
— Functionpoisson(psolver, f)
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.
Non-mutating/allocating/out-of-place version.
See also poisson!
.
IncompressibleNavierStokes.poisson!
— Functionpoisson!(solver, p, f)
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.
Mutating/non-allocating/in-place version.
See also poisson
.
IncompressibleNavierStokes.applypressure!
— Functionapplypressure!(u, p, setup)
Subtract pressure gradient (in-place).
IncompressibleNavierStokes.project
— Functionproject(u, setup; psolver)
Project velocity field onto divergence-free space.
IncompressibleNavierStokes.project!
— Functionproject!(u, setup; psolver, div, p)
Project velocity field onto divergence-free space.