Skip to content

About

Energy-conserving cut-cell finite volumes for incompressible Navier-Stokes: SBP, skew-symmetric, stable for any geometry

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

energy-conserving-cutcell: streamlines of the Re = 100 cylinder wake computed with the energy-conserving cut-cell method

energy-conserving-cutcell

tests License: MIT Python 3.10+

Yong Yi Bay

Research code developed at UIUC/NCSA, 2015–2019; released 2026.

A cut-cell finite volume method for the incompressible Navier-Stokes equations on staggered (MAC) Cartesian grids in which kinetic energy is conserved by construction. The discrete divergence is the negative transpose of the discrete gradient (summation by parts), so the Laplacian is symmetric negative definite and the convection operator is skew-symmetric for any cut-cell geometry. Energy stability then follows from the energy method for arbitrary immersed boundaries, with a nearest-neighbour stencil and no special-case logic for how a cell is cut. Flow past a cylinder at Re = 100 gives a mean drag coefficient of 1.35 ± 0.004 and a Strouhal number of 0.166, both inside the published experimental and numerical range; full cells converge at second order in L1 and L2 for scalar transport, Taylor-Green and Taylor-Couette flow.

Results

Test Measured result
Flow past a circular cylinder, Re = 100, domain [-8D, 22D] x [-6D, 6D] mean CD = 1.35 ± 0.004, St = 0.166 (experiments 1.21 to 1.41 and 0.16 to 0.17; published simulations 1.34 to 1.41 and 0.164 to 0.167)
Taylor-Couette flow, non-grid-aligned cut cells on both cylinders, N = 40 to 100 full-cell orders L1 2.32 / 2.31, L2 2.21 / 2.17 (u / v)
Taylor-Green vortex with grid-aligned cut cells, N = 40 to 120 full-cell orders L∞ 2.02, L1 2.14, L2 2.10
Diffusion and advection of a plane wave in a channel tilted to the grid, Dirichlet and Neumann walls L1 1.99 to 2.06, L2 1.97 to 2.04 over all cells; advection with Dirichlet walls 2.02 in L∞
Advection-diffusion in the tilted channel, Pe = 0 and 50, N = 50 to 300 full cells L1 2.08 / 2.03 and L∞ 2.01 / 1.97
Lid-driven cavity, Re = 100 primary vortex and both lower corner vortices; centreline velocity profiles match the reference solution
Solid-body rotation with diffusion in an annulus contour levels follow the spectrally accurate reference solution over a full revolution
Operator identities on a cut-cell grid (make verify, 64 x 64, 84 cut cells, volume fraction down to 5.1e-4) |D + GT| = 7e-17, |L - LT| = 2e-17, spectrum of L in [-8.0, -2.1e-3], |N + NT| = 0
Energy conservation, 400 implicit steps of pure convection on the same grid relative energy drift 3.3e-15; the plain divergence form grows by 106 before t = 0.4
Conditioning, CG on -L x = b to 1e-8 (642 to 2562) 228 / 454 / 890 iterations, within 3% of a grid-aligned body of the same size (222 / 439 / 873)

Drag coefficient and Strouhal number against the benchmark range

Figure 1. Flow past a circular cylinder at Re = 100. The cut-cell mean drag coefficient and Strouhal number (teal) against the range of experiments (shaded) and published simulations (gray). Forces are averaged over the periodic shedding regime up to t = 350 D/U.

Discrete energy history on a cut-cell grid

Figure 2. Discrete energy E = ½ fT V f for convection of a scalar through a cut-cell grid around a cylinder (64 x 64 cells, 84 cut cells, implicit midpoint, Δt = 0.02). Left: with the skew-symmetric operator the energy stays at its initial value and decays monotonically once diffusion is added; the same divergence-form fluxes without the skew-symmetrizing continuity term are unstable in the small cut cells. Right: the relative drift stays at a few machine epsilons. Data from make verify.

Measured convergence orders

Figure 3. Measured order of accuracy (Theil-Sen slope of error against Δx) for the scalar channel tests and the incompressible Navier-Stokes tests. Dashed line: formal order 2.

Cylinder grid and lid-driven cavity streamlines

Figure 4. Left: stretched Cartesian grid for the cylinder; the body enters only through cut-cell volume and face fractions. Right: streamlines of the lid-driven cavity at Re = 100, coloured by velocity magnitude, with the two lower corner vortices resolved.

Method

Cut-cell geometry. The body is described by a signed distance function, combined with constructive solid geometry (union min, intersection max). Each Cartesian cell carries its fluid volume V, fluid face fractions Aα and the cut-surface normal area Cα = Aα,i+½ - Aα,i-½, which satisfies a geometric conservation law by construction.

Summation by parts. The gradient (staggered to faces) and the divergence (back to cell centres) are built from finite volume fluxes with the cut-surface contribution Cα, and satisfy D = -GT exactly. The Laplacian L = D M-1 G, with M the diagonal staggered volumes, is therefore symmetric negative definite: viscous dissipation appears as a sink in the discrete kinetic energy budget.

Skew-symmetric convection. Convection is written in divergence form with central interpolation, plus half the local continuity residual. In this form the operator is skew-symmetric, ⟨C(u)v, w⟩ = -⟨v, C(u)w⟩, for Dirichlet boundaries and arbitrary cut fluxes; when the discrete continuity equation holds, the divergence, advective and skew-symmetric forms coincide. Mass, momentum and kinetic energy are conserved, and the energy method gives stability for any geometry without tuning parameters.

