Skip to content

Commit ac0fe6b

Browse files
committed
Automatic merge of T1.5.1-1004-g6fd841761e and 18 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at 2728d6d: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #912 at 359cfee: New Triple Valve Features Vol. 2 - Pull request #922 at 0d3e70b: Autopilot for timetable mode - Pull request #946 at 66f836c: Advanced track sounds - Pull request #949 at e375e56: Oil Burning Locomotive - Pull request #952 at b2af1f5: Investigation - Pulsing graphics part 1 - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #956 at 6adc5a3: Map settings saved
20 parents 0454f4e + 6fd8417 + dfc715e + d00beb9 + f92de76 + 8f695a4 + 2728d6d + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 359cfee + 0d3e70b + 66f836c + e375e56 + b2af1f5 + a519452 + 84c2f4b + 6adc5a3 commit ac0fe6b

File tree

1 file changed

+88
-1
lines changed

1 file changed

+88
-1
lines changed

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

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ public class MSTSSteamLocomotive : MSTSLocomotive
115115
bool Injector1SoundIsOn = false;
116116
public bool Injector2IsOn;
117117
bool Injector2SoundIsOn = false;
118+
bool WaterMotionPumpFitted = false;
119+
float WaterMotionPump1FlowRateLBpS;
120+
float WaterMotionPump2FlowRateLBpS;
121+
float MaximumWaterMotionPumpFlowRateLBpS;
122+
bool WaterMotionPump1IsOn = false;
123+
bool WaterMotionPump2IsOn = false;
124+
float WaterMotionPumpHeatLossBTU;
118125
public bool CylinderCocksAreOpen;
119126
public bool BlowdownValveOpen;
120127
public bool CylinderCompoundOn; // Flag to indicate whether compound locomotive is in compound or simple mode of operation - simple = true (ie bypass valve is open)
@@ -934,6 +941,11 @@ public override void Parse(string lowercasetoken, STFReader stf)
934941
if (heating == 1)
935942
FuelOilSteamHeatingReqd = true;
936943
break;
944+
case "engine(ortswatermotionpump":
945+
var motionpump = stf.ReadIntBlock(null);
946+
if (motionpump == 1)
947+
WaterMotionPumpFitted = true;
948+
break;
937949
case "engine(ortsfueloilspecificgravity": OilSpecificGravity = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
938950
case "engine(enginecontrollers(cutoff": CutoffController.Parse(stf); break;
939951
case "engine(enginecontrollers(ortssmallejector": SmallEjectorController.Parse(stf); SmallEjectorControllerFitted = true; break;
@@ -1048,6 +1060,7 @@ public override void Copy(MSTSWagon copy)
10481060
CylinderPortOpeningFactor = locoCopy.CylinderPortOpeningFactor;
10491061
BoilerVolumeFT3 = locoCopy.BoilerVolumeFT3;
10501062
MaxBoilerPressurePSI = locoCopy.MaxBoilerPressurePSI;
1063+
WaterMotionPumpFitted = locoCopy.WaterMotionPumpFitted;
10511064
MaxSuperheatRefTempF = locoCopy.MaxSuperheatRefTempF;
10521065
MaxIndicatedHorsePowerHP = locoCopy.MaxIndicatedHorsePowerHP;
10531066
SuperheatCutoffPressureFactor = locoCopy.SuperheatCutoffPressureFactor;
@@ -6999,6 +7012,41 @@ private void UpdateWaterGauge()
69997012

70007013
private void UpdateInjectors(float elapsedClockSeconds)
70017014
{
7015+
7016+
if (WaterMotionPumpFitted)
7017+
{
7018+
MaximumWaterMotionPumpFlowRateLBpS = (1.2f * EvaporationLBpS) / 2.0f; // Assume two pumps and that they can pump a fraction more water the the maximum steam production
7019+
7020+
if (WaterMotionPump1IsOn && absSpeedMpS > 0)
7021+
{
7022+
WaterMotionPump1FlowRateLBpS = MaximumWaterMotionPumpFlowRateLBpS * absSpeedMpS / MpS.FromMpH(MaxLocoSpeedMpH);
7023+
}
7024+
7025+
if (WaterMotionPump2IsOn && absSpeedMpS > 0)
7026+
{
7027+
WaterMotionPump2FlowRateLBpS = MaximumWaterMotionPumpFlowRateLBpS * absSpeedMpS / MpS.FromMpH(MaxLocoSpeedMpH);
7028+
}
7029+
7030+
if (WaterIsExhausted)
7031+
{
7032+
WaterMotionPump1FlowRateLBpS = 0.0f; // If the tender water is empty, stop flow into boiler
7033+
WaterMotionPump2FlowRateLBpS = 0.0f; // If the tender water is empty, stop flow into boiler
7034+
}
7035+
7036+
float TotalPumpFlowRateLbpS = WaterMotionPump1FlowRateLBpS + WaterMotionPump2FlowRateLBpS;
7037+
7038+
// Calculate heat loss for water injected
7039+
// Loss of boiler heat due to water injection - loss is the diff between steam and water Heat
7040+
WaterMotionPumpHeatLossBTU = TotalPumpFlowRateLbpS * (WaterHeatPSItoBTUpLB[BoilerPressurePSI] - WaterHeatPSItoBTUpLB[0]);
7041+
7042+
// calculate Water steam heat based on injector water delivery temp
7043+
BoilerMassLB += elapsedClockSeconds * TotalPumpFlowRateLbpS; // Boiler Mass increase by Injector both pumps
7044+
BoilerHeatBTU -= elapsedClockSeconds * WaterMotionPumpHeatLossBTU; // Total loss of boiler heat due to water injection - inject steam and water Heat
7045+
// InjectorBoilerInputLB += (elapsedClockSeconds * Injector1Fraction * InjectorFlowRateLBpS); // Keep track of water flow into boilers from Injector 1
7046+
BoilerHeatOutBTUpS += WaterMotionPumpHeatLossBTU; // Total loss of boiler heat due to water injection - inject steam and water Heat
7047+
}
7048+
else
7049+
{
70027050
#region Calculate Injector size
70037051

70047052
// Calculate size of injectors to suit cylinder size.
@@ -7140,6 +7188,7 @@ private void UpdateInjectors(float elapsedClockSeconds)
71407188
}
71417189
}
71427190
}
7191+
}
71437192

