Skip to content

Commit

Permalink
Update vorticity plots
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ramadhan committed Sep 12, 2020
1 parent d060385 commit 05c1f77
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions verification/lid_driven_cavity/plot_lid_driven_cavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def plot_lid_driven_cavity_frame(Re, n):
ax_w_mesh.set_ylabel("z")
ax_w_mesh.set_aspect("equal")

ζ_line = fabs(ds.ζ.isel(time=n, zF=Nz-1))
ζ_line = fabs(ds.ζ.isel(time=n, zF=Nz))
ax_ζ_line.plot(y_ζ_Ghia, ζ_Ghia[Re], label="Ghia et al. (1982)", color="tab:purple", linestyle="", marker="o", fillstyle="none")
ax_ζ_line.plot(ds.yF, ζ_line.values.flatten(), label="Oceananigans.jl", color="tab:purple")
ax_ζ_line.legend(loc="lower left", bbox_to_anchor=(0, 1.01, 1, 0.2), ncol=2, frameon=False)
Expand All @@ -107,12 +107,11 @@ def plot_lid_driven_cavity_frame(Re, n):
ax_ζ_line.set_xlim([0, 1])
ax_ζ_line.set_ylim(bottom=0)

ζ = ds.ζ.isel(yF=slice(0, -2), zF=slice(0, -2), time=n).squeeze()
ζ = ds.ζ.isel(time=n).squeeze()
img_ζ = ζ.plot.pcolormesh(ax=ax_ζ_mesh, cmap=cmocean.cm.curl, extend="both", add_colorbar=False,
# vmin=-100, vmax=100)
norm=colors.SymLogNorm(base=10, linthresh=1, vmin=-1e2, vmax=1e2))
fig.colorbar(img_ζ, ax=ax_ζ_mesh, extend="both")
ax_ζ_mesh.axhline(y=ds.zF[Nz-2], color="tab:purple", alpha=1.0)
ax_ζ_mesh.axhline(y=1, color="tab:purple", alpha=1.0)
ax_ζ_mesh.set_title("vorticity")
ax_ζ_mesh.set_xlabel("y")
ax_ζ_mesh.set_ylabel("z")
Expand All @@ -122,7 +121,7 @@ def plot_lid_driven_cavity_frame(Re, n):
plt.savefig(f"lid_driven_cavity_Re{Re}_{n:05d}.png")
plt.close("all")

Re = 10000
Re = 100
ds = xr.open_dataset(f"lid_driven_cavity_Re{Re}.nc")

joblib.Parallel(n_jobs=-1)(
Expand Down

0 comments on commit 05c1f77

Please sign in to comment.