Skip to content

Commit 2985bc1

Browse files
committed
Add steam booster pressure cab control
1 parent 776afa6 commit 2985bc1

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public enum CABViewControlTypes
133133
STEAM_BOOSTER_AIR,
134134
STEAM_BOOSTER_IDLE,
135135
STEAM_BOOSTER_LATCH,
136+
STEAM_BOOSTER_PRESSURE,
136137
WATER_INJECTOR1,
137138
WATER_INJECTOR2,
138139
SMALL_EJECTOR,

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public class MSTSSteamLocomotive : MSTSLocomotive
134134
public bool SteamBoosterIdleMode = false;
135135
public bool BoosterGearsEngaged = false;
136136
public bool SteamBoosterLatchedLocked = false;
137+
public float SteamBoosterPressurePSI;
137138
float BoosterGearEngageTimeS;
138139
float BoosterIdleHeatingTimerS;
139140
float BoosterIdleHeatingTimePeriodS = 120; // This is the time period that the Booster needs to be idled to heat it up
@@ -143,6 +144,8 @@ public class MSTSSteamLocomotive : MSTSLocomotive
143144
public float HuDBoosterSteamConsumptionLbpS;
144145
public float BoosterSteamConsumptionLbpS;
145146
float BoosterIdleChokeSizeIn;
147+
float BoosterPressureFactor = 0;
148+
float BoosterMaxIdleChokeSizeIn = 0.625f;
146149

147150
/// <summary>
148151
/// Grate limit of locomotive exceedeed?
@@ -1317,22 +1320,27 @@ public override void Initialize()
13171320
if (MaxBoilerPressurePSI > 300)
13181321
{
13191322
BoosterIdleChokeSizeIn = 0.375f;
1323+
BoosterPressureFactor = BoosterIdleChokeSizeIn / BoosterMaxIdleChokeSizeIn;
13201324
}
13211325
else if (MaxBoilerPressurePSI > 275 && MaxBoilerPressurePSI <= 300)
13221326
{
13231327
BoosterIdleChokeSizeIn = 0.4375f;
1328+
BoosterPressureFactor = BoosterIdleChokeSizeIn / BoosterMaxIdleChokeSizeIn;
13241329
}
13251330
else if (MaxBoilerPressurePSI > 250 && MaxBoilerPressurePSI <= 275)
13261331
{
13271332
BoosterIdleChokeSizeIn = 0.5f;
1333+
BoosterPressureFactor = BoosterIdleChokeSizeIn / BoosterMaxIdleChokeSizeIn;
13281334
}
13291335
else if (MaxBoilerPressurePSI > 200 && MaxBoilerPressurePSI <= 250)
13301336
{
13311337
BoosterIdleChokeSizeIn = 0.5625f;
1338+
BoosterPressureFactor = BoosterIdleChokeSizeIn / BoosterMaxIdleChokeSizeIn;
13321339
}
13331340
else
13341341
{
13351342
BoosterIdleChokeSizeIn = 0.625f;
1343+
BoosterPressureFactor = BoosterIdleChokeSizeIn / BoosterMaxIdleChokeSizeIn;
13361344
}
13371345

13381346
// Set crank angle between different sides of the locomotive
@@ -2343,15 +2351,16 @@ public override void Update(float elapsedClockSeconds)
23432351
{
23442352
// In Idle mode steam consumption will be calculated by steam through an orifice.
23452353
// Steam Flow (lb/hr) = 24.24 x Press(BoilerPressure + Atmosphere(psi)) x ChokeDia^2 (in) - this needs to be multiplied by Num Cyls
2346-
var BoosterPressurePSI = BoilerPressurePSI + OneAtmospherePSI;
2347-
SteamEngines[i].CylinderSteamUsageLBpS = pS.FrompH(SteamEngines[i].NumberCylinders * (24.24f * (BoosterPressurePSI) * BoosterIdleChokeSizeIn * BoosterIdleChokeSizeIn));
2354+
SteamBoosterPressurePSI = (BoilerPressurePSI + OneAtmospherePSI) * BoosterPressureFactor;
2355+
SteamEngines[i].CylinderSteamUsageLBpS = pS.FrompH(SteamEngines[i].NumberCylinders * (24.24f * (SteamBoosterPressurePSI) * BoosterIdleChokeSizeIn * BoosterIdleChokeSizeIn));
23482356
HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
23492357

23502358
}
23512359
else
23522360
{
23532361
// In run mode steam consumption calculated by cylinder model
23542362
HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
2363+
SteamBoosterPressurePSI = (throttle * InitialPressureDropRatioRpMtoX[pS.TopM(DrvWheelRevRpS)] * BoilerPressurePSI); // equivalent to steam chest pressure
23552364
}
23562365

23572366

@@ -6671,6 +6680,9 @@ public override float GetDataOf(CabViewControl cvc)
66716680
case CABViewControlTypes.STEAMHEAT_PRESSURE:
66726681
data = ConvertFromPSI(cvc, CurrentSteamHeatPressurePSI);
66736682
break;
6683+
case CABViewControlTypes.STEAM_BOOSTER_PRESSURE:
6684+
data = ConvertFromPSI(cvc, SteamChestPressurePSI);
6685+
break;
66746686
case CABViewControlTypes.CUTOFF:
66756687
case CABViewControlTypes.REVERSER_PLATE:
66766688
data = Train.MUReverserPercent / 100f;

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,11 @@ public virtual void LoadFromWagFile(string wagFilePath)
523523
if (MSTSWagonNumWheels == 0 && InitWagonNumAxles == 0 )
524524
{
525525
DerailmentCoefficientEnabled = false;
526+
527+
if (Simulator.Settings.VerboseConfigurationMessages)
528+
{
529+
Trace.TraceInformation("Derailment Coefficient set to false for Wagon {0}", WagFilePath);
530+
}
526531
}
527532

528533
// Ensure Drive Axles is set to a default if no OR value added to WAG file
@@ -539,7 +544,7 @@ public virtual void LoadFromWagFile(string wagFilePath)
539544

540545
if (Simulator.Settings.VerboseConfigurationMessages)
541546
{
542-
Trace.TraceInformation("Number of Wagon Axles set to default value of {0}", WagonNumAxles);
547+
Trace.TraceInformation("Number of Wagon Axles set to default value of {0} on Wagon {1}", WagonNumAxles, WagFilePath);
543548
}
544549
}
545550
else

0 commit comments

Comments
 (0)