pde-design-solver
Description
Industrial CFD Design: Custom Neural Operator Design
Objective
Design and implement a custom neural operator for industrial aerodynamic design prediction on 3D unstructured point clouds. Your code goes in the Model class in models/Custom.py. Reference implementations (PointNet, GraphSAGE, Transolver) are provided as read-only context.
Model Interface
Your model receives args at initialization and must implement:
forward(self, x, fx, T=None, geo=None) -> output
x: 3D spatial coordinates, shape(1, N, 3)where N varies per mesh (~5000-10000 points)fx: input features (boundary conditions + geometry), shape(1, N, 7)T: unused (alwaysNone)geo: edge_index tensor for graph connectivity between mesh points (required for graph-based models, can beNonefor non-graph approaches)- output: predicted flow field, shape
(1, N, 4)(velocity_x, velocity_y, velocity_z, pressure)
Note: Batch size is always 1 (one mesh per forward pass). Graph models (PointNet, GraphSAGE, Graph_UNet) squeeze the batch dimension and use geo for message passing. Non-graph models like Transolver ignore geo.
Key args attributes: n_hidden, n_layers, n_heads, space_dim=3, fun_dim=7, out_dim=4, act, mlp_ratio, dropout, geotype (unstructured), radius (for graph construction).
Evaluation
Trained and evaluated on the ShapeNet-Car design benchmark. Metrics (multiple, all reported):
- rho_d: Spearman rank correlation of drag coefficient (higher is better)
- c_d: Relative error of drag coefficient (lower is better)
- relative l2 error press/velo: Relative L2 errors for pressure and velocity fields (lower is better)
Uses 200 training epochs with OneCycleLR scheduler.
Code
1import torch2import torch.nn as nn3import numpy as np4from timm.models.layers import trunc_normal_5from layers.Basic import MLP6from layers.Embedding import unified_pos_embedding789class Model(nn.Module):10def __init__(self, args):11super(Model, self).__init__()12self.__name__ = 'Custom'13self.args = args1415# Input encoding: spatial coords (3D) + features (7D) -> hidden_dim
Additional context files (read-only):
Neural-Solver-Library/models/Transolver.pyNeural-Solver-Library/models/PointNet.pyNeural-Solver-Library/models/GraphSAGE.pyNeural-Solver-Library/models/Graph_UNet.pyNeural-Solver-Library/layers/Basic.pyNeural-Solver-Library/layers/Embedding.pyNeural-Solver-Library/layers/Physics_Attention.py
Results
| Model | Type | rho d Car ↓ | c d Car ↓ | l2 press Car ↓ | l2 velo Car ↓ | l2 press AirfRANS ↓ | l2 velo AirfRANS ↓ | l2 press AirCraft ↓ | l2 velo AirCraft ↓ |
|---|---|---|---|---|---|---|---|---|---|
| graphsage | baseline | 0.981 | 0.019 | 0.089 | 0.033 | 0.047 | 0.037 | 0.658 | 0.434 |
| pointnet | baseline | 0.963 | 0.025 | 0.101 | 0.033 | 0.052 | 0.029 | 0.615 | 0.382 |
| transolver | baseline | 0.987 | 0.014 | 0.084 | 0.024 | 0.036 | 0.018 | 0.683 | 0.398 |