--- license: other language: - en tags: - OneScience - fluid-dynamics - physics-informed-neural-networks - backward-facing-step --- # PseudoTimePINN-BackwardFacingStep ## Model Introduction This package reproduces the Re=800 backward-facing-step experiment from [When PINNs Go Wrong: Pseudo-Time Stepping Against Spurious Solutions](https://arxiv.org/abs/2604.23528). An adaptive pseudo-time PINN predicts steady velocity and pressure from `(x, y)`. The SU2 reference field is used for evaluation only, not for supervised parameter updates. ## Model Description The network uses a Fourier-feature MLP and a SOAP optimizer. The included run completed 100,000 training steps on one DCU. `weight/best_model.pth` was selected at step 47,200 using an unlabeled physics validation score; `weight/last_model.pth` is retained because the default inference compares the best and final checkpoints. ## Intended Use | Task | Description | | --- | --- | | Backward-facing-step flow | Approximate the separated Re=800 flow field | | PINN evaluation | Compare predictions with the author's SU2 reference field | ## Usage ### Download the Model Package ```bash hf download OneScience-Group/PseudoTimePINN-BackwardFacingStep --local-dir ./PseudoTimePINN-BackwardFacingStep cd PseudoTimePINN-BackwardFacingStep ``` ### Install Dependencies Use an environment with a compatible PyTorch GPU/DCU build. On the tested DCU platform, activate DTK and a compatible Conda environment, then install `requirements.txt` and `modelscope[datasets]`. Full training requires an allocated Slurm compute node; the provided configuration does not silently fall back to CPU. ```bash pip install -r requirements.txt pip install 'modelscope[datasets]' ``` ### Evaluation Data The only external file is the author's 31,265-point SU2 reference field. Download it from the [OneScience/BackwardFacingStep-SU2-Re800 dataset](https://www.modelscope.cn/datasets/OneScience/BackwardFacingStep-SU2-Re800) into the package's `data/` directory: ```bash modelscope download --dataset OneScience/BackwardFacingStep-SU2-Re800 --local_dir ./data ``` The expected file is `data/flow.vtu`, SHA256 `004f10b2b9ce1e38542537da648c1221730308310f1f7fa675dc7a92b4900d8a`. PDE and boundary training points are generated by the code. ### Train From the package root on an allocated GPU/DCU compute node: ```bash python scripts/train.py ``` The configured full run has 100,000 steps. Save copies of the bundled checkpoints before retraining. ### Inference and Results ```bash python scripts/inference.py python scripts/result.py ``` The best checkpoint's measured relative L2 error in `u` was `0.003582`, compared with `0.002320` in the paper's Table 1. The final checkpoint was substantially worse (`0.093482`); use the best checkpoint for applications. The comparison is one run, not a claim of exact paper-level reproduction. ## OneScience Repositories | Platform | Main repository | Skills repository | | --- | --- | --- | | Gitee | [OneScience](https://gitee.com/onescience-ai/onescience) | [OneSkills](https://gitee.com/onescience-ai/oneskills) | | GitHub | [OneScience](https://github.com/onescience-ai/OneScience) | [OneSkills](https://github.com/onescience-ai/oneskills) | ## Citation and License - Paper: [When PINNs Go Wrong](https://arxiv.org/abs/2604.23528). - Reference field: [JAXPI2 backward-facing-step data](https://github.com/sifanexisted/jaxpi2/tree/main/examples/bfs_flow/data). The data is distributed separately on ModelScope; consult the original repository's applicable terms.