Custom CFD Code
Spring 2022
Overview
In culmination of the knowledge I learned from my fluid mechanics and aerodynamics courses, I decided to built a simple custom CFD code to test and practice my knowledge. This was also part of my MAE 150B: Aerodynamics course.
Objectives
- Calculate pressure distribution, flow velocities, total lift, and total drag.
- Compute 2D incompressible potential flows using the finite difference method.
- Generate a computational mesh grid, then complete an iteration process in MATLAB.
- Calculate and plot pressure along airfoil, pressure contours, and streamlines.
Skills
Simulation: Computational Fluid Dynamics (CFD), MATLAB
Key Tasks

Computational Grid
- Plot the computational grid. A rectangular grid is generated for simplicity.

Coefficient of Pressure along Airfoil compared to the Panel Method

Coefficient of Pressure along Airfoil compared to the Published Experimental Results

Coefficient of Pressure along Airfoil compared to the Published Panel Method Results
- Iteratively solve for the stream function at all the grid points until convergence.
- Plot the resulting pressure coefficients against the panel method results and experimental results in literature.

Pressure Contour

Streamline
- Plot the pressure contour and the streamline.
Outcomes
- Successfully used existing knowledge of Fluid Mechanics and Aerodynamics to create a basic custom CFD code.
- Will continue to expand on the code for more complex airfoil geometries and flow conditions.