Open spinjet opened 4 years ago
I confirm that the current version, doesn't correctly set Mach number and using xf.M, will only compute Sonic Cp and Q/Qinf, and have no effect on Cl,Cd,Cm.
The problem lies in src/api.f90. There seems to be confusion between MINf1 and MINf.
So adding : MINf1 = M
after line 204, seems to solve the issue, and I get the same results as in original XFOIL. Maybe the maintainers can chime in and correct the code or me..
Also I should note that the code will throw an error if you try to set mach number before loading airfoil in python.
And yet another minor but annoying issue is the way the range of angles of attack is defined: it excludes the value of last angle of attack "a_end".
Maybe n = abs(int((a_end - a_start) / a_step)) + 1
on line 258 and
... byref(c_float(a_end+np.sign(a_end)*a_step)) ...
on line 267 of xfoil.py is more reasonable?
Cheers!
Regarding the ‘annoying issue’: This is modelled after the original behaviour of Python's range() function, which also does not include the endpoint. But I can see the annoyance of such a behaviour. I approached it with those two changes (please note, that his has been moved to the new codeberg repository, and the corresponding issue):
arange()
and clrange()
methods as synonyms for aseq()
and cseq()
to show the similarity to the range() function (aseq()
and cseq()
are still available, but deprecated, to stay backwards compatible).arange()
, clrange()
. If True
, the endpoint will be included (as suggested by you).
Hello, I've correctly installed your module but when I attempt to set a Mach Number, it doesn't have any effect on the calculations. The coefficients stay the same. Here's a plot with the generated polars of a NACA 0012 with different Mach numbers.
And this is the code I used: