leal26 / AeroPy

Python interface for XFOIL. The objective of this library is to be able to be able to call XFOIL from Python iteratively for any simulation in a total of 4 lines total.
MIT License
60 stars 31 forks source link

Call Command's not working #16

Open florencemnrg opened 4 years ago

florencemnrg commented 4 years ago

Hi, I am trying to get the "find_pressure_coefficients" for some airfoil that I store in a folder. My code is depicted as follows.

for filename in os.listdir(directory): if filename.endswith(".txt"): print(filename) filepath = 'D:\Python\cnn_inverse\Airfoil\' + filename

    # call(filename, alfas=0, output='Cp', Reynolds=300000, iteration=20)
    find_pressure_coefficients(airfoil=filename, Reynolds=3e5, alpha=0.)

But I get an error like this.

Traceback (most recent call last): File "D:/Python/cnn_inverse/dataset_gen.py", line 38, in find_pressure_coefficients(airfoil=filename, Reynolds=3e5, alpha=0.) File "D:\Python\cnn_inverse\venv\lib\site-packages\aeropy\xfoil_module.py", line 980, in find_pressure_coefficients Data = output_reader(filename, output='Cp', delete=delete) File "D:\Python\cnn_inverse\venv\lib\site-packages\aeropy\xfoil_module.py", line 667, in output_reader with open(filename, "r") as myfile: FileNotFoundError: [Errno 2] No such file or directory: 'Cp_NACA63(1)-212.txt_0000'

I think the "call" command failed to generate the file for storing the cp value. I have tried to find part of the "call" code that generate that file, but I don't know which one. Is it "file_name" function? I this "file_name" function only yield the name not the file. Can you help me to overcome this issue? Thank in advance.