Skip to content

Commit e236654

Browse files
committed
Adjustments to sander system
1 parent 9ee1da3 commit e236654

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ public float CurrentLocomotiveSteamHeatBoilerWaterCapacityL
204204
public float BoilerPressurePSI; // Steam Gauge pressure - what the engineer sees.
205205
public float MaxBoilerPressurePSI = 180f; // maximum boiler pressure, safety valve setting
206206

207+
public float SandingSteamUsageLBpS; // Sanding Steam Usage
208+
207209
// Vacuum Reservoir and Exhauster Settings
208210

209211
// Steam heating Flags
@@ -248,12 +250,14 @@ public enum SlipControlType
248250
float DebugSpeed = 1; // Used for debugging adhesion coefficient
249251

250252
// parameters for Track Sander based upon compressor air and abrasive table for 1/2" sand blasting nozzle @ 50psi
251-
public float MaxTrackSandBoxCapacityM3 = Me3.FromFt3(40.0f); // Capacity of sandbox - assume 40.0 cu ft
253+
public float MaxTrackSandBoxCapacityM3; // Capacity of sandbox
252254
public float CurrentTrackSandBoxCapacityM3;
253-
public float TrackSanderAirComsumptionM3pS = Me3.FromFt3(195.0f) / 60.0f; // Default value - cubic feet per min (CFM) 195 ft3/m
254-
public float TrackSanderAirPressurePSI = 50.0f;
255-
public float TrackSanderSandConsumptionM3pS = Me3.FromFt3(11.6f) / 3600.0f; // Default value - 11.6 ft3/h
255+
public float TrackSanderAirComsumptionM3pS;
256+
public float TrackSanderSandConsumptionM3pS;
256257
public float SandWeightKgpM3 = 1600; // One cubic metre of sand weighs about 1.54-1.78 tonnes.
258+
public float TrackSanderSteamConsumptionForwardLbpS;
259+
public float TrackSanderSteamConsumptionReverseLbpS;
260+
257261

258262
// Vacuum Braking parameters
259263
readonly static float OneAtmospherePSI = Bar.ToPSI(1);
@@ -1746,6 +1750,33 @@ public override void Initialize()
17461750
}
17471751
}
17481752

1753+
// Initialise track sanding parameters
1754+
if (MaxTrackSandBoxCapacityM3 == 0)
1755+
{
1756+
MaxTrackSandBoxCapacityM3 = Me3.FromFt3(40.0f); // Capacity of sandbox - assume 40.0 cu ft
1757+
}
1758+
1759+
if (TrackSanderAirComsumptionM3pS == 0)
1760+
{
1761+
TrackSanderAirComsumptionM3pS = Me3.FromFt3(195.0f) / 60.0f; // Default value - cubic feet per min (CFM) 195 ft3/m
1762+
}
1763+
1764+
if (TrackSanderSandConsumptionM3pS == 0)
1765+
{
1766+
TrackSanderSandConsumptionM3pS = Me3.FromFt3(11.6f) / 3600.0f; // Default value - 11.6 ft3/h
1767+
}
1768+
1769+
if (TrackSanderSteamConsumptionForwardLbpS == 0 && SandingSystemType == SandingSystemTypes.Steam)
1770+
{
1771+
TrackSanderSteamConsumptionForwardLbpS = 300f / 3600f; // Default value - 300lbs/hr
1772+
}
1773+
1774+
if (TrackSanderSteamConsumptionReverseLbpS == 0 && SandingSystemType == SandingSystemTypes.Steam)
1775+
{
1776+
TrackSanderSteamConsumptionReverseLbpS = 300f / 3600f; // Default value - 300lbs/hr
1777+
}
1778+
1779+
17491780
base.Initialize();
17501781
if (DynamicBrakeBlendingEnabled) airPipeSystem = BrakeSystem as AirSinglePipe;
17511782

@@ -3219,6 +3250,7 @@ public void UpdateTrackSander(float elapsedClockSeconds)
32193250

