Skip to content

Commit 2c39260

Browse files
committed
Add speed curve component
1 parent d2e63f1 commit 2c39260

File tree

1 file changed

+20
-13
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks

1 file changed

+20
-13
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
20092009
if (CurrentCurveRadius > 0)
20102010
{
20112011
if (RigidWheelBaseM == 0) // Calculate default values if no value in Wag File
2012-
{
2012+
{
20132013
float Axles = WheelAxles.Count;
20142014
float Bogies = Parts.Count - 1;
20152015
float BogieSize = Axles / Bogies;
@@ -2074,34 +2074,41 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
20742074
// Approximation for calculating rigid wheelbase for steam locomotives
20752075
// Wheelbase = 1.25 x (Loco Drive Axles - 1.0) x Drive Wheel diameter
20762076

2077-
RigidWheelBaseM = 1.25f * (LocoNumDrvAxles - 1.0f) * (DriverWheelRadiusM * 2.0f);
2077+
RigidWheelBaseM = 1.25f * (LocoNumDrvAxles - 1.0f) * (DriverWheelRadiusM * 2.0f);
20782078
}
20792079
}
20802080
}
20812081

20822082
// References:
20832083

2084-
// i) The modern locomotive by Clarence Edgar Allen – 1912 – pg 82 - https://archive.org/details/modernlocomotive00allerich
2084+
// i) The modern locomotive by Clarence Edgar Allen – 1912 – pg 82 - https://archive.org/details/modernlocomotive00allerich
20852085

2086-
// ii) Resistance to Traffic of Railway Rolling Stock by P.N.Astakhov – Moscow 1966 – pg 112
2087-
// http://scbist.com/scb/uploaded/1_astahov_p_n_soprotivlenie_dvizheniyu_zheleznodorozhnogo_podv.pdf
2086+
// ii) Resistance to Traffic of Railway Rolling Stock by P.N.Astakhov – Moscow 1966 – pg 112
2087+
// http://scbist.com/scb/uploaded/1_astahov_p_n_soprotivlenie_dvizheniyu_zheleznodorozhnogo_podv.pdf
20882088

2089-
// The CurveForce is a combination of these two components so that resistance will vary with stock characteristics and speed.
2089+
// The CurveForce is a combination of these two components such that resistance will vary with stock characteristics and speed.
20902090
// These formulas are a mix of imperial and metric expressions so these will be retained and converted to a common UoM in Newtons once calculations are complete.
20912091

20922092
// Base Curve Resistance (from refernce i)) = (Vehicle mass x Coeff Friction) * (Track Gauge + Vehicle Fixed Wheelbase) / (2 * curve radius)
20932093
// Vehicle Fixed Wheel base is the distance between the wheels, ie bogie or fixed wheels
20942094

2095-
CurveForceN = N.FromLbf(Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius)));
2095+
var rBaseWagonN = N.FromLbf(Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius)));
2096+
2097+
// if (CurrentCurveRadius > 0)
2098+
// Trace.TraceInformation("Curve Friction - CarID {0} Friction {1} Weight {2} WagonFriction {3} Gauge {4} WheelBase {5} CurveRadius {6}", CarID, rBaseWagonN, Kg.ToLb(MassKG), Train.WagonCoefficientFriction, Me.ToFt(TrackGaugeM), Me.ToFt(RigidWheelBaseM), Me.ToFt(CurrentCurveRadius));
2099+
2100+
// Speed Curve Resistance (from reference ii) - second term only) = ((Speed^2 / Curve Radius) - (Superelevation / Track Gauge) * Gravitational acceleration) * Constant
2101+
2102+
var speedConstant = 1.5f;
2103+
var MToMM = 1000;
2104+
var rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadius) - ((MToMM * SuperelevationM / MToMM * TrackGaugeM) * GravitationalAccelerationMpS2));
2105+
var rSpeedWagonN = GravitationalAccelerationMpS2 * (Kg.ToTonne(MassKG) * rspeedKgpTonne);
20962106

2097-
var tempCurveFriction = Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius));
2107+
// if (CurrentCurveRadius > 0)
2108+
// Trace.TraceInformation("Curve Friction Speed - CarID {0} Weight {1} WagonFriction {2} Gauge {3} CurveRadius {4} SuperElevation {5} Gauge {6} rspeedKgpTonne {7} rSpeedWagonN {8} rBaseWagonN {9}", CarID, Kg.ToTonne(MassKG), Train.WagonCoefficientFriction, TrackGaugeM, CurrentCurveRadius, SuperelevationM, TrackGaugeM, rspeedKgpTonne, rSpeedWagonN, rBaseWagonN);
20982109

2099-
// if (CurrentCurveRadius > 0)
2100-
// Trace.TraceInformation("Curve Friction - CarID {0} Friction {1} Weight {2} WagonFriction {3} Gauge {4} WheelBase {5} CurveRadius {6}", CarID, tempCurveFriction, Kg.ToLb(MassKG), Train.WagonCoefficientFriction, Me.ToFt(TrackGaugeM), Me.ToFt(RigidWheelBaseM), Me.ToFt(CurrentCurveRadius));
21012110

2102-
// float CurveResistanceSpeedFactor = Math.Abs((MaxCurveEqualLoadSpeedMps - AbsSpeedMpS) / MaxCurveEqualLoadSpeedMps) * StartCurveResistanceFactor;
2103-
// CurveForceN *= CurveResistanceSpeedFactor * CurveResistanceZeroSpeedFactor;
2104-
// CurveForceN *= GravitationalAccelerationMpS2; // to convert to Newtons
2111+
CurveForceN = rBaseWagonN + rSpeedWagonN;
21052112
}
21062113
else
21072114
{

0 commit comments

Comments
 (0)