Skip to content

Commit d6d0c82

Browse files
committed
Fix steam adhesion bug
1 parent c301fa6 commit d6d0c82

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5197,19 +5197,8 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
51975197
float connectRodInertiaAngleFactor = 0;
51985198

51995199
// Calculate the "angle variation factors" for the Inertia
5200-
// Account for the position of the crosshead position. In other words it depends upon whether the Rods and Reciporating gear is above or below the axle.
5201-
if (crankAngleRad > 0 && crankAngleRad < Math.PI)
5202-
{
5203-
// forward stroke
5204-
reciprocatingInertiaAngleFactor = (cos + ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5205-
connectRodInertiaAngleFactor = (cos + ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
5206-
}
5207-
else
5208-
{
5209-
// reverse stroke
5210-
reciprocatingInertiaAngleFactor = (cos - ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5211-
connectRodInertiaAngleFactor = (cos - ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
5212-
}
5200+
reciprocatingInertiaAngleFactor = (cos + ((CrankRadiusFt / ConnectRodLengthFt) * (float)Math.Cos(2 * crankAngleRad)));
5201+
connectRodInertiaAngleFactor = (cos + ((CrankRadiusFt * RodCoGFt) / (ConnectRodLengthFt * ConnectRodLengthFt)) * (float)Math.Cos(2 * crankAngleRad));
52135202

52145203
// Calculate the speed factor to allow for variation in speed
52155204
// Adjust the above factor to allow for the speed of rotation on the parts - based upon Eq 8 (pg 21)

0 commit comments

Comments
 (0)