Skip to content

Commit

Permalink
Fix a critical parachute bug, prep for v0.15.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ferram4 committed Jul 1, 2016
1 parent 039ac96 commit 4e55a17
Show file tree
Hide file tree
Showing 86 changed files with 107 additions and 103 deletions.
2 changes: 1 addition & 1 deletion FerramAerospaceResearch/FARAPI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
10 changes: 5 additions & 5 deletions FerramAerospaceResearch/FARAeroComponents/FARAeroSection.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -284,7 +284,7 @@ public void ClearAeroSection()
handledAeroModulesIndexDict.Clear();
}

public void PredictionCalculateAeroForces(float atmDensity, float machNumber, float reynoldsPerUnitLength, float pseudoKuttaNumber, float skinFrictionDrag, Vector3 vel, ferram4.FARCenterQuery center)
public void PredictionCalculateAeroForces(float atmDensity, float machNumber, float reynoldsPerUnitLength, float pseudoLanchesterNumber, float skinFrictionDrag, Vector3 vel, ferram4.FARCenterQuery center)
{
if (partData.Count == 0)
return;
Expand Down Expand Up @@ -351,7 +351,7 @@ public void PredictionCalculateAeroForces(float atmDensity, float machNumber, fl
nForce *= normalForceFactor;

double xForce = -skinFrictionForce * Math.Sign(cosAoA) * cosSqrAoA;
double localVelForce = xForce * pseudoKuttaNumber;
double localVelForce = xForce * pseudoLanchesterNumber;
xForce -= localVelForce;

localVelForce = Math.Abs(localVelForce);
Expand Down Expand Up @@ -430,7 +430,7 @@ public void PredictionCalculateAeroForces(float atmDensity, float machNumber, fl
center.AddTorque(torqueVector);
}

public void FlightCalculateAeroForces(float atmDensity, float machNumber, float reynoldsPerUnitLength, float pseudoKuttaNumber, float skinFrictionDrag)
public void FlightCalculateAeroForces(float atmDensity, float machNumber, float reynoldsPerUnitLength, float pseudoLanchesterNumber, float skinFrictionDrag)
{

double skinFrictionForce = skinFrictionDrag * xForceSkinFriction.Evaluate(machNumber); //this will be the same for each part, so why recalc it multiple times?
Expand Down Expand Up @@ -489,7 +489,7 @@ public void FlightCalculateAeroForces(float atmDensity, float machNumber, float
nForce *= normalForceFactor;

double xForce = -skinFrictionForce * Math.Sign(cosAoA) * cosSqrAoA;
double localVelForce = xForce * pseudoKuttaNumber;
double localVelForce = xForce * pseudoLanchesterNumber;
xForce -= localVelForce;

localVelForce = Math.Abs(localVelForce);
Expand Down
10 changes: 5 additions & 5 deletions FerramAerospaceResearch/FARAeroComponents/FARVesselAero.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -283,7 +283,7 @@ private void CalculateAndApplyVesselAeroProperties()
reynoldsNumber = FARAeroUtil.CalculateReynoldsNumber(_vessel.atmDensity, Length, _vessel.srfSpeed, machNumber, FlightGlobals.getExternalTemperature((float)_vessel.altitude, _vessel.mainBody), _vessel.mainBody.atmosphereAdiabaticIndex);
float skinFrictionDragCoefficient = (float)FARAeroUtil.SkinFrictionDrag(reynoldsNumber, machNumber);

float pseudoKuttaNumber = (float)(machNumber / (reynoldsNumber + machNumber));
float pseudoLanchesterNumber = (float)(machNumber / (reynoldsNumber + machNumber));

Vector3 frameVel = Krakensbane.GetFrameVelocityV3f();

Expand All @@ -307,7 +307,7 @@ private void CalculateAndApplyVesselAeroProperties()
}*/

for (int i = 0; i < _currentAeroSections.Count; i++)
_currentAeroSections[i].FlightCalculateAeroForces(atmDensity, (float)machNumber, (float)(reynoldsNumber / Length), pseudoKuttaNumber, skinFrictionDragCoefficient);
_currentAeroSections[i].FlightCalculateAeroForces(atmDensity, (float)machNumber, (float)(reynoldsNumber / Length), pseudoLanchesterNumber, skinFrictionDragCoefficient);

_vesselIntakeRamDrag.ApplyIntakeRamDrag((float)machNumber, _vessel.srf_velocity.normalized, (float)_vessel.dynamicPressurekPa);

Expand Down Expand Up @@ -340,10 +340,10 @@ public void SimulateAeroProperties(out Vector3 aeroForce, out Vector3 aeroTorque
float reynoldsPerLength = reynoldsNumber / (float)Length;
float skinFriction = (float)FARAeroUtil.SkinFrictionDrag(reynoldsNumber, machNumber);

float pseudoKuttaNumber = machNumber / (reynoldsNumber + machNumber);
float pseudoLanchesterNumber = machNumber / (reynoldsNumber + machNumber);

for(int i = 0; i < _currentAeroSections.Count; i++)
_currentAeroSections[i].PredictionCalculateAeroForces(density, machNumber, reynoldsPerLength, pseudoKuttaNumber, skinFriction, velocityWorldVector, center);
_currentAeroSections[i].PredictionCalculateAeroForces(density, machNumber, reynoldsPerLength, pseudoLanchesterNumber, skinFriction, velocityWorldVector, center);

for (int i = 0; i < _legacyWingModels.Count; i++)
_legacyWingModels[i].PrecomputeCenterOfLift(velocityWorldVector, machNumber, density, center);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -122,7 +122,6 @@ void UpdateAerodynamics(ModularFI.ModularFlightIntegrator fi, Part part)
part.DragCubes.SetDrag(part.dragVectorDirLocal, (float)fi.mach);
}
}

}

void CalculateLocalDynPresAndAngularDrag(ModularFI.ModularFlightIntegrator fi, Part p)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
2 changes: 1 addition & 1 deletion FerramAerospaceResearch/FARAeroUtil.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
4 changes: 2 additions & 2 deletions FerramAerospaceResearch/FARDebugAndSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -170,7 +170,7 @@ public void OnGUI()
if (debugMenu)
{

debugWinPos = GUILayout.Window("FARDebug".GetHashCode(), debugWinPos, debugWindow, "FAR Debug Options, v0.15.7.1", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
debugWinPos = GUILayout.Window("FARDebug".GetHashCode(), debugWinPos, debugWindow, "FAR Debug Options, v0.15.7.2", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
if (!inputLocked && debugWinPos.Contains(GUIUtils.GetMousePos()))
{
InputLockManager.SetControlLock(ControlTypes.KSC_ALL, "FARDebugLock");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
2 changes: 1 addition & 1 deletion FerramAerospaceResearch/FARGUI/FAREditorGUI/EditorGUI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
<<<<<<< HEAD:FerramAerospaceResearch/FARRungeKutta.cs
<<<<<<< HEAD:FerramAerospaceResearch/FARRungeLanchester.cs
Ferram Aerospace Research v0.14.7
Copyright 2014, Michael Ferrara, aka Ferram4
Expand Down Expand Up @@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License
* Toolbar integration powered by blizzy78's Toolbar plugin; used with permission
* http://forum.kerbalspaceprogram.com/threads/60863
=======
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -75,7 +75,7 @@ You should have received a copy of the GNU General Public License
Toolbar integration powered by blizzy78's Toolbar plugin; used with permission
http://forum.kerbalspaceprogram.com/threads/60863
>>>>>>> 89b2865ff34b6d3d23d7e6860f7820d7aa80af02:FerramAerospaceResearch/FARGUI/FAREditorGUI/Simulation/RungeKutta.cs
>>>>>>> 89b2865ff34b6d3d23d7e6860f7820d7aa80af02:FerramAerospaceResearch/FARGUI/FAREditorGUI/Simulation/RungeLanchester.cs
*/

using System;
Expand All @@ -85,7 +85,7 @@ You should have received a copy of the GNU General Public License

namespace FerramAerospaceResearch.FARGUI.FAREditorGUI.Simulation
{
class RungeKutta4
class RungeLanchester4
{
// Vector4 a = new Vector4(0, 0.5f, 0.5f, 1);
Vector4 c = new Vector4(1f / 6, 1f / 3, 1f / 3, 1f / 6);
Expand All @@ -101,7 +101,7 @@ class RungeKutta4
public double[,] soln;
public double[] time;

public RungeKutta4(double endTime, double dt, SimMatrix eqns, double[] initCond)
public RungeLanchester4(double endTime, double dt, SimMatrix eqns, double[] initCond)
{
// b.Add(0.5f, 0, 1);
// b.Add(0.5f, 1, 2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -135,7 +135,7 @@ public GraphData RunTransientSimLateral(StabilityDerivOutput vehicleData, double
*
*
*/
RungeKutta4 transSolve = new RungeKutta4(endTime, initDt, A, InitCond);
RungeLanchester4 transSolve = new RungeLanchester4(endTime, initDt, A, InitCond);
transSolve.Solve();

GraphData lines = new GraphData();
Expand Down Expand Up @@ -226,7 +226,7 @@ public GraphData RunTransientSimLongitudinal(StabilityDerivOutput vehicleData, d
*
*/

RungeKutta4 transSolve = new RungeKutta4(endTime, initDt, A, InitCond);
RungeLanchester4 transSolve = new RungeLanchester4(endTime, initDt, A, InitCond);
transSolve.Solve();

GraphData lines = new GraphData();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
4 changes: 2 additions & 2 deletions FerramAerospaceResearch/FARGUI/FARFlightGUI/FlightGUI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down Expand Up @@ -273,7 +273,7 @@ void OnGUI()
}
if (_vessel == FlightGlobals.ActiveVessel && showGUI && showAllGUI)
{
mainGuiRect = GUILayout.Window(this.GetHashCode(), mainGuiRect, MainFlightGUIWindow, "FAR, v0.15.7.1 'Kutta'", GUILayout.MinWidth(230));
mainGuiRect = GUILayout.Window(this.GetHashCode(), mainGuiRect, MainFlightGUIWindow, "FAR, v0.15.7.2 'Lanchester'", GUILayout.MinWidth(230));
GUIUtils.ClampToScreen(mainGuiRect);

if (showFlightDataWindow)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Ferram Aerospace Research v0.15.7.1 "Kutta"
Ferram Aerospace Research v0.15.7.2 "Lanchester"
=========================
Aerodynamics model for Kerbal Space Program
Expand Down
Loading

0 comments on commit 4e55a17

Please sign in to comment.