CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Avatar for JFM-23-1215.

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

| Download

H. Yao, M. Schnaubelt, A. Szalay, T. Zaki and C. Meneveau, 'Comparing local energy cascade rates in isotropic turbulence using structure function and filtering formulations', Journal of Fluid Mechanics, submission under review

© The Authors, 2022.

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'.

Project: JFM-23-1215
Views: 48
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2004-eol
Kernel: Python 3 (system-wide)
import math import numpy as np import pandas as pd import matplotlib.colors as colors from matplotlib import pyplot as plt
KHMH = pd.read_hdf('../Data/2M_database.h5', 'data')
KHMH
# Specify variables Cascade_phi = np.array(KHMH['Phi'].tolist()) Cascade_pi = np.array(KHMH['Pi'].tolist()) k_sf = np.array(KHMH['Du2'].tolist()) k_sgs = 0.5*(np.array(KHMH['Tau11'].tolist()) + np.array(KHMH['Tau22'].tolist()) + np.array(KHMH['Tau33'].tolist())) Eps = 1.3668 dx = 2*np.pi/8192 R = 15*dx #radius
# Normalization Cascade_phi = Cascade_phi/Eps Cascade_pi = Cascade_pi/Eps k_sgs = k_sgs / ((Eps*30*dx)**(2/3)) k_sf = k_sf / ((Eps*30*dx)**(2/3))
# Joint PDFs of Ksgs and Ksf fig = plt.figure(figsize =(10, 7)) ax = fig.add_axes([0.2, 0.2, 0.7, 0.7]) h, ex, ey = np.histogram2d(k_sf, k_sgs, bins=(np.linspace(0, 10, 200), np.linspace(0, 10, 200)), normed=True) eex =(ex[1:]+ex[:-1])/2 eey =(ey[1:]+ey[:-1])/2 plt.contour(eex, eey, h.T, np.r_[0.01, 0.03, 0.1, 0.3, 1, 3], colors='k') plt.ylim([-0.1,6]) plt.xlim([-0.1,6]) plt.ylabel(r'$k_{sgs,\ell} / (\langle \epsilon \rangle \ell)^{(2/3)} $', fontsize = 30) plt.xlabel(r'$k_{sf,\ell} / (\langle \epsilon \rangle \ell)^{(2/3)}$', fontsize = 30) ax.tick_params(axis='both', which='major', labelsize=30)
Image in a Jupyter notebook
# Joint PDFs of Pi and Phi fig = plt.figure(figsize =(10, 7)) ax = fig.add_axes([0.2, 0.2, 0.7, 0.7]) h, ex, ey = np.histogram2d(Cascade_phi, Cascade_pi, bins=(np.linspace(-30, 30, 300), np.linspace(-30, 30, 300)), density = True) eex =(ex[1:]+ex[:-1])/2 eey =(ey[1:]+ey[:-1])/2 plt.contour(eex, eey, h.T, np.r_[ 0.003, 0.01, 0.03, 0.1, 0.3, 1], colors='k') plt.plot(eex,eex,'--r') plt.ylim([-3.5,6]) plt.xlim([-3.5,6]) plt.ylabel(r'$\Pi_{\ell}/\langle \epsilon \rangle$', fontsize = 30) plt.xlabel(r'$\Phi_{\ell}/\langle \epsilon \rangle$', fontsize = 30) ax.tick_params(axis='both', which='major', labelsize=30)
Image in a Jupyter notebook