CMPSTheory & User Reference Manual
NeuralFlow: Solver-Trained Recurrent GNO
LIKUA HomeManual Home

NeuralFlow: Solver-Trained Recurrent Graph Neural Operator

Terminology and role. NeuralFlow is the learned iterative solver option in CMPS. It is not a postprocessor and not a one-shot surrogate fitted to a database of completed CFD fields. NeuralFlow is a recurrent local Graph Neural Operator (GNO): CMPS supplies the current finite-volume state, mesh topology, boundary information and conservation imbalance, and the GNO learns a correction that is applied repeatedly toward a converged state.

What NeuralFlow is—and is not

The central object learned by NeuralFlow is the iterative correction process, rather than a direct map from geometry and boundary conditions to one completed flow field. For rollout index \(r\),

\[\mathbf q^{(r+1)}=\Phi_\theta\!\left(\mathbf q^{(r)},\mathcal M,\mathcal C_{BC}\right),\]

where \(\mathcal M\) is the finite-volume mesh graph and \(\mathcal C_{BC}\) is the prescribed boundary-condition encoding. The same learned operator is reused recurrently, analogous to repeatedly applying an iterative nonlinear solver update.

Method classPrimary learned objectRelation to CMPS physics
One-shot surrogate / ROMCompleted field or engineering quantityUsually trained mainly from solved-case labels.
Classical PINNContinuous field satisfying pointwise differential-equation penaltiesPhysics normally appears through differential PDE residuals evaluated at sample points.
NeuralFlowRecurrent local solver correctionTrained through CMPS finite-volume residuals, numerical fluxes and solver Jacobian feedback.

Therefore NeuralFlow does not replace the CMPS flux functions, thermodynamic closures, boundary-condition operators or conservation equations with a neural approximation. Those remain the physical authority during training.

Current learned state

The current production GNO state contains exactly the carrier primitive variables

\[\mathbf q_i=[u_{1,i},\ldots,u_{D,i},p_i,T_i]^T,\qquad n_q=D+2.\]

The present formulation rejects equation layouts for which \(n_q\neq D+2\). Species, turbulence variables, dilute-particle variables, solid variables and VOF fractions are therefore outside the current learned-state schema.

CMPS as the physics teacher

After a NeuralFlow correction is applied, CMPS evaluates the ordinary cell-centered finite-volume imbalance

\[\mathbf B_i(\mathbf q)=\sum_{f\in\partial\Omega_i}\mathbf F^{asm}_{i,f}(\mathbf q)-\mathbf S_i(\mathbf q)V_i.\]

The face term is the same assembled CMPS numerical flux contribution used by the conventional solver. Thus shocks, wall layers, boundary closures and all-Mach flux behavior enter training through the actual discretized physics rather than through a separate neural flux law.

Let the exact residual Jacobian of the active differentiated residual be

\[\mathbf J_B=\frac{\partial\mathbf B}{\partial\mathbf q}.\]

With the current CMPS linear-system sign convention,

\[\mathbf A_{solv}\approx-\mathbf J_B.\]

For a frozen quadratic physical metric

\[J_{phys}=\frac12\mathbf B^T\mathbf W\mathbf B,\]

the state-space training gradient is

\[\nabla_{\mathbf q}J_{phys}=\mathbf J_B^T\mathbf W\mathbf B\approx-\mathbf A_{solv}^T\mathbf W\mathbf B.\]

During training, the finite-volume residual provides the physics objective and the coupled CMPS Jacobian supplies the sensitivity of that objective to the primitive state. Differentiation through the recurrent GNO then propagates the state-space gradient to the network parameters:

\[\nabla_\theta J_{phys}=\left(\frac{\partial\mathbf q^{(R)}}{\partial\theta}\right)^T\nabla_{\mathbf q^{(R)}}J_{phys}.\]

Meaning of “exact Jacobian.” Exact here means exact differentiation of the active differentiated residual for the prepared assembly state. Coefficients intentionally frozen outside that differentiated expression remain frozen, exactly as in the conventional implicit CMPS assembly.

