yushuang88 commited on
Commit
0ce837d
·
verified ·
1 Parent(s): a147612

Update README and model configuration

Browse files
Files changed (1) hide show
  1. README.md +123 -0
README.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: pytorch
6
+ tags:
7
+ - OneScience
8
+ - fluid-dynamics
9
+ - aerodynamic-surrogate
10
+ - neural-field
11
+ datasets:
12
+ - OneScience-Group/airfrans
13
+ ---
14
+
15
+ <p align="center">
16
+ <strong><span style="font-size: 30px;">MARIO</span></strong>
17
+ </p>
18
+
19
+ # Model Introduction
20
+
21
+ MARIO is a resolution-independent aerodynamic surrogate developed by researchers affiliated with ISAE-SUPAERO. It rapidly predicts velocity, pressure, turbulent viscosity, and surface-pressure distributions for different geometries and flight conditions.
22
+
23
+ This repository is an independent OneScience reproduction of the AirfRANS field-prediction experiment from the MARIO paper.
24
+
25
+ Paper: [MARIO: A Modulated Neural Field Framework for Resolution-Independent Surrogate Modeling of Aerodynamics](https://arxiv.org/abs/2505.14704)
26
+
27
+ # Model Description
28
+
29
+ MARIO uses a modulation-conditioned neural-field architecture trained on two-dimensional AirfRANS airfoil data to predict steady aerodynamic fields across mesh resolutions.
30
+
31
+ # Intended Uses
32
+
33
+ | Use case | Description |
34
+ | --- | --- |
35
+ | 2D airfoil surrogate | Predict velocity, pressure, and turbulent viscosity for AirfRANS-style steady RANS cases. |
36
+ | Unstructured-mesh querying | Sample points during training and query complete meshes in chunks during inference. |
37
+ | Surface-pressure evaluation | Report surface-pressure MSE to analyze near-wall and aerodynamic-force errors. |
38
+ | Hugging Face/OneCode execution | Download the standalone package and run the provided scripts. |
39
+
40
+ # Usage
41
+
42
+ ## 1. OneCode
43
+
44
+ [Launch the OneCode AI-for-Science environment](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)
45
+
46
+ ## 2. Manual Setup
47
+
48
+ **Hardware requirements**
49
+
50
+ - A GPU or DCU is recommended.
51
+ - A CPU can run imports and small connectivity checks, but full training and inference will be slow.
52
+ - DCU users should install DTK 25.04.2 or later, or the OneScience-recommended version for the cluster.
53
+
54
+ ### Download the model repository from Hugging Face
55
+
56
+ ```bash
57
+ pip install -U huggingface_hub
58
+ hf download OneScience-Group/MARIO --local-dir ./MARIO
59
+ cd MARIO
60
+ ```
61
+
62
+ ### Install the runtime environment
63
+
64
+ **DCU environment**
65
+
66
+ ```bash
67
+ # Activate DTK first.
68
+ conda create -n onescience311 python=3.11 -y
69
+ conda activate onescience311
70
+ pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
71
+ ```
72
+
73
+ **GPU environment**
74
+
75
+ ```bash
76
+ conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
77
+ conda activate onescience311
78
+ pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
79
+ ```
80
+
81
+ ### Download the training dataset from Hugging Face
82
+
83
+ ```bash
84
+ hf download OneScience-Group/airfrans --repo-type dataset --local-dir ./data
85
+ ```
86
+
87
+ After downloading, update these entries in `config/config.yaml`:
88
+
89
+ - `paths.data_root`: the AirfRANS root containing `manifest.json` and the simulation samples.
90
+ - `paths.project_root`: the absolute path to this MARIO project.
91
+
92
+ ### Train
93
+
94
+ Run the full two-stage experiment, including SDF geometry-encoder training and flow-field-decoder training:
95
+
96
+ ```bash
97
+ python scripts/train.py --config config/config.yaml
98
+ ```
99
+
100
+ Geometry-encoding loss, flow-field loss, and per-field MSE are printed during training. The full experiment uses the 200 training samples from the AirfRANS scarce task and trains the geometry encoder and field decoder for 1,000 epochs each.
101
+
102
+ ### Pretrained weights
103
+
104
+ The repository includes `weight/best_model.pth`, trained on AirfRANS.
105
+
106
+ ### Inference and visualization
107
+
108
+ ```bash
109
+ python scripts/inference.py --config config/config.yaml
110
+ ```
111
+
112
+ For each sample, inference reports SDF reconstruction error, normalized MSE for each physical field, surface-pressure MSE, aerodynamic coefficients, and runtime. Results are saved under `results/`.
113
+
114
+ Generate field-prediction, ground-truth, absolute-error, surface-pressure, and paper-comparison figures with:
115
+
116
+ ```bash
117
+ python scripts/result.py --config config/config.yaml
118
+ ```
119
+
120
+ # Citation and License
121
+
122
+ - Paper: [MARIO: A Modulated Neural Field Framework for Resolution-Independent Surrogate Modeling of Aerodynamics](https://arxiv.org/abs/2505.14704).
123
+ - This repository uses the Hugging Face-compatible Apache License 2.0 identifier (`apache-2.0`). AirfRANS and other third-party resources remain subject to their original licenses and terms.