doc: correct INS.jl solver description and exclusion rationale#102
Conversation
- The obstacle exclusion claimed the cylinder "cannot be represented in INS.jl" and that its "spectral/LU pressure projection is periodic-only". Neither holds: the LU (and DCT) pressure solvers handle non-periodic boundary conditions, and a finite Brinkman forcing term with the library's native channel BCs represents the obstacle. What diverges is this tesseract's hard-mask penalization (velocity zeroed after each projection), which is projection-inconsistent. Reword the exclusion to attribute the failure correctly. - INS.jl is a staggered finite-volume (energy-conserving) discretization, not finite-difference. - "CPU-only" describes this wrapper, not the library (KernelAbstractions kernels run on CUDA, including the spectral pressure solver and the differentiable path). Clarify the description; uses_gpu stays false as a property of this tesseract. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gdif1Cu1pdCJENe2hNUaF1
CLA signatures confirmedAll contributors have signed the Contributor License Agreement. |
|
@PasteurBot I have read the CLA Document and I hereby sign the CLA |
|
Thanks @agdestein ! Do you think enabling GPU execution would be valuable here, if only as an example for the community as to how to do so? |
|
Yes, I think that would be valuable. INS.jl's kernels are written with KernelAbstractions.jl, so the entire path this tesseract exercises already runs on CUDA in the library: the RK time stepper, the FFT pressure solver (CUFFT), and the hand-written adjoint kernels behind the Zygote rrules. The wrapper just never enabled it — it's a I've started a branch for this. Concretely:
Since #103 already makes the solve genuinely float32 end-to-end (which you want anyway before turning on a GPU backend), I'd suggest landing that first and doing GPU as a follow-up PR on top — that keeps the two benchmark re-runs interpretable (algorithmic fixes vs. hardware change). I'll validate forward + VJP on a local RTX 4090 before opening it. |
📊 View the full benchmark resultsNo benchmarks ran for this PR, so there is no status report. |
|
@agdestein That follow-up PR sounds awesome! Merging this in the meantime. |
Following up on the invitation in agdestein/IncompressibleNavierStokes.jl#197 — thanks for including INS.jl! This first PR only corrects a few statements about the solver; the companion upgrade PR is #103.
Suggested label:
benchmark:none— strings and metadata only, no behavior change.Changes
INS_JL_NO_OBSTACLEexclusion text. The current text says the cylinder "cannot be represented in INS.jl" and that its "spectral/LU pressure projection is also periodic-only". Neither is accurate:psolver_direct(LU) assembles the pressure Laplacian for any supported BC combination — it is the general-BC fallback thatdefault_psolverselects for non-periodic setups.psolver_transform(DCT) supports Dirichlet BCs, as this repo's own channel code uses. Onlypsolver_spectral(FFT) is periodic-only.−(χ/η)·uadded to the RHS before projection is smooth and stable. What diverges is this tesseract's hard-zero masking after each projection (an infinite-penalization clamp the projection cannot see). INS.jl also natively supports the channel configuration (DirichletBC(f)inflow,PressureBCoutflow, periodic lateral BCs).The exclusion itself stays (that route isn't implemented in the tesseract); only the attribution is corrected.
discretization: FD→FV. INS.jl is a staggered finite-volume (energy-conserving) discretization;FVis among the documented options for this field."CPU-only" description. The wrapper runs on CPU, but the library's kernels are KernelAbstractions.jl and run on CUDA (including the spectral pressure solver and the differentiable path). Reworded so readers don't take the cost tables as a solver property;
uses_gpu: falseis kept as a property of this tesseract.No results change; the generated solver/results pages pick these up on the next docs build.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Gdif1Cu1pdCJENe2hNUaF1