Difference between revisions of "Polar file formats"
Line 21: | Line 21: | ||
set { | set { | ||
deflection = -20.0 | deflection = -20.0 | ||
+ | # alpha cl cd cm | ||
p = [ -20.000 -1.2712 0.303250 0.2140 ] | p = [ -20.000 -1.2712 0.303250 0.2140 ] | ||
p = [ -15.000 -1.6465 0.097880 0.0669 ] | p = [ -15.000 -1.6465 0.097880 0.0669 ] |
Latest revision as of 00:36, 6 March 2007
A very important part of the aero model in Silent Wings is the airfoil polars. The quality of the polar files has a large impact on the way the aircraft will fly and perform in the simulator.
You will get the highest quality polars from using data from wind tunnel tests. Unfortunately, these are not often available. The second-best option is then to use calculated polars. There are several freely available programs that can do this. For the Silent Wings aircraft, these two programs have been used:
X-Foil is the most advanced program, and the most difficult to use. Used correctly it can produce quite good results.
Single file polar format
The easiest way to define a polar is to use the .polar file format. This is a single text file defining sets of polars with points for lift, drag and pitch moment as a function of angle of attack, at a fixed flap deflection. Here is an example, from a file called naca0012.polar, trimmed down for simplicity. It defines polars for 3 different flap deflections. It is only necessary to define the angle of attack points that you have. The rest will be taken care of by the Silent Wings aero model.
# Polar file for naca0012 # This is a comment # This is another # Polar with -20.0 degrees flap set { deflection = -20.0 # alpha cl cd cm p = [ -20.000 -1.2712 0.303250 0.2140 ] p = [ -15.000 -1.6465 0.097880 0.0669 ] : : p = [ -10.000 -1.7037 0.036230 0.0953 ] p = [ 13.000 0.5736 0.026330 0.1448 ] p = [ 16.000 0.9769 0.032570 0.1119 ] } # Polar with 0.0 degrees flap set { deflection = 0.0 p = [ -2.000 -0.2144 0.005810 -0.0030 ] p = [ -1.000 -0.1075 0.005490 -0.0014 ] p = [ 0.000 0.0000 0.005400 0.0000 ] : : p = [ 6.000 0.6940 0.009730 -0.0041 ] p = [ 7.000 0.8267 0.010940 -0.0093 ] p = [ 8.000 0.9101 0.012100 -0.0040 ] } # Polar with 20.0 degrees flap set { deflection = 20.0 p = [ -2.000 -0.2144 0.005810 -0.0030 ] p = [ -1.000 -0.1075 0.005490 -0.0014 ] p = [ 0.000 0.0000 0.005400 0.0000 ] : : p = [ 6.000 0.6940 0.009730 -0.0041 ] p = [ 7.000 0.8267 0.010940 -0.0093 ] p = [ 8.000 0.9101 0.012100 -0.0040 ] }
If you use X-Foil to generate the polars, you can use the small tool xf2sw to auto-generate the polar file.
Multi-file polar format
This file format is the older file format. It defines a complete table set for polars from -180 to 180 degrees angle of attack. It is very cumbersome to be edited by hand, so it might be better to use the newer .polar file format instead.
There are 3 files for a polar, named name.cl, name.cd and name.cm, defining lift, drag and pitch moment against angle of attack. Inside the file the tables are defined following strict rules:
<number of flap settings> <flap deflection in degrees> <number of points for this flap deflection> <angle of attack (rad) starting at -PI (-180 deg.)> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> : : <PI (+180 deg.)> <coefficient> <next flap deflection in degrees> <number of points for this flap deflection> <angle of attack (rad) starting at -PI (-180 deg.)> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> <angle of attack (rad))> <coefficient> : : <PI (+180 deg.)> <coefficient> <next flap deflection in degrees> : : etc etc
The coefficient is either cl, cd or cm (defined by the file name extension, .cl, .cd and .cm). It is important to define the whole range from -180 to +180 degrees angle of attack. This is not the easiest thing to do, as X-Foil won't do any good results with stalled airfoil and wind tunnel measurements of airfoils flying backwards are very rare. Using the .polar file format this job is done automatically by Silent Wings during startup.