Skip to content

Commit 95889a3

Browse files
committed
Adjustments to tractive effort
1 parent d0f6191 commit 95889a3

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

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

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,7 @@ public override void Update(float elapsedClockSeconds)
21782178

21792179
for (int i = 0; i < SteamEngines.Count; i++)
21802180
{
2181+
var enginethrottle = 0.0f;
21812182

21822183
SteamEngines[i].IndicatedHorsePowerHP = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;
21832184

@@ -2187,7 +2188,7 @@ public override void Update(float elapsedClockSeconds)
21872188
}
21882189
else if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster) // Booster Engine
21892190
{
2190-
var boosterthrottle = 0.0f;
2191+
21912192
var boostercutoff = SteamEngines[i].BoosterCutoff;
21922193

21932194
// Confirm that Latch is on
@@ -2202,30 +2203,28 @@ public override void Update(float elapsedClockSeconds)
22022203

22032204
// Identify operating mode for the Booster
22042205
// Idle mode
2205-
if (SteamBoosterAirOpen && !SteamBoosterIdle && SteamBoosterLatchedLocked)
2206+
if (SteamBoosterAirOpen && !SteamBoosterIdle)
22062207
{
22072208
SteamBoosterRunMode = false;
22082209
SteamBoosterIdleMode = true;
2209-
boosterthrottle = 0.2f;
2210+
enginethrottle = 0.2f;
22102211
}
22112212
// Run mode
22122213
else if (SteamBoosterAirOpen && SteamBoosterIdle && SteamBoosterLatchedLocked)
22132214
{
22142215
SteamBoosterIdleMode = false;
22152216
SteamBoosterRunMode = true;
2216-
boosterthrottle = 1.0f;
2217+
enginethrottle = 1.0f;
22172218
}
22182219
else if (!SteamBoosterAirOpen || !SteamBoosterLatchedLocked)
22192220
{
22202221
SteamBoosterRunMode = false;
22212222
SteamBoosterIdleMode = false;
2222-
boosterthrottle = 0;
2223+
enginethrottle = 0;
22232224
}
22242225

2225-
if (SteamBoosterRunMode || SteamBoosterIdleMode)
2226-
{
2227-
UpdateCylinders(elapsedClockSeconds, boosterthrottle, boostercutoff, absSpeedMpS, i);
2228-
}
2226+
UpdateCylinders(elapsedClockSeconds, enginethrottle, boostercutoff, absSpeedMpS, i);
2227+
22292228
}
22302229
BoilerMassLB -= elapsedClockSeconds * SteamEngines[i].CylinderSteamUsageLBpS; // Boiler mass will be reduced by cylinder steam usage
22312230
BoilerHeatBTU -= elapsedClockSeconds * SteamEngines[i].CylinderSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Boiler Heat will be reduced by heat required to replace the cylinder steam usage, ie create steam from hot water.
@@ -2237,13 +2236,19 @@ public override void Update(float elapsedClockSeconds)
22372236

22382237
SteamEngines[i].TractiveForceN = 0;
22392238

2240-
if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster && (SteamBoosterIdleMode || SteamBoosterRunMode))
2241-
UpdateTractiveForce(elapsedClockSeconds, 0, 0, 0, i);
2239+
float tractiveforcethrottle = 0;
2240+
2241+
if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster)
2242+
{
2243+
tractiveforcethrottle = enginethrottle;
2244+
}
22422245
else
22432246
{
2244-
UpdateTractiveForce(elapsedClockSeconds, 0, 0, 0, i);
2247+
tractiveforcethrottle = throttle;
22452248
}
22462249

2250+
UpdateTractiveForce(elapsedClockSeconds, tractiveforcethrottle, 0, 0, i);
2251+
22472252
TractiveForceN += SteamEngines[i].TractiveForceN;
22482253

22492254
MotiveForceN += SteamEngines[i].AttachedAxle.CompensatedAxleForceN;
@@ -5023,7 +5028,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
50235028
SteamReleasePressure_AtmPSI = SteamEngines[numberofengine].Pressure_c_AtmPSI; // for steam and smoke effects
50245029

