Closed Zcaic closed 11 months ago
Now I know via read AeroBuildup code, I found it will call get_aero_from_neuralfoil() for aerofoil, So does this mean that I don't need to call generate_polar_function() explicitly?
Hey @Zcaic !
In AeroSandbox v4.1.0 and higher, asb.Airfoil.generate_polars()
is no longer needed when performing asb.AeroBuildup
analyses. (As you note, AeroBuildup
now completely bypasses XFoil and instead only uses NeuralFoil. NeuralFoil requires no caching.) The output of AeroBuildup
does not change whether you call asb.Airfoil.generate_polars()
or not.
In previous versions of AeroSandbox (v4.0.9 and lower), users had to call asb.Airfoil.generate_polars()
to build up an XFoil data-table (stored in asb.Airfoil.xfoil_data
), so that AeroBuildup
could analyze 2D wing sections. Now, that is no longer needed. :)
The asb.Airfoil.generate_polars()
method may be deprecated in some future version (unless there is user demand otherwise), as it is no longer used internally within AeroSandbox. And, its performance is wholly superseded by asb.Airfoil.get_aero_from_neuralfoil()
.
hhh, I'm glad to hear it! And I modified some code about Airplane.generate_cadquery_geometry() function. Beaceuse when export *.step, I found it miss a leading edge like below:
So I modify code in Airplane.generate_cadquery_geometry():
...
af = xsec.airfoil
if af.TE_thickness() < minimum_airfoil_TE_thickness:
af = af.set_TE_thickness(thickness=minimum_airfoil_TE_thickness)
leindex = af.LE_index()
wp = cq.Workplane(
inPlane=cq.Plane(
origin=tuple(xsec.xyz_le),
xDir=tuple(csys[0]),
normal=tuple(-csys[1]),
)
)
upperspline = wp.spline(
listOfXYTuple=[
tuple(xy * xsec.chord) for xy in af.coordinates[: leindex + 1]
]
).spline(
listOfXYTuple=[
tuple(xy * xsec.chord) for xy in af.coordinates[leindex:]
]
).close()
xsec_wires.append(upperspline)
wire_collection = xsec_wires[0]
...
And the step file like below:
Of course, It doesn't have any effect on aerosandbox, Maybe it is only a little helpful to get leading edge feature lines for those who want to generate mesh from cad file.
Oh awesome, that looks excellent! Your change also probably improves the accuracy of the STEP representation - one possible geometric inaccuracy of the previous code was if the wing section loft gets "twisted" when sweeping between two adjacent airfoil cross sections (i.e., the same effect as getting a hyperboloid from twisting a cylinder loft). This could happen if, for example, the airfoils at the inboard and outboard cross sections had a very different number of points or point spacing. By adding a leading-edge node into the spline, it constrains any possible twisting, at least at the critical leading-edge point. Nice work!
It would be great to merge your improvements into Airplane.generate_cadquery_geometry()
. Feel free to submit a pull request (if you want to get GitHub "credit" for your contribution), or I can copy-paste add it for you if that's easier. Good find!
I'm happy that it is useful for aerosandbox. You can copy-paste directly because it is a small change.
In aerosandbox new version, when I define airfoil without calling generate_polar_function, then I use AreoBuildup to calculate aerodynamic, is there any different from calling generate_polar_function, Or if I don‘t call generate_polar_function manually, AeroBuildup.run() will call generate_polar_function automatically?