Skip to content

Commit

Permalink
Automatic merge of T1.5.1-535-g2f57132ee and 13 pull requests
Browse files Browse the repository at this point in the history
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations
- Pull request #821 at cc3af66: Adds suppression of safety valves
- Pull request #831 at 61bbf43: poor mans switch panel on tablet
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows
- Pull request #853 at a9760ec: Notify out of focus
- Pull request #855 at b39e5d8: Adds new route from TrainSimulations
- Pull request #856 at 30e7413: Add Alternate Syntax for Confusing Tokens
- Pull request #857 at 076c77a: Adding Air Flow Meters
- Pull request #858 at bbaeeba: Fix wheel animation problems
- Pull request #859 at 30d7b53: Steam adhesion bug#1
- Pull request #860 at 6a3f86f: Changes in the Car Operations Menu for the lines with brake information
- Pull request #861 at 2c39260: Curve friction#1
  • Loading branch information
openrails-bot committed Aug 11, 2023
15 parents 53e5caf + 2f57132 + 98dd1a7 + cc3af66 + 61bbf43 + d00beb9 + 410a585 + a9760ec + b39e5d8 + 30e7413 + 076c77a + bbaeeba + 30d7b53 + 6a3f86f + 2c39260 commit 8ea9ec4
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs
Expand Up @@ -2009,7 +2009,7 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
if (CurrentCurveRadius > 0)
{
if (RigidWheelBaseM == 0) // Calculate default values if no value in Wag File
{
{
float Axles = WheelAxles.Count;
float Bogies = Parts.Count - 1;
float BogieSize = Axles / Bogies;
Expand Down Expand Up @@ -2074,34 +2074,41 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
// Approximation for calculating rigid wheelbase for steam locomotives
// Wheelbase = 1.25 x (Loco Drive Axles - 1.0) x Drive Wheel diameter

RigidWheelBaseM = 1.25f * (LocoNumDrvAxles - 1.0f) * (DriverWheelRadiusM * 2.0f);
RigidWheelBaseM = 1.25f * (LocoNumDrvAxles - 1.0f) * (DriverWheelRadiusM * 2.0f);
}
}
}

// References:

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

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

// The CurveForce is a combination of these two components so that resistance will vary with stock characteristics and speed.
// The CurveForce is a combination of these two components such that resistance will vary with stock characteristics and speed.
// 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.

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

CurveForceN = N.FromLbf(Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius)));
var rBaseWagonN = N.FromLbf(Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius)));

// if (CurrentCurveRadius > 0)
// 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));

// Speed Curve Resistance (from reference ii) - second term only) = ((Speed^2 / Curve Radius) - (Superelevation / Track Gauge) * Gravitational acceleration) * Constant

var speedConstant = 1.5f;
var MToMM = 1000;
var rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadius) - ((MToMM * SuperelevationM / MToMM * TrackGaugeM) * GravitationalAccelerationMpS2));
var rSpeedWagonN = GravitationalAccelerationMpS2 * (Kg.ToTonne(MassKG) * rspeedKgpTonne);

var tempCurveFriction = Kg.ToLb(MassKG) * Train.WagonCoefficientFriction * (Me.ToFt(TrackGaugeM) + Me.ToFt(RigidWheelBaseM)) / (2.0f * Me.ToFt(CurrentCurveRadius));
// if (CurrentCurveRadius > 0)
// 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);

// if (CurrentCurveRadius > 0)
// 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));

// float CurveResistanceSpeedFactor = Math.Abs((MaxCurveEqualLoadSpeedMps - AbsSpeedMpS) / MaxCurveEqualLoadSpeedMps) * StartCurveResistanceFactor;
// CurveForceN *= CurveResistanceSpeedFactor * CurveResistanceZeroSpeedFactor;
// CurveForceN *= GravitationalAccelerationMpS2; // to convert to Newtons
CurveForceN = rBaseWagonN + rSpeedWagonN;
}
else
{
Expand Down

0 comments on commit 8ea9ec4

Please sign in to comment.