Skip to content

Commit 3d681b1

Browse files
committed
Merge internal branch into public
Data: - Add Rayleigh Benard uniform dataset - Edit information about Shear Flow data Statistics and Metrics: - Add RMS statistics - Add Pearson correlation metrics Code Refactoring: - Refine video generation control - Refactor sample load from HDF5 - Add transformation and augmentation based on resizing and roation - Allow specifying for dataset split
1 parent e8a936f commit 3d681b1

File tree

20 files changed

+989
-126
lines changed

20 files changed

+989
-126
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ datasets/viscoelastic_instability/data/
2626
2D/planetswe/data/
2727

2828
datasets/rayleigh_benard/data/
29+
datasets/rayleigh_benard_uniform/data/
2930
datasets/acoustic_scattering_inclusions/old_and_problematic_data/
3031
datasets/shear_flow/data/
3132
datasets/supernova_explosion_128/data/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.6.4
3+
rev: v0.9.9
44
hooks:
55
- id: ruff
66
args: [--fix]

datasets/rayleigh_benard/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
**Longer description of the data:**
66
Rayleigh-Bénard convection involves fluid dynamics and thermodynamics, seen in a horizontal fluid layer heated from below, forming convective cells due to a temperature gradient. With the lower plate heated and the upper cooled, thermal energy creates density variations, initiating fluid motion. This results in Bénard cells, showcasing warm fluid rising and cool fluid descending. The interplay of buoyancy, conduction, and viscosity leads to complex fluid motion, including vortices and boundary layers.
77

8+
Note the `rayleigh_benard` and the `rayleigh_benard_uniform` are distinct only by resampling the data to different grids.
89

910
**Associated paper**: [Paper 1](https://www.tandfonline.com/doi/pdf/10.1080/14786441608635602), [Paper 2](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/steady-rayleighbenard-convection-between-noslip-boundaries/B4F358EB0AE83BBE9D85968DC5DDD64D
1011
).
@@ -21,19 +22,19 @@ $$
2122
\begin{align*}
2223
\frac{\partial b}{\partial t} - \kappa \Delta b & = -u\nabla b,
2324
\\
24-
\frac{\partial u}{\partial t} - \nu \Delta u + \nabla p - b \vec{e}_z & = -u \nabla u,
25+
\frac{\partial u}{\partial t} - \nu \Delta u + \nabla p - b \vec{e}_y & = -u \nabla u,
2526
\end{align*}
2627
$$
2728

28-
where $\Delta = \nabla \cdot \nabla$ is the spatial Laplacian, $b$ is the buoyancy, $u = (u_x,u_y)$ the (horizontal and vertical) velocity, and $p$ is the pressure, $\vec{e}_z$ is the unit vector in the vertical direction, with the additional constraints $\int p = 0$ (pressure gauge).
29+
where $\Delta = \nabla \cdot \nabla$ is the spatial Laplacian, $b$ is the buoyancy, $u = (u_x,u_y)$ the (horizontal and vertical) velocity, and $p$ is the pressure, $\vec{e}_y$ is the unit vector in the vertical direction, with the additional constraints $\int p = 0$ (pressure gauge).
2930

3031
The boundary conditions vertically are as follows:
3132

3233
$$
3334
\begin{align*}
34-
b(z=0) = Lz ~~~,~~~ b(z=Lz) = 0
35+
b(y=0) = Ly ~~~,~~~ b(y=Ly) = 0
3536
\\
36-
u(z=0) = u(z=Lz) = 0
37+
u(y=0) = u(y=Ly) = 0
3738
\end{align*}
3839
$$
3940

@@ -70,9 +71,9 @@ Table: VRMSE metrics on test sets (lower is better). Best results are shown in b
7071

7172
**Size of the ensemble of all simulations:** 342 GB.
7273

73-
**Grid type:** uniform, cartesian coordinates.
74+
**Grid type:** Cartesian coordinates. Sampled uniformly along the $x$ axis. Sampled at Chebyshev nodes along the $y$ axis.
7475

75-
**Initial conditions:** the buoyancy is composed of a dumped noise added to a linear background $b(t=0) = (Lz-z)\times\delta b_0 + z(Lz-z) \times\epsilon$ where $\epsilon$ is a Gaussian white noise of scale $10^{-3}$.
76+
**Initial conditions:** the buoyancy is composed of a dumped noise added to a linear background $b(t=0) = (Ly-y)\times\delta b_0 + y(Ly-y) \times\epsilon$ where $\epsilon$ is a Gaussian white noise of scale $10^{-3}$.
7677
The other fields $u$ and $p$ are initialized to $0$.
7778

7879
**Boundary conditions:** periodic on the horizontal direction, Dirichlet conditions on the vertical direction.
@@ -81,7 +82,7 @@ The other fields $u$ and $p$ are initialized to $0$.
8182

8283
**Total time range ($t_{min}$ to $t_{max}$):** $t_{min} = 0$, $t_{max} = 50$.
8384

84-
**Spatial domain size:** $0 \leq x \leq 4$ horizontally, and $0 \leq z \leq 1$ vertically.
85+
**Spatial domain size:** $0 \leq x \leq 4$ horizontally, and $0 \leq y \leq 1$ vertically.
8586

8687
**Set of coefficients or non-dimensional parameters evaluated:** $\text{Rayleigh}\in[1e6,1e7,1e8,1e9,1e10], \text{Prandtl}\in[0.1,0.2,0.5,1.0,2.0,5.0,10.0]$. For initial conditions $\delta b_0\in[0.2,0.4,0.6,0.8,1.0]$, the seed used to generate the initial Gaussian white noise are $40,\ldots,49$.
8788

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Rayleigh-Bénard convection
2+
3+
**One line description of the data:** 2D horizontally-periodic Rayleigh-Benard convection on uniform grid.
4+
5+
**Longer description of the data:**
6+
Rayleigh-Bénard convection involves fluid dynamics and thermodynamics, seen in a horizontal fluid layer heated from below, forming convective cells due to a temperature gradient. With the lower plate heated and the upper cooled, thermal energy creates density variations, initiating fluid motion. This results in Bénard cells, showcasing warm fluid rising and cool fluid descending. The interplay of buoyancy, conduction, and viscosity leads to complex fluid motion, including vortices and boundary layers.
7+
8+
Note the `rayleigh_benard` and the `rayleigh_benard_uniform` are distinct only by resampling the data to different grids.
9+
10+
**Associated paper**: [Paper 1](https://www.tandfonline.com/doi/pdf/10.1080/14786441608635602), [Paper 2](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/steady-rayleighbenard-convection-between-noslip-boundaries/B4F358EB0AE83BBE9D85968DC5DDD64D
11+
).
12+
13+
**Data generated by**: [Rudy Morel](https://rudymorel.github.io/), Center for Computational Mathematics, Flatiron Institute.
14+
15+
**Code or software used to generate the data**: [Github repository](https://github.com/RudyMorel/the-well-rbc-sf), based on the software [Dedalus]( https://dedalus-project.readthedocs.io/en/latest/pages/examples/ivp_2d_rayleigh_benard.html).
16+
17+
**Equation**:
18+
19+
While we solve equations in the frequency domain, the original time-domain problem is
20+
21+
$$
22+
\begin{align*}
23+
\frac{\partial b}{\partial t} - \kappa \Delta b & = -u\nabla b,
24+
\\
25+
\frac{\partial u}{\partial t} - \nu \Delta u + \nabla p - b \vec{e}_y & = -u \nabla u,
26+
\end{align*}
27+
$$
28+
29+
where $\Delta = \nabla \cdot \nabla$ is the spatial Laplacian, $b$ is the buoyancy, $u = (u_x,u_y)$ the (horizontal and vertical) velocity, and $p$ is the pressure, $\vec{e}_y$ is the unit vector in the vertical direction, with the additional constraints $\int p = 0$ (pressure gauge).
30+
31+
The boundary conditions vertically are as follows:
32+
33+
$$
34+
\begin{align*}
35+
b(y=0) = Ly ~~~,~~~ b(y=Ly) = 0
36+
\\
37+
u(y=0) = u(y=Ly) = 0
38+
\end{align*}
39+
$$
40+
41+
These PDE are parameterized by the Rayleigh and Prandtl numbers through $\kappa$ and $\nu$.
42+
43+
$$
44+
\begin{align*}
45+
\text{(thermal diffusivity)} ~~~~~~~ \kappa & = \big(\text{Rayleigh} * \text{Prandtl}\big)^{-\frac12}
46+
\\
47+
\text{(viscosity)} ~~~~~~~ \nu & = \bigg(\frac{\text{Rayleigh}}{\text{Prandtl}}\bigg)^{-\frac12}.
48+
\end{align*}
49+
$$
50+
51+
![Gif](https://users.flatironinstitute.org/~polymathic/data/the_well/datasets/rayleigh_benard/gif/buoyancy_good_normalized.gif)
52+
<!-- <div style="transform: rotate(90deg);">
53+
<img src="https://users.flatironinstitute.org/~polymathic/data/the_well/datasets/rayleigh_benard/gif/buoyancy_normalized.gif" alt="Rotated GIF">
54+
</div> -->
55+
56+
57+
| Dataset | FNO | TFNO | Unet | CNextU-net
58+
|:-:|:-:|:-:|:-:|:-:|
59+
| `rayleigh_benard` | 0.8395 | $\mathbf{0.6566}$ |1.4860|0.6699|
60+
61+
Table: VRMSE metrics on test sets (lower is better). Best results are shown in bold. VRMSE is scaled such that predicting the mean value of the target field results in a score of 1.
62+
63+
## About the data
64+
65+
**Dimension of discretized data:** 200 timesteps of
66+
512 $\times$ 128 images.
67+
68+
**Fields are available in the data:** buoyancy (scalar field), pressure (scalar field), velocity (vector field).
69+
70+
**Number of simulations:** 1750 (35 PDE parameters $\times$ 50 initial conditions).
71+
72+
**Size of the ensemble of all simulations:** 342 GB.
73+
74+
**Grid type:** uniform, cartesian coordinates.
75+
76+
**Initial conditions:** the buoyancy is composed of a dumped noise added to a linear background $b(t=0) = (Ly-y)\times\delta b_0 + y(Ly-y) \times\epsilon$ where $\epsilon$ is a Gaussian white noise of scale $10^{-3}$.
77+
The other fields $u$ and $p$ are initialized to $0$.
78+
79+
**Boundary conditions:** periodic on the horizontal direction, Dirichlet conditions on the vertical direction.
80+
81+
**Simulation time-step:** 0.25.
82+
83+
**Total time range ($t_{min}$ to $t_{max}$):** $t_{min} = 0$, $t_{max} = 50$.
84+
85+
**Spatial domain size:** $0 \leq x \leq 4$ horizontally, and $0 \leq y \leq 1$ vertically.
86+
87+
**Set of coefficients or non-dimensional parameters evaluated:** $\text{Rayleigh}\in[1e6,1e7,1e8,1e9,1e10], \text{Prandtl}\in[0.1,0.2,0.5,1.0,2.0,5.0,10.0]$. For initial conditions $\delta b_0\in[0.2,0.4,0.6,0.8,1.0]$, the seed used to generate the initial Gaussian white noise are $40,\ldots,49$.
88+
89+
**Approximate time to generate the data: per input parameter** from $\sim6\,000s$ to $\sim 50\,000s$ (high Rayleigh numbers take longer), total: $\sim 60$ hours.
90+
91+
**Hardware used to generate the data and precision used for generating the data:** 12 nodes of 64 CPU cores with 8 processes per node, in single precision.
92+
93+
## What is interesting and challenging about the data:
94+
95+
Rayleigh-Bénard convection datasets offer valuable insights into fluid dynamics under thermal gradients, revealing phenomena like turbulent eddies and convection cells.
96+
The position of such cells are highly sensitive to small variations in the initial conditions.
97+
Understanding these dynamics is crucial for applications in engineering and environmental science.
98+
99+
Please cite the associated paper if you use this data in your research:
100+
101+
```
102+
@article{burns2020dedalus,
103+
title={Dedalus: A flexible framework for numerical simulations with spectral methods},
104+
author={Burns, Keaton J and Vasil, Geoffrey M and Oishi, Jeffrey S and Lecoanet, Daniel and Brown, Benjamin P},
105+
journal={Physical Review Research},
106+
volume={2},
107+
number={2},
108+
pages={023068},
109+
year={2020},
110+
publisher={APS}
111+
}
112+
```
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
dataset_name: rayleigh_benard
2+
n_spatial_dims: 2
3+
spatial_resolution:
4+
- 512
5+
- 128
6+
scalar_names: []
7+
constant_scalar_names:
8+
- Rayleigh
9+
- Prandtl
10+
field_names:
11+
0:
12+
- buoyancy
13+
- pressure
14+
1:
15+
- velocity_x
16+
- velocity_y
17+
2: []
18+
constant_field_names:
19+
0: []
20+
1: []
21+
2: []
22+
boundary_condition_types:
23+
- PERIODIC
24+
- WALL
25+
n_files: 35
26+
n_trajectories_per_file:
27+
- 5
28+
- 5
29+
- 5
30+
- 5
31+
- 5
32+
- 5
33+
- 5
34+
- 5
35+
- 5
36+
- 5
37+
- 5
38+
- 5
39+
- 5
40+
- 5
41+
- 5
42+
- 5
43+
- 5
44+
- 5
45+
- 5
46+
- 5
47+
- 5
48+
- 5
49+
- 5
50+
- 5
51+
- 5
52+
- 5
53+
- 5
54+
- 5
55+
- 5
56+
- 5
57+
- 5
58+
- 5
59+
- 5
60+
- 5
61+
- 5
62+
n_steps_per_trajectory:
63+
- 200
64+
- 200
65+
- 200
66+
- 200
67+
- 200
68+
- 200
69+
- 200
70+
- 200
71+
- 200
72+
- 200
73+
- 200
74+
- 200
75+
- 200
76+
- 200
77+
- 200
78+
- 200
79+
- 200
80+
- 200
81+
- 200
82+
- 200
83+
- 200
84+
- 200
85+
- 200
86+
- 200
87+
- 200
88+
- 200
89+
- 200
90+
- 200
91+
- 200
92+
- 200
93+
- 200
94+
- 200
95+
- 200
96+
- 200
97+
- 200
98+
grid_type: cartesian
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mean:
2+
buoyancy: 0.3554901777056377
3+
pressure: 0.00015696872462685817
4+
velocity:
5+
- -4.087598508971704e-06
6+
- 1.503515349262273e-13
7+
std:
8+
buoyancy: 0.19656606235363866
9+
pressure: 0.12835234405568197
10+
velocity:
11+
- 0.20802661326557004
12+
- 0.21215223278514359

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ nav:
3636
- planetswe: datasets/planetswe.md
3737
- post_neutron_star_merger: datasets/post_neutron_star_merger.md
3838
- rayleigh_benard: datasets/rayleigh_benard.md
39+
- rayleigh_benard_uniform: datasets/rayleigh_benard_uniform.md
3940
- rayleigh_taylor_instability: datasets/rayleigh_taylor_instability.md
4041
- shear_flow: datasets/shear_flow.md
4142
- supernova_explosion_64: datasets/supernova_explosion_64.md

0 commit comments

Comments
 (0)