| name | cfd-optimization |
| description | CFD shape optimization — parametric vs. adjoint, surrogate models (Kriging/RBF), design of experiments (LHS), mesh morphing, multi-objective NSGA-II, RANS-based optimization, Pareto front. |
| metadata | {"priority":7,"promptSignals":{"phrases":["CFD optimization","shape optimization CFD","surrogate model CFD","aerodynamic optimization","design of experiments CFD","NSGA-II CFD"],"minScore":3}} |
CFD Shape Optimization — Complete Skill
Optimization Framework Overview
Design variable space:
α = [α₁, α₂, ..., αₙ] — shape parameters (FFD control points, CAD dimensions, Bézier coefficients)
Objective(s):
J = [J₁(α), J₂(α), ...] — e.g., drag, pressure drop, heat transfer, noise
Constraints:
g_i(α) ≤ 0 — e.g., volume ≥ V_min, stress ≤ σ_allow, Cl ≥ Cl_min
Problem:
min J(α) subject to g_i(α) ≤ 0, α_L ≤ α ≤ α_U
Shape Parameterization
Free-Form Deformation (FFD)
Lattice of control points surrounds geometry; deform lattice → geometry moves
x_new = Σ B_ijk(s,t,u) × P_ijk [trivariate Bernstein polynomial; P = control points]
Degrees of freedom: n_x × n_y × n_z × 3 (3D displacement) = design variables
Advantage: differentiable; adjoint compatible; any geometry
CAD Parameters
Directly vary geometry dimensions: chord, twist, chord position, camber
Fewer variables (5–50); physical meaning; constrains design space
Disadvantage: re-meshing required for each design; costly
NACA Profile Parameters (Airfoil)
4-digit NACA (m, p, t): 4 parameters
t = max thickness; m = max camber; p = position of max camber
Combined with CST or Hicks-Henne bumps for finer control
Hicks-Henne Bumps
Surface perturbation:
Δy(x) = Σ aₙ × sin^n(π x^c) [aₙ = bump amplitude; c = bump location exponent]
n_bumps per surface (upper + lower); n = 10–30 per surface typical
Design Space Exploration
Latin Hypercube Sampling (LHS)
Space-filling DoE: ensures uniform coverage of n-dimensional design space
N_samples = 3–10 × n_variables (minimum for surrogate building)
For 20 variables: 60–200 CFD runs at space-filling points
Randomized vs. optimal LHS: maximize minimum distance between points
Tools: pyDOE (Python), Minitab, JMP
Central Composite Design (CCD)
Face-centered CCD: factorial + axial + center points
N_runs = 2^k + 2k + 1 [k = number of variables; 3 variables → 15 runs]
Good for quadratic surrogate building; limited variables (< 7)
Surrogate Models
Kriging (Gaussian Process)
Interpolating surrogate:
ŷ(x) = f(x)^T β + Z(x) [trend + stochastic process]
Z(x) ~ Gaussian Process with covariance: cov(Z(x_i), Z(x_j)) = σ² × R(|x_i - x_j|)
Kriging prediction:
ŷ(x*) = F(x*)β̂ + r(x*)^T R⁻¹ (y - Fβ̂)
r(x*) = [R(x*, x_1), ..., R(x*, x_N)] — correlation vector
Advantage: provides prediction uncertainty σ̂²(x*) → guides next sample point
Hyperparameter optimization: maximize log-likelihood to find θ in R(d) = exp(-Σθ_i |d_i|^p)
Radial Basis Function (RBF)
Surrogate:
ŷ(x) = Σ w_i × φ(||x - x_i||) [φ = basis function; w = weights from training data]
φ types: multiquadric φ = √(r² + c²); thin plate: r² ln(r); Gaussian: exp(-r²/σ²)
Training: solve linear system [φ(||x_i - x_j||)] w = y_training
Advantage: fast; simple; good for smooth functions; less robust to noise than Kriging
Neural Network Surrogate
Multi-layer perceptron (MLP):
Input: α → output: J; trained on CFD dataset
Advantage: handles nonlinear high-dimensional; requires large dataset (N > 500 typically)
Tools: TensorFlow, PyTorch; scikit-learn (small networks)
Optimization Algorithms
Gradient-Based (with Adjoint)
SLSQP (Sequential Least SQuares Programming):
min J(α) using gradients from adjoint; fast convergence (10–50 iterations)
Best for: smooth objective, single objective, large n
BFGS / L-BFGS:
Quasi-Newton; approximate Hessian; 20–100 iterations to convergence
PyOpt, scipy.optimize.minimize; gradient from adjoint or finite difference
Multi-Objective: NSGA-II
Non-dominated Sorting Genetic Algorithm:
Population: 50–200 individuals
Generations: 50–200 (total CFD runs = pop × gen = 5000–40,000 → use surrogate)
Selection: tournament + crowding distance
Output: Pareto front of J₁ vs. J₂ trade-off
NSGA-III: extended NSGA-II for > 2 objectives
MOEA/D: decomposition approach; best for many objectives (4+)
Bayesian Optimization (EGO — Efficient Global Optimization)
Sequential infill strategy:
- Build Kriging surrogate on initial LHS samples
- Maximize Expected Improvement: EI(x) = E[max(J_best - ŷ(x), 0)]
- Run CFD at x* = argmax EI(x)
- Update Kriging; repeat
Optimal allocation: ~10–50 CFD runs per variable (much fewer than gradient-free DoE)
Mesh Morphing
RBF mesh morphing:
Move boundary nodes per shape change; interpolate interior nodes via RBF
Interior displacement: Δx_int = Σ w_j × φ(||x_int - x_j||) [w from boundary constraint]
Advantage: no re-meshing; fast; differentiable (for adjoint compatibility)
Tools: Sculptor, RBF Morph, ANSA morphing, Altair HyperMorph
Limitation: large deformations cause poor mesh quality → check mesh quality metrics (min orthogonality, aspect ratio) after each morphing step
CFD Solver Integration
Automated parametric loop:
- Update parameters → CAD/FFD deformation
- Mesh generation (if re-mesh) or morph
- CFD solve (RANS; k-ω SST typical for aerodynamic optimization)
- Extract objective and constraint values
- Update surrogate/optimizer
- Repeat
Tools: Pointwise, ICEM CFD (meshing); OpenFOAM, Fluent, STAR-CCM+ (CFD); Dakota, OpenMDAO (optimization framework)
OpenMDAO (NASA):
Unified framework for CFD + adjoint + gradient-based optimization
MACH-Aero: full aircraft aero-structural optimization; production use
Output
Provide: design variable count and type (FFD/CAD/Hicks-Henne), DoE method (LHS/CCD) and sample count N, surrogate type (Kriging/RBF/NN) and cross-validation error [%], optimizer (BFGS/NSGA-II/EGO), objective improvement ΔJ [%], Pareto front description (if multi-objective), design variable range [% of nominal], CFD runs total (DoE + infill), mesh morphing quality check, and software stack (mesher/solver/optimizer).