Skip to content

Commit ac3d33c

Browse files
committed
Automatic merge of T1.5.1-992-g1383ac843 and 16 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 b3f83ed: Blueprint/train car operations UI window - Pull request #885 at 56c17fb: 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 9305062: New Triple Valve Features Vol. 2 - Pull request #922 at abe2e52: Autopilot for timetable mode - Pull request #946 at 66f836c: Advanced track sounds - Pull request #948 at bc806e2: Fix Cycling Lights - Pull request #949 at 8ddd645: Oil Burning Locomotive - Pull request #950 at a98ff62: Ctrl-F5 showing yellow rectangles where mouse left button is active
18 parents 27332b7 + 1383ac8 + dfc715e + d00beb9 + f92de76 + b3f83ed + 56c17fb + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 9305062 + abe2e52 + 66f836c + bc806e2 + 8ddd645 + a98ff62 commit ac3d33c

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ public class MSTSSteamLocomotive : MSTSLocomotive
297297
SmoothedData OilBurnRateSmoothKGpS = new SmoothedData(3); // Changes in Oil BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat. Oil faster then steam
298298
float FuelFeedRateSmoothedKGpS = 0.0f; // Smoothed Fuel feedd Rate
299299
public float FuelBurnRateSmoothedKGpS; // Smoothed fuel burning rate
300-
float OilSpecificGravity = 0.9659f; // Assume a mid range of API for this value, say API = 15.
300+
float OilSpecificGravity = 0.9659f; // Assume a mid range of API for this value, say API = 15 @ 20 Cdeg.
301+
float WaterSpecificGravity = 1.0f; // Water @ 20 degC.
301302

302303
int NumberofTractiveForceValues = 36;
303304
float[,] TractiveForceAverageN = new float[5, 37];
@@ -383,14 +384,15 @@ public class MSTSSteamLocomotive : MSTSLocomotive
383384
float IdealFireDepthIN = 7.0f; // Assume standard coal coverage of grate = 7 inches.
384385
float FuelDensityKGpM3 = 864.5f; // Anthracite Coal : 50 - 58 (lb/ft3), 800 - 929 (kg/m3)
385386
float DamperFactorManual = 1.0f; // factor to control draft through fire when locomotive is running in Manual mode
386-
public float WaterLBpUKG = 10.0f; // lbs of water in 1 gal (uk)
387+
public float WaterLBpUKG = 10.021f; // lbs of water in 1 gal (uk)
387388
public float MaxTenderCoalMassKG = 1; // Maximum read from Eng File - - this value must be non-zero, if not defined in ENG file, can cause NaN errors
388389
public float TenderCoalMassKG // Decreased by firing and increased by refilling
389390
{
390391
get { return FuelController.CurrentValue * MaxTenderCoalMassKG; }
391392
set { FuelController.CurrentValue = value / MaxTenderCoalMassKG; }
392393
}
393394

395+
float MaxTenderOilMassL;
394396
float DamperBurnEffect; // Effect of the Damper control Used in manual firing)
395397
float Injector1Fraction = 0.0f; // Fraction (0-1) of injector 1 flow from Fireman controller or AI
396398
float Injector2Fraction = 0.0f; // Fraction (0-1) of injector of injector 2 flow from Fireman controller or AI
@@ -914,10 +916,12 @@ public override void Parse(string lowercasetoken, STFReader stf)
914916
case "engine(ortssuperheatcutoffpressurefactor": SuperheatCutoffPressureFactor = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
915917
case "engine(shovelcoalmass": ShovelMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
916918
case "engine(maxtendercoalmass": MaxTenderCoalMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
919+
case "engine(ortsmaxtenderfueloilvolume": MaxTenderOilMassL = stf.ReadFloatBlock(STFReader.UNITS.Volume, null); break;
917920
case "engine(maxtenderwatermass": MaxLocoTenderWaterMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
918921
case "engine(steamfiremanmaxpossiblefiringrate": MaxFiringRateKGpS = stf.ReadFloatBlock(STFReader.UNITS.MassRateDefaultLBpH, null) / 2.2046f / 3600; break;
919922
case "engine(steamfiremanismechanicalstoker": Stoker = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
920923
case "engine(ortssteamfiremanmaxpossiblefiringrate": ORTSMaxFiringRateKGpS = stf.ReadFloatBlock(STFReader.UNITS.MassRateDefaultLBpH, null) / 2.2046f / 3600; break;
924+
case "engine(ortsfueloilspecificgravity": OilSpecificGravity = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
921925
case "engine(enginecontrollers(cutoff": CutoffController.Parse(stf); break;
922926
case "engine(enginecontrollers(ortssmallejector": SmallEjectorController.Parse(stf); SmallEjectorControllerFitted = true; break;
923927
case "engine(enginecontrollers(ortslargeejector": LargeEjectorController.Parse(stf); LargeEjectorControllerFitted = true; break;
@@ -1083,6 +1087,8 @@ public override void Copy(MSTSWagon copy)
10831087
CylinderExhausttoCutoff = locoCopy.CylinderExhausttoCutoff;
10841088
CylinderCompressiontoCutoff = locoCopy.CylinderCompressiontoCutoff;
10851089
CylinderAdmissiontoCutoff = locoCopy.CylinderAdmissiontoCutoff;
1090+
OilSpecificGravity = locoCopy.OilSpecificGravity;
1091+
MaxTenderOilMassL = locoCopy.MaxTenderOilMassL;
10861092

10871093
SteamEngines.Copy(locoCopy.SteamEngines);
10881094
}
@@ -1276,6 +1282,12 @@ public override void Initialize()
12761282
CutoffInitialPressureDropRatioUpper = SteamTable.CutoffInitialPressureUpper();
12771283
CutoffInitialPressureDropRatioLower = SteamTable.CutoffInitialPressureLower();
12781284

1285+
// Set Oil mass - if an oil locomotive
1286+
if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Oil && MaxTenderOilMassL != 0)
1287+
{
1288+
MaxTenderCoalMassKG = MaxTenderOilMassL * OilSpecificGravity;
1289+
}
1290+
12791291
// Assign default steam table values if cylinder event is not in ENG file
12801292
if (CylinderExhausttoCutoff == null)
12811293
{
@@ -1477,7 +1489,7 @@ public override void Initialize()
14771489
// Set to compound operation intially
14781490

14791491
// include check to see if it is a balanced compound locomotive, ie number of HP cylinders = number of LP cylinders
1480-
if(SteamEngines[i].NumberCylinders != SteamEngines[i].LPNumberCylinders && Simulator.Settings.VerboseConfigurationMessages)
1492+
if (SteamEngines[i].NumberCylinders != SteamEngines[i].LPNumberCylinders && Simulator.Settings.VerboseConfigurationMessages)
14811493
{
14821494

14831495
Trace.TraceInformation("This doesn't appear to be a balanced compound locomotive, ie LP Cylinders = HP Cylinders. Game performnce may not be realistic.");

0 commit comments

Comments
 (0)