Divergence-Free Neural Networks
- dfNNs are neural parameterizations that enforce divergence-free conditions exactly through architectural designs, ensuring conservation laws hold identically.
- They leverage methods like potential lifting and spectral projection to transform physical constraints into well-defined neural representations, enhancing stability and accuracy.
- Applications in incompressible flows, solid mechanics, and medical imaging demonstrate that encoding physical laws directly in the network improves model performance.
Divergence-Free Neural Networks (dfNNs) are neural parameterizations whose outputs satisfy a divergence-free constraint identically, by construction, rather than only approximately through a loss penalty. In the literature, the constraint appears in several equivalent or application-specific forms: the incompressibility condition for velocity fields, ; the equilibrium condition for stress fields, ; and the space-time conservation law , recast as divergence-freeness of a space-time current in (Richter-Powell et al., 2022, He et al., 30 Mar 2026). The defining feature of dfNNs is therefore architectural: the admissible hypothesis space is restricted to solenoidal fields, or to divergence-free tensor fields, before optimization begins.
1. Mathematical foundations
A central starting point is the observation that the continuity equation can be rewritten as a divergence-free condition in space-time. If
then
Parameterizing as a divergence-free object therefore enforces conservation exactly. In the differential-forms formulation, this is achieved by identifying the metric-lowered current as a co-closed $1$-form and representing it as a coexact form, 0, or equivalently as a curl-like construction in space-time (Richter-Powell et al., 2022).
The same idea admits a classical vector-calculus interpretation. In Euclidean space, for a smooth vector field 1 with Jacobian 2, the divergence is 3. For linear fields 4, skew-symmetry 5 implies 6, hence divergence-freeness. More generally, divergence-free vector fields are linked to skew-adjoint directional derivative operators on 7 spaces, and the associated flows preserve volume by Liouville’s theorem; orthogonal recurrent models exploit precisely this structure in discrete time (Azencot et al., 2021).
For Sobolev vector fields on bounded Lipschitz domains, the modern dfNN literature makes this structure explicit through potential lifting. On domains that are starlike with respect to a ball, every divergence-free Sobolev field 8 admits a stable potential 9 such that
0
with
1
and
2
In two dimensions this reduces to the stream-function representation 3, while in three dimensions it reduces to the vector-potential representation 4 (He et al., 30 Mar 2026).
2. Architectural realizations
The most direct dfNN construction parameterizes a potential and differentiates it. In two dimensions, one sets
5
and in three dimensions
6
Because 7 and 8, incompressibility holds identically. A higher-dimensional variant uses an antisymmetric tensor potential 9 and defines the velocity row-wise by
0
Then
1
in the distributional sense because 2 and mixed derivatives commute (He et al., 30 Mar 2026, Cheng et al., 18 Mar 2026).
A second family enforces divergence-freeness by projection. On periodic domains, the Leray projector
3
maps any field to its divergence-free component. In Fourier variables, for 4,
5
with the zero mode removed to enforce zero mean. This produces a differentiable spectral layer that can be inserted into deterministic neural operators or into generative probability flows; exact incompressibility then holds up to discretization error (Li et al., 25 Mar 2026, Genuist et al., 27 Jan 2026). A related discrete perspective appears in large-eddy simulation, where divergence-freeness is enforced not by the network alone but by a divergence-consistent filter and projection pipeline acting on the full right-hand side of the coarse dynamics (Agdestein et al., 2024).
The same architectural logic extends from vectors to tensors. In solid mechanics, a stress row 6 can be represented as
7
or, in Fourier space,
8
which guarantees 9 mode-by-mode (Khorrami et al., 2024, Khorrami et al., 1 May 2026). For divergence-free symmetric tensors, Riemann Tensor Neural Networks (RTNNs) represent
0
with 1 satisfying Riemann symmetries; the output is symmetric and divergence-free to machine precision by construction (Jnini et al., 2 Mar 2025).
3. Approximation theory and optimization regimes
A distinctive theoretical development is the divergence-free finite neuron space built from linearized ReLU2 features. With the augmented variable 3 and quasi-uniform inner parameters 4, the scalar finite neuron space is
5
where 6. Combining scalar Sobolev integral representation with stable antisymmetric potential lifting yields divergence-free basis functions
7
and the approximation theorem
8
In particular, the 9 rate is
0
and the 1 rate is available only for 2 (He et al., 30 Mar 2026).
Optimization strategies vary with the architecture. In finite-neuron and TransNet-style constructions, inner parameters are fixed and only outer coefficients are learned, so training reduces to convex or overdetermined linear least squares (He et al., 30 Mar 2026, Cheng et al., 18 Mar 2026). In the Decoupled-DFNN method for Navier–Stokes, nonlinearity is handled by Gauss–Newton linearization of the stream-function or vector-potential subproblem, after which each iteration again reduces to a linear least-squares solve (Cheng et al., 18 Mar 2026). By contrast, DAF-FlowNet is an unsupervised coordinate-based implicit network trained per timeframe with Adam and a cosine data-consistency loss, while the PeFNO stress models use FNO backbones whose outputs are passed through fixed Fourier-space curl layers (Bisbal et al., 31 Mar 2026, Khorrami et al., 2024).
From a function-space viewpoint, universality is established in several settings. The differential-forms constructions of Neural Conservation Laws are universal for divergence-free vector fields on periodic domains up to harmonic components (Richter-Powell et al., 2022). RTNNs prove a corresponding universal approximation theorem for sufficiently smooth divergence-free symmetric tensors (Jnini et al., 2 Mar 2025). The operator-theoretic viewpoint from orthogonal recurrent models adds a complementary statement: divergence-free dynamics correspond to skew-symmetric directional derivative operators, while soft divergence penalties enlarge the model class to general vector fields (Azencot et al., 2021).
4. Applications and empirical behavior
In incompressible flow solvers, dfNNs are used both as ansatz spaces and as learned dynamics models. The Decoupled-DFNN method for Stokes and Navier–Stokes represents velocity by a stream function in 3D or a vector potential in 4D, achieves divergence errors at machine precision 5–6 in experiments, and reports approximately 7 speedups relative to coupled TransNet solves in several regimes (Cheng et al., 18 Mar 2026). In neural-operator and generative settings, divergence-free projection markedly improves long-term stability: the project-and-generate framework reports exact incompressibility up to discretization error and substantially improved stability and physical consistency on 8D Navier–Stokes, while divergence-free diffusion models for Kolmogorov flow show that manifold projection gives 9 and that predictor–corrector Leray variants preserve exact incompressibility with competitive rollout errors (Li et al., 25 Mar 2026, Genuist et al., 27 Jan 2026). At the discrete LES level, a divergence-consistent formulation coupled with a CNN closure is stable and accurate with both a-priori and a-posteriori training, whereas divergence-inconsistent filtering is unstable unless stabilized by additional measures (Agdestein et al., 2024).
In solid mechanics, dfNNs encode quasi-static equilibrium directly in the architecture. The physics-encoded FNO (PeFNO) outputs a stress potential rather than stress, and a non-trainable Fourier-space curl mapping enforces 0 for all parameters (Khorrami et al., 2024). In reported comparisons, the weak-divergence baseline exhibits pixel-wise errors around 1 for 2 and 3, whereas the divergence-free model yields significantly smaller equilibrium residuals across 4 (Khorrami et al., 2024). A later stress-potential formulation reports that the largest error in 5 from PeFNO is three orders of magnitude smaller than PiFNO with 6, at comparable stress accuracy (Khorrami et al., 1 May 2026). RTNNs broaden this pattern from vector fields to conservative tensor surrogates: for the Cylinder benchmark at 7, RTNN reports relative 8 error 9 versus 0 for Neural Conservation Laws and 1 for PINN; for the 2D Beltrami case at 3, RTNN reports 4 versus 5 and 6 (Jnini et al., 2 Mar 2025).
Medical imaging and geophysics provide application domains in which divergence-freeness encodes mass conservation rather than fluid-state admissibility alone. DAF-FlowNet parameterizes velocity as the curl of a vector potential and combines this with a cosine data-consistency loss that exploits phase periodicity. On synthetic aortic 7D Flow MRI, it reports up to 8 lower velocity normalized root mean square error, 9 lower directional error, and 0 lower divergence relative to the best-performing alternative across noise levels; at peak velocity/velocity-encoding ratios of 1 and 2, it leaves 3 and 4 residual wrapped voxels, respectively (Bisbal et al., 31 Mar 2026). On 5 hypertrophic cardiomyopathy datasets, aortic AAoP–AAoD flow bias is reduced from 6 to 7 in HNCM, and pulmonary bias from 8 to 9 (Bisbal et al., 31 Mar 2026). For Antarctic ice flux interpolation over Byrd Glacier, the stream-function dfNN achieves RMSE $1$0, MAE $1$1, and MAD $1$2; with directional guidance the RMSE improves to $1$3, while PINN retains nonzero MAD and unconstrained NN exhibits large divergence artifacts (Bente et al., 7 Oct 2025).
5. Hard constraints, soft penalties, and common points of confusion
A recurring comparison is between physics-encoded dfNNs and penalty-based models. In the cited works, the hard-constraint approach removes the need to balance a divergence penalty against data fit or PDE residuals. This is emphasized in the finite-neuron approximation theory, in solid-mechanics PeFNO models, in DAF-FlowNet, and in ice-flux interpolation, where soft penalties are described as requiring delicate weighting and as being prone to optimization or stability difficulties (He et al., 30 Mar 2026, Khorrami et al., 2024, Bisbal et al., 31 Mar 2026, Bente et al., 7 Oct 2025). The DNN-MG study provides an explicit negative example: adding penalties on the divergence of the correction or on the corrected field did not significantly reduce divergence, and for $1$4 the network output collapsed toward zero, whereas the stream-function architecture produced better fidelity (Margenberg et al., 2020).
A second point is that exact divergence-freeness is not equivalent to full physical correctness. Curl-based stress parameterizations enforce equilibrium but do not enforce symmetry of the first Piola–Kirchhoff stress, which is not generally symmetric in nonlinear elasticity (Khorrami et al., 2024). In the diffusion setting, exact projection can improve short-horizon fidelity yet be less favorable than softer corrections in some out-of-distribution regimes: for the perturbed Taylor–Green vortex, the PINN-like soft-constraint variant reports the best MSE, while hard-projected variants preserve $1$5 (Genuist et al., 27 Jan 2026). Likewise, in DAF-FlowNet, the cosine loss becomes difficult in the very low VENC regime, where specialized unwrapping methods remain preferable (Bisbal et al., 31 Mar 2026).
A third point concerns representation versus geometry. The theorem linking divergence-free vector fields to skew-symmetric directional derivative operators does not imply that every divergence-free field has the linear form $1$6; the finite-dimensional skew-symmetric matrix is only the linear special case, whereas the general statement is operator-theoretic (Azencot et al., 2021). More generally, coexact or curl representations may require harmonic components on periodic or topologically nontrivial domains, and gauge choices matter whenever the potential is not uniquely determined (Richter-Powell et al., 2022).
6. Domain assumptions, limitations, and extensions
Most exact dfNN constructions rely on structural assumptions about the domain or discretization. The divergence-free finite-neuron theory assumes a bounded Lipschitz domain that is starlike with respect to a ball; on general domains, a finite-dimensional harmonic subspace must be added through Hodge decomposition (He et al., 30 Mar 2026). Spectral Leray projection and the diffusion-based models are presented on periodic domains, with the zero mode removed and FFT-based implementations throughout (Li et al., 25 Mar 2026, Genuist et al., 27 Jan 2026). Stress-potential PeFNO models likewise rely on periodic Fourier representations of unit cells (Khorrami et al., 2024, Khorrami et al., 1 May 2026).
Regularity and conditioning are equally central. In the ReLU$1$7 finite-neuron theory, the approximation rate depends on $1$8, and $1$9 rates require 00; low regularity, such as corner singularities in lid-driven cavity flow, degrades observed convergence (He et al., 30 Mar 2026). The Decoupled-DFNN potential formulation involves fourth-order operators such as 01 or 02, which are handled by automatic differentiation and least squares but can challenge stability at high Reynolds number (Cheng et al., 18 Mar 2026). RTNNs require second derivatives of scalar coefficient fields, and further derivatives appear when viscous or MHD residuals are added (Jnini et al., 2 Mar 2025). DAF-FlowNet, although robust to moderate segmentation perturbations, incurs substantial runtime—03 on synthetic data and 04 in vivo on an NVIDIA A100, compared with much faster baselines (Bisbal et al., 31 Mar 2026).
The reported extensions are broad but structured. The divergence-free finite-neuron framework explicitly suggests deep networks, adaptive parameter distributions, and analogous treatments of curl-free fields, Maxwell complexes, and neural-operator trial spaces (He et al., 30 Mar 2026). Stress-potential work proposes incorporating nonzero body forces, anisotropy, plasticity, and alternative neural operators such as DeepONets (Khorrami et al., 1 May 2026). DAF-FlowNet points to multi-VENC acquisitions, adaptive Fourier-feature scaling, and broader anatomical validation (Bisbal et al., 31 Mar 2026). Projection-based operator learning identifies non-periodic boundary conditions, 05D vector-potential formulations, and more general geometries as natural next steps (Li et al., 25 Mar 2026, Genuist et al., 27 Jan 2026). Taken together, these directions suggest that dfNNs are less a single architecture than a design principle: encode the relevant divergence constraint in the representation, projection, or operator pipeline, and then optimize only within that constrained function class.