CMPSTheory & User Reference Manual
NeuralFlow Finite-Volume Graph and Boundary Encoding
LIKUA HomeManual Home

NeuralFlow Finite-Volume Graph and Boundary Encoding

Solver graph, not a generic point cloud. NeuralFlow uses the finite-volume mesh topology itself. Nodes are control volumes, directed edges are cell-face incidences, and boundary edges preserve the physical boundary operator. The graph therefore encodes the same locality and orientation used by CMPS flux assembly.

Directed cell-face graph

Every cell is a graph node. Every cell-face incidence is one directed edge. An interior face shared by cells \(i\) and \(j\) therefore contributes both \(i\to j\) and \(j\to i\). A physical boundary edge has no destination cell and instead carries its boundary-family descriptor.

For an edge seen from owner cell \(i\), the compact geometry block is

\[\mathbf g_e=\left[\mathbf A_f,\ \mathbf n_f,\ \frac{\mathbf A_f}{d_f},\ \Delta\mathbf r_f,\ \frac1{d_f},\ \frac{|\mathbf A_f|}{d_f}\right],\]

with \(\Delta\mathbf r_f=\mathbf x_j-\mathbf x_i\) on an interior edge and \(\Delta\mathbf r_f=\mathbf x_f-\mathbf x_i\) on a boundary edge. Its dimension is \(4D+2\).

Primitive normalization

\[\mathbf q_i^{feat}=\left[\frac{\mathbf u_i}{U_{ref}},\ \ln\!\left(\frac{p_i}{p_{ref}}\right),\ \ln\!\left(\frac{T_i}{T_{ref}}\right)\right].\]

The current fixed reference values are \(U_{ref}=347\,\mathrm{m/s}\), \(p_{ref}=101325\,\mathrm{Pa}\) and \(T_{ref}=300\,\mathrm K\). Pressure and temperature are first kept in the admissible CMPS range before logarithms are formed.

Finite-volume-inspired raw edge messages

For an owner state \(i\) and a neighbor or differentiable boundary-surrogate state \(j\), define

\[\Delta\ell_p=\ln p_j-\ln p_i,\qquad \Delta\ell_T=\ln T_j-\ln T_i,\]
\[\mathbf u_f=\frac12(\mathbf u_i+\mathbf u_j),\qquad \phi_u=\mathbf A_f\cdot\mathbf u_f.\]

The current raw edge-message families are

\[\mathbf m_{p,e}=\mathbf A_f\,\Delta\ell_p,\]
\[\mathbf m_{T,e}=\frac{\mathbf A_f}{d_f}\,\Delta\ell_T,\]
\[\mathbf m_{adv,e}=\phi_u\,\mathbf u_f,\]
\[\mathbf m_{diff,e}=\frac{|\mathbf A_f|}{d_f}(\mathbf u_j-\mathbf u_i).\]

These quantities are features for learning the solver correction. They are not substitute conservation fluxes and are never used in place of the actual CMPS residual.

Boundary-family buckets and geometric normalization

Raw messages are accumulated separately into interior, open-boundary, wall and symmetry buckets. Two local geometric scales are

\[S_i=\sum_{f\in i}|\mathbf A_f|,\qquad G_i=\sum_{f\in i}\frac{|\mathbf A_f|}{d_f}.\]

Pressure/advection-like sums are normalized by \(S_i\); thermal-gradient and velocity-diffusion sums are normalized by \(G_i\). Both raw and normalized forms are retained.

\[\mathbf x_i=[\mathbf q_i^{feat},\ \mathbf m_i^{raw},\ \mathbf m_i^{norm},\ \ln S_i,\ \ln G_i,\ \mathbf f_i^{op}].\]

The operator-fraction vector \(\mathbf f_i^{op}\in\mathbb R^5\) contains local fractions of interior, far-field, pressure-outlet, wall and symmetry faces. The resulting node-input dimension is

\[P=n_q+32D+7,\]

giving \(P=75\) in 2D and \(P=108\) in 3D.

Versioned prescribed-boundary descriptor

The current boundary contract is schema version 2. It carries prescribed physical data, validity masks and family/subtype information. It is deliberately distinct from a snapshot of a solved boundary-face state.

\[P_{host}=3n_q+2N_{aux}+N_{po}+N_{wm}+N_{wt},\]

with \(N_{aux}=6\), \(N_{po}=2\), \(N_{wm}=2\) and \(N_{wt}=6\). Therefore \(P_{host}=34\) in 2D and 37 in 3D.

Auxiliary physical values

The auxiliary fields expose boundary physics needed to construct a differentiable local surrogate, including thermodynamic and kinematic information whose interpretation depends on the boundary family. Masks distinguish a meaningful prescribed value from an unused slot.

Boundary semantics in the learned solver

Far-field and pressure-outlet edges communicate the prescribed open-boundary state and pressure/backflow information. Wall edges communicate wall velocity and wall-type/thermal metadata. Symmetry edges communicate the symmetry operator rather than an arbitrary ghost-cell value. This preserves the distinction between different physical boundary operators inside the learned update.

Differentiable local boundary surrogate

The feature path constructs a local differentiable surrogate state from the owner primitive state and prescribed boundary data. That surrogate is used only to form graph features; CMPS still applies the actual production boundary operator when assembling \(\mathbf B\) for the physics objective.

Learned hidden message passing

After encoding the physical node vector, NeuralFlow applies a shared recurrent graph stage. In schematic form,

\[\mathbf m_{ij}^{(\ell)}=\psi_\theta\!\left(\mathbf h_i^{(\ell)},\mathbf h_j^{(\ell)},\mathbf g_{ij},\mathbf b_{ij}\right),\]
\[\bar{\mathbf m}_i^{(\ell)}=\frac{1}{d_i}\sum_{j\in\mathcal N(i)}\mathbf m_{ij}^{(\ell)},\]
\[\mathbf h_i^{(\ell+1)}=\mathbf h_i^{(\ell)}+\alpha_h\,\varphi_\theta\!\left(\mathbf h_i^{(\ell)},\bar{\mathbf m}_i^{(\ell)}\right),\]

where the same parameter set is reused across repeated graph stages. Degree normalization prevents the latent update magnitude from growing simply because a cell has more incident graph edges.

What the graph is designed to learn

The graph supplies local state, geometry, boundary semantics and finite-volume-inspired directional signals. The neural operator is then trained to infer a correction that reduces the actual CMPS finite-volume imbalance. In that sense the graph is an encoding of the nonlinear-solver neighborhood, not a dataset representation of a completed CFD solution.