This project implements PANKH (Panel Analysis of uNsteady Kinematics of Hovering airfoils), a solver designed to study the aerodynamics of flapping foils. PANKH is a low-fidelity solver that solves the Laplace equation to determine the velocity distribution in the flow field. It enforces the Neumann boundary condition to satisfy the no-penetration condition (zero normal flux) on the airfoil surface. The unsteady Bernoulli equation is then applied to compute the pressure difference across the airfoil, enabling the calculation of aerodynamic loads.
The essence of this approach lies in transforming a partial differential equation (PDE) into a system of linear algebraic equations, reducing the problem to a linear algebra problem. The real geometry is discretized into a series of flat panels, and a piecewise linearly varying vortex panel method is used to simulate the flow around the airfoil. At each time instant, a constant-strength vortex panel is shed from the trailing edge to satisfy Kelvin's Circulation Theorem, ensuring the correct representation of unsteady effects.
This solver is implemented in C++ and utilizes the Eigen library for efficient matrix operations. The code computes unsteady aerodynamic forces acting on an airfoil undergoing prescribed motion. A detailed document explaining the numerical framework will be provided separately.
-
Real-time wake visualization using Gnuplot for enhanced flow analysis.
-
Live tracking of Cl vs time plot to observe aerodynamic force variations dynamically.
-
Support for any NACA 4-digit series airfoil, allowing user-defined airfoil selection.
-
Flexible motion simulation — the code can be easily modified to analyze various kinematic motions
-
User-controlled wake modeling – The
constants.cpp
file allows users to choose between prescribed wake and free wake analysis. -
Flexible panel discretization – The code supports both even and odd numbers of panels with cosine clustering for improved resolution near the leading and trailing edges. For details, refer to the
nodal_coordinates_initial
function ingeometry.cpp
.
Before compiling and running the code, ensure the installation of the following dependencies:
Install a C++ Compiler
- You need a compiler that supports C++11 or later.
- Recommended options:
- GCC (GNU Compiler Collection)
- Intel C++ Compiler (ICPC/ICX/IPCX)
- To install GCC on Ubuntu:
sudo apt install g++
Install Eigen Library(Required for matrix operations:)
- Install via package manager:
sudo apt install libeigen3-dev # Ubuntu
- Or download manually from Eigen's official website.
- Install, compile and run a code which uses Eigen Library ==> Getting started
Install Gnuplot (Required for real-time in-situ plotting)
- Gnuplot is needed for real-time visualization of results.
- Install Gnuplot on Ubuntu:
sudo apt install gnuplot
- To test if Gnuplot is working, run:
If it opens a terminal, Gnuplot is installed correctly.
gnuplot
Install X11 (Required for Gnuplot visualization)
- Install X11 support on Ubuntu:
sudo apt install x11-apps
- Verify installation:
xeyes # Should open a graphical window with moving eyes
- You can also check the Gnuplot terminal type:
If
gnuplot set terminal
x11
is missing, install X11 as shown above.
You can obtain the source code in two ways:
Cloning the Repository (Recommended for Development)
If you want to contribute or track changes, clone the repository using Git:
git clone https://github.com/coding4Acause/PANKH.git
cd PANKH # this is simply the name of the local(host system) directory
Downloading as a ZIP (For Direct Usage)
If you only need the code without version control:
- Go to the GitHub repository.
- Click the "Code" button.
- Select "Download ZIP".
- Extract the ZIP file and navigate to the extracted folder.
To compile the code, ensure all .cpp and .h files are in the appropriate directories.
The typical structure is:
PANKH # the name of the local repository
- │── /src # Contains all .cpp source files
- │── /include # Contains all .h header files
- │── README.md
- │── LICENSE
- │── /output_files
GCC compilers
If you are using g++, compile everything together with:g++ -o PANKH_solver src/*.cpp -Iinclude -std=c++11
Intel compilers
icpx -o PANKH_solver src/*.cpp -Iinclude -std=c++11
- Before compiling the code, modify the input parameters in
constants.cpp
as needed. - Ensure that the required output directories exist before running the code. Refer to
SETUP.md
for details on directory structure. - After compiling the code, run the solver using:
./ PANKH_solver
The source code is already documented using Doxygen comments, making it easy to generate HTML-based documentation.
Before running Doxygen, ensure the following dependencies are installed:
- Doxygen (Required for generating documentation)
- Graphviz (Required for function call graphs in Doxygen)
sudo apt install doxygen graphviz
doxygen -v # Should print the installed Doxygen version
dot -V # Should print the installed Graphviz version
cd path/to/your/repository
doxygen Doxyfile
This project is licensed under the terms of the MIT License. See License for details.
Incorporating the viscous effects - A hybrid approach can be implemented by first solving the inviscid potential flow to obtain velocity and pressure distributions. These will serve as inputs for a 2D boundary layer solver to estimate local wall friction and boundary layer thickness. If displacement thickness effect is sought, the airfoil geometry is iteratively updated by adjusting the body panels based on local boundary layer displacement, and the potential flow solution is recomputed until convergence is achieved.
Airfoil Geometry – Currently, the code supports only NACA 4-digit series airfoils. Future improvements could extend its capability to handle other NACA series airfoils, as well as non-NACA airfoils, providing greater flexibility in airfoil selection.
Parallelization for Improved Performance – The current implementation runs sequentially, but performance can be significantly enhanced using parallel computing techniques. Since the code utilizes the Eigen library, enabling multi-threading with OpenMP and leveraging Eigen’s built-in vectorization (SIMD) can accelerate matrix operations.
- Nipun Arora
- Ashish Pathak
- Rohit Chowdhury