Downloads · 30 days
0
dave1368/cluster-03-potential-flow-pinn
cluster-03-potential-flow-pinn is a machine learning model from dave1368. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A Physics-Informed Neural Network predicting velocity potential (φ) and stream function (ψ) for 2D potential flow around a rotating cylinder — the pre-image, under the exact Joukowski conformal map, of a Joukowski air…
Downloads · 30 days
0
Access
Public
Updated Aug 28, 2026
Repo size
272 KB
Likes
0
Public
Click a slice to open those files.
.pt272 KB · 95%
From the Hugging Face model README
A Physics-Informed Neural Network predicting velocity potential (φ) and stream function (ψ) for 2D potential flow around a rotating cylinder — the pre-image, under the exact Joukowski conformal map, of a Joukowski airfoil — at any angle of attack. Trained as part of the 9-cluster Scientific AI Cluster Orchestration Framework, which pairs this network with an exact symbolic ("Symetria") Joukowski solver and two physics-grounded safety audits under LangGraph supervision.
| Input | (x, y, angle_of_attack_deg) — 3 features |
| Output | (φ, ψ) — velocity potential, stream function |
| Hidden layers | 5 × 128 neurons, Tanh activation |
| Parameters | ~66,000 |
| Circulation term | Computed analytically (exact, via atan2), not learned |
The network predicts only the smooth, single-valued doublet+uniform-flow
part of φ (plus ψ). The multi-valued vortex/circulation contribution to φ —
(Γ(α)/2π)·θ, a genuine topological feature of point-vortex potentials that
no smooth feedforward network can represent without corrupting its local
gradient near the branch cut — is added analytically instead, so the
network is only ever asked to learn the smooth part it can actually
represent.
import torch
from huggingface_hub import hf_hub_download
from modeling import PotentialFlowPINN
ckpt_path = hf_hub_download("dave1368/cluster-03-potential-flow-pinn", "potential_flow_pinn.pt")
# weights_only=False: the checkpoint is a dict with metadata (model_state_dict
# plus training info), not a bare tensor, so torch's default-safe loader can't
# be used as-is. Only do this for checkpoints you trust the source of.
checkpoint = torch.load(ckpt_path, map_location="cpu", weights_only=False)
model = PotentialFlowPINN()
model.load_state_dict(checkpoint["model_state_dict"]) # checkpoint also carries training-time loss history, see training_metrics.json
model.eval()
# coords: (x, y, angle_of_attack_degrees)
coords = torch.tensor([[1.5, 0.5, 5.0]])
phi_psi = model(coords)
print(phi_psi) # tensor([[phi, psi]])
Exact closed-form labels — no synthetic correlation needed. For each sampled
(r, θ, α), the exact potential-flow-around-a-rotating-cylinder solution
(uniform flow + doublet + circulation, with circulation set by the Kutta
condition at the trailing edge) provides the ground-truth (φ, ψ):
r ∈ [1, 5·R], θ ∈ [-π, π], α ∈ [-10°, 25°]Cross-checked against Euler (1757), d'Alembert (1752), and Joukowski (1910) — the papers cited in this cluster's Master Specification. Full data tables in the Space README. This network's drag error, correctly measured in the flow-aligned frame, is small and roughly constant across the full AoA range (0.13–0.35) rather than growing with angle.
| Check | Result |
|---|---|
| Joukowski (1910) exact mapping | Exact solver matches independent recomputation to floating-point precision |
| Kutta condition self-consistency | v_θ ≈ 0 (numerical precision) at trailing edge, α ∈ [−10°, 25°] |
| d'Alembert (1752) drag, exact solution (flow-aligned) | ≈0 at every tested angle, as required |
| d'Alembert (1752) drag, this network (flow-aligned) | 0.13–0.35 across α ∈ [−10°, 25°] |
| Pointwise φ, ψ vs. exact (32-pt grid, α=0°/15°) | Mean |err|: φ=1.06, ψ=1.23 (field magnitudes ~20–115) |
| Euler/Laplace ∇²φ (r ≥ 1.5, away from body) | Small relative to local velocity-gradient scale |