Notebooks supporting the J. Fluid Mech. submission "Turbulent mixed convection in vertical and horizontal channels"
unlisted
ubuntu2204Kernel: Python 3 (system-wide)
In [3]:
import numpy as np import h5py import matplotlib.pyplot as plt import seaborn as sns import cmocean # Aesthetics sns.set_theme() sns.set_style('ticks') sns.set_context('paper') plt.rc('mathtext', fontset='stix') plt.rc('font', family='serif') plt.rc('axes', grid=True) import pandas as pd
Load energy budget data
In [4]:
df = pd.read_csv('../data/budget_data.csv') df.head()
Out[4]:
Set parameter-dependent figure aesthetics
In [5]:
def Pr_mark(Pr): if Pr==1: return 'o' elif Pr==4: return '^' else: return 'v' camp = sns.color_palette('flare', as_cmap=True) cspeed = cmocean.tools.crop_by_percent(cmocean.cm.tempo, 30, which='both', N=None) def Re_col(lR): return camp((lR - 2.5)/1.5) def Gr_col(lG): return cspeed((lG - 6)/2)
In [6]:
fig, axs = plt.subplots(2,2, figsize=(5.2,3.6), dpi=200, layout='constrained') for Gr in df.Gr.unique(): for Pr in df.Pr.unique(): sdf = df[(df.Gr==Gr) & (df.Pr==Pr)].sort_values('Re') Ub = np.minimum(sdf.Re/Gr**0.5, 1) nu = np.minimum(Gr**-0.5, sdf.Re**-1) axs[0,0].loglog(sdf.Re, (sdf.Pu)/(Ub**3), marker=Pr_mark(Pr), color=Gr_col(np.log10(Gr)), markeredgecolor='k') axs[0,1].semilogx(sdf.Re, (sdf.Pu)/sdf.I, marker=Pr_mark(Pr), color=Gr_col(np.log10(Gr)), markeredgecolor='k') Rr = 10**np.linspace(3.1,3.9,101) axs[0,0].loglog(Rr, 0.1*(Rr/1e3)**-1, 'k--') for ax in axs[0,:]: ax.set_xlabel('$Re$') axs[0,0].set_ylabel('$\mathcal{P}_u/(U^3/H)$') axs[0,1].set_ylabel('$\mathcal{P}_u/\mathcal{I}$') axs[0,0].annotate('$Re^{-1}$', (5e3, 4e-2), rotation=0, ha='center', va='center') axs[0,1].set_ylim([0.2,0.6]) axs[0,0].set_ylim([2e-3,1e-1]) for Gr in df.Gr.unique(): for Pr in df.Pr.unique(): sdf = df[(df.Gr==Gr) & (df.Pr==Pr)].sort_values('Re') nu = np.minimum(Gr**-0.5, sdf.Re**-1) Uf = np.minimum(Gr**0.5/sdf.Re, 1) U0 = sdf.Re0/np.maximum(Gr**0.5, sdf.Re) UL = sdf.UL axs[1,0].loglog(sdf.Re**2/sdf.Gr, (sdf.Pw)/(Uf**3), marker=Pr_mark(Pr), color=Gr_col(np.log10(Gr)), markeredgecolor='k') axs[1,1].semilogx(sdf.Re**2/sdf.Gr, (sdf.Pw)/sdf.qm, marker=Pr_mark(Pr), color=Gr_col(np.log10(Gr)), markeredgecolor='k') for ax in axs[1,:]: ax.set_xlabel('$Re^2/Gr = Ri^{-1}$') axs[1,0].set_ylabel('$\mathcal{P}_w/(U_f^3/H)$') axs[1,1].set_ylabel('$\mathcal{P}_w/\overline{q}$') axs[1,1].set_ylim([0.2,1]) axs[1,0].set_ylim([2e-3,1e-1]) alph = 'abcd' for i, ax in enumerate(axs.flatten()): ax.annotate('$('+alph[i]+')$', (-0.05, 1.05), xycoords='axes fraction', ha='right', va='bottom') # fig.savefig('mean_KE_budget.pdf') plt.show()
Out[6]: