dkavolis / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
81 stars 32 forks source link

Legacy ControlSurface and Wing modules #19

Open alex-dev opened 5 years ago

alex-dev commented 5 years ago

Are FARControllableSurface and FARWingAerodynamicModel still needed for wings and control surface to work properly?

If so, would it be possible to explain how values are to be calculated? I think integrating for MAC is not giving me the same values for winglet as what is in the patches.

dkavolis commented 5 years ago

Those modules are not really legacy, they are used for all aerodynamic parts. I assume they are in LEGACYferram4 because FAR was built around them and ferram didn't bother changing the namespace to match the rest of the plugin.

For calculating values, check upstream wiki

Mainly

@PART[planeWingSweptN]:NEEDS[FerramAerospacResearch|NEAR]
{
  // zero out all stock values, remove stock module
  @module = Part
  @maximum_drag = 0
  @minimum_drag = 0
  @angularDrag = 0
  @dragCoeff = 0
  @deflectionLiftCoeff = 0
  @ctrlSurfaceRange = 0
  @ctrlSurfaceArea = 0

  // add custom FAR values
  MODULE
  {
    name = FARControllableSurface // or FARWingAerodynamicModel for non-controllable wings
    MAC = 2.32  // Tip = 1.23m | Root = 3.4m
    MidChordSweep = 16.67 // Leading sweep 21.8* | Trailing sweep 11.54*
    b_2 = 11.19 // Root to tip in meters
    TaperRatio = 0.36 // Ratio of tip chord to root chord
    nonSideAttach = 0  // 0 for canard-like / normal wing pieces, 1 for ctrlsurfaces attached to the back of other wing parts
    maxdeflect = 15  // Default maximum deflection value; only used by FARControlableSurface
    ctrlSurfFrac = 0.09 // wing surface area = 43.56 | control surface area = 3.796
  }
}

MAC is simply the average of the tip and root chords (FAR doesn't handle non-trapezoidal wings). I think it would be too expensive to handle general wing shapes as trapezoidal shapes have some nice analytic results.

alex-dev commented 5 years ago

I see... It is weird tho. Looking at stock models, FAR values don't always match up.

alex-dev commented 5 years ago

As an example, for the winglet averaging chords, I get (2.11 + 0.687) / 2 = 1.3985. The patch sets a MAC of 1.239. I get a span of 1.432 while it's 1.425 in the patch.

dkavolis commented 5 years ago

The patch is 5 years old so it might be that some parts have changed, I haven't been around that long. If you are sure about your values, you can submit a PR.

alex-dev commented 5 years ago

There is no documented change to winglet model. So no. I'm not sure of my values.

alex-dev commented 5 years ago

Do correct me if I'm wrong... FARWingAerodynamicModel is not needed in itself. Wings can simply be handled through voxels.

dkavolis commented 5 years ago

Voxels are used for computing properties that depend on the cross section. FARWingAerodynamicModel is still required for FAR to function.

alex-dev commented 5 years ago

Then how does FAR actually handle lifting bodies? Because... From my point of view, a thin lifting body is no different than a wing.

dkavolis commented 5 years ago

If I'm not mistaken, the lifting body is handled through cross-sectional properties but without FARWingAerodynamicModel module a thin lifting body will have different behaviour than a wing since it won't have lifting line theory applied to it. FAR is not a generalized flow solver, it needs some guidance to properly work.