NeuralFlowTheory & User Reference Manual
Sparse Linear Solver
LIKUA HomeManual Home

9 Sparse Linear Solver

The global coupled correction has the block-sparse form . Each matrix block represents the sensitivity of one cell residual to its own or a neighboring cell's primitive-variable correction. The GUI linear-solver options change how this system is solved; they do not redefine the finite-volume governing equations.

9.1 Block-sparse structure

For cell , (9.1) The dense block structure is an advantage: coupling among momentum, continuity, energy, turbulence, particles, and species is retained locally, while sparsity is governed by mesh connectivity rather than by the square of the total cell count.

The active NeuralFlow linear-algebra formulation provides a CPU path based on Intel MKL and a GPU path based on NVIDIA CUDA. Both operate on the same assembled coupled block system. Linear-solver options are runtime-configurable; this guide does not assume that one Krylov/preconditioner combination is universally optimal for every equation set.

For a current linear iterate , the algebraic residual is

A normalized linear convergence measure can therefore be written as

9.2 NeuralFlow scalable solver layer

The coupled matrix is solved through the NeuralFlow scalable linear-solver interface. On CPUs, sparse/block algebra and solver kernels are provided through the Intel MKL formulation; on NVIDIA GPUs, the corresponding accelerator path uses CUDA. The interface exposes several solver families without changing the finite-volume assembly: conventional Krylov methods with local preconditioners, algebraic multigrid (AMG) as a solver, and AMG-preconditioned Krylov methods.

This separation is important. The nonlinear CFD layer constructs the same block system while the scalable-solver layer determines how that system is inverted. Changing from ILU-preconditioned GMRES to AMG-preconditioned FGMRES, for example, does not change the residual or its AD Jacobian.

9.3 Algebraic multigrid (AMG)

AMG constructs a hierarchy directly from the algebraic operator rather than from the CFD mesh hierarchy. Denote the fine-grid matrix by . AMG generates successively smaller operators (9.2) where is the algebraic prolongation and is restriction. A multilevel application combines smoothing of high-frequency algebraic error on each level with coarse-grid correction of error components that are slow for the smoother.

NeuralFlow exposes an AMG-only path, denoted by the formulation option AGGAMG. In this mode the multilevel hierarchy itself provides the linear correction, without requiring an outer Krylov iteration. The formulation provides configurable AMG depth; the present NeuralFlow option set includes a default maximum of five AMG levels unless changed by the case settings. The same NeuralFlow AMG abstraction can be used by the MKL CPU solver path or by the CUDA accelerator path according to the selected build and execution target.

AMG is distinct from the agglomeration/geometric multigrid described in Chapter 18. The latter coarsens the physical control-volume problem and can rediscretize the governing equations. AMG coarsens the assembled linear algebra of one implicit solve. NeuralFlow can therefore use geometric/agglomeration multigrid at the nonlinear CFD level while still using AMG or an AMG-preconditioned Krylov method inside a level’s linear solve.

One multigrid correction step starts from a smoothed approximation , forms the level residual and restricts it,

then solves or approximately solves the coarse error equation

and prolongs the correction back to the finer level,

For an algebraically generated hierarchy, the coarse operator has the standard triple-product form

9.4 AMG-preconditioned Krylov solvers

The NeuralFlow AMGPCKSS family uses AMG as the preconditioner of a Krylov-space method rather than as a stand-alone solve. With right preconditioning, (9.3) The purpose of is to reduce the long-range/low-frequency error components that make a purely local ILU or block-Jacobi preconditioner deteriorate as the mesh and MPI partition count grow.

The scalable-solver options include flexible Krylov choices, notably FGMRES and a flexible BiCGSTAB-type path, so that the effective AMG preconditioner is allowed to vary between iterations. This is appropriate when the multilevel application contains level-dependent iterative smoothing or when the preconditioner is not mathematically stationary.

The AMG configuration exposes, among other controls:

The distinction between AGGAMG and AMGPCKSS should therefore be kept explicit: the former uses aggregation AMG as the primary linear solve, whereas the latter embeds AMG inside an outer Krylov iteration.

With a possibly iteration-dependent AMG preconditioner, a flexible Krylov method applies

and stores the preconditioned basis vectors so that the correction has the form