71447193
private void UpdateFiring(float absSpeedMpS)
71457194
{
@@ -7190,6 +7239,27 @@ private void UpdateFiring(float absSpeedMpS)
71907239

71917240
#region AI Fireman
71927241
{
7242+
7243+
if (WaterMotionPumpFitted && !WaterIsExhausted)
7244+
{
7245+
if (WaterGlassLevelIN > 7.99) // turn pumps off if water level in boiler greater then 8.0, to stop cycling
7246+
{
7247+
WaterMotionPump1IsOn = false;
7248+
WaterMotionPump2IsOn = false;
7249+
}
7250+
else if (WaterGlassLevelIN <= 7.0 && WaterGlassLevelIN > 5.75) // turn water pump #1 on if water level in boiler drops below 7.0 and is above
7251+
{
7252+
WaterMotionPump1IsOn = true;
7253+
WaterMotionPump2IsOn = false;
7254+
}
7255+
else if (WaterGlassLevelIN <= 5.75 && WaterGlassLevelIN > 4.5) // turn water pump #1 on if water level in boiler drops below 7.0 and is above
7256+
{
7257+
WaterMotionPump1IsOn = true;
7258+
WaterMotionPump2IsOn = true;
7259+
}
7260+
}
7261+
else
7262+
{
71937263
// Injectors
71947264
// Injectors normally not on when stationary?
71957265
// Injector water delivery heat decreases with the capacity of the injectors, ideally one injector would be used as appropriate to match steam consumption. @nd one only used if required.
@@ -7365,6 +7435,7 @@ private void UpdateFiring(float absSpeedMpS)
73657435
PlayInjector2SoundIfStarting();
73667436
}
73677437
}
7438+
}
73687439

73697440
float BoilerHeatCheck = BoilerHeatOutBTUpS / BoilerHeatInBTUpS;
73707441
BoilerHeatExcess = BoilerHeatBTU / MaxBoilerHeatBTU;
@@ -8159,7 +8230,21 @@ public override string GetDebugStatus()
81598230
"FHLoss",
81608231
FireHeatLossPercent);
81618232
#endif
8162-
8233+
if (WaterMotionPumpFitted)
8234+
{
8235+
status.AppendFormat("{0}\t{1}\t{2}/{7}\t\t{3}\t{4}/{7}\t\t{5}\t{6}/{7}\n",
8236+
Simulator.Catalog.GetString("Pump:"),
8237+
Simulator.Catalog.GetString("Max"),
8238+
FormatStrings.FormatFuelVolume(pS.TopH(L.FromGUK(MaximumWaterMotionPumpFlowRateLBpS / WaterLBpUKG)), IsMetric, IsUK),
8239+
Simulator.Catalog.GetString("Pump1"),
8240+
FormatStrings.FormatFuelVolume(pS.TopH(L.FromGUK(WaterMotionPump1FlowRateLBpS / WaterLBpUKG)), IsMetric, IsUK),
8241+
Simulator.Catalog.GetString("Pump2"),
8242+
FormatStrings.FormatFuelVolume(pS.TopH(L.FromGUK(WaterMotionPump2FlowRateLBpS / WaterLBpUKG)), IsMetric, IsUK),
8243+
FormatStrings.h
8244+
);
8245+
}
8246+
else
8247+
{
81638248
status.AppendFormat("{0}\t{1}\t{6}/{12}\t\t({7:N0} {13})\t{2}\t{8}/{12}\t\t{3}\t{9}\t\t{4}\t{10}/{12}\t\t{5}\t{11}\n",
81648249
Simulator.Catalog.GetString("Injector:"),
81658250
Simulator.Catalog.GetString("Max"),
@@ -8175,6 +8260,8 @@ public override string GetDebugStatus()
81758260
FormatStrings.FormatTemperature(C.FromF(Injector2WaterDelTempF), IsMetric, false),
81768261
FormatStrings.h,
81778262
FormatStrings.mm);
8263+
}
8264+
81788265

81798266
if (SteamIsAuxTenderCoupled)
81808267
{

0 commit comments

Comments
 (0)