Skip to content

Pressure solvers

The discrete pressure Poisson equation

Lp=WMF(u)

enforces divergence freeness. There are multiple options for solving this system.

# IncompressibleNavierStokes.default_psolverMethod.
julia
default_psolver(
    setup
) -> Union{IncompressibleNavierStokes.var"#psolve!#100"{Bool}, IncompressibleNavierStokes.var"#psolver#121"}

Get default Poisson solver from setup.

source


# IncompressibleNavierStokes.poisson!Method.
julia
poisson!(psolver, p, f) -> Any

Solve the Poisson equation for the pressure (in-place version).

source


# IncompressibleNavierStokes.poissonMethod.
julia
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.

source


# IncompressibleNavierStokes.pressure!Method.
julia
pressure!(p, u, temp, t, setup; psolver, F, div)

Compute pressure from velocity field (in-place version).

source


# IncompressibleNavierStokes.pressureMethod.
julia
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.

source


# IncompressibleNavierStokes.project!Method.
julia
project!(u, setup; psolver, div, p)

Project velocity field onto divergence-free space (in-place version).

source


# IncompressibleNavierStokes.projectMethod.
julia
project(u, setup; psolver)

Project velocity field onto divergence-free space (differentiable version).

source


# IncompressibleNavierStokes.psolver_cgMethod.
julia
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.

source


# IncompressibleNavierStokes.psolver_cg_matrixMethod.
julia
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.

source


# IncompressibleNavierStokes.psolver_directMethod.
julia
psolver_direct(
    setup
) -> IncompressibleNavierStokes.var"#psolve!#100"{Bool}

Create direct Poisson solver using an appropriate matrix decomposition.

source


# IncompressibleNavierStokes.psolver_spectralMethod.
julia
psolver_spectral(
    setup
) -> IncompressibleNavierStokes.var"#psolver#121"

Create spectral Poisson solver from setup.

source


# IncompressibleNavierStokes.psolver_spectral_lowmemoryMethod.
julia
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.

source