dkavolis / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
77 stars 31 forks source link

Add Groud-effect support #8

Open GER-Space opened 5 years ago

GER-Space commented 5 years ago

I don't know if its possible to add something like this, or at least fake it in a playable way:

https://en.wikipedia.org/wiki/Ground_effect_(aerodynamics)

Groundeffect happens whenever the altitude of the vessel is below the halve wingspan if the vessel.

the strength is between 0 and 2 times the normal lift, depending on the altitude. (0 if its above the effective height)

dkavolis commented 5 years ago

I'm not promising anything but it might be doable. I think FAR uses lifting line theory to calculate lift and drag which could probably be extended to include ground effects by adding the influences of parts mirrored with respect to the ground. No idea how the performance would be affected though.

dkavolis commented 5 years ago

For reference: http://www.academia.edu/7670885/Analysis_of_Wing_in_Ground_Effect_using_Potential_Flow_Theory https://digitalcommons.usu.edu/cgi/viewcontent.cgi?article=1080&context=mae_facpub https://www.howfliesthealbatross.com/Elliptical%20Wing%20in%20or%20out%20of%20Ground%20Effect.pdf

GER-Space commented 5 years ago

A simple solution would a sinple force modifier, depending on craft altitude. That would make it easier to take off an land at reasonable speeds. I know its not very accurate, but easy to implement

GER-Space commented 5 years ago

If you could tell me where in the code the the forces are clculated, I would try to write a patch for it, so you can test it, if you like it.

dkavolis commented 5 years ago

Not sure if a simple force modifier is the way to go as designing a vehicle that exploits the ground effect in real life would behave quit differently in this case.

If you could tell me where in the code the the forces are clculated, I would try to write a patch for it, so you can test it, if you like it.

This controls entire force calculation and application for the vessel: https://github.com/dkavolis/Ferram-Aerospace-Research/blob/f9e448793239b7360d14f6cd64765b3e202e7853/FerramAerospaceResearch/FARAeroComponents/FARVesselAero.cs#L260-L308

This calculates the forces: https://github.com/dkavolis/Ferram-Aerospace-Research/blob/f9e448793239b7360d14f6cd64765b3e202e7853/FerramAerospaceResearch/FARAeroComponents/FARAeroSection.cs#L456-L590

This applies the forces: https://github.com/dkavolis/Ferram-Aerospace-Research/blob/f9e448793239b7360d14f6cd64765b3e202e7853/FerramAerospaceResearch/FARAeroComponents/FARAeroPartModule.cs#L436-L519

However, there might be a better way of calculating the ground effect, FAR already computes interactions between wings in FARWingInteraction which could probably be extended to handle the ground effect problem. Fixed surface problems are solved by replacing the surface with a mirror image of the object, in this case the vehicle. So the interactions would need to calculated based on mirrored part transforms every few or so frames because their relative positions are not fixed as is the case for original parts. Performance near the ground would suffer so additional screening would be needed to reduce the computational load.

dkavolis commented 5 years ago

What would you need to make Ground Effect compatible with FAR? I can add an interface that FAR is aware of to adjust force and torque values if found that would be in a separate small dll, like Scale_Redist.dll. It would be called after the calculation of aerodynamic forces has finished.

svm420 commented 5 years ago

I really hope you consider the largest user base of FAR that is the Realism overhaul users. The entire point of FAR is realism, or as close as can be approximated within KSP. Ferram has discussed at length the reasons he didn't implement ground effect before. The main issue I believe he stated was it had to scale to wing span of the craft not just altitude. I don't know if he was able to easy get that data for any arbitrarily built craft in KSP.

My point being please don't compromise realism with a "hack". The majority of users are more concerned with realism than any other factor. Yes ground effect is a real thing and should be in any good simulation of real world aerodynamics, but faking it in a way that comprises other areas of the realistic simulation only results in a less realistic approximation. Ferram has stated about the same sentiments.

If you still consider its implementation in a less than accurate way please post about it to the forums and maybe ask the RO group what they think.

Thank you for your continued work and support of this mod.

dkavolis commented 5 years ago

I won't add a "hacky" version of ground effect to FAR but it doesn't prevent from FAR exposing some of its inner workings through interfaces. It would be up to the user to decide if he/she wants to use it.

HB-Stratos commented 4 years ago

Long time since the someone commented on here, but there's a (FAR-Incompatible) Ground effect mod that does factor in wingspan. So it is possible and if it is considered too hacky then it could be supplied as an optional patch.