32203251
if (Sander && AbsSpeedMpS < SanderSpeedOfMpS) // If sander switch is on, and not blocked by speed, adjust parameters
32213252
{
3253+
// Calculate sand consumption for sander
32223254
if (CurrentTrackSandBoxCapacityM3 > 0.0) // if sand still in sandbox then sanding is available
32233255
{
32243256
// Calculate consumption of sand, and drop in sand box level
@@ -3231,9 +3263,17 @@ public void UpdateTrackSander(float elapsedClockSeconds)
32313263
}
32323264
}
32333265

3266+
// Calculate steam, air or gravity consumption for different sander modes
32343267
if (SandingSystemType == SandingSystemTypes.Steam)
32353268
{
3236-
3269+
if (Direction == Direction.Reverse)
3270+
{
3271+
SandingSteamUsageLBpS = TrackSanderSteamConsumptionReverseLbpS;
3272+
}
3273+
else
3274+
{
3275+
SandingSteamUsageLBpS = TrackSanderSteamConsumptionForwardLbpS;
3276+
}
32373277

32383278
}
32393279
else

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ public float TenderCoalMassKG // Decreased by firing and increased
411411
float BoilerHeatTransferCoeffWpM2K = 45.0f; // Heat Transfer of locomotive boiler 45 Wm2K
412412
float TotalSteamUsageLBpS; // Running total for complete current steam usage
413413
float GeneratorSteamUsageLBpS = 1.0f; // Generator Steam Usage
414-
float SandingSteamUsageLBpS; // Sanding Steam Usage
415414
float RadiationSteamLossLBpS = 2.5f; // Steam loss due to radiation losses
416415
float BlowerBurnEffect; // Effect of Blower on burning rate
417416
float FlueTempDiffK; // Current difference in flue temp at current firing and steam usage rates.
@@ -691,8 +690,6 @@ public float TenderCoalMassKG // Decreased by firing and increased
691690
public float SanderSteamExhaustVelocityMpS;
692691
public float SanderSteamExhaustParticleDurationS;
693692

694-
float SanderSteamConsumptionLbpS = 17; // Assume 1000lbs/hr steam consumption for the sander
695-
696693
public float Cylinders2_11SteamVolumeM3pS;
697694
public float Cylinders2_12SteamVolumeM3pS;
698695
public float Cylinders2_21SteamVolumeM3pS;
@@ -6631,11 +6628,10 @@ private void UpdateAuxiliaries(float elapsedClockSeconds, float absSpeedMpS)
66316628
CylCockSteamUsageDisplayLBpS = 0.0f;
66326629
}
66336630

6634-
// Calculate sanding steam Usage if turned on
6631+
// Calculate sanding steam Usage if a steam based system and turned on
66356632
// Assume steam sanding usage is 1000lbs/hr
6636-
if (Sander && SandingSystemType == SandingSystemTypes.Steam)
6633+
if (Sander && SandingSystemType == SandingSystemTypes.Steam)
66376634
{
6638-
SandingSteamUsageLBpS = SanderSteamConsumptionLbpS;
66396635
BoilerMassLB -= elapsedClockSeconds * SandingSteamUsageLBpS; // Reduce boiler mass to reflect steam usage by generator
66406636
BoilerHeatBTU -= elapsedClockSeconds * SandingSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by generator
66416637
BoilerHeatOutBTUpS += SandingSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by generator

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,7 @@ public Direction Direction
646646
public int LocoNumDrvAxles; // Number of drive axles on locomotive
647647
protected float MSTSLocoNumDrvWheels; // Number of drive axles on locomotive - used to read MSTS value as default
648648
public float DriverWheelRadiusM = Me.FromIn(30.0f); // Drive wheel radius of locomotive wheels - Wheel radius of loco drive wheels can be anywhere from about 10" to 40".
649-
650-
public enum SteamEngineTypes
649+
public enum SteamEngineTypes
651650
{
652651
Unknown,
653652
Simple,
@@ -662,6 +661,7 @@ public enum SandingSystemTypes
662661
Unknown,
663662
Air,
664663
Steam,
664+
Gravity,
665665
}
666666

667667
public SandingSystemTypes SandingSystemType;

0 commit comments

Comments
 (0)