def main(): yplus = np.array([0.25, 0.5, 1.0, 5.0, 10.0, 25.0]) gridScale = np.array([0.5, 0.75, 1.0, 2.0, 4.0, 6.0]) zTE = 0.005 Mach = 0.85 alt = 10000 alpha = 0.0 npts = 101 t = Timer() fc = flight_conditions.FlightConditions(Mach, alt) A = np.array([0.06421182,0.11882206,0.12335525,0.12384311,0.11381198, -0.01503971,-0.07024083,-0.04311071,0.02437696]) #af = af_cfd_analysis.airfoil.cst_x(A, nPts=npts) af = af_cfd_analysis.airfoil.Airfoil() af.read_txt('N64A206.txt') af.display() #af.set_trailing_edge(zTE) fid = open('grid_convergence.txt','wt') fid.write('yplus\tgridSize\ttime\tcl\tcd\tcm\n') fid.close() nCase = 0 for i,yp in enumerate(yplus): for j,gs in enumerate(gridScale): t.start() nCase += 1 cl, cd, cm, gridSize = run_analysis(af, fc, alpha, yp, gs,nCase) duration = t.lap() out = '%.1f\t%d\t%.4f\t%.6f\t%.6f\t%.6f\n'%(yp,gridSize,duration,cl,cd,cm) fid = open('grid_convergence.txt','a') fid.write(out) fid.close() print out t.stop()