This differs from fixed-preconditioner GMRES because is allowed to change between Krylov iterations.

9.5 Local block preconditioning

For MPI calculations, a simpler scalable option is a block-Jacobi decomposition in which each MPI rank approximately solves its local diagonal subproblem. In NeuralFlow this is represented by the PCKSS family, with local ILU available inside each block. If where contains rank-local diagonal submatrices, then a block-Jacobi preconditioner is where each local inverse can be approximated by ILU. This has low communication cost but does not by itself provide the global coarse correction available from AMG.

For a domain decomposition with rank-local diagonal blocks , the block-Jacobi preconditioner is

with the preconditioner application defined by independent local solves

9.6 GMRES

For a nonsymmetric Jacobian, GMRES constructs an approximate correction in the Krylov space where is the preconditioner. The method minimizes the residual norm over the current Krylov space and is therefore suitable for the nonsymmetric block matrices produced by upwind finite-volume fluxes.

Restarted GMRES limits the basis length to control memory. A smaller restart reduces storage but can slow convergence when important low-frequency/error components are discarded at restart.

The Arnoldi process constructs an orthonormal basis and upper-Hessenberg matrix such that

GMRES chooses the Krylov coefficients from the least-squares problem

and updates

9.7 Incomplete-LU preconditioning

An ILU factorization approximates without allowing all fill generated by exact Gaussian elimination. ILU(0) retains the original sparsity pattern; ILU() permits progressively larger levels of fill. More fill generally improves the preconditioner but increases setup cost, memory, and communication/parallel complexity.

For a cell-coupled CFD matrix it is important to preserve the dense equation block when applying a local factorization. Treating each scalar equation independently can destroy the very pressure-velocity/energy coupling introduced by the fully coupled discretization.

The preconditioner application consists of triangular substitutions

For block ILU, every retained scalar entry in these expressions represents a dense coupled variable block; this preserves local pressure–velocity–energy/species coupling.

9.8 Linear versus nonlinear accuracy

The linear residual is not the physical CFD residual. It measures how accurately the current linearized correction equation is solved. If the nonlinear state is still far from the solution or the pseudo-time term is strongly stabilizing the system, an excessively tight Krylov tolerance may spend work solving an approximation that will immediately be rebuilt. Conversely, a very loose solve can prevent the outer iteration from following a useful Newton direction.

A practical strategy therefore coordinates:

No asymptotic complexity claim such as “quadratic becomes linear” should be inferred solely from the storage format; actual cost depends on mesh connectivity, block size, fill, Krylov iteration count, and parallel communication.

9.9 Multigrid relationship

Geometric/agglomeration multigrid does not replace the fine-grid linear algebra with an unrelated solver. It provides a hierarchy that attacks error components on different spatial scales. Each active coarse level can reuse the same coupled residual/Jacobian machinery and its configured linear solver, with smoothing/coarse-solve effort chosen for the multigrid role. Chapter 18 describes this separation.

9.10 NeuralFlow scalable-solver option map

The Advanced Linear Solver panel separates the outer family, local preconditioner, algebraic-multigrid relaxation/smoothing, cycle type and the outer flexible Krylov method used when AAMG acts as a preconditioner. The customer-facing GUI names are PCKSS, AAMG and AAMGKSS; their detailed controls and defaults are listed in the Linear Solver GUI chapter.

RoleCurrent choices
Scalable solver familyPCKSS; aggregation AMG; AMG-preconditioned Krylov
Local PCKSS preconditionerBlock Jacobi; block ILU
PCKSS Krylov methodGMRES; BiCGSTAB; TFQMR
AMG level relaxationILU; symmetric Gauss–Seidel; additive Schwarz
AMG level Krylov smootherNone; GMRES; BiCGSTAB; TFQMR
AMG-preconditioned outer KrylovFGMRES; flexible BiCGSTAB
AMG cycleV; F; W; FW

Stand-alone AAMG and the AAMG preconditioner have separate controls for level count, relaxation, smoothing, fill level, threshold, smoothing count and cycle. The current defaults use five levels, two smoothing applications, ILU level relaxation, no extra Krylov smoother and an F-cycle. AAMGKSS uses FGMRES by default. Treat these as starting values rather than universal optima; total time-to-solution is the relevant tuning metric.