pde-design-solver

PDE SolversNeural-Solver-Libraryrigorous codebase

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 (always None)
  • geo: edge_index tensor for graph connectivity between mesh points (required for graph-based models, can be None for 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

Custom.py
EditableRead-only
1import torch
2import torch.nn as nn
3import numpy as np
4from timm.models.layers import trunc_normal_
5from layers.Basic import MLP
6from layers.Embedding import unified_pos_embedding
7
8
9class Model(nn.Module):
10 def __init__(self, args):
11 super(Model, self).__init__()
12 self.__name__ = 'Custom'
13 self.args = args
14
15 # Input encoding: spatial coords (3D) + features (7D) -> hidden_dim

Additional context files (read-only):

  • Neural-Solver-Library/models/Transolver.py
  • Neural-Solver-Library/models/PointNet.py
  • Neural-Solver-Library/models/GraphSAGE.py
  • Neural-Solver-Library/models/Graph_UNet.py
  • Neural-Solver-Library/layers/Basic.py
  • Neural-Solver-Library/layers/Embedding.py
  • Neural-Solver-Library/layers/Physics_Attention.py

Results

ModelTyperho d Car c d Car l2 press Car l2 velo Car l2 press AirfRANS l2 velo AirfRANS l2 press AirCraft l2 velo AirCraft
graphsagebaseline0.9810.0190.0890.0330.0470.0370.6580.434
pointnetbaseline0.9630.0250.1010.0330.0520.0290.6150.382
transolverbaseline0.9870.0140.0840.0240.0360.0180.6830.398