You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
+45-44Lines changed: 45 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -625,8 +625,6 @@ public float TenderCoalMassKG // Decreased by firing and increased
625
625
626
626
// Rotative Force and adhesion
627
627
628
-
float CalculatedFactorofAdhesion; // Calculated factor of adhesion
629
-
630
628
float ReciprocatingWeightLb = 580.0f; // Weight of reciprocating parts of the rod driving gears
631
629
float ConnectingRodWeightLb = 600.0f; // Weignt of connecting rod
632
630
float ConnectingRodBalanceWeightLb = 300.0f; // Balance weight for connecting rods
@@ -1471,7 +1469,7 @@ public override void Initialize()
1471
1469
// Adjust resistance for neutral gearing
1472
1470
GearedRetainedDavisAN = DavisAN; // remember davis a value for later
1473
1471
NeutralGearedDavisAN = DavisAN; // Initialise neutral gear value
1474
-
float TempDavisAAmount = N.FromLbf((DavisMechanicalResistanceFactor * Kg.ToTUS(DrvWheelWeightKg))); // Based upon the Davis formula for steam locomotive resistance
1472
+
float TempDavisAAmount = N.FromLbf((DavisMechanicalResistanceFactor * Kg.ToTUS(SteamEngines[0].AttachedAxle.WheelWeightKg))); // Based upon the Davis formula for steam locomotive resistance
1475
1473
if (TempDavisAAmount > 0.5 * DavisAN)
1476
1474
{
1477
1475
TempDavisAAmount = DavisAN * 0.5f; // If calculated mechanical resistance is greater then then 50% of the DavisA amount then set to an arbitary value of 50%.
@@ -1716,10 +1714,10 @@ public override void Initialize()
1716
1714
DisplaySpeedFactor = MaxSpeedFactor;
1717
1715
}
1718
1716
1719
-
// Calculate max velocity of the locomotive based upon above piston speed
1717
+
// Calculate max velocity of the locomotive based upon above piston speed (use first steam engine as the reference)
@@ -1931,17 +1929,18 @@ public override void Initialize()
1931
1929
1932
1930
for (int i = 0; i < SteamEngines.Count; i++)
1933
1931
{
1934
-
if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0 && SteamEngines.Count == 0 && MaxIndicatedHorsePowerHP != 0) // if MaxIHP is not set in ENG file, then set a default
else if (SteamEngines[i].MaxIndicatedHorsePowerHP == 0)
1939
1938
{
1940
1939
// Max IHP = (Max TE x Speed) / 375.0, use a factor of 0.85 to calculate max TE
1941
1940
SteamEngines[i].MaxIndicatedHorsePowerHP = MaxSpeedFactor * (SteamEngines[i].MaxTractiveEffortLbf * MaxLocoSpeedMpH) / 375.0f; // To be checked what MaxTractive Effort is for the purposes of this formula.
// only set advanced wheel slip when advanced adhesion, and simplecontrols/physics is not set and is in the the player train, AI locomotive will not work to this model.
5319
5314
// Don't use slip model when train is in auto pilot
5320
5315
{
5321
-
if (SteamEngineType != SteamEngineTypes.Geared && SteamEngines[numberofengine].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster)
5316
+
if (SteamEngineType != SteamEngineTypes.Geared || SteamEngines[numberofengine].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster)
// For more then two cylinder eingines reciprocating inertia is not required as it only applies to the gearing on each side and not the number of cylinders.
5529
5524
// Hence "zero" it out, however reciprocating rods will still apply
5530
-
if ((SteamEngines[numberofengine].NumberCylinders == 3 && i > 1) || (SteamEngines[numberofengine].NumberCylinders == 4 && (i == 1 || i == 3)))
5525
+
if ((SteamEngines[numberofengine].NumberCylinders == 3 && i > 1) || (SteamEngines[numberofengine].NumberCylinders == 4 && (i == 1 || i == 3)))
// This next section calculates wheel inertia, which is used in adhesion module
5871
5889
// A Generic wheel profile is used, so results may not be applicable to all locomotive, but should provide a "reasonable" guestimation
5872
5890
// Generic wheel assumptions are - 80 inch drive wheels ( 2.032 metre), a pair of drive wheels weighs approx 6,000lbs, axle weighs 1,000 lbs, and has a diameter of 8 inches.
5873
5891
// Moment of Inertia (Wheel and axle) = (Mass x Radius^2) / 2.0
float TotalWheelMomentofInertia = WheelMomentInertia + AxleMomentInertia; // Total MoI for generic wheelset
5881
5898
5882
5899
SteamDrvWheelWeightLbs = Kg.ToLb(DrvWheelWeightKg / axle.NumberWheelAxles); // Calculate the weight per axle (used in MSTSLocomotive for friction calculatons)
@@ -5892,33 +5909,17 @@ public override void AdvancedAdhesion(float elapsedClockSeconds)
0 commit comments