Hello,
I installed welib and tried an example to modify an AeroDyn15 polar file, but it fails because it cannot use the template file:
On Windows, the data folder does not exist inside welib folder as needed to retrieve the template here on this line
Here is the error message:
In [1]: import numpy as np
In [2]: import os
In [3]: from welib.airfoils.Polar import Polar
In [4]: from welib.airfoils.Polar import Polar
In [5]: from welib.weio.csv_file import CSVFile
In [6]: AD_polarFile_in = os.path.join('./', 'airfoil01.dat')
In [7] polar = Polar(AD_polarFile_in, fformat='ADPolar')
In [8]: AD_polarFile_out = '_Polar_out.dat.ignore'
In [8]: polar.Re
Out[8]: nan
In [9]: polar.Re
Out[9]: nan
In [10]: comment = 'Cylinder at Re=6Million\nUpdated unsteady parameters' # Optional comment
In [11]: Re = 6
In [12]: ADpol = polar.toAeroDyn(AD_polarFile_out, Re=6, comment=comment)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[12], line 1
----> 1 ADpol = polar.toAeroDyn(AD_polarFile_out, Re=6, comment=comment)
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\welib\airfoils\Polar.py:1124, in Polar.toAeroDyn(self, filenameOut, templateFile, Re, comment, unsteadyParams)
1122 ADpol = templateFile
1123 else:
-> 1124 ADpol = ADPolarFile(templateFile)
1126 # --- Updating the AD polar file
1127 ADpol['Re'] = Re # TODO UNKNOWN
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\welib\weio\fast_input_file.py:1903, in ADPolarFile.__init__(self, filename, hasUA, numTabs, **kwargs)
1902 def __init__(self, filename=None, hasUA=True, numTabs=1, **kwargs):
-> 1903 FASTInputFileBase.__init__(self, filename, **kwargs)
1904 if filename is None:
1905 # Define a prototype for this file format
1906 self.addComment('! ------------ AirfoilInfo Input File ------------------------------------------')
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\welib\weio\fast_input_file.py:244, in FASTInputFileBase.__init__(self, filename, IComment, **kwargs)
242 if filename:
243 self.filename = filename
--> 244 self.read(IComment=IComment)
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\welib\weio\fast_input_file.py:381, in FASTInputFileBase.read(self, filename, IComment)
379 if self.filename:
380 if not os.path.isfile(self.filename):
--> 381 raise OSError(2,'File not found:',self.filename)
382 if os.stat(self.filename).st_size == 0:
383 raise EmptyFileError('File is empty:',self.filename)
FileNotFoundError: [Errno 2] File not found:: 'C:\\Users\\s1291\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\welib\\airfoils\\../../data/NREL5MW/5MW_Baseline/Airfoils/Cylinder1.dat'
Hello,
I installed welib and tried an example to modify an AeroDyn15 polar file, but it fails because it cannot use the template file:
On Windows, the
datafolder does not exist inside welib folder as needed to retrieve the template here on this lineHere is the error message: