Update README.md
Browse files
README.md
CHANGED
|
@@ -29,7 +29,7 @@ ensures greater diversity than existing ones. Please refer to our [arXiv paper](
|
|
| 29 |
|39-56| Mach numbers and angles of attacks |
|
| 30 |
|
| 31 |
2. Index file
|
| 32 |
-
`index.npy` provides the crucial information for all provided samples; it has
|
| 33 |
|
| 34 |
|index|description|
|
| 35 |
|-|-|
|
|
@@ -71,14 +71,14 @@ ensures greater diversity than existing ones. Please refer to our [arXiv paper](
|
|
| 71 |
CGNS library to be read out. Since they are too large, they are available via university storage upon reasonable request to the authors.
|
| 72 |
|
| 73 |
|
| 74 |
-
The table below summarizes the data.
|
| 75 |
|
| 76 |
|Type | File | Description | Shape | Size |
|
| 77 |
|-|-|-|-|-|
|
| 78 |
|Geometric parameters | `Configs.dat` | shape parameters | N x 57 | 5.0 MB
|
| 79 |
|Information | `index.npy` | group information, operating conditions, and aerodynamic coefficients | N x 12 | 2.8 MB
|
| 80 |
-
|Surface mesh | `origingeom.npy` | reference surface mesh (grid points) |
|
| 81 |
-
| | `geom0.npy` | reference surface mesh (cell center) |
|
| 82 |
|Surface flow | `data.npy` | \\( C_p, \bm {C_f} \\) at reference mesh (cell center) | N x 3 x 128 x 256 | 22.7 GB
|
| 83 |
|Volume flow | `data_vol.*.npy.zst` | \\(x, y, z, \rho, p, v_x, v_y, v_z\\) at near-field volumetric simulation mesh (cell center) | N x 8 x 2,204,800 | 2.3 TB (46 files)
|
| 84 |
|Raw data | `*\wing.xyz` | surface simulation mesh | | 7.8 GB
|
|
@@ -86,4 +86,98 @@ The table below summarizes the data.
|
|
| 86 |
| | `*\vol.cgns` | raw flow field output | | 5.5 TB
|
| 87 |
|
| 88 |
|
| 89 |
-
The simulations are conducted on the 160-core high-performance computing cluster at AeroLab, Tsinghua University, for over four months.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|39-56| Mach numbers and angles of attacks |
|
| 30 |
|
| 31 |
2. Index file
|
| 32 |
+
`index.npy` provides the crucial information for all provided samples; it has 12 channels, with each channel listed below:
|
| 33 |
|
| 34 |
|index|description|
|
| 35 |
|-|-|
|
|
|
|
| 71 |
CGNS library to be read out. Since they are too large, they are available via university storage upon reasonable request to the authors.
|
| 72 |
|
| 73 |
|
| 74 |
+
The table below summarizes the data. (N=28856, Nshape=4239)
|
| 75 |
|
| 76 |
|Type | File | Description | Shape | Size |
|
| 77 |
|-|-|-|-|-|
|
| 78 |
|Geometric parameters | `Configs.dat` | shape parameters | N x 57 | 5.0 MB
|
| 79 |
|Information | `index.npy` | group information, operating conditions, and aerodynamic coefficients | N x 12 | 2.8 MB
|
| 80 |
+
|Surface mesh | `origingeom.npy` | reference surface mesh (grid points) | Nshape x 3 x 129 x 257 | 3.3 GB
|
| 81 |
+
| | `geom0.npy` | reference surface mesh (cell center) | Nshape x 3 x 128 x 256 | 3.3 GB
|
| 82 |
|Surface flow | `data.npy` | \\( C_p, \bm {C_f} \\) at reference mesh (cell center) | N x 3 x 128 x 256 | 22.7 GB
|
| 83 |
|Volume flow | `data_vol.*.npy.zst` | \\(x, y, z, \rho, p, v_x, v_y, v_z\\) at near-field volumetric simulation mesh (cell center) | N x 8 x 2,204,800 | 2.3 TB (46 files)
|
| 84 |
|Raw data | `*\wing.xyz` | surface simulation mesh | | 7.8 GB
|
|
|
|
| 86 |
| | `*\vol.cgns` | raw flow field output | | 5.5 TB
|
| 87 |
|
| 88 |
|
| 89 |
+
The simulations are conducted on the 160-core high-performance computing cluster at AeroLab, Tsinghua University, for over four months.
|
| 90 |
+
|
| 91 |
+
# Train-test split
|
| 92 |
+
|
| 93 |
+
The default training-testing split is decided by the **shape indices**, so that the samples in the testing dataset contain shapes that are totally unseen during training. We
|
| 94 |
+
select 90\% shapes and their sample number (corresponding to the rows in `index.npy`) are in `training_samples_index.txt`.
|
| 95 |
+
|
| 96 |
+
# Postprocess
|
| 97 |
+
|
| 98 |
+
## Aerodynamic coefficients
|
| 99 |
+
|
| 100 |
+
One can integrate surface flow (formatted as in `data.npy`) to get the aerodynamic coefficients (i.e., the lift coefficient $C_L$, the drag coefficient $C_D$, the pitching
|
| 101 |
+
moment coefficient $C_{M,z}$) with the code in `floGen` (`flogen.post`). We also provide the `post.py` file here for simple download.
|
| 102 |
+
|
| 103 |
+
Remark.
|
| 104 |
+
1. It uses `pytorch`.
|
| 105 |
+
2. The geometric information should be with the grid point mesh (`origingeom.npy`), not the cell-centric mesh (`geom0.npy`).
|
| 106 |
+
3. The values in `data.npy` are already non-dimensionalized with the freestream condition
|
| 107 |
+
|
| 108 |
+
```python
|
| 109 |
+
import post
|
| 110 |
+
geom = torch.from_numpy(np.load('origingeom.npy'))[i_shape]).float().to(device)
|
| 111 |
+
aoa = 3.0
|
| 112 |
+
ref_area = np.load('index.npy')[i_sample, 4]
|
| 113 |
+
|
| 114 |
+
output = <your_model_output> # with shape (H, W, 3)
|
| 115 |
+
|
| 116 |
+
cf_xyz = post._get_xz_cf_t(geom, output[..., 1:]) # transfer to xyz coordinates
|
| 117 |
+
|
| 118 |
+
force_coefficients = post.get_force_2d_t(geom=geom, aoa=aoa, cp=output[..., 0], cf=cf_xyz) / ref_area # returns: CD, CL, CZ
|
| 119 |
+
moment_coefficients = post.get_moment_2d_t(geom=geom, cp=output[..., 0], cf=cf_xyz, ref_point=[0.25, 0, 0]) / ref_area # returns: CMx, CMy, CMz
|
| 120 |
+
```
|
| 121 |
+
One can also use the `cfdpost` repo (https://github.com/YangYunjia/cfdpost).
|
| 122 |
+
|
| 123 |
+
```python
|
| 124 |
+
from cfdpost.wing.basic import BasicWing
|
| 125 |
+
|
| 126 |
+
geom = torch.from_numpy(np.load('origingeom.npy'))[i_shape]).float().to(device)
|
| 127 |
+
geom_infos = {}
|
| 128 |
+
geom_infos['ref_area'] = np.load('index.npy')[i_sample, 4]
|
| 129 |
+
aoa = 3.0
|
| 130 |
+
|
| 131 |
+
output = <your_model_output> # with shape (H, W, 3)
|
| 132 |
+
|
| 133 |
+
wg1 = BasicWing(paras=geom_infos, aoa=aoa, iscentric=True)
|
| 134 |
+
wg1.read_formatted_surface(geometry=geom, data=output, isinitg=False, isnormed=False)
|
| 135 |
+
wg1.aero_force()
|
| 136 |
+
cl_real = wg1.coefficients # CL, CD, CMz
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
## Visualization
|
| 140 |
+
|
| 141 |
+
To visualize the wing surface field, we provide a brief code that gives a not bad looking.
|
| 142 |
+
|
| 143 |
+
```python
|
| 144 |
+
import numpy as np
|
| 145 |
+
import matplotlib.pyplot as plt
|
| 146 |
+
import matplotlib as mpl
|
| 147 |
+
|
| 148 |
+
def color_map(data, c_map, alpha, dmin=None, dmax=None):
|
| 149 |
+
dmin = np.nanmin(data) if dmin is None else dmin
|
| 150 |
+
dmax = np.nanmax(data) if dmax is None else dmax
|
| 151 |
+
_c_map = mpl.colormaps.get_cmap(c_map)
|
| 152 |
+
|
| 153 |
+
norm = mpl.colors.Normalize(vmin=dmin, vmax=dmax)
|
| 154 |
+
_sm = mpl.cm.ScalarMappable(norm=norm, cmap=_c_map)
|
| 155 |
+
_colors = _sm.to_rgba(data)
|
| 156 |
+
_colors[..., -1] = alpha
|
| 157 |
+
|
| 158 |
+
return _colors, _sm
|
| 159 |
+
|
| 160 |
+
geom = np.load('data/ppn2norigingeom.npy')[0]
|
| 161 |
+
output = <your_model_output> # with shape (H, W, 3)
|
| 162 |
+
|
| 163 |
+
fig = plt.figure(figsize=(10, 4), dpi=200)
|
| 164 |
+
ax = fig.add_subplot(projection='3d')
|
| 165 |
+
|
| 166 |
+
elev = 68; azim =120
|
| 167 |
+
|
| 168 |
+
colors, sm = color_map(output[..., 0], 'gist_rainbow', alpha=1, dmin=-1, dmax=1) # cp
|
| 169 |
+
ax.plot_surface(*geom[[0,2,1]], facecolors=colors, edgecolor='none', rstride=1, cstride=3, shade=True)
|
| 170 |
+
ax.view_init(elev=elev, azim=azim)
|
| 171 |
+
ax.set_axis_off()
|
| 172 |
+
ax.grid(False)
|
| 173 |
+
ax.xaxis.pane.set_visible(False)
|
| 174 |
+
ax.yaxis.pane.set_visible(False)
|
| 175 |
+
ax.zaxis.pane.set_visible(False)
|
| 176 |
+
|
| 177 |
+
plt.show()
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
This should gives sth. like:
|
| 181 |
+
|
| 182 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/6878e482bd4380c813fd99de/8_e3e0Qjik3TSv4evI7dR.png" alt="transform" width="30%">
|
| 183 |
+
|