|
| 1 | +# XAeroNet: Scalable Neural Models for External Aerodynamics |
| 2 | + |
| 3 | +XAeroNet is a collection of scalable models for large-scale external |
| 4 | +aerodynamic evaluations. It consists of two models, XAeroNet-S and XAeroNet-V for |
| 5 | +surface and volume predictions, respectively. |
| 6 | + |
| 7 | +## Problem overview |
| 8 | + |
| 9 | +External aerodynamics plays a crucial role in the design and optimization of vehicles, |
| 10 | +aircraft, and other transportation systems. Accurate predictions of aerodynamic |
| 11 | +properties such as drag, pressure distribution, and airflow characteristics are |
| 12 | +essential for improving fuel efficiency, vehicle stability, and performance. |
| 13 | +Traditional approaches, such as computational fluid dynamics (CFD) simulations, |
| 14 | +are computationally expensive and time-consuming, especially when evaluating multiple |
| 15 | +design iterations or large datasets. |
| 16 | + |
| 17 | +XAeroNet addresses these challenges by leveraging neural network-based surrogate |
| 18 | +models to provide fast, scalable, and accurate predictions for both surface-level |
| 19 | +and volume-level aerodynamic properties. By using the DrivAerML dataset, which |
| 20 | +contains high-fidelity CFD data for a variety of vehicle geometries, XAeroNet aims |
| 21 | +to significantly reduce the computational cost while maintaining high prediction |
| 22 | +accuracy. The two models in XAeroNet—XAeroNet-S for surface predictions and XAeroNet-V |
| 23 | +for volume predictions—enable rapid aerodynamic evaluations across different design |
| 24 | +configurations, making it easier to incorporate aerodynamic considerations early in |
| 25 | +the design process. |
| 26 | + |
| 27 | +## Model Overview and Architecture |
| 28 | + |
| 29 | +### XAeroNet-S |
| 30 | + |
| 31 | +XAeroNet-S is a scalable MeshGraphNet model that partitions large input graphs into |
| 32 | +smaller subgraphs to reduce training memory overhead. Halo regions are added to these |
| 33 | +subgraphs to prevent message-passing truncations at the boundaries. Gradient aggregation |
| 34 | +is employed to accumulate gradients from each partition before updating the model parameters. |
| 35 | +This approach ensures that training on partitions is equivalent to training on the entire |
| 36 | +graph in terms of model updates and accuracy. Additionally, XAeroNet-S does not rely on |
| 37 | +simulation meshes for training and inference, overcoming a significant limitation of |
| 38 | +GNN models in simulation tasks. |
| 39 | + |
| 40 | +The input to the training pipeline is STL files, from which the model samples a point cloud |
| 41 | +on the surface. It then constructs a connectivity graph by linking the N nearest neighbors. |
| 42 | +This method also supports multi-mesh setups, where point clouds with different resolutions |
| 43 | +are generated, their connectivity graphs are created, and all are superimposed. The Metis |
| 44 | +library is used to partition the graph for efficient training. |
| 45 | + |
| 46 | +For the XAeroNet-S model, STL files are used to generate point clouds and establish graph |
| 47 | +connectivity. Additionally, the .vtp files are used to interpolate the solution fields onto |
| 48 | +the point clouds. |
| 49 | + |
| 50 | +### XAeroNet-V |
| 51 | + |
| 52 | +XAeroNet-V is a scalable 3D UNet model with attention gates, designed to partition large |
| 53 | +voxel grids into smaller sub-grids to reduce memory overhead during training. Halo regions |
| 54 | +are added to these partitions to avoid convolution truncations at the boundaries. |
| 55 | +Gradient aggregation is used to accumulate gradients from each partition before updating |
| 56 | +the model parameters, ensuring that training on partitions is equivalent to training on |
| 57 | +the entire voxel grid in terms of model updates and accuracy. Additionally, XAeroNet-V |
| 58 | +incorporates a continuity constraint as an additional loss term during training to |
| 59 | +enhance model interpretability. |
| 60 | + |
| 61 | +For the XAeroNet-V model, the .vtu files are used to interpolate the volumetric |
| 62 | +solution fields onto a voxel grid, while the .stl files are utilized to compute |
| 63 | +the signed distance field (SDF) and its derivatives on the voxel grid. |
| 64 | + |
| 65 | +## Dataset |
| 66 | + |
| 67 | +We trained our models using the DrivAerML dataset from the [CAE ML Dataset collection](https://caemldatasets.org/drivaerml/). |
| 68 | +This high-fidelity, open-source (CC-BY-SA) public dataset is specifically designed |
| 69 | +for automotive aerodynamics research. It comprises 500 parametrically morphed variants |
| 70 | +of the widely utilized DrivAer notchback generic vehicle. Mesh generation and scale-resolving |
| 71 | +computational fluid dynamics (CFD) simulations were executed using consistent and validated |
| 72 | +automatic workflows that represent the industrial state-of-the-art. Geometries and comprehensive |
| 73 | +aerodynamic data are published in open-source formats. For more technical details about this |
| 74 | +dataset, please refer to their [paper](https://arxiv.org/pdf/2408.11969). |
| 75 | + |
| 76 | +## Training the XAeroNet-S model |
| 77 | + |
| 78 | +To train the XAeroNet-S model, follow these steps: |
| 79 | + |
| 80 | +1. Download the DrivAer ML dataset using the provided `download_aws_dataset.sh` script. |
| 81 | + |
| 82 | +2. Navigate to the `surface` folder. |
| 83 | + |
| 84 | +3. Specify the configurations in `conf/config.yaml`. Make sure path to the dataset |
| 85 | + is specified correctly. |
| 86 | + |
| 87 | +4. Run `combine_stl_solids.py`. The STL files in the DriveML dataset consist of multiple |
| 88 | + solids. Those should be combined into a single solid to properly generate a surface point |
| 89 | + cloud using the Modulus Tesselated geometry module. |
| 90 | + |
| 91 | +5. Run `preprocessing.py`. This will prepare and save the partitioned graphs. |
| 92 | + |
| 93 | +6. Create a `partitions_validation` folder, and move the samples you wish to use for |
| 94 | + validation to that folder. |
| 95 | + |
| 96 | +7. Run `compute_stats.py` to compute the global mean and standard deviation from the |
| 97 | + training samples. |
| 98 | + |
| 99 | +8. Run `train.py` to start the training. |
| 100 | + |
| 101 | +9. Download the validation results (saved in form of point clouds in `.vtp` format), |
| 102 | + and visualize in Paraview. |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +## Training the XAeroNet-V model |
| 107 | + |
| 108 | +To train the XAeroNet-V model, follow these steps: |
| 109 | + |
| 110 | +1. Download the DrivAer ML dataset using the provided `download_aws_dataset.sh` script. |
| 111 | + |
| 112 | +2. Navigate to the `volume` folder. |
| 113 | + |
| 114 | +3. Specify the configurations in `conf/config.yaml`. Make sure path to the dataset |
| 115 | + is specified correctly. |
| 116 | + |
| 117 | +4. Run `preprocessing.py`. This will prepare and save the voxel grids. |
| 118 | + |
| 119 | +5. Create a `drivaer_aws_h5_validation` folder, and move the samples you wish to |
| 120 | + use for validation to that folder. |
| 121 | + |
| 122 | +6. Run `compute_stats.py` to compute the global mean and standard deviation from |
| 123 | + the training samples. |
| 124 | + |
| 125 | +7. Run `train.py` to start the training. Partitioning is performed prior to training. |
| 126 | + |
| 127 | +8. Download the validation results (saved in form of voxel grids in `.vti` format), |
| 128 | + and visualize in Paraview. |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | +## Logging |
| 133 | + |
| 134 | +We mainly use TensorBoard for logging training and validation losses, as well as |
| 135 | +the learning rate during training. You can also optionally use Weight & Biases to |
| 136 | +log training metrics. To visualize TensorBoard running in a |
| 137 | +Docker container on a remote server from your local desktop, follow these steps: |
| 138 | + |
| 139 | +1. **Expose the Port in Docker:** |
| 140 | + Expose port 6006 in the Docker container by including |
| 141 | + `-p 6006:6006` in your docker run command. |
| 142 | + |
| 143 | +2. **Launch TensorBoard:** |
| 144 | + Start TensorBoard within the Docker container: |
| 145 | + |
| 146 | + ```bash |
| 147 | + tensorboard --logdir=/path/to/logdir --port=6006 |
| 148 | + ``` |
| 149 | + |
| 150 | +3. **Set Up SSH Tunneling:** |
| 151 | + Create an SSH tunnel to forward port 6006 from the remote server to your local machine: |
| 152 | + |
| 153 | + ```bash |
| 154 | + ssh -L 6006:localhost:6006 <user>@<remote-server-ip> |
| 155 | + ``` |
| 156 | + |
| 157 | + Replace `<user>` with your SSH username and `<remote-server-ip>` with the IP address |
| 158 | + of your remote server. You can use a different port if necessary. |
| 159 | + |
| 160 | +4. **Access TensorBoard:** |
| 161 | + Open your web browser and navigate to `http://localhost:6006` to view TensorBoard. |
| 162 | + |
| 163 | +**Note:** Ensure the remote server’s firewall allows connections on port `6006` |
| 164 | +and that your local machine’s firewall allows outgoing connections. |
0 commit comments