Datasets:
Languages:
English
Size:
10K - 100K
pretty_name: Wind Tunnel 20K Dataset | |
size_categories: | |
- 10K<n<100K | |
task_categories: | |
- feature-extraction | |
- graph-ml | |
- image-to-3d | |
language: | |
- en | |
tags: | |
- simulation | |
- openfoam | |
- physics | |
- windtunnel | |
- inductiva | |
- machine learning | |
- synthetic | |
<p align="center"> | |
<img src="https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/pressure_field_mesh.png", width="500px"> | |
</p> | |
# Wind Tunnel 20K Dataset | |
The Wind Tunnel Dataset contains 19,812 OpenFOAM simulations of 1,000 unique automobile-like objects placed in a virtual wind tunnel. | |
Each object is simulated under 20 distinct conditions: 4 random wind speeds ranging from 10 to 50 m/s, and 5 rotation angles | |
(0°, 180° and 3 random angles). | |
The meshes for these automobile-like objects were generated using the Instant Mesh model on images sourced from the Stanford Cars Dataset. | |
To ensure stable and reliable results, each simulation runs for 300 iterations. | |
The entire dataset of 20,000 simulations is organized into three subsets: 70% for training, 20% for validation, and 10% for testing. | |
The data generation process itself was orchestrated using the [Inductiva API](https://inductiva.ai/), | |
which allowed us to run hundreds of OpenFOAM simulations in parallel on the cloud. | |
# Why? | |
Existing object datasets have many limitations: they are either small in size, closed source, or have low quality meshes. | |
Hence, we decided to generate a new dataset using the [InstantMesh](https://github.com/TencentARC/InstantMesh) model, | |
which is open-source (Apache-2.0) and is currently state-of-the-art in image-to-mesh generation. | |
The automobile-like meshes were generated by running the image-to-mesh model [InstantMesh](https://github.com/TencentARC/InstantMesh) | |
on 1k images from the publicly available (Apache-2.0) | |
[Stanford Cars Dataset](https://www.kaggle.com/datasets/jessicali9530/stanford-cars-dataset) consisting of 16,185 images of automobiles. | |
Naturally, running the image-to-mesh model leads to meshes that may have certain defects, such as irregular surfaces, asymmetry issues | |
and disconnected components. Therefore, after running the image-to-mesh model, we run a custom post-processing step where we try to | |
improve the meshes quality. We used PCA to align the mesh with the main axis and we removed disconnected components. | |
The resulting set of meshes still have little defects, such as presence of "spikes" or "cavities" in supposedly flat areas and | |
asymmetric shapes, among others. We consider these little defects as valuable features of the dataset not as issues, since from the | |
point of view of the learning problem, they bring challenges to the model that we believe will contribute to obtaining more robust | |
and generalizable models. | |
# How did we generate the dataset? | |
1. **Generate Input Meshes**: First, input meshes are generated using the InstantMesh model with images from the Stanford Cars Dataset. Post-processing is then applied to these input meshes. | |
2. **Run OpenFOAM Simulations**: The Inductiva API is utilized to run OpenFOAM simulations on the input meshes at various wind speeds and object angles. This process produces an output mesh named `openfoam_mesh.obj`, which contains all relevant simulation information. | |
3. **Post-process OpenFOAM Output**: The OpenFOAM output is post-processed to generate streamlines and pressure map meshes. | |
The code used to generate the meshes and postprocess them is available on github: [https://github.com/inductiva/datasets-generation](https://github.com/inductiva/datasets-generation). | |
# Dataset Structure | |
``` | |
data | |
├── train | |
│ ├── <SIMULATION_ID> | |
│ │ ├── input_mesh.obj | |
│ │ ├── openfoam_mesh.obj | |
│ │ ├── pressure_field_mesh.vtk | |
│ │ ├── simulation_metadata.json | |
│ │ └── streamlines_mesh.ply | |
│ └── ... | |
├── validation | |
│ └── ... | |
└── test | |
└── ... | |
``` | |
## Dataset Files | |
Each simulation in the Wind Tunnel Dataset is accompanied by several key files that provide both the input and the output data of the simulations. | |
Here’s a breakdown of the files included in each simulation: | |
- **[input_mesh.obj](#input_meshobj)**: OBJ file with the input mesh. | |
- **[openfoam_mesh.obj](#openfoam_meshobj)**: OBJ file with the OpenFOAM mesh. | |
- **[pressure_field_mesh.vtk](#pressure_field_meshvtk)**: VTK file with the pressure field data. | |
- **[streamlines_mesh.ply](#streamlines_meshply)**: PLY file with the streamlines. | |
- **[metadata.json](#metadatajson)**: JSON with metadata about the input parameters and about some output results such as the force coefficients (obtained via simulation) and the path of the output files. | |
### input_mesh.obj | |
Input mesh generated with InstantMesh model from images of the Stanford Cars Dataset. | |
This mesh was used as the input of the OpenFoam simulation. | |
The mesh generation process is described [here](#Why). | |
| **Input Mesh** | **Points Histogram** | | |
|-------------------------------|------------------------------| | |
| ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/input_mesh.png) | ![Histogram](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/histogram_of_points_input.png) | | |
### openfoam_mesh.obj | |
Output mesh obtained from the OpenFoam simulation. The number of points is smaller than `input_mesh` due to internal OpenFoam processing. | |
| **Open Foam Mesh** | **Points Histogram** | | |
|-------------------------------|------------------------------| | |
| ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/openfoam_mesh.png) | ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/histogram_of_points_foam.png) | | |
### pressure_field_mesh.obj | |
We extracted pressure values from the `openfoam_mesh.obj`. | |
Then we interpolated the pressure values with closest_point strategy on the `input_mesh.obj` so that we have a higher resolution mesh. | |
As can be seen on the histogram, the distribution of points is the same as the input_mesh.obj. | |
More information [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L111). | |
| **Pressure Field Mesh** | **Points Histogram** | | |
|-------------------------------|------------------------------| | |
| ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/pressure_field_mesh.png) | ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/histogram_of_points_input.png)) | | |
### streamlines_mesh.ply | |
We generated streamlines from the `openfoam_mesh.obj`. | |
More information [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L70). | |
| **Streamlines Mesh** | | |
|-------------------------------| | |
| ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/streamlines_mesh.png) | | |
### metadata.obj | |
This file contains metadata information about the simulation. | |
It consists of input parameters like `wind_speed`, `rotate_angle`, `num_iterations` and ´resolution`. | |
It also has output parameters like `drag_coefficient`, `moment_coefficient`, `lift_coefficient`, `front_lift_coefficient`, `rear_lift_coefficient` | |
and the location of the output meshes: | |
```json | |
{ | |
"id": "1w63au1gpxgyn9kun5q9r7eqa", | |
"object_file": "object_24.obj", | |
"wind_speed": 35, | |
"rotate_angle": 332, | |
"num_iterations": 300, | |
"resolution": 5, | |
"drag_coefficient": 0.8322182, | |
"moment_coefficient": 0.3425206, | |
"lift_coefficient": 0.1824983, | |
"front_lift_coefficient": 0.4337698, | |
"rear_lift_coefficient": -0.2512715, | |
"input_mesh_path": "data/train/1w63au1gpxgyn9kun5q9r7eqa/input_mesh.obj", | |
"openfoam_mesh_path": "data/train/1w63au1gpxgyn9kun5q9r7eqa/openfoam_mesh.obj", | |
"pressure_field_mesh_path": "data/train/1w63au1gpxgyn9kun5q9r7eqa/pressure_field_mesh.vtk", | |
"streamlines_mesh_path": "data/train/1w63au1gpxgyn9kun5q9r7eqa/streamlines_mesh.ply" | |
} | |
``` | |
### Dataset Statistics | |
The dataset comprises 19,812 valid samples out of a total of 20,000 simulations, with [188 submissions failing](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/failed_tasks.txt) due to numerical errors in OpenFOAM. | |
The complete dataset requires X GB of storage. | |
## Downloading the Dataset: | |
To download the dataset you have to install the [Datasets package](https://huggingface.co/docs/datasets/en/index) by HuggingFace: | |
```python | |
pip install datasets | |
``` | |
### 1. Using snapshot_download() | |
```python | |
import huggingface_hub | |
dataset_name = "inductiva/windtunnel-20k" | |
# Download the entire dataset | |
huggingface_hub.snapshot_download(repo_id=dataset_name, repo_type="dataset") | |
# Download to a specific local directory | |
huggingface_hub.snapshot_download( | |
repo_id=dataset_name, repo_type="dataset", local_dir="local_folder" | |
) | |
# Download only the simulation metadata across all simulations | |
huggingface_hub.snapshot_download( | |
repo_id=dataset_name, | |
repo_type="dataset", | |
local_dir="local_folder", | |
allow_patterns=["*/*/*/simulation_metadata.json"] | |
) | |
``` | |
### 2. Using load_dataset() | |
```python | |
import datasets | |
# Load the dataset (streaming is supported) | |
dataset = datasets.load_dataset("inductiva/windtunnel-20k", streaming=False) | |
# Display dataset information | |
print(dataset) | |
# Access a sample from the training set | |
sample = dataset["train"][0] | |
print("Sample from training set:", sample) | |
``` | |
## OpenFoam Parameters | |
We used [Inductiva Template Manager](https://tutorials.inductiva.ai/intro_to_api/templating.html) to parameterize the OpenFoam configuration files. | |
Need a better way to do this: | |
``` | |
flowVelocity ({{ wind_speed }} 0 0); | |
vertices | |
( | |
({{ x_min }} {{ y_min }} {{ z_min }}) | |
({{ x_max }} {{ y_min }} {{ z_min }}) | |
({{ x_max }} {{ y_max }} {{ z_min }}) | |
({{ x_min }} {{ y_max }} {{ z_min }}) | |
({{ x_min }} {{ y_min }} {{ z_max }}) | |
({{ x_max }} {{ y_min }} {{ z_max }}) | |
({{ x_max }} {{ y_max }} {{ z_max }}) | |
({{ x_min }} {{ y_max }} {{ z_max }}) | |
); | |
endTime {{ num_iterations }}; | |
magUInf {{ wind_speed }}; | |
lRef {{ length }}; // Wheelbase length | |
Aref {{ area }}; // Estimated | |
geometry | |
{ | |
object | |
{ | |
type triSurfaceMesh; | |
file "object.obj"; | |
} | |
refinementBox | |
{ | |
type searchableBox; | |
min ({{ x_min }} {{ y_min }} {{ z_min }}); | |
max ({{ x_max }} {{ y_max }} {{ z_max }}); | |
} | |
}; | |
features | |
( | |
{ | |
file "object.eMesh"; | |
level {{ resolution + 1 }}; | |
} | |
); | |
refinementSurfaces | |
{ | |
object | |
{ | |
// Surface-wise min and max refinement level | |
level ({{ resolution }} {{ resolution + 1 }}); | |
// Optional specification of patch type (default is wall). No | |
// constraint types (cyclic, symmetry) etc. are allowed. | |
patchInfo | |
{ | |
type wall; | |
inGroups (objectGroup); | |
} | |
} | |
} | |
refinementRegions | |
{ | |
refinementBox | |
{ | |
mode inside; | |
levels ((1E15 {{ resolution - 1 }})); | |
} | |
} | |
locationInMesh ({{ x_min }} {{ y_min }} {{ z_min }}); | |
``` | |
You can find the OpenFoam configuration files on github: [https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates](https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates) | |
## What's next? | |
If you have any issues using this dataset, feel free to reach out to us at [support@intuctiva.ai](support@intuctiva.ai). | |
If you detect any clearly problematic mesh, please let us know so we can correct that issue for the next version of the | |
Windtunnel-20k dataset. | |
To learn more about how we created this dataset—or how you can generate synthetic datasets for Physics-AI models—visit [Inductiva.AI](inductiva.ai) or check out our blog post on [transforming complex simulation workflows into easy-to-use Python classes](https://inductiva.ai/blog/article/transform-complex-simulations). |