Cluster 5 Compressible Euler PINN
A Physics-Informed Neural Network predicting the compressible Euler flow
field (P, Ο, u, v) across a stationary normal shock, at any upstream Mach
number. Trained as part of the 9-cluster Scientific AI Cluster
Orchestration Framework,
which pairs this network with an exact symbolic ("Symetria") Rankine-
Hugoniot shock solver and a Second Law (entropy) safety audit under
LangGraph supervision.
Architecture
| Input | (x, y, z, M1) β 4 features |
| Output | (P, Ο, u, v) β pressure, density, streamwise/spanwise velocity |
| Hidden layers | 5 Γ 128 neurons, Tanh activation |
| Parameters | ~67,000 |
| Output scaling | log10(P/P1) (spans 2 orders of magnitude); Ο, u, v kept linear/normalized |
Quickstart
import torch
from huggingface_hub import hf_hub_download
from modeling import CompressibleEulerPINN
ckpt_path = hf_hub_download("dave1368/cluster-05-compressible-euler-pinn", "compressible_euler_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 = CompressibleEulerPINN()
model.load_state_dict(checkpoint["model_state_dict"]) # checkpoint also carries training-time loss history, see training_metrics.json
model.eval()
# coords: (x, y, z, upstream_mach_number) -- x=0.5 is the shock location
coords = torch.tensor([[0.95, 0.5, 0.5, 3.0]])
p_rho_u_v = model(coords)
print(p_rho_u_v) # tensor([[P, rho, u, v]])
Training data
Exact Rankine-Hugoniot normal-shock solution β no synthetic correlation needed. A stationary shock at x=0.5, planar (independent of y, z); upstream state is ISA-standard-day ambient, downstream state via the exact jump ratios:
- 60,000 training points, 10,000 validation points
- Domain:
x β [0, 1](spatially oversampled near x=0.5, the shock),y, z β [0, 1],M1 β [1, 10] - Final train loss: 0.00237 Β· Final val loss: 0.00388 (MSE, 3000 epochs, cosine LR decay)
Design notes and a known limitation
The shock is a true physical discontinuity in x (not a synthetic approximation), but unlike Cluster 3's multi-valued potential, a step function has no topological obstruction to a smooth network approximating it well β it just needs adequate local sampling density near the discontinuity, which the training data provides by design.
For upstream Mach numbers roughly in [1.10, 1.60], the network's own
predicted pressure/temperature jump implies a spurious entropy decrease β
a genuine approximation gap, not a bug in the audit or the orchestrator.
The true entropy jump scales as (M1Β²β1)Β³, vanishing cubically as M1β1,
while the network's absolute error stays roughly constant across the full
Mach range β so near M1β1, a small, otherwise-unremarkable prediction error
can be larger than the true (tiny) margin it's being compared against. This
is a capacity/formulation limit (the downstream audit combines two
independently-evaluated points into a ratio, which can't resolve a
cubically-vanishing margin), not a fixable training issue. See the Space
README
for the full data.
Validated against classical sources (post-deployment finding)
Cross-checked against Rankine (1870), Hugoniot (1887), and Mach (1887) β the papers cited in this cluster's Master Specification. Full data tables in the Space README.
| Check | Result |
|---|---|
| Symetria exact ratios vs. published table (Anderson, Modern Compressible Flow) | Exact match at every tested M1 |
| Second Law + downstream-subsonic (M2<1), exact solution | Holds at every tested M1 |
| Network's predicted jump vs. exact, M1 outside [1.10, 1.60] | Passes Second Law audit at every tested point |
| Network's predicted jump vs. exact, M1 inside [1.10, 1.60] | Fails β genuine approximation gap, see above |
| Mach angle ΞΌ=arcsin(1/M1) (Mach, 1887) | Computed independently as context; not modeled by this network |
Limitations
- Models a stationary 1D normal shock only β no oblique shocks or the Mach cone geometry Mach's own photographs captured.
- A bounded weak-shock Mach range (β1.10β1.60) fails its own Second Law audit due to a real, unresolved approximation gap (see above). The orchestrator's retry mechanism cannot recover a different result for these inputs, since neither the network nor its check points are randomized between attempts.