Finite-volume physics rather than pointwise PDE fitting

NeuralFlow is closer in spirit to a physics-constrained learned nonlinear solver than to a classical PINN. The physical constraint is the integral finite-volume balance over every control volume,

\[\int_{\partial\Omega_i}\mathbf F(\mathbf q)\cdot\mathbf n\,dA-\int_{\Omega_i}\mathbf S(\mathbf q)\,dV=\mathbf 0,\]

represented numerically by \(\mathbf B_i=\mathbf 0\). Consequently, the same upwind fluxes, wall closures, thermodynamic derivatives and implicit coupling used to resolve shocks and boundary layers also define the training feedback.

Actual recurrent correction pipeline

  1. Construct the directed finite-volume graph from CMPS cell-face connectivity.
  2. Encode local primitive state, mesh geometry and solver-inspired edge quantities.
  3. Encode prescribed boundary conditions with explicit masks, family labels and physical auxiliary values.
  4. Apply one shared graph-update operator repeatedly to propagate information through the local mesh graph.
  5. Decode a primitive correction: additive velocity increments and multiplicative/logarithmic pressure-temperature corrections.
  6. Apply the configured bounded correction authority and physical pressure/temperature limits.
  7. Repeat the learned correction recurrently during rollout.
  8. During training, write predicted states back to CMPS, assemble physical imbalance/Jacobian feedback, and backpropagate the resulting physics-constrained gradient through the rollout.

Construction lifecycle and option consistency

The graph must exist before the GNO architecture is constructed. The current ordering is

\[\mathcal M\;\longrightarrow\;\mathcal G_\theta(\mathcal M,\Theta_{arch})\;\longrightarrow\;\operatorname{Initialize}\;\longrightarrow\;\operatorname{NearIdentityInit}.\]

Architecture-changing controls such as hidden width, repeated graph-stage count, device and arithmetic precision are therefore construction-time semantics.

Current structural defaults

ControlCurrent defaultMeaning
Hidden MLP widths96, 96, 96Encoder and graph sub-network widths.
ActivationSiLUCurrent default nonlinear activation.
Latent node width96Dimension of the recurrent hidden state.
Shared graph stages60Repeated applications of one shared graph operator per GNO forward pass.
Hidden residual scale0.5\(h^{\ell+1}=h^\ell+0.5\,\Delta h^\ell\).
Training rollout steps20Recurrent learned corrections unrolled before the final physical objective.
Learned relaxation headOffDefault correction authority is fixed rather than predicted.
Maximum velocity relaxation0.4Velocity correction authority per learned pass.
Maximum pressure relaxation0.05Applied to the bounded log-pressure correction.
Maximum temperature relaxation0.05Applied to the bounded log-temperature correction.
Log-pressure cap0.2Bound before relaxation.
Log-temperature cap0.08Bound before relaxation.
Default device / precisionNVIDIA CUDA / single precisionCPU and double-precision execution are also supported.

Boundary-condition scope

The learned descriptor currently has explicit semantics for far field, pressure outlet, ordinary wall and symmetry faces. It transports prescribed boundary information into the GNO rather than treating detached solver-computed face states as training data. One-dimensional charring walls and one-sided interior/FSI-wall graph edges are rejected by the present schema.

Execution modes and present restrictions

ModeRole
CFDConventional CMPS solve with no NeuralFlow correction.
TrainingRecurrent differentiable GNO rollout with CMPS physics feedback and optimizer update. Current CMPS formulation is serial.
InferenceNo-gradient recurrent GNO evaluation for learned state advancement.

The current VOF state is incompatible with the \([\mathbf u,p,T]\) learned schema, so VOF remains on the conventional CFD path. The same applies to other equation layouts that add active transported variables beyond the current carrier primitive block.

Detailed NeuralFlow chapters

The formulation is expanded in finite-volume graph and boundary encoding, recurrent correction, rollout and training, and physics-constrained objectives and Jacobian metrics.