Skip to content

fabiobeltratti/PPUN2D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PPUN2D โ€“ Post-Processing Tool for Unstructured 2D CFD Solutions

PPUN2D (Post-Processing Unstructured 2D Data) is a C++ software developed for the aerodynamic force computation and drag decomposition from CFD solutions on unstructured 2D grids. The code originates from the structure and methodology of UBF2D, a structured-grid code developed by Dr. Mauro Minervino (CIRA) and by the University of Naples "Federico II" (https://github.com/m-minervino/UBF2D). It supports both near-field and far-field approaches and includes Green-Gauss gradient reconstruction and domain decomposition techniques. The software is intended for academic and research purposes.

Developed at the Italian Aerospace Research Centre (CIRA), in collaboration with the University of Naples Federico II as part of a master's thesis project.


๐Ÿš€ Overview

PPUN2D processes binary Tecplot (.szplt) files obtained from CFD solvers and provides:

  • Total aerodynamic force evaluation using the near-field approach.
  • Support for Lamb vector-based and thermodynamic far-field methods.
  • Drag breakdown into viscous, wave, and spurious components.
  • Gradient and divergence computation via Green-Gauss techniques.
  • Sensor-based region tagging (boundary layer, shock, wake).

Results are exported in both Tecplot and plain-text formats for visualization and further analysis.


๐Ÿ“ฆ Input Requirements

  • Tecplot .szplt file containing:

    • Primitive variables: $\rho$, $u$, $v$, $p$, $T$.
    • Optional turbulence fields: $\mu_t$, $\omega$.
    • Mesh connectivity and coordinates.
  • Configuration file (ppun2d_config.cas) with:

    • Freestream conditions (Mach, Temperature, Density, etc.).
    • Flags for method activation.
    • Control volume specifications.
    • Sensor thresholds and surface definition parameters.

๐Ÿงฎ Implemented Methods

Near-field method

Computes the aerodynamic force through surface integration of pressure and viscous stresses.

  • It does not allow decomposition into physical and spurious drag contributions.
  • Although often provided by the CFD solver, it is recalculated here to ensure consistent comparison with the implemented far-field methods.

Far-field methods

Compute the aerodynamic force through integration of the net momentum flux on a control volume surrounding the body. These methods allow decomposition into physical and spurious contributions. The following formulations are implemented:

  • Paparone & Tognaccini method โ†’ computes the irreversible drag as a function of the non-dimensional entropy.
  • Destarac & van der Vooren method โ†’ computes the irreversible drag as a function of both entropy and total enthalpy.
  • Vorticity-based Lamb vector method, where $\ell = \omega \times V$ โ†’ computes both lift and drag.
  • Thermodynamic-based Lamb vector method, where $\ell = T \nabla s โˆ’ \nabla H + \nabla \cdot \underline{\underline{\tau_v}} / \rho$ โ†’ computes lift and drag with reduced numerical sensitivity.

Irreversible and parasite drag breakdown

PPUN2D supports detailed domain decomposition to isolate the sources of drag:

  • Viscous, shock-associated, and spurious contributions can be separated.
  • Decomposition is performed via:
    • Internal sensors based on eddy-viscosity ratio, specific dissipation rate, and pressure gradient.
    • User-defined margins extending each tagged region, set in the config file.
  • Viscous regions are detected via high values of $(\mu + \mu_t)/\mu$ or $\omega$.
  • Shock regions are flagged using pressure gradients.
  • Spurious drag is computed as the residual from the total.
  • All tagged regions are exported for direct visualization in Tecplot.

๐Ÿ“ Gradient and Divergence Schemes

  • Green-Gauss (GG) method:

    • Both cell-based and node-based implementations are available.
    • Gradients and divergences are allocated at cell centers.
    • Used to compute $\nabla \phi$, $\nabla \cdot \boldsymbol{\tau}$, and other key quantities.
  • Volume integrals are computed via cell-wise summation.

  • Surface integrals use interpolated face values and outward normal vectors.


๐Ÿ—‚ Output Files

  • output.szplt: Tecplot file containing:

  • Input and computed variables (Cl, Cd, Lamb vector, region tags, etc.).

  • Compatible with Tecplot 360 for visualization.

  • forces_summary.txt: structured table including:

  • Lift and drag coefficients.

  • Near-field and far-field results.

  • Drag-breakdown by region (viscous, shock, spurious).

  • Results for all evaluated wake-plane locations.


๐Ÿ” Applications

PPUN2D is suitable for:

  • Post-processing of compressible 2D steady-state RANS solutions.
  • Investigating drag contributions from different flow features.
  • Benchmarking Lamb vector-based and thermodynamic drag breakdown methods.
  • Supporting research in unstructured mesh CFD and aerodynamic optimization.

๐Ÿ“– References

Theoretical background and numerical formulations are based on:

Lamb vector-based methods:

  • Minervino, M. & Tognaccini, R., A unified thermodynamic/Lamb-vector-based analysis of the aerodynamic force, Physics of Fluids, 2023. DOI: 10.1063/5.0164384
  • Minervino, M. & Tognaccini, R., On the spurious effects in Lamb-vector-based force decomposition methods, Aerospace Science and Technology, 2023. DOI: 10.1016/j.ast.2023.108674
  • Wu, J.-Z., Lu, X.-Y., & Zhuang, L.-X., Integral force acting on a body due to local flow structures, Journal of Fluid Mechanics, Vol. 576, 2007, pp. 265โ€“286. DOI: 10.1017/S0022112006004551
  • Mele, B. & Tognaccini, R., Aerodynamic force by Lamb vector integrals in compressible flow, Physics of Fluids, Vol. 26, No. 5, 2014, p. 056104. DOI: 10.1063/1.4875015

Thermodynamic formulations:

  • Paparone, L. & Tognaccini, R., Computational Fluid Dynamics-Based Drag Prediction and Decomposition, AIAA Journal, Vol. 41, No. 9, 2003, pp. 1647โ€“1657. DOI: 10.2514/2.7300
  • Destarac, D. & van der Vooren, J., Drag/thrust analysis of jet-propelled transonic transport aircraft, Aerospace Science and Technology, 2004. DOI: 10.1016/j.ast.2004.03.004

Ph.D. Thesis:

  • Minervino, M., A unified thermodynamic/vortical theory for the aerodynamic force analysis, Ph.D. thesis, University of Naples Federico II, 2025. hdl: 11588/989058

๐Ÿ‘จโ€๐Ÿ’ป Development and License

This code was developed by Fabio Beltratti as part of a masterโ€™s thesis in aerospace engineering.
Supervisors: Ing. Mauro Minervino (CIRA), Prof. Renato Tognaccini (University of Naples "Federico II")
License: Research use only โ€“ contact the author for usage permissions.


๐Ÿ™ Acknowledgments

Special thanks to Dr. Mauro Minervino (CIRA) for his guidance and technical insights, and to Prof. Renato Tognaccini for scientific supervision and support throughout the development.


๐Ÿ›  Build & Run

Clone the repository

git clone https://github.com/your-username/PPUN2D.git cd PPUN2D

Compile with Intel compiler (icc)

icc -std=c++11 -o PPUN2D PPUN2D.cpp /path/to/tecio/libtecio.so

Run the executable with the following syntax:

./ppun2d <input_solution.szplt> <config_file.cas> <output_file.szplt>

./ppun2d input_CFDsolution.szplt ppun2d_config.cas output_results.szplt

About

Post-Processing tool for 2D steady-state CFD solutions based on unstructured grids.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages