Dear all,
iam working on a sort of optimisation that involving python and xfoil. and for that I am doing a python Code to run xfoil in Iteration mode. the coupling is running well and iam able to get the CP and CL, CD resuls in the first Iteration but then the calculation stop the calculation and i have no clue why. the Code i used is as giving bellow.
Can anyone suggest me ideas on how overcomming this issue ?
Thanks in advance
Kouider
import os import numpy as np import matplotlib.pyplot as plt # Files names saveFlnmAF = 'Save_Airfoil.txt' saveFlnmCp = 'Save_Cp.txt' xfoilFlnm = 'xfoil_input.txt' saveFlnmCL ='SaveCLvsCD.txt' # Delete files if they exist if os.path.exists(saveFlnmAF): os.remove(saveFlnmAF) if os.path.exists(saveFlnmCp): os.remove(saveFlnmCp) def Xfoil(Xloc,Yloc,Degree): # %% CREATE LOADING FILE # Knowns NACA = 4418 Renolds =1000000 AoA = 5 iteration =200 # Create the airfoil fid = open(xfoilFlnm,"w") fid.write("NACA " + str(NACA) + "\n") fid.write("GDES\n") fid.write("flap\n") fid.write(str(Xloc) +"\n") fid.write('999' +"\n") fid.write(str(Yloc) +"\n") fid.write(str(Degree) +"\n") fid.write("exec\n") fid.write("\n\n") fid.write("PPAR\n") fid.write("\n\n") fid.write("PSAV " + saveFlnmAF + "\n") fid.write("OPER\n") fid.write("iter\n") fid.write(str(iteration) +"\n") fid.write("v\n") fid.write(str(Renolds) +"\n") fid.write("ALFA " + str(AoA) + "\n") fid.write("CPWR " + saveFlnmCp + "\n") fid.write("pacc\n") fid.write(saveFlnmCL+"\n") fid.write("\n") fid.write("ALFA " + str(AoA) + "\n") fid.write("\n") fid.write("quit") fid.close() #Optimised Parametres Xl =[0.7,0.75,0.8,0.85,0.9,0.95] Yl =[0.2,0.25,0.3,0.35,0.4,0.45] Degr =[0,2,4,6,8,10,12,14,16,18,20,22] # Xl ={0.7} # Yl ={0.2} # Degr ={0} # Xfoil(Xl,Yl,Degr) # os.system("xfoil.exe