+
+Convergence behaviors of the transition simulation are presented in the above figure at AoA=5°. Left figure shows the time history of the non-linear residuals from Nalu-Wind for the mean flow (momentum), turbulence model (𝑘), and transition model (𝛾) at the last Picard iteration of each main iteration. In the figure, all residuals decline smoothly by 3.5 to 4 orders of magnitude until they finally stall. Similary, both the lift and drag converge well without oscillations, with less than 0.1% difference from the converged value around iteration 4,000.
+
Each case with the "Fine" mesh took approximately 40 minutes to 10,000 iterations, using 4 Picard iterations per time step, on 26 cores of NREL's Kestrel HPC cluster. The number of cores per case was not determined by Nalu-Wind’s scalability on Kestrel, but simply to accommodate 4 cases on a single node of Kestrel.
## References
diff --git a/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_clcd.py b/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_clcd.py
new file mode 100755
index 00000000..56c42f4d
--- /dev/null
+++ b/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_clcd.py
@@ -0,0 +1,84 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.backends.backend_pdf import PdfPages
+import glob, pathlib
+import pandas as pd
+import math
+from mpl_toolkits.mplot3d import Axes3D
+
+
+# Figure size format
+size=15
+params = {'legend.fontsize': size-2,
+ 'axes.labelsize': size,
+ 'axes.titlesize': size,
+ 'xtick.labelsize': size,
+ 'ytick.labelsize': size}
+plt.rcParams.update(params)
+
+# Forc outpute file from Nalu-Wind
+force_dir='../performance/forces.dat'
+
+# Flow conditions
+u_infty = 341*0.1
+rho = 1.225
+dt = 1/(u_infty*2.0)
+alpha = 5.0
+
+
+# Read the force file
+data = pd.read_csv(force_dir,sep="\s+",skiprows=1,
+ names=[
+ "Time",
+ "Fpx",
+ "Fpy",
+ "Fpz",
+ "Fvx",
+ "Fvy",
+ "Fvz",
+ "Mtx",
+ "Mty",
+ "Mtz",
+ "Y+min",
+ "Y+max",
+ ],
+)
+
+# Non-dimensionalization
+dyn_pres = 0.5 * rho * (u_infty ** 2)
+cfz = (data["Fpy"] + data["Fvy"]) / dyn_pres
+cfx = (data["Fpx"] + data["Fvx"]) / dyn_pres
+
+cos_aoa=math.cos(math.radians(alpha))
+sin_aoa=math.sin(math.radians(alpha))
+
+cl = cfz*cos_aoa - cfx*sin_aoa
+cd = cfz*sin_aoa + cfx*cos_aoa
+
+# Plot time time history
+fig, ax1 = plt.subplots(1)
+
+# Adjust plot legend
+cl_l=cl.iloc[-1]*0.985
+cl_u=cl.iloc[-1]*1.015
+
+cd_l=cd.iloc[-1]*0.99
+cd_u=cd.iloc[-1]*1.01
+
+x= data['Time']/dt
+ax2 = ax1.twinx()
+ax1.plot(x, cl, 'g')
+ax2.plot(x, cd, 'b')
+ax1.set_xlabel('Iteration')
+ax1.set_ylabel('Lift coefficient, $C_{l}$', color='g')
+ax2.set_ylabel('Drag coefficient, $C_{d}$', color='b')
+ax1.set_xlim(0, 10000)
+ax1.set_ylim(cl_l, cl_u)
+ax2.set_ylim(cd_l, cd_u)
+ax2.set_ylim(0.0075,0.0082)
+ax1.tick_params(axis='y', colors='g')
+ax2.tick_params(axis='y', colors='b')
+plt.tight_layout()
+plt.savefig("time_clcd_nlf0416_F_aoa_5.png",dpi=300)
+plt.show()
+
diff --git a/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_resid.py b/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_resid.py
new file mode 100755
index 00000000..3ab93dc0
--- /dev/null
+++ b/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/plot_time_hist_resid.py
@@ -0,0 +1,114 @@
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.backends.backend_pdf import PdfPages
+import glob, pathlib
+import pandas as pd
+from mpl_toolkits.mplot3d import Axes3D
+
+
+# Plot format
+size=15
+params = {'legend.fontsize': size-2,
+ 'axes.labelsize': size,
+ 'axes.titlesize': size,
+ 'xtick.labelsize': size,
+ 'ytick.labelsize': size}
+plt.rcParams.update(params)
+
+# Nalu-Wind input
+trans = 1 # transition model on
+log_file = "nlf0416_F_aoa_5.0.log" # Nalu-Wind log file
+
+
+def read_resid(log_file,niter,line_num):
+
+ # Find residual values
+ dum=[]
+ file=open(log_file,'r')
+ for lines in file:
+ dum += [lines.split()]
+ file.close()
+ n_line=int(len(dum))
+
+ # Save residuals in arrays
+ resid_mom_eqs_x = np.zeros((niter))
+ resid_mom_eqs_y = np.zeros((niter))
+ resid_mom_eqs_z = np.zeros((niter))
+ resid_mom_eqs = np.zeros((niter))
+ resid_rho_eqs = np.zeros((niter))
+ resid_k_eqs = np.zeros((niter))
+ resid_w_eqs = np.zeros((niter))
+ it = np.zeros((niter))
+ resid_gamma_eqs = np.zeros((niter))
+
+ nlines=9
+ if(trans==1):
+ nlines=10
+
+ for j in range(niter):
+ i0 = line_num[j+2]
+
+ # Read time step count number
+ ii = i0+1
+ it[j] = dum[ii][3]
+
+ dum_lines = 8
+ n_solver = 4
+ i =i0+ dum_lines + (n_solver-1)*nlines
+ resid_mom_eqs[j] = dum[i+5][3]
+ resid_rho_eqs[j] = dum[i+6][3]
+ resid_k_eqs[j] = dum[i+8][3]
+ resid_w_eqs[j] = dum[i+9][3]
+ if(trans==1):
+ resid_gamma_eqs[j] = dum[i+10][3]
+
+ return it,resid_mom_eqs,resid_rho_eqs,resid_k_eqs,resid_w_eqs,resid_gamma_eqs
+
+def find_index_location(log_file):
+ # Find line numbers
+ with open(log_file, 'r') as file:
+ lines = file.readlines()
+ file.close()
+
+ n_line=len(lines)
+
+ line_num=[]
+ for i in range(n_line):
+ if(lines[i][0]=="*"):
+ line_num.append(i)
+ del lines
+
+ niter=len(line_num)-4
+ print(niter)
+
+ return niter, line_num
+
+
+def create_nalu_hist(niter,line_num,log_file):
+ print(log_file)
+
+ [it,resid_mom_eqs,resid_rho_eqs,resid_k_eqs,resid_w_eqs,resid_gamma]=read_resid(log_file,niter,line_num)
+
+ plt.figure
+
+ plt.semilogy(it, resid_mom_eqs)
+ plt.semilogy(it, resid_k_eqs,'-.')
+ plt.semilogy(it, resid_gamma,'--')
+ plt.xlabel('Iteration')
+ plt.ylabel('Residuals')
+ plt.xlim([0, 8000])
+ plt.xticks(np.arange(0, 10000.1, 2000))
+ plt.ylim([1e-7, 1e-1])
+ #plt.legend(["Mean flow","Turbulence model:k","Turbuelnce model: omega","Transition model"])
+ plt.legend(["Mean flow","Turbulence model","Transition model"])
+ plt.tight_layout()
+ plt.savefig("resid_nlf0416_F_aoa_5.png",dpi=300)
+ plt.show()
+
+ del it,resid_mom_eqs,resid_rho_eqs,resid_k_eqs,resid_w_eqs
+
+if __name__=="__main__":
+
+ # Nalu-Wind log file
+ [niter, line_num] = find_index_location(log_file)
+ create_nalu_hist(niter,line_num,log_file)
diff --git a/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/time_history.png b/nalu-wind/2D_airfoil_Transition/NLF1-0416/aoa_5/figures_and_scripts/time_history.png
new file mode 100644
index 0000000000000000000000000000000000000000..932c7c0e21b077e1866fe010cf963d26d78d87bf
GIT binary patch
literal 654479
zcmeFZcT`jBwl>5cb 2M>kO
z3gkx> x`tJ|ahTb1#xX++vl o9lOBhI-Q<{e_7P06&Wge|V
zS_)j63n06Akrq4E?*YO9Rd7bjE9ccN?1Z%)#(&(1MAyGKYtjvU&K7N-uZKAz-*`co
z`y>0JI63?wm*X2>-K@MzC1BF<(npHUp$SGL_^cYzQ;3X1L!$RHpb*XkRZjm>nG74!
zdVZ*4r`H(r?o3w_ksYLAjE|fyM*!UEN@z3hYxs29ph_LUZ+G*-lRum>=q(a$EHsyv
z6bzvEjmpOwa`c?GJ@yX-r^C?0koZi!o9Y*P xO`RMh0C^6PJ=DJV5jf+#iQ)f
z%lHUN0gFq?asN;;6aw|~;&NvbG&cS7(d+8gwALr;CAXz?@Tu9QNZ{kb82Jt@&}AV~
zZ=Dbci#A9_G9VUKe`&y(BXG~HegVsFb?D0Vy$`HUPEM}7a`kFSx)=1Gi>S$2Ea2Sf
zJd&_rT}^VPZiul&%>A
zkZR+Z!^K}+-ap*%|Le^I{
AW{0yfSKGbS)}Tt55L
zLPngEk?rRQN1Pl*&{aV`L9^SfR_N)0M5J7a?Hc!9%%cR^nE(RZqfxaC_}~GV=91Xj
zz3Celn~;9r?+FWkHOzQ2%8pUx`WGnk{~H0BGmty@
kRMCLv`oI+}YVnbu4eB+3MQ7y8gs67yhSNJ4XWuno$VeG=
zzmZ($go4RUdv6%%m%={e#)GlNlpj*Ii5;Rs4YHMq|-6`0Uo}0@*
z(z2WupWE0d%V$u^tJ_LM$U>KILIpYTg10G%dd=;e;^UakpOH|kKH+=H_ufyM-tBkn
z*Iktstm}Ge=V+sC`0n7*97$6UJwy!
9Bp<841@I&jVqN;QVR;cLR_Mx{c5MYS96}llr~_%hBO>&9RPrK
zfUHeQ480;cU%lO@v=4CN%wu~@Nl8hL<8ZqR$