Skip to content

Commit 04b214b

Browse files
committed
Fix usage of axle numbers
1 parent 8d02194 commit 04b214b

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ public override void Update(float elapsedClockSeconds)
25522552

25532553
UpdateSteamTractiveForce(elapsedClockSeconds, tractiveforcethrottle, 0, 0, i);
25542554

2555-
SteamDrvWheelWeightLbs += Kg.ToLb(SteamEngines[i].AttachedAxle.WheelWeightKg / SteamEngines[i].AttachedAxle.NumAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
2555+
SteamDrvWheelWeightLbs += Kg.ToLb(SteamEngines[i].AttachedAxle.WheelWeightKg / SteamEngines[i].AttachedAxle.NumDriveAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
25562556

25572557
}
25582558

@@ -6332,7 +6332,7 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
63326332
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
63336333

63346334
// The moment of inertia needs to be increased by the number of wheels in each set
6335-
TotalWheelMomentofInertia *= linkedEngine.AttachedAxle.NumAxles;
6335+
TotalWheelMomentofInertia *= linkedEngine.AttachedAxle.NumDriveAxles;
63366336

63376337
// the inertia of the coupling rods can also be added
63386338
// Assume rods weigh approx 1500 lbs

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerTransmissions/Axle.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,12 @@ public void Initialize()
235235
if (axle.InertiaKgm2 <= 0) axle.InertiaKgm2 = locomotive.AxleInertiaKgm2 / AxleList.Count;
236236
if (axle.WheelWeightKg <= 0) axle.WheelWeightKg = locomotive.DrvWheelWeightKg / AxleList.Count;
237237
if (axle.AxleWeightN <= 0) axle.AxleWeightN = 9.81f * axle.WheelWeightKg; //remains fixed for diesel/electric locomotives, but varies for steam locomotives
238-
if (axle.NumAxles <= 0) axle.NumAxles = locomotive.LocoNumDrvAxles;
238+
if (axle.NumDriveAxles <= 0) axle.NumDriveAxles = locomotive.LocoNumDrvAxles;
239239
if (axle.WheelRadiusM <= 0) axle.WheelRadiusM = locomotive.DriverWheelRadiusM;
240240
if (axle.WheelFlangeAngleRad <= 0) axle.WheelFlangeAngleRad = locomotive.MaximumWheelFlangeAngleRad;
241241
if (axle.DampingNs <= 0) axle.DampingNs = locomotive.MassKG / 1000.0f / AxleList.Count;
242242
if (axle.FrictionN <= 0) axle.FrictionN = locomotive.MassKG / 1000.0f / AxleList.Count;
243-
if (axle.NumberWheelAxles <= 0) axle.NumberWheelAxles = 1;
244-
243+
245244
// set the wheel slip threshold times for different types of locomotives
246245
// Because of the irregular force around the wheel for a steam engine during a revolution, "response" time for warnings needs to be lower
247246
if (locomotive.EngineType == TrainCar.EngineTypes.Steam)
@@ -513,7 +512,7 @@ public float TransmissionEfficiency
513512
/// <summary>
514513
/// Wheel number
515514
/// </summary>
516-
public int NumberWheelAxles;
515+
// public int NumberWheelAxles;
517516

518517
/// <summary>
519518
/// Wheel mass parameter in kilograms
@@ -548,7 +547,7 @@ public float TransmissionEfficiency
548547
/// <summary>
549548
/// Number of drive axles in group of wheels
550549
/// </summary>
551-
public float NumAxles;
550+
public float NumDriveAxles;
552551

553552
/// <summary>
554553
/// Static adhesion coefficient, as given by Curtius-Kniffler formula
@@ -791,8 +790,8 @@ public void Parse(STFReader stf)
791790
case "ortsflangeangle":
792791
WheelFlangeAngleRad = stf.ReadFloatBlock(STFReader.UNITS.Angle, null);
793792
break;
794-
case "ortsnumberwheelaxles":
795-
NumAxles = stf.ReadFloatBlock(STFReader.UNITS.Distance, null);
793+
case "ortsnumberdriveaxles":
794+
NumDriveAxles = stf.ReadFloatBlock(STFReader.UNITS.Distance, null);
796795
break;
797796
case "ortsinertia":
798797
InertiaKgm2 = stf.ReadFloatBlock(STFReader.UNITS.RotationalInertia, null);
@@ -801,9 +800,6 @@ public void Parse(STFReader stf)
801800
WheelWeightKg = stf.ReadFloatBlock(STFReader.UNITS.Mass, null);
802801
AxleWeightN = 9.81f * WheelWeightKg;
803802
break;
804-
case "numberwheelaxles":
805-
NumberWheelAxles = stf.ReadIntBlock(null);
806-
break;
807803
case "animatedparts":
808804
foreach (var part in stf.ReadStringBlock("").ToUpper().Replace(" ", "").Split(','))
809805
{
@@ -820,13 +816,12 @@ public void Copy(Axle other)
820816
{
821817
WheelRadiusM = other.WheelRadiusM;
822818
WheelFlangeAngleRad = other.WheelFlangeAngleRad;
823-
NumAxles = other.NumAxles;
819+
NumDriveAxles = other.NumDriveAxles;
824820
InertiaKgm2 = other.InertiaKgm2;
825821
WheelWeightKg = other.WheelWeightKg;
826822
AxleWeightN = other.AxleWeightN;
827823
AnimatedParts.Clear();
828824
AnimatedParts.AddRange(other.AnimatedParts);
829-
NumberWheelAxles = other.NumberWheelAxles;
830825
}
831826

832827
/// <summary>
@@ -1232,8 +1227,8 @@ public void Update()
12321227
var wheelRadiusMM = Axle.WheelRadiusM * 1000;
12331228
var wheelDistanceGaugeMM = Axle.WheelDistanceGaugeM * 1000;
12341229
var GNm2 = 8.40E+10;
1235-
wheelLoadN = Axle.AxleWeightN / (Axle.NumAxles * 2); // Assume two wheels per axle, and thus wheel weight will be have the value - multiple axles????
1236-
var wheelLoadkN = Axle.AxleWeightN / (Axle.NumAxles * 2 * 1000); // Assume two wheels per axle, and thus wheel weight will be have the value - multiple axles????
1230+
wheelLoadN = Axle.AxleWeightN / (Axle.NumDriveAxles * 2); // Assume two wheels per axle, and thus wheel weight will be have the value - multiple axles????
1231+
var wheelLoadkN = Axle.AxleWeightN / (Axle.NumDriveAxles * 2 * 1000); // Assume two wheels per axle, and thus wheel weight will be have the value - multiple axles????
12371232
var Young_ModulusMPa = 207000;
12381233

12391234
// Calculate Hertzian values - assume 2b = 12mm.

Source/RunActivity/Viewer3D/Popups/HUDWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ static string GetCarWhyteLikeNotation(TrainCar car)
622622
currentCount += 2;
623623
axlesCount += 1;
624624

625-
if (axlesCount >= steamloco.SteamEngines[i].AttachedAxle.NumberWheelAxles && currentCount != 0)
625+
if (axlesCount >= steamloco.SteamEngines[i].AttachedAxle.NumDriveAxles && currentCount != 0)
626626
{
627627
whyte.Add(currentCount.ToString());
628628
currentBogie = axle.BogieIndex;

0 commit comments

Comments
 (0)