|Home||Give it some wings.|
This page describes Racer's aerodynamic capabilities. These are the aspects concerning aerodynamics:
Note that Racer currently only calculates longitudinal aerodynamics; no side aero or changes due to car pitching is implemented.
The air density is specified in racer.ini under environment.air_density. Normally it is 1.225 (kg/m^3).
The car can be viewed as one big aerodynamic block or wing. It has a center (aero.body.center=x y z), which is defined relative to the nullpoint (in Racer's coordinate system, which is the same as the OpenGL coordinate system; see the tutorial on coordinate systems for more details), a drag coefficient (aero.body.cx, actually this works in Racer's Z direction; in the automotive world 'X' is the forward direction) and an area (aero.body.area) in m^2. Racer v0.5.3 beta 7 adds aero.body.cz for body downforce and aero.body.cy for sideforce, although currently ONLY the longitudinal vehicle velocity is used (so 'cy' doesn't really make sense to be anything but 0). Note the cx/cy/cz axes are in the SAE axis system (X forward, Y left, Z up).
When the car gets some speed, the air resistance quickly becomes an important factor, since its influence is proportional to the velocity squared.
An example cx coefficient would be 0.3 for an average car. Racing cars can go lower, to about 0.2, and other cars go up to 0.4 or worse. The aerodynamic drag is applied at the center. This means that with speed the car may also get pitched somewhat (unless you apply it at (0,0,0)).
|To the left you can see a frontal view of a car. A good approximation of the drag area is the real-life area if you filled in this image with a solid color.|
Next to the car getting drag (top speed is lowered), it gets a torque that wants to rotate the body (sprung mass). This effect depends on how far off the center of drag is with respect to the center of gravity.
Wings (downforce and drag)
All other wing-type aerodynamic objects are called wings in Racer. So spoilers and dams act like wings.
Wings are defined by the aero.wing<x> sections. First you have to decide the number of wings, which you place in aero.wings. Then you defined each wing using the following subparameters (i.e. 'aero.wing0.<parameter>'):
Wing forces are calculated (in Newtons) using the following formula:
F_drag = 0.5*span*cord*coeff_drag*(angle+angle_offset)*airDensity*airVelocity^2
The downforce is calculated similarly. Note that here,
angle and angle_offset are in radians (they are converted when loading)! The
airDensity is defined in env.ini, but is generally somewhere around 1.225 (kg/m^3).
Notice the quite big coefficients you'll probably need (in comparison to body drag) to get some real effective downforce. To understand the effect of the angle offset, realise that a good wing at 0 degrees still produces lift. Lift is taken linear with the relative incoming air angle, but in order to generate lift even at zero angle, the offset is used. This might take some experimenting or calculations to get right. I'd advise to use known downforce numbers and calculate back to a realistic coefficient.
These signals are available (since v0.8.35) in the System hierarchy:
Drafting / slipstreaming
Racer supports drafting since v0.6.5. The parameters vary per car.
|aero.draft.scale_lon_rear||Factor that scales car velocity to come up with a length of the suction area at the rear of the car. This is the longitudinal factor (right behind the car). Normally the rear slipstream area is larger than the front area.|
|aero.draft.scale_lat_rear||Similar to scale_lon_rear, only this is the lateral factor.|
|aero.draft.scale_lon_front||Similar to scale_lon_rear, only this one is used for the front suction area. Normally cars will generate a far less bigger area in front of them, as they push the air forward. This then helps any car just in front of them to also speed up (a reason why car groups in Nascar races can go faster than cars driving on their own).|
|aero.draft.scale_lat_front||Similar to scale_lon_front, only this is the lateral factor.|
All these factors give a pyramid-shaped area in front of, and at the rear of the car. To visualize the effect, use the script command 'show aero' (use hide aero to hide the area visualization again).
The purple transparency above gives away a clue to the amount of slipstreaming, although it is not entirely correct (but that was a limitation with OpenGL triangle color interpolation). The more opaque region indicates more slipstreaming.
There are 2 directions in which slipstreaming becomes less apparent: longitudinally and laterally. As you get further away longitudinally from the car, draft influence becomes 0 at the of the wide end of the pyramid. Also, as the car gets closer to the lateral edges of the pyramid, draft influence decreases as well. The final influence is a linear combination of the two. The closer a car is to the 'top' of pyramid, the more influence.
You can visually check things using the script command 'show aero' and/or using Ctrl-2 (or the script command 'debug 2') to see the influence in numbers.
(last updated November 13, 2012 )