@@ -133,6 +133,9 @@ public class MSTSSteamLocomotive : MSTSLocomotive
133133 public bool SteamBoosterRunMode = false;
134134 public bool SteamBoosterIdleMode = false;
135135 public bool SteamBoosterLatchedLocked = false;
136+ public float HuDBoosterSteamConsumptionLbpS;
137+ public float BoosterSteamConsumptionLbpS;
138+ float BoosterIdleChokeSizeIn;
136139
137140 /// <summary>
138141 /// Grate limit of locomotive exceedeed?
@@ -1268,6 +1271,31 @@ public override void Initialize()
12681271 FractionBoilerAreaInsulated = 0.86f; // Rough approximation - based upon empirical graphing
12691272 }
12701273
1274+ // Define Booster choke size
1275+ // Based on information in "The Locomotive Booster - Instruction book No 102-A" by Franklin Railway Supply Company
1276+ // http://users.fini.net/~bersano/english-anglais/locomotive_booster/locomotive_booster.pdf
1277+
1278+ if (MaxBoilerPressurePSI > 300)
1279+ {
1280+ BoosterIdleChokeSizeIn = 0.375f;
1281+ }
1282+ else if (MaxBoilerPressurePSI > 275 && MaxBoilerPressurePSI <= 300)
1283+ {
1284+ BoosterIdleChokeSizeIn = 0.4375f;
1285+ }
1286+ else if (MaxBoilerPressurePSI > 250 && MaxBoilerPressurePSI <= 275)
1287+ {
1288+ BoosterIdleChokeSizeIn = 0.5f;
1289+ }
1290+ else if (MaxBoilerPressurePSI > 200 && MaxBoilerPressurePSI <= 250)
1291+ {
1292+ BoosterIdleChokeSizeIn = 0.5625f;
1293+ }
1294+ else
1295+ {
1296+ BoosterIdleChokeSizeIn = 0.625f;
1297+ }
1298+
12711299 // Set crank angle between different sides of the locomotive
12721300 if (Cylinder2CrankAngleRad == 0) // if not set by user set default values based upon the cylinder
12731301 {
@@ -2202,7 +2230,7 @@ public override void Update(float elapsedClockSeconds)
22022230 {
22032231 SteamBoosterRunMode = false;
22042232 SteamBoosterIdleMode = true;
2205- enginethrottle = 0.2f ;
2233+ enginethrottle = 0.0f ;
22062234 }
22072235 // Run mode
22082236 else if (SteamBoosterAirOpen && SteamBoosterIdle && SteamBoosterLatchedLocked)
@@ -2220,6 +2248,23 @@ public override void Update(float elapsedClockSeconds)
22202248
22212249 UpdateCylinders(elapsedClockSeconds, enginethrottle, boostercutoff, absSpeedMpS, i);
22222250
2251+ // Update Booster steam consumption
2252+ if (SteamBoosterIdleMode)
2253+ {
2254+ // In Idle mode steam consumption will be calculated by steam through an orifice.
2255+ // Steam Flow (lb/hr) = 24.24 x Press(BoilerPressure + Atmosphere(psi)) x ChokeDia^2 (in) - this needs to be multiplied by Num Cyls
2256+ var BoosterPressurePSI = BoilerPressurePSI + OneAtmospherePSI;
2257+ SteamEngines[i].CylinderSteamUsageLBpS = pS.FrompH(SteamEngines[i].NumberCylinders * (24.24f * (BoosterPressurePSI) * BoosterIdleChokeSizeIn * BoosterIdleChokeSizeIn));
2258+ HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
2259+
2260+ }
2261+ else
2262+ {
2263+ // In run mode steam consumption calculated by cylinder model
2264+ HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
2265+ }
2266+
2267+
22232268 }
22242269 BoilerMassLB -= elapsedClockSeconds * SteamEngines[i].CylinderSteamUsageLBpS; // Boiler mass will be reduced by cylinder steam usage
22252270 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.
@@ -2228,6 +2273,7 @@ public override void Update(float elapsedClockSeconds)
22282273 CumulativeCylinderSteamConsumptionLbs += SteamEngines[i].CylinderSteamUsageLBpS * elapsedClockSeconds;
22292274 CylinderSteamUsageLBpS += SteamEngines[i].CylinderSteamUsageLBpS;
22302275 CylCockSteamUsageLBpS += SteamEngines[i].CylCockSteamUsageLBpS;
2276+
22312277
22322278 SteamEngines[i].MeanEffectivePressurePSI = MeanEffectivePressurePSI;
22332279
@@ -2728,18 +2774,31 @@ private void UpdateFX(float elapsedClockSeconds)
27282774 float SmokeColorUnits = (RadiationSteamLossLBpS + CalculatedCarHeaterSteamUsageLBpS + BlowerBurnEffect + (SmokeColorDamper * SmokeColorFireMass)) / PreviousTotalSteamUsageLBpS - 0.2f;
27292775 SmokeColor.Update(elapsedClockSeconds, MathHelper.Clamp(SmokeColorUnits, 0.25f, 1));
27302776
2731- // Variable1 is proportional to angular speed, value of 10 means 1 rotation/second.
2732- // If wheel is not slipping then use normal wheel speed, this reduces oscillations in variable1 which causes issues with sounds.
2733- var variable1 = 0.0f;
2734- if (WheelSlip)
2735- {
2736- variable1 = Math.Abs(WheelSpeedSlipMpS / DriverWheelRadiusM / MathHelper.Pi * 5);
2737- }
2738- else
2777+ float[] variable = new float[5];
2778+
2779+ for (int i = 0; i < SteamEngines.Count; i++)
27392780 {
2740- variable1 = Math.Abs(WheelSpeedMpS / DriverWheelRadiusM / MathHelper.Pi * 5);
2781+
2782+ // Variable is proportional to angular speed, value of 10 means 1 rotation/second.
2783+ // If wheel is not slipping then use normal wheel speed, this reduces oscillations in variable1 which causes issues with sounds.
2784+
2785+ if (SteamEngines[i].AttachedAxle.IsWheelSlip)
2786+ {
2787+ variable[i] = Math.Abs(SteamEngines[i].AttachedAxle.SlipSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
2788+ }
2789+ else
2790+ {
2791+ variable[i] = Math.Abs((float)SteamEngines[i].AttachedAxle.AxleSpeedMpS / SteamEngines[i].AttachedAxle.WheelRadiusM / MathHelper.Pi * 5);
2792+ }
2793+ Variable1 = ThrottlePercent == 0 ? 0 : variable[i];
27412794 }
2742- Variable1 = ThrottlePercent == 0 ? 0 : variable1;
2795+
2796+ // Set variables for each engine
2797+ Variable1 = variable[0];
2798+ Variable2_1 = variable[1];
2799+ Variable3_1 = variable[2];
2800+ Variable4_1 = variable[3];
2801+
27432802 Variable2 = MathHelper.Clamp((CylinderCocksPressureAtmPSI - OneAtmospherePSI) / BoilerPressurePSI * 100f, 0, 100);
27442803 Variable3 = FuelRateSmoothed * 100;
27452804
@@ -5726,7 +5785,7 @@ private void UpdateAuxiliaries(float elapsedClockSeconds, float absSpeedMpS)
57265785 else
57275786 {
57285787 CylCockSteamUsageLBpS = 0.0f; // set steam usage to zero if turned off
5729- CylCockSteamUsageDisplayLBpS = CylCockSteamUsageLBpS ;
5788+ CylCockSteamUsageDisplayLBpS = 0.0f ;
57305789 }
57315790
57325791 // Calculate Generator steam Usage if turned on
@@ -6533,7 +6592,7 @@ public override string GetDebugStatus()
65336592 if (!(BrakeSystem is Orts.Simulation.RollingStocks.SubSystems.Brakes.MSTS.VacuumSinglePipe))
65346593 {
65356594 // Display air compressor information
6536- status.AppendFormat("{0}\t{1}\t{2}/{21 }\t{3}\t{4}/{21 }\t{5}\t{6}/{21 }\t{7}\t{8}/{21 }\t{9}\t{10}/{21 }\t{11}\t{12}/{21 }\t{13}\t{14}/{21 }\t{15}\t{16}/{21 }\t{17}\t{18}/{21} ( {19}x {20:N1}\")\n",
6595+ status.AppendFormat("{0}\t{1}\t{2}/{23 }\t{3}\t{4}/{23 }\t{5}\t{6}/{23 }\t{7}\t{8}/{23 }\t{9}\t{10}/{23 }\t{11}\t{12}/{23 }\t{13}\t{14}/{23 }\t{15}\t{16}/{23 }\t{17}\t{18}/{23}\t {19}\t {20}/{23}\t({21}x{22 :N1}\")\n",
65376596 Simulator.Catalog.GetString("Usage:"),
65386597 Simulator.Catalog.GetString("Cyl"),
65396598 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(CylinderSteamUsageLBpS)), IsMetric),
@@ -6551,6 +6610,8 @@ public override string GetDebugStatus()
65516610 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(StokerSteamUsageLBpS)), IsMetric),
65526611 Simulator.Catalog.GetString("BlowD"),
65536612 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(BlowdownSteamUsageLBpS)), IsMetric),
6613+ Simulator.Catalog.GetString("Booster"),
6614+ FormatStrings.FormatMass(pS.TopH(Kg.FromLb(HuDBoosterSteamConsumptionLbpS)), IsMetric),
65546615 Simulator.Catalog.GetString("MaxSafe"),
65556616 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(MaxSafetyValveDischargeLbspS)), IsMetric),
65566617 NumSafetyValves,
@@ -6560,7 +6621,7 @@ public override string GetDebugStatus()
65606621 else
65616622 {
65626623 // Display steam ejector information instead of air compressor
6563- status.AppendFormat("{0}\t{1}\t{2}/{21 }\t{3}\t{4}/{21 }\t{5}\t{6}/{21 }\t{7}\t{8}/{21 }\t{9}\t{10}/{21 }\t{11}\t{12}/{21 }\t{13}\t{14}/{21 }\t{15}\t{16}/{21 }\t{17}\t{18}/{21} ( {19}x {20:N1}\")\n",
6624+ status.AppendFormat("{0}\t{1}\t{2}/{23 }\t{3}\t{4}/{23 }\t{5}\t{6}/{23 }\t{7}\t{8}/{23 }\t{9}\t{10}/{23 }\t{11}\t{12}/{23 }\t{13}\t{14}/{23 }\t{15}\t{16}/{23 }\t{17}\t{18}/{23}\t {19}\t {20}/{23}\t({21}x{22 :N1}\")\n",
65646625 Simulator.Catalog.GetString("Usage:"),
65656626 Simulator.Catalog.GetString("Cyl"),
65666627 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(CylinderSteamUsageLBpS)), IsMetric),
@@ -6578,6 +6639,8 @@ public override string GetDebugStatus()
65786639 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(StokerSteamUsageLBpS)), IsMetric),
65796640 Simulator.Catalog.GetString("BlowD"),
65806641 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(BlowdownSteamUsageLBpS)), IsMetric),
6642+ Simulator.Catalog.GetString("Booster"),
6643+ FormatStrings.FormatMass(pS.TopH(Kg.FromLb(HuDBoosterSteamConsumptionLbpS)), IsMetric),
65816644 Simulator.Catalog.GetString("MaxSafe"),
65826645 FormatStrings.FormatMass(pS.TopH(Kg.FromLb(MaxSafetyValveDischargeLbspS)), IsMetric),
65836646 NumSafetyValves,
0 commit comments