Vector case. On the staggered grid the same construction gives the vector gradient, the rate-of-strain and stress tensors and the tensor divergence in 2-D and 3-D, and the resulting vector Laplacian is symmetric negative definite. The derivation is dimension independent.

Time integration. A fractional step (projection) method: second-order Adams-Bashforth for convection, Crank-Nicolson for diffusion, and a pressure Poisson solve with the symmetric cut-cell Laplacian.

Accuracy. Second order in full cells; grid-aligned cut cells recover first-order gradients through modified staggered volumes (paper, Appendix A and B).

Where things live

Component File
Cut-cell volumes, apertures, signed distance geometry cutcell/geometry.py
Scalar gradient G, divergence D (flux form with Cα), staggered mass M cutcell/operators.py gradient, divergence, staggered_mass
Symmetric Laplacian L = D M-1 G cutcell/operators.py laplacian
Skew-symmetric convection (paper Table 4.3) cutcell/operators.py convection
Energy-conserving implicit-midpoint march, verification driver cutcell/verify.py
Explicit energy-conserving cut-cell scalar solver: skew-symmetric convection, symmetric diffusion, MMS drivers (Fortran, 2.1k lines) src/ccscalar_explicit.f90
Assembled 3-D cut-cell diffusion and advection stencils (Fortran) src/matrixing.f90
Distributed spectrum and symmetry check, PETSc DMDA + SLEPc Krylov-Schur src/slepcing.f90
Matrix-free spectrum, ARPACK implicitly restarted Arnoldi src/arpacking.f90
Dense full spectrum, LAPACK DGEEV src/lapacking.f90
Exact tilted-channel solutions and L∞, L1, L2 error norms src/mms_cc.f90

Layout

energy-conserving-cutcell/
├── cutcell/       Python reference implementation of the scalar operators and verification
├── tests/         pytest validation: SBP, symmetry, definiteness, skew-symmetry, energy
├── benchmarks/    operator and solver cost (bench_operators.py, results.md)
├── src/           Fortran cut-cell solver modules (PETSc, SLEPc, ARPACK, LAPACK)
├── data/          result tables (JSON) and simulation renderings used by the figures
├── assets/        README figures
├── tools/         make_readme_assets.py, lab.mplstyle
├── Makefile, pyproject.toml, uv.lock, LICENSE, CITATION.cff

Reproducing

git clone https://github.com/bay-yearick-lab/energy-conserving-cutcell.git
cd energy-conserving-cutcell
uv sync                      # numpy, scipy (+ pytest); Python 3.10+

make verify                  # about one second
make test                    # 19 validation tests
make bench                   # writes benchmarks/results.md
make figures                 # rebuilds assets/ from data/

Expected output of make verify:

cut-cell grid 64 x 64: 3728 full, 84 cut cells (smallest volume fraction 5.1e-04)
summation by parts   |D + G^T| / |D|        = 7.1e-17
Laplacian symmetry   |L - L^T| / |L|        = 1.6e-17
Laplacian spectrum   [-7.998e+00, -2.107e-03]  (negative definite)
convection skew      |N + N^T| / |N|        = 0.0e+00
energy drift (1/2) f^T V f, skew-symmetric form, 400 steps = 3.3e-15
plain divergence form (no skew term): energy grows 1e6x by t = 0.38
energy monotonically decreasing with diffusion       : True

The tests sweep three cylinder positions and radii (different cut patterns and cut-cell sizes) plus a two-boundary annulus, and assert each identity to round-off.

Benchmarks (benchmarks/results.md, single thread):

grid active cells cut cells nnz (L + N) LU memory (MB) implicit step (ms) CG iters CG iters, aligned square
64 x 64 3812 84 37960 3.7 1.0 228 222
128 x 128 15160 164 151280 22.1 1.9 454 439
256 x 256 60488 324 604240 113.2 19.2 890 873

Building the Fortran modules

The files in src/ are the cut-cell solver modules of the research code. They plug into a parallel staggered-grid finite volume framework that supplies the grid and cut-cell types (grid_t, cutcell_t), the geometric cut-cell weights, MPI decomposition, I/O and the config.h macros (FV_ASSERT, FV_ABORT, FV_RANK, FV_ROOT). Requirements: a Fortran 2003 compiler with preprocessing (gfortran 5+ or ifort), MPI, PETSc and SLEPc 3.5 (Fortran finclude header layout), ARPACK and LAPACK.

Citation

@misc{bay2019cutcell,
  author = {Bay, Yong Yi},
  title  = {An Energy-Conservative Cut-Cell Method and Advanced {B}-Spline-Based
            Filtering Method for Flow Simulation},
  note   = {PhD dissertation},
  year   = {2019}
}

@unpublished{bay2026cutcell,
  author = {Bay, Yong Yi},
  title  = {Energy Conserving Cut-cell Method for the Incompressible
            {N}avier--{S}tokes Equations},
  year   = {2026},
  note   = {Manuscript}
}

License

MIT. See LICENSE.

About

Energy-conserving cut-cell finite volumes for incompressible Navier-Stokes: SBP, skew-symmetric, stable for any geometry

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages