9 Sparse Linear Solver
The global coupled correction has the block-sparse form
9.1 Block-sparse structure
For cell
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
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
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
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
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,
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:
AMG and preconditioner-AMG level counts (currently configurable up to the selected case limit, with five levels used by the existing default configuration),
V-, W-, and F-cycle selection,
aggregation/coarsening thresholds,
numbers of pre- and post-smoothing sweeps,
ILU, block-Jacobi, symmetric Gauss–Seidel, or additive-Schwarz-type relaxation choices where supported by the selected execution mode,
Krylov smoothers including GMRES, FGMRES, BiCGSTAB, and TFQMR families, and
ILU fill level for local subdomain factorizations.
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
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
For a domain decomposition with rank-local diagonal blocks
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
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
GMRES chooses the Krylov coefficients from the least-squares problem
and updates
9.7 Incomplete-LU preconditioning
An ILU factorization approximates
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:
pseudo-time CFL/diagonal stabilization,
nonlinear residual reduction,
Krylov relative/absolute tolerance,
maximum Krylov iterations, and
preconditioner strength.
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.
| Role | Current choices |
|---|---|
| Scalable solver family | PCKSS; aggregation AMG; AMG-preconditioned Krylov |
| Local PCKSS preconditioner | Block Jacobi; block ILU |
| PCKSS Krylov method | GMRES; BiCGSTAB; TFQMR |
| AMG level relaxation | ILU; symmetric Gauss–Seidel; additive Schwarz |
| AMG level Krylov smoother | None; GMRES; BiCGSTAB; TFQMR |
| AMG-preconditioned outer Krylov | FGMRES; flexible BiCGSTAB |
| AMG cycle | V; 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.