rvalerio commited on
Commit
b92ac56
1 Parent(s): b507d03

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -4
README.md CHANGED
@@ -172,8 +172,28 @@ More details can be found here [here](https://github.com/inductiva/wind-tunnel/b
172
  | ![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)) |
173
 
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  ### streamlines_mesh.ply
176
- Streamlines were generated from the openfoam_mesh.obj, providing a visual representation of the flow characteristics within the simulation.
 
177
 
178
  More information can be found [here](https://github.com/inductiva/wind-tunnel/blob/deab68a018531ff05d0d8ef9d63d8c108800f78f/windtunnel/windtunnel_outputs.py#L70).
179
 
@@ -183,7 +203,7 @@ More information can be found [here](https://github.com/inductiva/wind-tunnel/bl
183
  |-------------------------------|
184
  | ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/streamlines_mesh.png) |
185
 
186
- ### metadata.obj
187
  This file contains metadata related to the simulation, including input parameters such as `wind_speed`, `rotate_angle`, `num_iterations`, and `resolution`. Additionally, it includes output parameters like `drag_coefficient`, `moment_coefficient`, `lift_coefficient`, `front_lift_coefficient`, and `rear_lift_coefficient`. The file also specifies the locations of the generated output meshes.
188
 
189
  ```json
@@ -265,7 +285,7 @@ print("Sample from training set:", sample)
265
 
266
  We used [Inductiva Template Manager](https://tutorials.inductiva.ai/intro_to_api/templating.html) to parameterize the OpenFoam configuration files.
267
 
268
- Need a better way to do this:
269
  ```
270
  flowVelocity ({{ wind_speed }} 0 0);
271
 
@@ -342,7 +362,7 @@ locationInMesh ({{ x_min }} {{ y_min }} {{ z_min }});
342
 
343
  ```
344
 
345
- 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)
346
 
347
 
348
  ## What's next?
 
172
  | ![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)) |
173
 
174
 
175
+ ```python
176
+ import pyvista as pv
177
+
178
+ mesh_path = "pressure_field_mesh.vtk"
179
+ mesh = pv.read(mesh_path)
180
+
181
+ # The vertices array contains the coordinates of each point in the mesh.
182
+ vertices = mesh.points
183
+
184
+ # The faces array contains the number of vertices per face followed by the vertex indices.
185
+ # For example: [3, v1, v2, v3, 3, v4, v5, v6, ...] where 3 means a triangle.
186
+ faces = mesh.faces
187
+
188
+ # Get the pressure data (scalar named "p")
189
+ # This retrieves the pressure values associated with each vertex in the mesh.
190
+ pressure_data = mesh.point_data["p"]
191
+ ```
192
+
193
+
194
  ### streamlines_mesh.ply
195
+ Streamlines were generated from the `openfoam_mesh.obj`, providing 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).
199
 
 
203
  |-------------------------------|
204
  | ![Input Mesh](https://huggingface.co/datasets/inductiva/windtunnel/resolve/main/assets/streamlines_mesh.png) |
205
 
206
+ ### metadata.json
207
  This file contains metadata related to the simulation, including input parameters such as `wind_speed`, `rotate_angle`, `num_iterations`, and `resolution`. Additionally, it includes output parameters like `drag_coefficient`, `moment_coefficient`, `lift_coefficient`, `front_lift_coefficient`, and `rear_lift_coefficient`. The file also specifies the locations of the generated output meshes.
208
 
209
  ```json
 
285
 
286
  We used [Inductiva Template Manager](https://tutorials.inductiva.ai/intro_to_api/templating.html) to parameterize the OpenFoam configuration files.
287
 
288
+ Below are some of the templates we used for the windtunnel simulations.
289
  ```
290
  flowVelocity ({{ wind_speed }} 0 0);
291
 
 
362
 
363
  ```
364
 
365
+ 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)
366
 
367
 
368
  ## What's next?