DARcorporation/xfoil-python

How to use with non NACA airfoil?

Opened this issue · 3 comments

Hi,

I got the naca0012 example working. Is there an example how to get it working with non NACA airfoil? Thanks!

import numpy as np
from xfoil import XFoil
from xfoil.model import Airfoil

xf = XFoil()

#x, y coordinates of your airfoil
x = np.array([1.     , 0.98037, 0.93064, 0.8537 , 0.75616, 0.64594, 0.53099,
              0.41638, 0.30609, 0.20549, 0.11999, 0.05468, 0.01338, 0.     ,
              0.01338, 0.05468, 0.11999, 0.20549, 0.30609, 0.41638, 0.53099,
              0.64594, 0.75616, 0.8537 , 0.93064, 0.98037, 1.     ])
y = np.array([0.001341,  0.008009,  0.014067,  0.026066,  0.040484,  0.054959,
              0.06816 ,  0.078438,  0.083164,  0.080166,  0.068108,  0.047083,
              0.019785, -0.000696, -0.018018, -0.032271, -0.041626, -0.048684,
             -0.053613, -0.052991, -0.048566, -0.041285, -0.031565, -0.021308,
             -0.012699, -0.007986, -0.00155 ])

xf.airfoil = Airfoil(x, y)

This worked for me. With x, y, the coordinates of your airfoil.

airfoil_data.txt
XFOIL works with the attached file with the following set of commands,

LOAD airfoil_data.txt
airfoil_data
PANE
OPER
Visc 6000000
PACC
polar_file.txt

ITER 100
alfa 10

quit

However, it is not working with the package,
x = data_1[:, 0]
y = data_1[:, 1]
xf.airfoil = Airfoil(x, y)
xf.Re = 6e6
xf.max_iter = 500
cl, cd, cm, cp = xf.a(10)

sphh commented

@sahilbhola14: Without seeing your error message, it is difficult to say, what is going wrong. But the ongoing development at codepage added the possibility to load the airfoil data from a file (and save it to a file). See https://codeberg.org/xfoil-python/xfoil-python/issues/12