Ian ForsterLewis, University of Cambridge, 26th December 2007
(sim_probe home)
(update 14th January 2008)
By sampling the ground elevation of the terrain in a windward direction relative to the current position of the user aircraft, an appropriate value of applicable topographic lift can be calculated. The technique is highly efficient for flight simulator use as only the lift at the current location of the user aircraft needs to be calculated. With a small number of ground elevation sample points, highly detailed topographic lift can be simulated. 
Topographic lift, known to glider pilots as 'ridge lift', is caused by the simple upward deflection of the wind as it flows over a locally raised area of ground. Exploiting this upward component of the wind can keep a glider or birds aloft for considerable distances.
While any hill can provide lift given a suitable wind, it is the long ridges perpendicular to the prevailing wind that really provide benefit. The animation below illustrates the effect of wind blowing against a ridge, with the wind being deflected up and over the ridge and the strongest lift being concentrated on the upwind side near the top. Note that the lee of the ridge contains strong sink, and glider pilots (and migrating birds) know to avoid this area.
The next illustration shows gliders positioned in the ridge lift. The gliders 'ridgerun' along the direction of the ridge (with the wind blowing from the left in the diagram) and position themselves in the strongest part of the lift, upwind of the crest and close to the ground.
This paper describes a technique for the automatic simulation of ridge lift based on the underlying terrain. This differs from the support provided in FSX missions for the individual placement of RidgeLift boxes within the mission area, and is considered to render that approach obsolete. Another article provides an overview of lift placement in Flight Simulator missions.
The figure below shows the lift (in metres per second) calculated by the technique described in this paper. Further sections in the paper explain the computation in detail. (Note: the wind is in the opposite direction to the illustrations above).
The essence of the technique is to:
continuously sample the ground elevation upwind of the user aircraft and calculate slopes, combined with the wind strength and height of the user aircraft above the ground, to produce a lift factor that can be applied to the user aircraft. 
The required number of ground samples is minimised by aligning the sample points into a straight line into the wind.
This paper provides details of an implementation in Visual C++ for Microsoft Flight Simulator X using the simconnect application program interface.
The calculation of lift discussed in this paper uses the following inputs:
The slope to each of the probe points is used to accumulate a lift factor at the user aircraft.
Probe zero: user aircraft (so a separate probe is not needed). Slopes from each of the other probes to the ground elevation at this point are calculated.
Probe one: local. 500m upwind of the user aircraft. The local slope (probe zero to probe one) is used to adjust the lift generated by the main slope, using the difference between the local slope and the main slope. This increases the lift if the upwind slope is concave, and reduces it if it is convex.
Probe two: main. 1000m upwind of the user aircraft. The main slope (probe zero to probe two) is the domininant determinant of the lift factor for the user aircraft.
Probe three: far upwind. 3000m upwind of the user aircraft. The far upwind slope (probe zero to probe three) is used to detect upwind high ground that would diminish the lift on the user aircraft.
Probe four: downwind. 500m downwind of the user aircraft. This probe has a considerable influence on the lift factor for the aircraft. If the upward or downward slope continues 'behind' (downwind) the user aircraft then the main lift or sink is enhanced, and but if the slope downwind does not continue the direction of the main slope, the lift factor is reduced.
Compared to the manual placement of RidgeLift boxes in Microsoft Flight Simulator X:
Compared to the use of precompiled 'slope files' as in CCS2004 and CumulusX! version 0.8:
To sample the ground elevations around the user aircraft, four AI simulated objects are created and placed around the landscape, numbered '1' through '4' as in the diagram below (the user aircraft is above position '0'). The pattern used in this development has been an intowind straight line but the opportunity remains to try other patterns although that will likely mean the need for more sampling points and the processing overhead will need to be carefully assessed.
The simconnect API provided with Microsoft Flight Simulator includes the basic facility (amongst many other capabilities) to:
With these capabilities, the ground elevations can be found by
The set of ground elevations can then be combined with the wind speed and aircraft agl altitude to compute a lift value to apply to the aircraft, and the process can be repeated (say) once per second so that the apparent lift is contantly updated as the user aircraft moves over the terrain.
This technique has been implemented in Microsoft Flight Simulator, with the default AI object "Food_pallet" used as the 'probe', as can be seen in the screenshot below (they are the size and shape of a purple igloo). In this test there are five probes and their regular placement near the user aircraft was for test purposes only.
Here is a more detailed overview of the actual simconnect code needed:
With the oncepersecond request in (3), the program steps (4)(6) should run oncepersecond.
Important note re step (4): the more obvious step would be to REQUEST the ground elevation of every probe immediately here, effectively skipping step (5). *But* this does not return the correct ground elevation, as if the probe is not yet fully moved. The additional 'redundant' request for the user position gives FSX the processing control back to do the actual probe moves.
The choice of units with simconnect is very flexible, and for consistency throughout this analysis we shall use metres and seconds where applicable. A useful ruleofthumb is that one metrepersecond is very close to two knots. At this point we have:
Crucial to the understanding of the technique described in this paper is keeping track of the various 'slopes' derived from the ground elevation values. Keeping in mind the user aircraft is effectively 'probe 0', slope[0..2] are calculated between 'probe 0' and probes '1' to '3' respectively, and slope[4] is calculated between 'probe 0' and 'probe 4', as in the diagram below:
The formula for each slope is simply the difference in ground altitude divided by the distance between the points, e.g.
Note that a negative slope using this formula can be expected to provide positive lift.
Using the distances chosen for the development, this is the average slope of the land to 1000 metres upwind of the user aircraft.
The other slopes are used to adjust the lift for a more detailed result:
slope[0]  can be used to account for a convex or concave slope 500m upwind 
slope[2]  identifies high ground 3000m upwind of the user aircraft which might reduce lift 
slope[4]  confirms whether the slope continues 500m downwind of the user aircraft 
Note that the simple calculation of slope will given a value anywhere between plus and minus infinity. For the purposes of lift calculation the slope number is adjusted using the formula atan_slope = atan(4*slope)/2. This function enhances more gentle slopes, attenuates the steepest slopes, and smoothly limits the values to between plus and minus 0.78 (i.e. pi/4), illustrated in the graph below.
Up to this point we have moved from
For each 'atan' slope, we now need calculate a lift factor. These will sum to the overall lift factor which multiplied by the wind speed gives us the base lift at the location of the user aircraft. As the contribution due to each slope is different, a different formula is used for each.
Lift factor 1 is simply the negative of atan_slope[1], reflecting the fact that it is this slope that is used as the primary factor to determine the lift affecting the aircraft.
factor[1] = atan_slope[1]

