Jens commited on
Commit
7b2cf95
·
verified ·
1 Parent(s): 18d5b37

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +200 -0
README.md ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ task_categories:
4
+ - tabular-regression
5
+ tags:
6
+ - cfd
7
+ - openfoam
8
+ - surrogate-modeling
9
+ - scientific-computing
10
+ - scientific-machine-learning
11
+ - physics-informed-neural-networks
12
+ - neural-operator
13
+ - heat-transfer
14
+ - engineering
15
+ - simulation
16
+ - fluid-dynamics
17
+ - rans
18
+ language:
19
+ - en
20
+ size_categories:
21
+ - 1K<n<10K
22
+ configs:
23
+ - config_name: params
24
+ data_files: "params/data.parquet"
25
+ - config_name: fields
26
+ data_files: "fields/*.safetensors"
27
+ default: true
28
+ ---
29
+
30
+ # U-bend Conjugate Heat Transfer Dataset
31
+
32
+ Parameterized U-bend CFD dataset for surrogate modeling and scientific machine learning.
33
+
34
+ ## Dataset Description
35
+
36
+ This dataset contains **~9,000 conjugate heat transfer simulations** of a parameterized U-bend cooling channel, generated with OpenFOAM (`chtMultiRegionSimpleFoam`). Each sample represents a unique channel geometry defined by 28 design parameters, with corresponding flow and temperature solution fields.
37
+
38
+ The dataset is designed for scientific machine learning tasks including:
39
+ - **Parameter-to-objective regression**: predict pressure loss and cooling effectiveness from geometry parameters
40
+ - **Field prediction / Neural operators**: predict full solution fields (velocity, pressure, temperature, turbulence quantities) from mesh coordinates (e.g. DeepONet, FNO)
41
+ - **Physics-informed neural networks (PINNs)**: mesh coordinates and boundary conditions available for physics-constrained training
42
+ - **Surrogate modeling**: fast approximation of expensive CFD simulations for design optimization
43
+
44
+ ## Configurations
45
+
46
+ ### `params` — Tabular parameter data
47
+ Lightweight CSV/Parquet with 28 input parameters and 2 scalar targets per sample.
48
+
49
+ ```python
50
+ from datasets import load_dataset
51
+ ds = load_dataset("JensDe/ubend-cfd", "params")
52
+ ```
53
+
54
+ | Column | Description |
55
+ |---|---|
56
+ | `input_0` ... `input_27` | 28 Sobol-sampled geometry parameters |
57
+ | `target_0` | Pressure loss (area-averaged inlet pressure) |
58
+ | `target_1` | Cooling effectiveness (integrated squared temperature deviation) |
59
+ | `target_0_mean`, `target_0_std` | Mean and std over last 100 solver iterations |
60
+ | `target_1_mean`, `target_1_std` | Mean and std over last 100 solver iterations |
61
+
62
+ ### `fields` — Solution fields on the mesh
63
+ Per-sample safetensors files containing mesh coordinates and solution fields, cropped to the bend region (240 x 60 cells).
64
+
65
+ ```python
66
+ from safetensors.numpy import load_file
67
+ data = load_file("fields/sample_0.safetensors")
68
+ ```
69
+
70
+ | Key | Shape | Description |
71
+ |---|---|---|
72
+ | `sample_id` | (1,) | Sample index |
73
+ | `params` | (28,) | Geometry parameters |
74
+ | `targets` | (6,) | Target values (last, mean, std for both objectives) |
75
+ | `coords` | (3, 240, 60) | Cell center coordinates (x, y, z) |
76
+ | `U` | (3, 240, 60) | Velocity field (Ux, Uy, Uz) |
77
+ | `p` | (240, 60) | Pressure field |
78
+ | `T` | (240, 60) | Temperature field (fluid) |
79
+ | `k` | (240, 60) | Turbulent kinetic energy |
80
+ | `nut` | (240, 60) | Turbulent viscosity |
81
+ | `p_rgh` | (240, 60) | Pressure minus hydrostatic (equal to `p` for constant density) |
82
+ | `solid_coords` | (3, 240, 15) | Solid region cell centers |
83
+ | `solid_T` | (240, 15) | Solid temperature field |
84
+
85
+ ## Simulation Setup
86
+
87
+ - **Solver**: `chtMultiRegionSimpleFoam` (OpenFOAM-plus)
88
+ - **Turbulence**: k-omega SST with wall functions
89
+ - **Reynolds number**: 40,000
90
+ - **Fluid**: Air, constant density (rho = 1.2 kg/m³)
91
+ - **Boundary conditions**: Constant heat flux q = 100,000 W/m² on outer wall, inlet T = 300 K
92
+ - **Mesh**: Structured 2D, 57,000 cells (45,600 fluid + 11,400 solid), wall grading ratio 10. The fluid region contains the flow channel (60 cells across), the solid region models the heated channel wall (15 cells across). Both regions are thermally coupled at the interface.
93
+ - **Convergence**: Residual-based termination (p_rgh < 1e-6), max 15,000 iterations
94
+
95
+ ## Parameterization
96
+
97
+ The geometry is controlled by 28 parameters sampled via a scrambled Sobol sequence (seed=42). Sobol sequences are quasi-random low-discrepancy sequences that provide more uniform coverage of high-dimensional parameter spaces than pseudo-random sampling, requiring fewer samples to achieve comparable space-filling properties. The 28 parameters comprise:
98
+ - 6 anchor point displacements (outer wall shape)
99
+ - 6 midpoint displacements (inner wall shape)
100
+ - 16 cubic Bezier control weights (wall curvature)
101
+
102
+ ![Animation](animation_both.gif)
103
+
104
+ ## Dataset Statistics
105
+
106
+ - **Total samples**: 10,000
107
+ - **Successful simulations**: ~8,950 (89.5%)
108
+ - **Mesh generation failures**: ~990 (9.9%) — extreme parameter combinations producing invalid geometries
109
+ - **Solver divergence**: ~65 (0.7%) — physically unsteady flow in strongly constricted geometries
110
+ - **Pressure loss range**: 24 – 800 (successful samples)
111
+ - **Temperature range**: 3.7 – 10.0 (successful samples)
112
+
113
+ ### Failed samples and error codes
114
+
115
+ The `params` configuration contains **all** 10,000 samples including failed ones. Failed samples are indicated by sentinel values in the target columns:
116
+
117
+ | `target_0` value | Meaning |
118
+ |---|---|
119
+ | `10000` | Mesh generation failed (`checkMesh` reported errors) — geometry too extreme for valid mesh |
120
+ | `11000` | Simulation diverged (final residual >= 1e-4) — flow is physically unsteady or geometry too constricted |
121
+ | other | Actual pressure loss value (successful simulation) |
122
+
123
+ The `fields` configuration contains **only successful samples** (~8,950) since no solution fields are available for failed cases.
124
+
125
+ Note that the failed samples are not randomly distributed in parameter space — they cluster in regions with extreme parameter combinations (sharp bends, strong constrictions). This means the parameter space has **gaps** where no valid simulation results exist. Users training surrogate models should be aware of this and filter out samples with `target_0 >= 10000`.
126
+
127
+ ## Mesh Quality
128
+
129
+ The computational mesh was selected based on a mesh convergence study across multiple wall grading configurations. The final mesh provides a good balance between numerical accuracy and simulation stability. Convergence quality is confirmed by recording the mean and standard deviation of each target over the last 100 solver iterations (median relative std < 0.05%).
130
+
131
+ ## Quick Start
132
+
133
+ ### Parameter regression
134
+ ```python
135
+ from datasets import load_dataset
136
+
137
+ ds = load_dataset("JensDe/ubend-cfd", "params")
138
+ print(ds["train"][0]) # {'input_0': ..., 'target_0': ..., ...}
139
+ ```
140
+
141
+ ### Field prediction with PyTorch
142
+ ```python
143
+ from torch.utils.data import Dataset, DataLoader
144
+ from safetensors.numpy import load_file
145
+ from pathlib import Path
146
+ import torch
147
+
148
+ class UBendFieldDataset(Dataset):
149
+ def __init__(self, data_dir):
150
+ self.files = sorted(Path(data_dir).glob("*.safetensors"))
151
+
152
+ def __len__(self):
153
+ return len(self.files)
154
+
155
+ def __getitem__(self, idx):
156
+ data = load_file(str(self.files[idx]))
157
+ return {
158
+ "params": torch.from_numpy(data["params"]), # (28,)
159
+ # Fluid region
160
+ "coords": torch.from_numpy(data["coords"]), # (3, 240, 60)
161
+ "U": torch.from_numpy(data["U"]), # (3, 240, 60)
162
+ "p": torch.from_numpy(data["p"]), # (240, 60)
163
+ "T": torch.from_numpy(data["T"]), # (240, 60)
164
+ "k": torch.from_numpy(data["k"]), # (240, 60)
165
+ "nut": torch.from_numpy(data["nut"]), # (240, 60)
166
+ # Solid region
167
+ "solid_coords": torch.from_numpy(data["solid_coords"]), # (3, 240, 15)
168
+ "solid_T": torch.from_numpy(data["solid_T"]), # (240, 15)
169
+ }
170
+
171
+ ds = UBendFieldDataset("fields/")
172
+ loader = DataLoader(ds, batch_size=16, shuffle=True, num_workers=4)
173
+ ```
174
+
175
+ ## Version History
176
+
177
+ This is an updated version of the original U-bend dataset with improved mesh quality (mesh convergence study), corrected Sobol sampling, and additional output fields (mean/std of targets, solution fields in safetensors format). The underlying geometry parameterization and simulation setup remain the same.
178
+
179
+ ## Citation
180
+
181
+ If you use this dataset, please cite the original publication:
182
+
183
+ ```bibtex
184
+ @article{decke2023dataset,
185
+ title={Dataset of a parameterized U-bend flow for Deep Learning Applications},
186
+ author={Decke, Jens and W{\"u}nsch, Olaf and Sick, Bernhard},
187
+ booktitle={Data in Brief},
188
+ volume={50},
189
+ year={2023},
190
+ publisher={Elsevier}
191
+ }
192
+ ```
193
+
194
+ ## Authors
195
+
196
+ Jens Decke, Olaf Wunsch, Bernhard Sick
197
+
198
+ ## Acknowledgments
199
+
200
+ This research has been funded by the Federal Ministry for Economic Affairs and Climate Action (BMWK) within the project "KI-basierte Topologieoptimierung elektrischer Maschinen (KITE)" (19I21034C).