The following is an aerodynamic shape optimization case for the NACA0012 airfoil in transonic conditions using the density-based DARhoJSTFoam solver.
Case: Airfoil aerodynamic optimization Geometry: NACA0012 Objective function: Drag coefficient (CD) Lift coefficient (CL): 0.5 Design variables: 8 FFD shape variables moving in the z direction, one angle of attack Constraints: Volume, thickness, leading-edge radius, and lift constraints (total number: 24) Mach number: 0.7 (243 m/s) Reynolds number: 15.9 million Mesh cells: ~28,000 Solver: DARhoJSTFoam
The “runScript.py” is similar to the one used in the NACA0012 transonic case with the following exceptions:
-
We use “DARhoJSTFoam”, a density-based solver with JST spatial discretization. The flow is solved by an approximate Newton-Krylov (ANK) solver followed by a Newton-Krylov (NK) solver, set in the “rhoJST” key.
-
The “shockSensor” is set to “entropy” to capture the shock on the upper surface.
-
We use Uno as the default optimizer. Use “-optimizer SNOPT”, “IPOPT”, or “SLSQP” to change it.
To run this case, first download tutorials and untar it. Then go to tutorials-main/DARhoJSTFoam/Airfoil_Aero_Opt and run the “preProcessing.sh” script to generate the mesh:
./preProcessing.sh
Then, use the following command to run the optimization with 8 CPU cores:
mpirun -np 8 python runScript.py 2>&1 | tee log_opt.txt
The optimization converged in 14 iterations and took about 9 minutes using 8 CPU cores. According to “log_opt.txt” and “opt_Uno.txt”, the initial drag is 0.01692 and the optimized drag is 0.01145 with a drag reduction of 32.3%. The optimization removes the shock on the upper surface.
The evolution of pressure and shape during the optimization is as follows.

Fig. 1. Pressure and shape evolution during the optimization process