50255030
}
5026-
protected override void UpdateTractiveForce(float elapsedClockSeconds, float t, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
5031+
protected override void UpdateTractiveForce(float elapsedClockSeconds, float locomotivethrottle, float AbsSpeedMpS, float AbsWheelSpeedMpS, int numberofengine)
50275032
{
50285033
// Pass force and power information to MSTSLocomotive file by overriding corresponding method there
50295034

@@ -5122,7 +5127,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
51225127
float slipcutoff = 0;
51235128
if (SteamEngines[numberofengine].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster)
51245129
{
5125-
slipcutoff = 1.0f;
5130+
slipcutoff = SteamEngines[numberofengine].BoosterCutoff;
51265131
}
51275132
else
51285133
{
@@ -5219,7 +5224,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
52195224
// Combined cylinder pressure
52205225
crankCylinderPressure = forwardCylinderPressure - backwardCylinderPressure;
52215226

5222-
if ((throttle < 0.01 && SteamEngines[numberofengine].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster) || (!SteamBoosterAirOpen && SteamEngines[numberofengine].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster))
5227+
if (locomotivethrottle < 0.01)
52235228
{
52245229
crankCylinderPressure = 0;
52255230
}
@@ -5391,7 +5396,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
53915396
TractiveEffortLbsF = (SteamEngines[numberofengine].NumberCylinders / 2.0f) * (Me.ToIn(SteamEngines[numberofengine].CylindersDiameterM) * Me.ToIn(SteamEngines[numberofengine].CylindersDiameterM) * Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM) / (2.0f * Me.ToIn(DriverWheelRadiusM))) * (SteamEngines[numberofengine].MeanEffectivePressurePSI * CylinderEfficiencyRate) * MotiveForceGearRatio;
53925397

53935398
// Force tractive effort to zero if throttle is closed, or if a geared steam locomotive in neutral gear. MEP calculation is not allowing it to go to zero
5394-
if (throttle < 0.001 || (SteamEngineType == SteamEngineTypes.Geared && SteamGearPosition == 0))
5399+
if (locomotivethrottle < 0.001 || (SteamEngineType == SteamEngineTypes.Geared && SteamGearPosition == 0))
53955400
{
53965401
TractiveEffortLbsF = 0.0f;
53975402
}
@@ -5412,7 +5417,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
54125417
}
54135418

54145419
// On starting allow maximum motive force to be used, unless gear is in neutral (normally only geared locomotive will be zero). Decrease force if steam pressure is not at maximum
5415-
if (absSpeedMpS < 1.0f && cutoff > 0.70f && throttle > 0.98f && MotiveForceGearRatio != 0)
5420+
if (absSpeedMpS < 1.0f && cutoff > 0.70f && locomotivethrottle > 0.98f && MotiveForceGearRatio != 0)
54165421
{
54175422
SteamEngines[numberofengine].TractiveForceN = MaxForceN * (BoilerPressurePSI / MaxBoilerPressurePSI);
54185423
}
@@ -5467,22 +5472,12 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
54675472
ApplyDirectionToTractiveForce(ref SteamEngines[numberofengine].TractiveForceN);
54685473

54695474
// Set tractive force to zero if throttle is closed
5470-
if (SteamEngines[numberofengine].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster)
5475+
if (locomotivethrottle < 0.001)
54715476
{
5472-
var boosterthrottle = 0;
5473-
if (boosterthrottle < 0.01)
5474-
{
5475-
SteamEngines[numberofengine].TractiveForceN = 0;
5476-
}
5477-
}
5478-
else
5479-
{
5480-
if (throttle < 0.001)
5481-
{
5482-
SteamEngines[numberofengine].TractiveForceN = 0;
5483-
}
5477+
SteamEngines[numberofengine].TractiveForceN = 0;
54845478
}
54855479

5480+
54865481
SteamEngines[numberofengine].AttachedAxle.DriveForceN = SteamEngines[numberofengine].TractiveForceN;
54875482
}
54885483

0 commit comments

Comments
 (0)