Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Ground Effect Bug described in code
- //Fix shown below and is working perfectly well in three EFM aircraft I've developed
- void ed_fm_set_surface(double h,//surface height under the center of aircraft
- double h_obj,//surface height with objects
- unsigned surface_type,
- double normal_x,//components of normal vector to surface
- double normal_y,//components of normal vector to surface
- double normal_z//components of normal vector to surface
- )
- {
- double altitudeAboveTerrain = alt - h; //alt is from ed_fm_set_atmosphere
- double altitudeClearance = alt - h_obj; //this clearance becomes negative when underneath another aircraft, bridge, aircraft shelter, etc.
- double groundEffectAltitude = altitudeClearance;
- //why negative altitude matters:
- //equation for ground effect influence on lift:
- //CLge_mult - ground effect lift coefficient multiplier
- //b - aircraft wingspan (m)
- double CLge_mult = CLge_mult_table->getValue(groundEffectAltitude / b); //table lookup to get multiplier
- //Here is a lift coefficient multiplier table that is typical
- // h/b is the independent variable and is always supposed to be positive, as you should never fly underground
- // h/b CL mult
- // *CLge_multTable
- // 0.054000 1.250000
- // 0.100000 1.160000
- // 0.200000 1.096100
- // 0.300000 1.060000
- // 0.400000 1.040000
- // 0.500000 1.030000
- // 0.600000 1.024200
- // 0.700000 1.021300
- // 0.800000 1.016100
- // 0.900000 1.010000
- // 1.000000 1.000000;
- //This means 25% increase in lift when a negative groundEffectAltitude is used.
- //How to fix:
- if (altitudeClearance < 0)
- groundEffectAltitude = altitudeAboveTerrain; //use this altitude whenever the other method gives a negative.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement