Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for S0022112025103832.
Download

Daniel Edgington-Mitchell; Joel Weightman; Soudeh Mazharmanesh; Petrônio Nogueira, ‘Vortices, shocks and non-linear acoustic waves: the ingredients for resonance in impinging compressible jets', Journal of Fluid Mechanics, (https://DOI.org/10.1017/jfm.2025.10383). Key words: Impinging jets; Supersonic jets; Resonance; Aeroacoustics © The Authors, 2025. Published by Cambridge University Press.

To edit and run the notebooks: (1) click the 'Edit...' button; (2) on the following screen, click 'Use CoCalc Anonymously', (3) then click 'Create New Project'.

347 views
unlisted
ubuntu2204
Kernel: Python 3 (system-wide)

logo

Axisymmetric jet impinging on cylinder

import os import h5py import numpy as np import matplotlib.pyplot as plt import imageio.v2 as imageio import time from IPython.display import Video, display from IPython.display import display, HTML from skimage.transform import resize from pathlib import Path # Load MATLAB file with h5py.File('Figure9_zD30_NPR_250_Fields_Less_Sample.mat', 'r') as mat_data: imdata_Fig9 = mat_data['imdata'][:] # Invert y-axis for the entire imdata_Fig9 imdata_Fig9_flipped = np.flipud(imdata_Fig9) imdata_Fig9=imdata_Fig9_flipped # Create directory for images if it does not exist output_dir_Fig9 = 'images_Fig9' os.makedirs(output_dir_Fig9, exist_ok=True) # Create video frames from imdata and resize images for i in range(imdata_Fig9.shape[2]): img_Fig9 = imdata_Fig9[:, :, i] img_resized_Fig9 = resize(img_Fig9, (880, 736)) plt.imsave(f'{output_dir_Fig9}/frame_{i:03d}.png', img_resized_Fig9, cmap='gray') # Create a video from the images images_Fig9 = [] for i in range(imdata_Fig9.shape[2]): images_Fig9.append(imageio.imread(f'{output_dir_Fig9}/frame_{i:03d}.png')) # Save video video_path_Fig9 = 'loaded_video_Fig9.mp4' imageio.mimsave(video_path_Fig9, images_Fig9, fps=10, format='FFMPEG', codec='libx264') #Set the video frame rate using fps # Wait to ensure the file is written properly time.sleep(1) # Verify if the video file exists and is not empty if not os.path.exists(video_path_Fig9) or os.stat(video_path_Fig9).st_size == 0: print("Error: Video Fig9 file was not created correctly or is empty.") else: # Display video display(HTML("<span style='font-size:18px; font-weight:bold;'>Axisymmetric jet impinging on cylinder, NPR=2.5, z/D=3.0</span>")) display(Video("loaded_video_Fig9.mp4", embed=True))