Published June 13, 2024 | Version v2.0.0
Software Open

Shock Oscillation Analysis Library

  • 1. Institute of Fluid Flow Machinery

Description

Shock Tracking Library

The instability of shock waves due to induced separation presents a significant challenge in aerodynamics. Accurately predicting shock wave instability is crucial for reducing vibrations and noise generation. The high-speed schlieren technique, valued for its simplicity, affordability, and non-intrusiveness, is crucial for understanding the flow patterns in linear cascades. This Python package introduces an advanced method that employs line-scanning to detect and track shock waves from a large series of schlieren images. This method provides a feedback system to handle uncertainties in shock detection, with potential applications in supervised learning and AI. It proves effective in identifying and analyzing different types of shocks, even in images with low resolution or visibility. The method's performance was tested on a transonic fan passage test section in two case studies: one involving various Reynolds number conditions, and the other focusing on low Reynolds numbers, where shock instability is more prominent. The shock testing details can be found in this publication Hanfy, A. H., Flaszyński, P., Kaczyński, P., & Doerffer, P., Advancements in Shock-Wave Analysis and Tracking from Schlieren Imaging. DOI: 10.2139/ssrn.4797840 This library employes OpenCV, scipy, glob, sys, numpy and matplotlib libraries.

Software packaging

The full Python package is now ready for sharing

To install Shock Tracking Library from pip you can use: <br> pip install ShockOscillationAnalysis

Alternatively, you can also clone the repository manually by running:<br> git clone https://github.com/EngAhmedHady/ShockTrackingLibrary.git

Then install the package using:<br> pip3 install dist\ShockOscillationAnalysis-2.0.0-py3-none-any.whl

The full documentation

All functions have been well-defined and documented, and 4 tutorials for the package have been added through this link

Code Improvements

Function Running Time Calculation

  • Build a new functions file to calculate the function running time, added to the file called: decorators.py

Terminal Text Color

  • Added the class BCOLOR to improve the readability of running status and to draw better attention to warnings and failures.
  • Add colors to info, warnings, and Errors to improve the readability of running status and to draw better attention to them.

Improve the InclinedShockTracking.ShockPointsTracking.anglesInterpolation function

Using the numpy and scipy.interpolate function for efficient performance with better boundary point definition and extrapolation

Shock Inclination

  • Added calculation of shock angle standard deviation with the argument tracking_std (default is False). This feature is still under development.
  • Introduced the argument avg_show_txt (default is True) to display the average inclination text.
  • Changed the keyword avg_ang_Yloc to avg_txt_Yloc to specify the text location for the average shock angle.

Define the inclined tracking domain

  • With the bool parameter osc_boundary on the main function InclinedShockTracking.ShockPointsTracking.
  • To control the visualization parameters, the parameters b_color, b_lins_opacity, and osc_range_opacity. An example where the inclined tracking domain is the orange region: <img src="https://github.com/EngAhmedHady/ShockTrackingLibrary/assets/49737863/637eeccf-6626-4121-b973-9dcb7ac58225" width="500"/>

Optimizing the stored images from InclinedShockTracking.ShockPointsTracking

For an efficient estimate of the inclination angle or oscillation domain without a need to store all tested images which is memory and storage consuming.

  • With the int | tuple [int, int] | tuple [int, int, int] parameter called store_n_files.

List Generation Tool

  • Fixed a bug in the file list generation tool to avoid errors when nfiles is set larger than the number of files in the directory.

Cleaning the code

  • Do some cleaning modifications to BrightnessAndContrast
  • Remove tracking_std until being well developed
  • Improve the preview.AvgAnglePlot function to generalize the use with parameters.
  • Add Draft code at the end, for the next improvements
  • Remove unnecessary dependencies

Code Documentation

  1. Added documentation for the functions: preview.AvgAnglePlot, DefineReferences, ShockTrakingAutomation, VelocitySignal, GradientGenerator, IntegralShocktracking, GradShocktracking, inc_tracking.ImportingFiles, anglesInterpolation

  2. Improved documentation for the functions: extract_coordinates, LineDraw, CleanSnapshots, SliceListAverage, CleanIlluminationEffects, BrightnessAndContrast, InclinedShockDomainSetup

Notes

If you use this software, please cite it as below.

Files

EngAhmedHady/ShockTrackingLibrary-v2.0.0.zip

Files (163.2 MB)

Name Size Download all
md5:73b5484ab81aecb73d3c893c6f7dbd4c
163.2 MB Preview Download

Additional details

Related works

Funding

European Commission
TEAMAero - Towards Effective Flow Control and Mitigation of Shock Effects in Aeronautical Applications 860909

Software

Repository URL
https://github.com/EngAhmedHady/ShockTrackingLibrary/
Programming language
Python
Development Status
Active