Graph neural network predicting incompressible 2D Stokes/NavierβStokes
solutions (vx, vy, p) and the inlet flow rate Q from geometry only,
trained on CFD reference solutions produced by the
Zienki finite-element solver.
ZienkiFlowNet/
βββ GCNN/ β Python package
β βββ dataset.py
β βββ model.py
β βββ train.py
β βββ infer.py
β βββ evaluate.py
β βββ utils.py
β βββ README.md
βββ README.md
../cfd_database/ β reference dataset (sibling, not tracked here)
βββ cases/
βββ case_XXXX/
βββ params.json
βββ result.vtu
βββ result.post.json
The dataset directory is expected as a sibling of ZienkiFlowNet/. It can be
overridden with --cases on the CLI.
PYBIN=/path/to/venv/bin/python
$PYBIN -m GCNN.dataset --build # build cached PyG dataset
$PYBIN -m GCNN.train --epochs 300 # train
$PYBIN -m GCNN.evaluate # evaluate on validation split
$PYBIN -m GCNN.infer --case ../cfd_database/cases/case_0000- Encoder: per-node features (8 geom + 4 obs + 2 wall normal) + 16-dim
Laplacian-eigenvector positional encoding (
MLP_pos,MLP_specheads). - Processor: 8 Γ MeshGraphNet blocks + 8 Γ CellBlock (FE-native TRI3 message-passing using P1 basis gradients), interleaved with global-token cross-attention and per-graph multi-head boundary cross-attention every two layers.
- Decoder: per-node
(vx_n, vy_n, p_n)+ global head forQ. - Hard BC projection in scaled space: walls
u=0, inletp=1, outletp=0.
JEPA-style auto-supervision: a fraction of nodes carry the ground-truth field as input (context), the rest are masked (targets). The mask ratio anneals on a cosine schedule from 0.30 β 1.00 over the training run, so the final epochs match the inference setting (pure geometry).
Losses: node MSE on targets + BC residual + global Q + scaled divergence on cells.