def run_lowRe(): #af = airfoil.naca4(12,2,30) af = airfoil.read_txt('E:\\codes\\rae2822.txt') af.display() #af.read_txt(r'E:\laptop_sync\1. Projects\RENN\airfoil design\AG24new.txt') # result = af.get_X_polar(0.02,0.355e6,[0,16,2.0],nIter=100) fc = FlightConditions(22.,0,0,0.24) solver = CFDsolver(af,fc,1.0,mesh='O') solver.fluent.residuals['energy']=1e-6 solver.fluent.relaxationFactor['xvelocity'] = 1e-3 solver.mesh._airfoilPts = 75 solver.mesh._interiorPts = 75 solver.mesh._dsTE = solver.mesh._dsWall solver.mesh._dsLE = 2e-3 solver.mesh._growthRate = 1.2 solver.create_mesh() alpha = array([-10.,-5,0,5,10,12,14,16,18]) result = solver.run_for_multiple_aoa(alpha,turbulenceModel='SA') for a,cl,cd,cm in zip(result.alpha,result.cl,result.cd,result.cm): print a,'\t',cl,'\t',cd,'\t',cm
#ax3.grid(True,which='major',linestyle='-') ax4.hold(True) #ax4.grid(True,which='major',linestyle='-') ax2.set_xlabel('Angle of attack, deg') ax2.set_ylabel('Lift coefficient') ax3.set_xlabel('Drag coefficient') ax3.set_ylabel('Lift coefficient') ax4.set_xlabel('Angle of attack, deg') ax4.set_ylabel('Moment coefficient') ax3.axis([0,0.05,-1,2]) linetype = ['k-.','k:','k--','k.'] ax1.axis('equal') for i,name in enumerate(afName): af = airfoil.read_txt(path1+'\\'+name) pol = af.get_xfoil_polar(0.2,3e6,[-10,20,0.5],nIter=100) ax1.plot(af.pts[:,0],af.pts[:,1]-0.2*i,linetype[i],label='airfoil %d'%(i+1),lw=1.5) ax2.plot(pol.alpha,pol.cl,linetype[i],label='airfoil %d'%(i+1)) ax3.plot(pol.cd,pol.cl,linetype[i],label='airfoil %d'%(i+1)) ax4.plot(pol.alpha,pol.cm,linetype[i],label='airfoil %d'%(i+1)) print '%.4f '%af.thickness + '%.4f '%af.camber + '%.4f '%af.thicknessLocation + '%.4f '%af.camberLocation ax2.legend(loc='lower right') ax3.legend(loc='lower right') plt.show()