CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Avatar for S002211202200903X.
| Download

Charles Meneveau and Colm-cille P. Caulfield, 'Introducing JFM Notebooks', Journal of Fluid Mechanics 952 (2022), E1 (https://doi.org/10.1017/jfm.2022.903). Figure 1 key words: channel flow, velocity profile, logarithmic law

© The Authors, 2022. Published by Cambridge University Press.

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

Views: 1977
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204
Kernel: Python 3 (system-wide)

logo

import numpy as np import scipy.io as sio import matplotlib.pyplot as plt # load y+ and u+ data (ascii file with 2 columns: y+ & u+, at 2 Re-tau) temp1=np.loadtxt('u-profile-Retau1000.dat') y1=temp1[:,0]; u1=temp1[:,1] temp2=np.loadtxt('u-profile-Retau5200.dat') y2=temp2[:,0]; u2=temp2[:,1] kappa=0.38; B=4.2; # log-law model parameters. c1=12.0; c2=(1/kappa)*np.log(c1)+B # composite model parameters. # log and linear law: ym1=np.array(list(range(1,5000))); um1=(1/kappa)*np.log(ym1)+B ym2=np.array(list(range(1,100))); um2=ym2 # composite function: ym3=ym1; um3=((1/kappa)*np.log(c1+ym3)+B)*(1+(ym3/c2)**(-2))**(-1/2) # create semilog mean velocity profile plot fig, ax = plt.subplots() CS = ax.plot(y1, u1, '-r',y2, u2, '-g') CS = ax.plot(ym1, um1, '--k', ym2, um2, ':k',ym3,um3,'-.b') plt.xlim(1,7000); plt.ylim(0,30) plt.title('Mean velocity',fontsize=15) plt.xlabel(r'$y^+=y u_{\tau}/~\nu$',fontsize=18) plt.xticks(fontsize=16); plt.yticks(fontsize=16) plt.ylabel(r'$\overline{u}^+=\overline{u}~ / ~ u_{\tau}$',fontsize=18) ax.set_xscale('log')
Image in a Jupyter notebook