rvalerio commited on
Commit
ff17aa3
1 Parent(s): 762ca70

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +48 -51
README.md CHANGED
@@ -23,67 +23,64 @@ tags:
23
  </p>
24
 
25
 
26
- # Wind Tunnel 20K Dataset
27
- The Wind Tunnel Dataset contains 19,812 OpenFOAM simulations of 1,000 unique automobile-like objects placed in a virtual wind tunnel measuring 20 meters in length, 10 meters in width, and 8 meters in height.
28
- Each object is simulated under 20 distinct conditions: 4 random wind speeds ranging from 10 to 50 m/s, and 5 rotation angles
29
- (0°, 180° and 3 random angles).
30
- The meshes for these automobile-like objects were generated using the Instant Mesh model on images sourced from the Stanford Cars Dataset.
31
- To ensure stable and reliable results, each simulation runs for 300 iterations.
32
- The entire dataset of 19,812 simulations is organized into three subsets: 70% for training, 20% for validation, and 10% for testing.
 
33
 
34
  The data generation process itself was orchestrated using the [Inductiva API](https://inductiva.ai/),
35
  which allowed us to run hundreds of OpenFOAM simulations in parallel on the cloud.
36
 
37
 
38
- # Motivation
39
- Recently, there has been great interest in developing
40
- ML methods to accelerate CFD simulations. Research
41
- has shown that for well defined CFD simulation scenarios (e.g. a virtual wind tunnel), it is possible to train an ML model capable of “predicting” the end result of the simulation orders of magnitude faster than existing classical simulation methods, while maintaining comparable accuracy levels.
42
 
43
- However, the ML/CFD communities still lack training data
44
- for their research. We identified two main reasons for that.
45
 
46
- First, there is a fundamental lack of datasets containing
47
- 3D meshes over which we can run CDF simulation. In fact existing 3D object datasets have many limitations: they are either small in size, closed source, or have low quality meshes. The absence of such input data has been a fundamental blocker for any attempt to generate large-scale training data in any realistic CFD scenario, which will naturally involve 3D meshes.
48
 
49
- Second, even if you had all the 3D meshes you needed, it is still not trivial to orchestrate the thousands CFD
50
- simulations that are required to generate a large and diverse enough dataset for training ML-based CFD methods. For creating such a dataset one has to be
51
- able to define an initial simulation scenario (e.g. the windtunnel scenario), and run enough
52
- variations of the simulation, with different meshes, different wind speeds, etc to cover a wide enough range of data points to train a generalizable and robust ML model. Now, using most CFD software, running one simulation alone may be difficult enough. Orchestrating thousands of them and managing all the resulting data is a challenge in itself.
53
 
54
- While both of these problems are difficult to solve in general, we decided to focus on one common CFD scenario: a virtual wind tunnel for (static) automobiles and produce a large dataset of CFD simulation run using the popular simulation package OpenFOAM.
55
 
56
- Next, we will explain how we tackled the data and the simulation orchestration issues.
57
 
 
58
 
59
- ## Generating a large quantity of Automobile-like 3D Meshes
60
- Due to the lack of publicly available 3D meshes of automobile objects, we decided to use recent advances in image-to-mesh models to generate meshes from images of automobiles that are freely available.
61
 
62
- More specifically, we used 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 InstatMesh image-to-mesh model 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.
63
 
64
- Naturally, running the image-to-mesh model leads to meshes that may have certain defects, such as irregular surfaces, asymmetry issues, holes 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.
65
 
66
- The resulting set of meshes still have little defects, such as presence of "spikes" or "cavities" in supposedly flat areas, unexpected holes, asymmetry issues, among others. We consider these defects as valuable features of the dataset, since from the point of view of the learning problem, they bring certain challenges to ML models that we believe will make overfitting harder and will generally contribute to obtaining more robust and generalizable models.
67
 
68
 
69
- ## Orchestrating 20k simulations on the cloud (just using Python)
70
- For solving the challenge of orchestrating 20k OpenFOAM simulations, we resorted to the Inductiva API. The Inductiva platform exposes a simple Python API for running simulation workflows on the cloud. Inductiva makes available several popular open-source simulation packages, including OpenFOAM. Here is an example of how to run an OpenFOAM simulation using Inductiva (point to the doc that Paulo is preparing).
71
 
72
- Using the Inductiva API, it becomes easy to parametrise specific simulation scenarios and run variations of a base case by programatically changing the input parameters and starting conditions of the simulation. Additionally, users can build custom Python classes that wrap parameterized simulation scenarios, allowing them to have a simple Python interface to running simulations without the need to directly interface with the low level simulation packages. We leveraged [Inductiva API to create a Python class for the Wind Tunnel scenario](https://github.com/inductiva/wind-tunnel), which we then used to run 20k simulations over a range of input parameters.
73
 
74
- For more information on how to transform complex simulation workflows in simple Python classes check this [blog post](https://inductiva.ai/blog/article/transform-complex-simulations).
75
 
 
76
 
77
- # How did we generate the dataset?
78
- 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.
79
- 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.
80
- 3. **Post-process OpenFOAM Output**: The OpenFOAM output is post-processed to generate streamlines and pressure map meshes.
81
 
82
- The code used to generate the meshes and postprocess them is available on [GitHub](https://github.com/inductiva/datasets-generation/tree/main/windtunnel_dataset).
 
 
 
83
 
 
84
 
85
 
86
- # Dataset Structure
 
87
  ```
88
  data
89
  ├── train
@@ -112,7 +109,7 @@ Here’s a breakdown of the files included in each simulation:
112
 
113
 
114
  ### input_mesh.obj
115
- The input mesh was generated using the Instant Mesh model from images in the Stanford Cars Dataset. This mesh serves as the input for the subsequent OpenFOAM simulation.
116
 
117
  Details on the mesh generation process can be found [here](#Generating-a-large-quantity-of-Automobile-like-3D-Meshes).
118
 
@@ -140,7 +137,7 @@ faces = mesh.faces
140
 
141
 
142
  ### openfoam_mesh.obj
143
- This mesh was generated as a result of the OpenFOAM simulation. The number of points is reduced compared to the `input_mesh.obj`, due to mesh refinement and processing steps applied by OpenFOAM during the simulation.
144
 
145
  | **OpenFoam Mesh** | **# points of OpenFoam meshes** |
146
  |-------------------------------|------------------------------|
@@ -163,7 +160,7 @@ faces = mesh.faces
163
  ```
164
 
165
  ### pressure_field_mesh.vtk
166
- Pressure values were extracted from the `openfoam_mesh.obj` and then interpolated onto the `input_mesh.obj` using the closest point strategy. This approach allowed us to project the pressure values onto a higher-resolution mesh. As shown in the histogram, the distribution of points matches that of the `input_mesh.obj`.
167
 
168
  More details can be found here [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L111).
169
 
@@ -192,7 +189,7 @@ pressure_data = mesh.point_data["p"]
192
 
193
 
194
  ### streamlines_mesh.ply
195
- Streamlines provide a visual representation of the flow characteristics within the simulation. The streamlines help illustrate how the air flows around the object.
196
 
197
 
198
  More information can be found [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L70).
@@ -228,13 +225,14 @@ This file contains metadata related to the simulation, including input parameter
228
 
229
  ### Dataset Statistics
230
 
231
- 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.
232
- The complete dataset requires about 300 GB of storage, however, it is possible to download only a fraction of the dataset.
 
233
 
234
 
235
  ## Downloading the Dataset:
236
 
237
- To download the dataset you have to install the [Datasets package](https://huggingface.co/docs/datasets/en/index) by HuggingFace:
238
 
239
  ```python
240
  pip install datasets
@@ -282,9 +280,9 @@ print("Sample from training set:", sample)
282
 
283
  ## OpenFoam Parameters
284
 
285
- We used [Inductiva Template Manager](https://tutorials.inductiva.ai/intro_to_api/templating.html) to parameterize the OpenFoam configuration files.
286
 
287
- Below are snippets from some of the templates used in the wind tunnel simulations.
288
 
289
 
290
  initialConditions.jinja
@@ -357,11 +355,10 @@ locationInMesh ({{ x_min }} {{ y_min }} {{ z_min }});
357
  You can find the full OpenFoam configuration on github: [https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates](https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates)
358
 
359
 
360
- ## What's next?
361
- If you have any issues using this dataset, feel free to reach out to us at [support@intuctiva.ai](support@intuctiva.ai).
362
-
363
- If you detect any clearly problematic mesh, please let us know so we can correct that issue for the next version of the
364
- Windtunnel-20k dataset.
365
 
 
366
 
367
- 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).
 
 
23
  </p>
24
 
25
 
26
+ # Wind Tunnel Dataset: 20,000 OpenFOAM Simulations
27
+ The **Wind Tunnel Dataset** contains **19,812 OpenFOAM simulations** of **1,000 unique automobile-like objects** placed in a virtual wind tunnel measuring **20 meters long, 10 meters wide, and 8 meters high.**
28
+
29
+ Each object was tested under **20 different conditions**: 4 random wind speeds ranging from **10 to 50 m/s**, and 5 rotation angles (**0°**, **180°** and **3 random angles**).
30
+
31
+ The object meshes were generated using [Instant Mesh](https://github.com/TencentARC/InstantMesh) based on images sourced from the [Stanford Cars Dataset](https://www.kaggle.com/datasets/jessicali9530/stanford-cars-dataset). To make sure the results are stable and reliable, each simulation runs for **300 iterations**.
32
+
33
+ The entire dataset is organized into three subsets: **70% for training, 20% for validation, and 10% for testing.**
34
 
35
  The data generation process itself was orchestrated using the [Inductiva API](https://inductiva.ai/),
36
  which allowed us to run hundreds of OpenFOAM simulations in parallel on the cloud.
37
 
38
 
39
+ ## Motivation: Addressing the Data Gap in CFD
40
+ Recently, there’s been a lot of interest in using **machine learning (ML)** to speed up **CFD simulations**. Research has shown that for well-defined scenarios—like a virtual wind tunnel—you can train an ML model to “predict” the results of a simulation **much faster** than traditional methods, while still keeping the accuracy close to what you’d expect from classical simulations.
 
 
41
 
42
+ That said, the **ML/CFD communities** are still lacking enough **training data** for their research. We’ve identified two main reasons for this.
 
43
 
44
+ First, there’s a shortage of datasets with **high-quality 3D meshes** needed for running CFD simulations. Existing 3D object datasets have a lot of limitations: they’re either too small, closed-source, or have low-quality meshes. Without this input data, it’s been really hard to generate large-scale training datasets for realistic CFD scenarios, which almost always involve 3D meshes.
 
45
 
46
+ Second, even if you had all the 3D meshes you needed, setting up and running thousands of **CFD simulations** to generate a large, diverse dataset isn’t easy. To create a dataset like this, you’d need to define an initial simulation scenario (like the wind tunnel setup) and then run enough variations—different meshes, wind speeds, and so on—to cover a wide range of data points for training a robust **ML model**.
 
 
 
47
 
48
+ The problem is, running a single CFD simulation can be tricky enough with most software. Orchestrating **thousands of simulations** and handling all the resulting data? That’s a whole new level of challenge.
49
 
50
+ While both of these problems are difficult to solve in general, we decided to focus on one common CFD scenario: a **virtual wind tunnel** for **static automobiles**. Using the popular **OpenFOAM** simulation package, we produced a large dataset of CFD simulations.
51
 
52
+ Next, we’ll explain how we tackled the challenges of generating the data and orchestrating the simulations.
53
 
54
+ ## Generating a Large Quantity of Automobile-like 3D Meshes
55
+ Since there aren’t many publicly available 3D meshes of automobiles, we decided to use recent image-to-mesh models to generate meshes from freely available car images.
56
 
57
+ We specifically used the open-source [InstantMesh](https://github.com/TencentARC/InstantMesh) model (Apache-2.0), which is currently state-of-the-art in **image-to-mesh generation**. We generated the automobile-like meshes by running Instant Mesh on **1,000 images** from the publicly available [Stanford Cars Dataset](https://www.kaggle.com/datasets/jessicali9530/stanford-cars-dataset) (Apache-2.0), which contains 16,185 images of automobiles.
58
 
59
+ Running the image-to-mesh model naturally results in some defects, like irregular surfaces, asymmetry, holes, and disconnected components. To address these issues, we implemented a custom post-processing step to improve mesh quality. We used **PCA** to align the meshes with the main axes and removed any disconnected components.
60
 
61
+ The resulting set of meshes still contains minor defects, like spikes or cavities in flat areas, unexpected holes, and asymmetry issues. However, we see these imperfections as valuable features of the dataset. From a machine learning perspective, they bring challenges that can help prevent overfitting and contribute to building more robust and generalizable models.
62
 
63
 
64
+ ## Orchestrating 20k Cloud Simulations—Using Just Python
65
+ To tackle the challenge of orchestrating **20,000 OpenFOAM simulations**, we resorted to the **Inductiva API**. The Inductiva platform offers a simple Python API for running simulation workflows in the cloud and supports several popular open-source packages, including **OpenFOAM**. Here’s an example of how to run an OpenFOAM simulation using Inductiva (point to the doc that Paulo is preparing).
66
 
67
+ With the Inductiva API, it’s easy to parameterize specific simulation scenarios and run variations of a base case by programmatically adjusting the input parameters and starting conditions of the simulation. Additionally, users can create custom Python classes that wrap these parameterized simulations, providing a simple Python interface for running simulations—no need to interact directly with the underlying simulation packages.
68
 
69
+ We used the [Inductiva API to create a Python class for the Wind Tunnel scenario](https://github.com/inductiva/wind-tunnel), which allowed us to run **20,000 simulations** across a range of input parameters.
70
 
71
+ For more on how to transform your complex simulation workflows into easy-to-use Python classes, we wrote a [blog post](https://inductiva.ai/blog/article/transform-complex-simulations) all about it.
72
 
 
 
 
 
73
 
74
+ ## How Did We Generate the Dataset?
75
+ 1. **Generate Input Meshes**: We first generated input meshes using the **InstantMesh model** with images from the **Stanford Cars Dataset**, followed by post-processing to improve mesh quality.
76
+ 2. **Run OpenFOAM Simulations**: Using the Inductiva API, we ran OpenFOAM simulations on the input meshes under different wind speeds and angles. The result is an output mesh `openfoam_mesh.obj`that contains all the relevant simulation data.
77
+ 3. **Post-process OpenFOAM Output**: We post-processed the OpenFOAM output to generate streamlines and pressure map meshes.
78
 
79
+ The code we used to generate and post-process the meshes is available on [GitHub](https://github.com/inductiva/datasets-generation/tree/main/windtunnel_dataset).
80
 
81
 
82
+
83
+ ## Dataset Structure
84
  ```
85
  data
86
  ├── train
 
109
 
110
 
111
  ### input_mesh.obj
112
+ The input mesh we generated using the Instant Mesh model from images in the Stanford Cars Dataset, serves as the starting point for the OpenFOAM simulation.
113
 
114
  Details on the mesh generation process can be found [here](#Generating-a-large-quantity-of-Automobile-like-3D-Meshes).
115
 
 
137
 
138
 
139
  ### openfoam_mesh.obj
140
+ This mesh is the result of the OpenFOAM simulation. The number of points is reduced compared to the `input_mesh.obj` due to mesh refinement and processing steps applied by OpenFOAM during the simulation.
141
 
142
  | **OpenFoam Mesh** | **# points of OpenFoam meshes** |
143
  |-------------------------------|------------------------------|
 
160
  ```
161
 
162
  ### pressure_field_mesh.vtk
163
+ Pressure values were extracted from the `openfoam_mesh.obj` and interpolated onto the `input_mesh.obj` using the closest point strategy. This approach allowed us to project the pressure values onto a higher-resolution mesh. As shown in the histogram, the the point distribution matches that of the `input_mesh.obj`.
164
 
165
  More details can be found here [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L111).
166
 
 
189
 
190
 
191
  ### streamlines_mesh.ply
192
+ Streamlines visually represent the flow characteristics within the simulation, illustrating how air flows around the object
193
 
194
 
195
  More information can be found [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L70).
 
225
 
226
  ### Dataset Statistics
227
 
228
+ The dataset includes **19,812 valid samples** out 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.
229
+
230
+ The full dataset requires about **300 GB** of storage, but you can also download smaller portions if needed.
231
 
232
 
233
  ## Downloading the Dataset:
234
 
235
+ To download the dataset, you’ll need to install the [Datasets package](https://huggingface.co/docs/datasets/en/index) from Hugging Face:
236
 
237
  ```python
238
  pip install datasets
 
280
 
281
  ## OpenFoam Parameters
282
 
283
+ We used the [Inductiva Template Manager](https://tutorials.inductiva.ai/intro_to_api/templating.html) to **parameterize** the OpenFoam configuration files.
284
 
285
+ Below are some snippets from the templates used in the wind tunnel simulations.
286
 
287
 
288
  initialConditions.jinja
 
355
  You can find the full OpenFoam configuration on github: [https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates](https://github.com/inductiva/wind-tunnel/tree/main/windtunnel/templates)
356
 
357
 
358
+ ## What's Next?
359
+ If you encounter any issues with this dataset, feel free to reach out at [support@intuctiva.ai](support@intuctiva.ai).
 
 
 
360
 
361
+ If you spot any problematic meshes, let us know so we can fix them in the next version of the **Windtunnel-20k dataset**.
362
 
363
+ To learn more about how we created this dataset—or how you can generate synthetic datasets for Physics-AI models—check out our well-tested [4-step recipe for generating synthetic data](https://inductiva.ai/blog/article/supercharge-your-physics-ml-with-inductivas-cloud-based-simulation-api) or discover how to [transform your own complex simulation workflows into easy-to-use Python classes](https://inductiva.ai/blog/article/transform-complex-simulations).
364
+ Also because mesh resolution is such an import aspect of CFD have a look at our [blog post](https://inductiva.ai/blog/article/5k-points-is-all-you-need) where we study the impact of using different mesh resolutions in a virtual windtunnel simulation results.