Lift factor 0 is the adjustment due to a convex or concave slope near the aircraft. The formula is
factor[0] = (atan_slope[1]atan_slope[0]) * absolute(factor[1])

Lift factor 2 is the adjustment due to high or low ground 3km upwind of the aircraft
factor[2] = atan_slope[2] / 1.5

Lift factor 4 is the adjustment due to rising or falling ground 500m downwind of the user aircraft
factor[4] = atan_slope[4] / 4

The figure below shows the calculation of base lift with a 10 m/s wind flowing over land with ground elevations 700, 700, 450, 300, 300 meters at probe points 4,0,1,2,3 respectively, i.e. at intowind distances from the user aircraft of 500, 0, 500, 1000 and 3000 metres.
Following the redcircled numbers, it can be seen the lift factors sum to 0.693, which multiplied by the wind speed of 10, gives a base lift of 6.934 meters per second.
By creating a much longer test land profile at 250 metre intervals, and repeating the lift calculation above each point on the landscape, the overall effectiveness of the technique can be assessed.
In the spreadsheet below, looking within the area circled in red, the base lift at each point on the ridge has been calculated, ranging from 5.4 metres per second (i.e. sink) in the lee of the ridge, to a maximum of 6.9 metres per second lift on the upwind crest of the ridge.
The column highlighted with a red outline in the figure below has lift of 6.9 metres per seconds, and is the 'given point' that was analysed in the prior section. Note that the only ground elevation values that are used in the computation at that point are highlighted in green.
The calculation so far produces base lift for a given land profile and wind speed, which can be imagined as the nominal lift at ground level beneath the user aircraft.
An extra (reducing) factor must be applied taking into account the height of the user aircraft above the ground.
Here, thanks to Peter Lürkens, is the graph of lift versus altitude AGL, for a nominal base lift of 4.5 meters per second. At 100 meters above the ground, the lift is a healthy 4 meters per second. However, by about 800 meters AGL the lift will have reduced to 1 meter per second.
Peter Lürkens, in his CumulusX! development, also uses the ground elevation at the user aircraft, with the reasoning that the higher the ground, the higher the lift will go above the ground. The lift affecting the user aircraft becomes a function of the base lift, the altitude of the aircraft agl, and the ground elevation beneath the aircraft. Again for a nominal base lift of about 4.5 meters per second, the chart (courtesy Peter Lürkens) showing the lift with altitude AGL at various ground elevations is given below.
The principles described in the preceding paper have proved effective during testing within Microsoft FSX, and more accurate values for the weight values and formulae have been evolved.
The parameters available for adjustment include:
The current version uses the following probe distances: 0m, 250m, 750m, 2000m, 100m. It may be noted these are all reduced from the initial estimate as it was found the sorter distances give greater sensitivity to local ground features without being overly vulnerable to erroneous local distortions.
The initial work assumed each slope would be taken with reference to probe 0 i.e. in each case one point would be the ground elevation beneath the user aircraft. With testing it was found more effective to calculate each slope with reference to the adjacent probes. At the same time, for ease of use,the polarity of the slopes was adjusted to consistently make a positive slope indicate a positive potential lift contribution. Also the slopes are consistently named slope[0..3] rather than naming the downwind slope slope[4].
Noting that the distance to probe 4 (the downwind probe) is negative):
slope[0] = (ground_elevation[0]  ground_elevation[1]) / distance[1] 
slope[1] = (ground_elevation[1]  ground_elevation[2]) / distance[2] 
slope[2] = (ground_elevation[2]  ground_elevation[3]) / distance[3] 
slope[3] = (ground_elevation[4]  ground_elevation[0]) / distance[4] 
with distance[0..4] being 0m, 250m, 750m, 2000m, 100m as discussed earlier.
The formula
was found to give good results. This function versus slope angle in degrees is illustrated in the chart below with a Sine curve for comparison.
The results of testing within FSX produced the following suitable weights to apply to each adjusted slope:
slope[0]  0.2 
slope[1]  0.2 
slope[2]  if (slope[2] is negative) 0.5 else 0.0 
slope[3]  if (slope[0] is positive AND slope[3] is negative) 0.0 else 0.2 
A function was created which divided the user altitude above the ground (AGL) into three regions.
As a result of testing, the heights chosen for BOUNDARY1 and BOUNDARY2 were
BOUNDARY1  40 meters 
BOUNDARY2  130 meters 
In addition, work done by Peter Lurkens with his CumulusX! development highlighted the benefit of decreasing the exponential decay of lift as the ground elevation at the user aircraft increased. This approximation means the lift will rise high above ridges with high peaks, but not as high above lower ridges. In general this is expected to be a good compromise with generally appropriate behaviour except where a high plateau contains a small ridge.
If we were not seeking to normalize the lift adjustment factor to 1 at BOUNDARY2 and ignored the adjustment for altitude, the simple exponential formula would be
taking into account the requirement to give the factor 1 at user_agl=BOUNDARY2, and providing a linear adjustment to the exponential factor according to ground elevation, we end up with
The following graphic illustrates the contours of lift generated by the technique (still subject to 'tuning' of the parameters):
Please note the vertical scale is greatly exaggerated. This helps the visualization and it might be noted that the user perception within the simulator (and flying along the real ridges) is that they are steeper than they really are. The following small image shows the vertical and horizontal distances at the same scale:
The spreadsheet used to test the base lift calculations is available here.
The compiled simconnect program which creates five AI probes and continuously displays their ground elevation is here.
The Visual C++ simconnect source file for this executable is here.