I have a little issue with calculating coordinates. Given are airfoil profiles in two lists with the following exemplary coordinates:
Example:
x_Coordinates = [1, 0.9, 0.7, 0.5, 0.3, 0.1, 0.0, ...]
y_Coordinates = [0, -0.02, -0.06, -0.08, -0.10, -0.05, 0.0, ...]
diagram 1:
The only known things about the profile are the lists above and the following facts:
- the first coordinate is always the trailing edge, in the example above at (x=1, y=0)
- the coordinates always run on the bottom/underside to the leading edge, in the example above at (0,0) and from there back to the trailing edge
- the profile is not normalized and it can exist in a rotated form
Now I want to determine
- the leading edge and
- the camber line.
Until now, I have always used the smallest x-coodinate as the leading edge. However, this would not work in the following exemplary profile, since the smallest x-coordinate is located on the upper surface of the profile.
diagram 2:
Does anybody have an idea, how I could easily calculate/determine this data?
edit
one full sample array data
(1.0, 0.95, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.25, 0.2, 0.15, 0.1, 0.075, 0.05, 0.025, 0.0125, 0.005, 0.0, 0.005, 0.0125, 0.025, 0.05, 0.075, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0)
(0.00095, 0.00605, 0.01086, 0.01967, 0.02748, 0.03423, 0.03971, 0.04352, 0.04501, 0.04456, 0.04303, 0.04009, 0.03512, 0.0315, 0.02666, 0.01961, 0.0142, 0.0089, 0.0, -0.0089, -0.0142, -0.01961, -0.02666, -0.0315, -0.03512, -0.04009, -0.04303, -0.04456, -0.04501, -0.04352, -0.03971, -0.03423, -0.02748, -0.01967, -0.01086, -0.00605, -0.00095)
Well it was quite a few years I do something with wings.
I do not have any skewed wings data as on your image the closest thing I found was this:
leading edge not correct for nontrivial wings
just find point where the sign of
dx
is flipping and computethen mark zones where
dx
is positive or negative and find the middle between them (usuallydx==0
for that zone). Mark the edge point asix1
camber line
for precise geometry you will need intersections of normals casted from each side so:
i
This is doable but with insane complexity
approximate camber line
less precise way but much much faster so:
i
axis0
points. Do this for all pointsi=(0-ix1)
(Red line)axis1
(dark red)axis0,axis1
This can be done in the same way result is blue axis polyline
C++ source:
List<double> xxx;
is just mine dynamic list template the same asdouble xxx[];
xxx.add(5)
; adds 5 to end of the listxxx[7]
access array elementxxx.num
is the actual used size of the arrayxxx.reset()
clears the array and set xxx.num=0[edit1] correct leading edge point
Have an insane thought about this to find the edge point on the run plus some code tweaking and the outcome is good enough for me :) so first some explaining:
algorithm for axis stays the same but instead of
ix1
bound use only points that was not yet used ... Also count only valid closest points (on the opposite side) if none found stop (top image case). From this point find the most far point from last axis point this is the leading edge point.This approach has much much accurate output (
axis0,axis1
are closer together)Now the C++ code:
constant
n=4
is just for safety overlapped search for closest points it should be a fraction ofpnt.num
. Sometimes the closest point is before the last found closest point this depends on the curvature of booth sides. Too bign
will cause slowdowns and ifn>pnt.num/4
it could also invalidate output.If too small then for smaller radius of curvature will lower the accuracy this approach is dependent on sufficient point coverage. If the wing is sampled with too low point count it can lead to inaccuracy. The source code is 3 times almost the same thing you can chose which
ix1
to remember (from first or second search) they are neighboring pointstest profile: