2D Potential Flow Solver: Vortex & Source Panel Method solver for built-in NACA 4-digit series foils and arbitrary user defined bodies.
Authors: Bora Ugurcan Ekizoglu, Kurt Spiteri
Language: Julia (Pluto.jl)
This repository contains an interactive, fully parameterized interactive 2D numerical solver built in Julia (using Pluto.jl) to estimate the lift and flow field around fully submerged NACA 4-digit series hydrofoils/airfoils.
The tool utilizes inviscid potential flow theory, allowing users to seamlessly toggle between First-Order Source Panel and First-Order Vortex Panel methodologies to evaluate continuous pressure, velocity magnitudes, and integrated force coefficients as well as the Kutta-Joukowski lift at various geometric angles of attack.
Figure 1: Interactive flow field visualization (Velocity Magnitude) over a parametrised NACA foil.
-
Interactive Geometry Generation: Sliders to dynamically manipulate the number of panels (
$N$ ), chord length, thickness, camber, and angle of attack for any NACA 4-digit foil. The solver can also handle user defined arbitrary body functions. - Dual Singularity Solver: Fully interchangeable between purely Source (thickness modeling) and purely Vortex (lifting modeling) mathematical Green's functions.
-
Kutta Condition Enforcement: Explicit matrix augmentation to enforce the trailing edge stagnation point, allowing the mathematical generation of physical circulation and lift. The panel
$x$ and$y$ coordinate arrays should start and end at the trailing to be able to enforce the Kutta condition on the correct panels. - Aerodynamic Post-Processing: Automated integration of the continuous pressure field (via Bernoulli's Equation) to calculate integrated lift and numerical drag, alongside theoretical Kutta-Joukowski checks.
-
Flow Visualization: Superposition of the freestream and panel-induced velocity grids to map continuous Velocity Magnitude (
$V$ ), directional vectors ($U_x$ ,$U_y$ ), and Pressure Coefficient ($C_p$ ) contours.
The solver discretizes the continuous airfoil curve into
Where
The potential induced at a point
-
Point Source:
$G = \frac{1}{2}\ln(r)$ -
Point Vortex:
$G = \arctan\left( \frac{y-y_{s}}{x-x_{s}}\right)$
By evaluating the influence of every panel on every other panel's collocation point (the midpoint), we assemble an aerodynamic influence matrix
To prevent infinite velocities around the sharp trailing edge, the system is modified to physically lock the trailing-edge stagnation point. We sacrifice the final matrix equation and replace it with the Kutta Condition, enforcing zero net vorticity at the trailing edge:
Figure 2: Pressure Coefficient (
A rigorous validation study (NACA_XXXX_PM_validation_convergence.jl) accompanies the core tool. The matrix assembly and mathematical integration are validated against closed-body sanity checks (circles and ellipses) before being applied to the lifting foil.
As the panel resolution (
Figure 3: Grid convergence study demonstrating stable singularity distribution and asymptotic lift convergence.
While this tool includes a built-in NACA 4-digit generator, the core solver is entirely geometry-agnostic. You can compute the flow around any arbitrary body by simply feeding 1D arrays of solve() function.
For example, to simulate flow around a custom circular body, you can define a simple coordinate generator:
# 1. Define a custom geometry function
function circle(N, R=1.0)
# N panels require N+1 node points to close the loop
theta = range(-π, π, length=N+1)
x = R .* cos.(theta)
y = R .* sin.(theta)
return x, y
end
# 2. Generate the coordinates for 32 panels
x_circ, y_circ = circle(32, 0.5)
# 3. Feed the coordinate arrays directly into the solver!
U_free = (1.0, 0.0)
q_circ = solve(x_circ, y_circ, U_free; G=source, loopdir=:CCW)This project is built as a reactive Pluto.jl notebook.
- Install Julia.
- Open the Julia REPL and install Pluto:
julia> ] (@v1.x) pkg> add Pluto julia> import Pluto julia> Pluto.run()