Vessel aerodynamics

From OrbiterWiki
Jump to navigation Jump to search


In Orbiter, the aerodynamics of a vessel can be defined in two ways:

The first option is the simple way and often good enough for most vessels, but it has a few limitations:

  • You can't model lift. As any real vehicle can create a little lift, thats not always desired.
  • Your aerodynamics are symmetric (up/down moving vehicles have no special attributes)

The simple model is often just good enough for satellite, spent rocket stages and small objects. For more detailled aerodynamics, you need more effort.

The airfoil model[edit]

Orbiter allows much more detailed aerodynamics by defining airfoil parameters. This airfoil is more than just the wing, you represent the whole spacecraft with it.

Defining the lift function[edit]

You need two airfoil definitions: horizontal and vertical. The vertical lift function represents the lift working upwards, the horizonal lift represent the sideways force.

A lift function accepts the following parameters:

aoa
Angle of Attack. Thats the angle between the XZ-plane of your vessel and the airspeed vector.
M
Mach number. The speed of your vehicle in multiples of the speed of sound.
Re
Reynolds number. This value tells you more about the atmosphere surrounding you.
cl
lift coefficient. Here you return how much lift your vessel will create for this airfoil.
cm
moment coefficient. This return value defines, in which direction and how strong your vessel will rotate.
cd
drag coefficient. Here you can tell orbiter, how much drag your vessel now creates.

For example:

void VLiftCoeff (double aoa, double M, double Re, double *cl, double *cm, double *cd)
{
	const int nabsc = 9;
	static const double AOA[nabsc] = {-180*RAD,-60*RAD,-30*RAD, 1*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
	static const double CL[nabsc]  = {       0,   -0.1,   -0.2,     0,    0.3,   0.7,   0.2,     0,      0};
	static const double CM[nabsc]  = {       0,      0,  0.014, 0.004,-0.0074,-0.094,-0.012,     0,      0};
	for (int i = 0; i < nabsc-1 && AOA[i+1] < aoa; i++);
	double f = (aoa-AOA[i]) / (AOA[i+1]-AOA[i]);
	*cl = CL[i] + (CL[i+1]-CL[i]) * f;  // aoa-dependent lift coefficient
	*cm = CM[i] + (CM[i+1]-CM[i]) * f;  // aoa-dependent moment coefficient
	double saoa = sin(aoa);
	double pd = 0.015 + 0.3*saoa*saoa;  // profile drag
	*cd = pd + oapiGetInducedDrag (*cl, 1.5, 0.7) + oapiGetWaveDrag (M, 0.85, 1.0, 1.1, 0.02);
	// profile drag + (lift-)induced drag + transonic/supersonic wave (compressibility) drag
}

The airfoils get defined by this code in clbkSetClassCaps()

	ClearAirfoilDefinitions();


	CreateAirfoil (LIFT_VERTICAL, _V(0,0, 0.0), VLiftCoeff, 5, 36.28, 1.5);
	// wing and body lift+drag components

	CreateAirfoil (LIFT_HORIZONTAL, _V(0,0,0), HLiftCoeff, 5, 13.79, 1.5);
	// vertical stabiliser and body lift and drag components

Adding control surfaces[edit]

	CreateControlSurface (AIRCTRL_ELEVATOR,     1.2, 1.5, _V(   0,0,-2.9), AIRCTRL_AXIS_XPOS);
	CreateControlSurface (AIRCTRL_RUDDER,       0.8, 1.5, _V(   0,0,-2.9), AIRCTRL_AXIS_YPOS);
	CreateControlSurface (AIRCTRL_AILERON,      0.2, 1.5, _V( 3.5,0,-2.9), AIRCTRL_AXIS_XPOS);
	CreateControlSurface (AIRCTRL_AILERON,      0.2, 1.5, _V(-3.5,0,-2.9), AIRCTRL_AXIS_XNEG);
	CreateControlSurface (AIRCTRL_ELEVATORTRIM, 0.1, 1.5, _V(   0,0,-2.9), AIRCTRL_AXIS_XPOS);

Variable drag elements[edit]

	CreateVariableDragElement (&fSpeedBrake, 1.2, _V(0, 0.75 ,-3.5));        // airbrake

Landing gear[edit]

Parachutes[edit]

Airbrakes[edit]

Need more?[edit]

Hypersonic vs supersonic vs subsonic[edit]

The aerodynamics at supersonic speeds are different from subsonic speed and as most programmers have problems with experiencing supersonic effects in real life, here is a short overview of the effects.

We will split the aerodynamic range of our vehicles into 4 regions:

  • subsonic
  • transonic
  • supersonic
  • hypersonic

subsonic flight[edit]

I don't think I have to explain much to you here, so I will just limit this to the important details. You are subsonic when you have no local supersonic flow on your vessel (this means: The air always moves slower than mach 1, regardless of where you measure it).

transonic flight[edit]

When you become faster, then at some points (sharp edges, top side of the wings, control surfaces) the local airspeed will become faster than Mach 1. This creates shockwaves around your craft. The aircraft start experiencing vibrations first. The appearing shockwaves have two important effects:

  • Drag raises quickly
  • Lift drops

The lift drops because you have less wing surface with laminar flow, while the raise in drag just comes from the fact, that the incoming air can no longer flow around your vessel at this point. Because the loss of lift happens mostly on the forward egdes of the wings, the center of pressure will move backward - your nose will drop unless you trim your vessel.

At mach 1, the drag and the loss in lift will reach a maximum and slowly go down to the supersonic values.

supersonic flight[edit]

Supersonic flight has two important qualities: The drag is lower than in subsonic flight and drag is constant at constant aoa (until getting to hypersonic flight). The lift is also lower than in subsonic flight. The reason is the shockwaves created by your vessel, which slow the air down, relative to your vessel, and change its flow direction.

hypersonic flight[edit]

What is the difference between hypersonic and supersonic? Its not a specific mach number, the transition depends more on the properties of your vessel and the surrounding air. At some point, the air is not only no longer able to flow around your vessel (like in subsonic flight), the shockwaves created by your craft also start "flowing" around your vessel. What sounds terribly complex (and creates a lot of high research budgets) is actually very simple to imagine:

The aerodynamics of your vessel get more and more away from flow and more to the mechanical interaction between the spacecraft hull and individual molecules.

At true hypersonic flight, you would have no interaction between air molecules. You get this kind of situation at high mach numbers and thin atmosphere - just like satellites and spacecraft like it.

Most of the lifetime of your vessels will be in this region of flight, so its always a good idea, to pay attention to it.

At hypersonic flight, the drag will slowly start to raise again, while lift even starts dropping a bit more.