File size: 1,661 Bytes
b673a5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
library_name: phase
license: mit
pipeline_tag: image-to-image
tags:
- magnetohydrodynamics
- neural-operator
- diffusion
- physics-informed-machine-learning
---

# PHASE Kelvin-Helmholtz MR

Multi-regime PHASE model for the 2-D incompressible MHD Kelvin-Helmholtz instability on t=[0,5], with gated Re/Rm adapters and residual diffusion.

- **Channels:** [ux, uy, Bx, By]
- **Reynolds numbers:** Re=Rm in {80, 200, 400, 650, 1000, 1500, 2050, 2750, 3600, 4500}
- **Conditioner:** `conditioner/model.safetensors`
- **Diffusion model:** `diffusion/model.safetensors`
- **Normalization:** `normalization/`

## POSEIDON dependency

```bash
git clone https://github.com/camlab-ethz/poseidon.git external/poseidon
git -C external/poseidon checkout b8fa28f59bd7f7673323f28d11a12c6f3a215c61
pip install --no-deps -e external/poseidon
```

## Load

```python
import torch
from phase import PHASEPipeline

model = PHASEPipeline.from_pretrained(
    "phaseMHD/PHASE-KH-MR",
    device="cuda" if torch.cuda.is_available() else "cpu",
)

# Physical initial condition: [batch, channels, x, y]
# The KH model was trained on 101 frames from t=0 to t=5.
times = torch.linspace(0.0, 5.0, 101, device=model.device)
prediction = model.predict(initial_fields, times, re=1000, seed=0)
# prediction: [batch, channels, time, x, y]
```

Install the runtime from [PHASE](https://github.com/PHASE-MHD/PHASE):

```bash
pip install "phase[hub,dino,scot] @ git+https://github.com/PHASE-MHD/PHASE.git"
```

The package contains model-only weights, exact inference configs, and training-derived normalization statistics. See `pipeline.yaml` and `provenance.json` for the artifact mapping.