File size: 3,565 Bytes
eae86f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
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.