Exemple #1
0
startH = 5.000
topH = 205.0
zNum_ = 21
kappa = 0.4
uStar_0 = kappa / np.log(zSeq_0[0]/0.001) * np.power(uSeq_0[-1][0]**2 + vSeq_0[-1][0]**2,0.5)
uStar_1 = kappa / np.log(zSeq_1[1]/0.001) * np.power(uSeq_1[-1][1]**2 + vSeq_1[-1][1]**2,0.5)

fig, ax = plt.subplots(figsize=(3,4.5))
z_ = np.linspace(startH,topH,zNum_)
dz = (topH - startH) / (zNum_-1)
# sowfa
zero = np.zeros(1)
v_0 = np.concatenate((zero, uSeq_0[-1]))
z_0 = np.concatenate((zero, zSeq_0))
f_0 = interp1d(z_0, v_0, kind='linear', fill_value='extrapolate')
v_0 = funcs.calc_deriv_1st_FD(dz, f_0(z_))
v_0 = v_0 * kappa * z_ / uStar_0
# palm
v_1 = uSeq_1[-1]
z_1 = zSeq_1
f_1 = interp1d(z_1, v_1, kind='linear', fill_value='extrapolate')
v_1 = funcs.calc_deriv_1st_FD(dz, f_1(z_))
v_1 = v_1 * kappa * z_ / uStar_1

plt.plot(v_0, z_, label='sowfa', linewidth=1.0, linestyle='-', color='k')
plt.plot(v_1, z_, label='palm', linewidth=1.0, linestyle='--', color='k')
plt.xlabel(r"$\mathrm{\phi_m}$", fontsize=12)
plt.ylabel('z (m)', fontsize=12)
xaxis_min = -3
xaxis_max = 5
xaxis_d = 2
Exemple #2
0
zNum_ = 21
kappa = 0.4
uStar_0 = kappa / np.log(zSeq_0[0] / 0.001) * np.power(
    uSeq_0[-1][0]**2 + vSeq_0[-1][0]**2, 0.5)
uStar_3 = kappa / np.log(zSeq_3[1] / 0.001) * np.power(
    uSeq_3[-1][1]**2 + vSeq_3[-1][1]**2, 0.5)

fig, ax = plt.subplots(figsize=(3, 4.5))
z_ = np.linspace(startH, topH, zNum_)
dz = (topH - startH) / (zNum_ - 1)
# sowfa
zero = np.zeros(1)
v_0 = np.concatenate((zero, uSeq_0[-1]))
z_0 = np.concatenate((zero, zSeq_0))
f_0 = interp1d(z_0, v_0, kind='linear', fill_value='extrapolate')
v_0 = funcs.calc_deriv_1st_FD(dz, f_0(z_))
v_0 = v_0 * kappa * z_ / uStar_0
# palm
v_3 = uSeq_3[-1]
z_3 = zSeq_3
f_3 = interp1d(z_3, v_3, kind='linear', fill_value='extrapolate')
v_3 = funcs.calc_deriv_1st_FD(dz, f_3(z_))
v_3 = v_3 * kappa * z_ / uStar_3

plt.plot(v_0, z_, label='sowfa', linewidth=1.0, linestyle='-', color='k')
plt.plot(v_3, z_, label='palm', linewidth=1.0, linestyle='--', color='k')
plt.xlabel(r"$\mathrm{\phi_m}$", fontsize=12)
plt.ylabel('z (m)', fontsize=12)
xaxis_min = -3
xaxis_max = 5
xaxis_d = 2
Exemple #3
0
startH = 0.001
topH = 200.0
zNum_ = 21
uStar = 0.4
kappa = 0.4

fig, ax = plt.subplots(figsize=(6,6))
colors = plt.cm.jet(np.linspace(0,1,tplotNum))
for i in range(tplotNum):
    zero = np.zeros(1)
    v_ = np.concatenate((zero, varplotList[i]))
    z_ = np.concatenate((zero, zSeq))
    f = interp1d(z_, v_, kind='linear', fill_value='extrapolate')
    z_ = np.linspace(startH,topH,zNum_)
    dz = (topH - startH) / (zNum_-1)
    v_ = funcs.calc_deriv_1st_FD(dz, f(z_))
    v_ = v_ * kappa * z_ / uStar
    plt.plot(v_, z_, label='t = ' + str(int(tplotList[i])) + 's', linewidth=1.0, color=colors[i])
plt.xlabel(r"$\mathrm{\phi_m}$")
plt.ylabel('z (m)')
xaxis_min = -3
xaxis_max = 5
xaxis_d = 2
yaxis_min = 0
yaxis_max = 200.0
yaxis_d = 20.0
plt.ylim(yaxis_min - 0.25*yaxis_d,yaxis_max)
plt.xlim(xaxis_min - 0.25*xaxis_d,xaxis_max)
plt.xticks(list(np.linspace(xaxis_min, xaxis_max, int((xaxis_max-xaxis_min)/xaxis_d)+1)))
plt.yticks(list(np.linspace(yaxis_min, yaxis_max, int((yaxis_max-yaxis_min)/yaxis_d)+1)))
plt.legend(bbox_to_anchor=(1.05,0.5), loc=6, borderaxespad=0) # (1.05,0.5) is the relative position of legend to the origin, loc is the reference point of the legend