Skip to content

Commit 58461ba

Browse files
committed
Automatic merge of T1.5.1-870-ge0bf062eb and 17 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - 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 9c456aa: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - 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 #897 at 42f1dd9: feat: Improved system information collection - Pull request #903 at 9bead33: Downloading route content (Github, zip) - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR - Pull request #912 at d595703: New Triple Valve Features Vol. 2 - Pull request #914 at 476d67b: Adjustments to Duplex steam - Pull request #915 at 6d911d7: Correct calculation error with curve friction - Pull request #917 at fde18cf: Lighting Configuration Enhancements - Pull request #918 at f7ba507: Manual - News topics updated since 1.5.1
19 parents 560da40 + e0bf062 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + 9bead33 + 9b0b04f + 6834af0 + d595703 + 476d67b + 6d911d7 + fde18cf + f7ba507 commit 58461ba

File tree

2 files changed

+83
-25
lines changed

2 files changed

+83
-25
lines changed

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

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ public float TenderCoalMassKG // Decreased by firing and increased
656656

657657
float ReciprocatingWeightLb = 580.0f; // Weight of reciprocating parts of the rod driving gears
658658
float ConnectingRodWeightLb = 600.0f; // Weignt of connecting rod
659-
float ConnectingRodBalanceWeightLb = 300.0f; // Balance weight for connecting rods
660-
float ExcessBalanceFactor = 400.0f; // Factor to be included in excess balance formula
661659
float CrankRadiusFt = 1.08f; // Assume crank and rod lengths to give a 1:10 ratio - a reasonable av for steam locomotives?
662660
float ConnectRodLengthFt = 10.8f;
663661
float RodCoGFt = 4.32f; // 0.4 from crank end of rod
@@ -1229,25 +1227,6 @@ public override void Initialize()
12291227
if (ZeroError(BoilerVolumeFT3, "BoilerVolume"))
12301228
BoilerVolumeFT3 = 1;
12311229

1232-
// For light locomotives reduce the weight of the various connecting rods, as the default values are for larger locomotives. This will reduce slip on small locomotives
1233-
// It is not believed that the weight reduction on the connecting rods is linear with the weight of the locmotive. However this requires futher research, and this section is a
1234-
// work around until any further research is undertaken
1235-
// "The following code provides a simple 2-step adjustment, as not enough information is currently available for a more flexible one."
1236-
if (MassKG < Kg.FromTUS(10))
1237-
{
1238-
const float reductionfactor = 0.2f;
1239-
ReciprocatingWeightLb = 580.0f * reductionfactor; // Weight of reciprocating parts of the rod driving gears
1240-
ConnectingRodWeightLb = 600.0f * reductionfactor; // Weignt of connecting rod
1241-
ConnectingRodBalanceWeightLb = 300.0f * reductionfactor; // Balance weight for connecting rods
1242-
}
1243-
else if (MassKG < Kg.FromTUS(20))
1244-
{
1245-
const float reductionfactor = 0.3f;
1246-
ReciprocatingWeightLb = 580.0f * reductionfactor; // Weight of reciprocating parts of the rod driving gears
1247-
ConnectingRodWeightLb = 600.0f * reductionfactor; // Weignt of connecting rod
1248-
ConnectingRodBalanceWeightLb = 300.0f * reductionfactor; // Balance weight for connecting rods
1249-
}
1250-
12511230
#region Initialise additional steam properties
12521231

12531232
WaterDensityPSItoLBpFT3 = SteamTable.WaterDensityInterpolatorPSItoLBpFT3();
@@ -2020,6 +1999,26 @@ public override void Initialize()
20201999
SteamEngines[i].MaxIndicatedHorsePowerHP = MaxSpeedFactor * (SteamEngines[i].MaxTractiveEffortLbf * MaxLocoSpeedMpH) / 375.0f; // To be checked what MaxTractive Effort is for the purposes of this formula.
20212000
MaxIndicatedHorsePowerHP += SteamEngines[i].MaxIndicatedHorsePowerHP;
20222001
}
2002+
2003+
if (SteamEngines[i].ExcessWheelBalanceLbs == 0)
2004+
{
2005+
SteamEngines[i].ExcessWheelBalanceLbs = 440f; // set to a default value.
2006+
}
2007+
2008+
// For light locomotives reduce the weight of the various connecting rods, as the default values are for larger locomotives. This will reduce slip on small locomotives
2009+
// It is not believed that the weight reduction on the connecting rods is linear with the weight of the locmotive. However this requires futher research, and this section is a
2010+
// work around until any further research is undertaken
2011+
// "The following code provides a simple 2-step adjustment, as not enough information is currently available for a more flexible one."
2012+
if (MassKG < Kg.FromTUS(10))
2013+
{
2014+
const float reductionfactor = 0.2f;
2015+
SteamEngines[i].ExcessWheelBalanceLbs *= reductionfactor;
2016+
}
2017+
else if (MassKG < Kg.FromTUS(20))
2018+
{
2019+
const float reductionfactor = 0.3f;
2020+
SteamEngines[i].ExcessWheelBalanceLbs *= reductionfactor;
2021+
}
20232022
}
20242023

20252024
// Check to see if MaxIHP is in fact limited by the boiler
@@ -5981,8 +5980,39 @@ private void UpdateSteamTractiveForce(float elapsedClockSeconds, float locomotiv
59815980
float verticalThrustForcelbf = effectiveRotationalForcelbf * verticalThrustFactor;
59825981

59835982
// Calculate Excess Balance
5984-
float excessBalanceWeightLb = (ConnectingRodWeightLb + ReciprocatingWeightLb) - ConnectingRodBalanceWeightLb - (Kg.ToLb(MassKG) / ExcessBalanceFactor);
5985-
float excessBalanceForcelbf = inertiaSpeedCorrectionFactor * excessBalanceWeightLb * sin;
5983+
float excessBalanceForcelbf = inertiaSpeedCorrectionFactor * SteamEngines[numberofengine].ExcessWheelBalanceLbs * sin;
5984+
5985+
// Hammer (dynamic) force due to the rotation of the wheels is calculated
5986+
// From The Steam Locomotive by Ralph Johnson (pg 276 ) -
5987+
// Hammer force = 1.6047 x stroke (ins) x excessbalancemass (lbf) x speed^2 (mph) / ( Dia of drive wheel^2 (ins)) - This is per wheel
5988+
// The excess balance weight is on one side of the locomotive, is spread evenly over the number of wheels (this is not always the
5989+
// case for prototypical locomotives)
5990+
5991+
if (SteamEngines[numberofengine].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster)
5992+
{
5993+
SteamEngines[numberofengine].HammerForceLbs = (1.6047f * Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM) * SteamEngines[numberofengine].ExcessWheelBalanceLbs * (float)Math.Pow(MpS.ToMpH(absSpeedMpS), 2)) / ((float)Math.Pow(Me.ToIn(2.0f * SteamEngines[numberofengine].AttachedAxle.WheelRadiusM), 2) * SteamEngines[numberofengine].AttachedAxle.NumWheelsetAxles);
5994+
5995+
// weight on each individual wheel, rather then each axle
5996+
var wheelWeight = SteamEngines[numberofengine].AttachedAxle.WheelWeightKg / (SteamEngines[numberofengine].AttachedAxle.NumWheelsetAxles * 2f);
5997+
5998+
if (SteamEngines[numberofengine].HammerForceLbs > wheelWeight)
5999+
{
6000+
SteamEngines[numberofengine].IsWheelHammerForce = true;
6001+
}
6002+
else
6003+
{
6004+
SteamEngines[numberofengine].IsWheelHammerForce = false;
6005+
}
6006+
6007+
if (SteamEngines[numberofengine].HammerForceLbs > 0.9 * wheelWeight)
6008+
{
6009+
SteamEngines[numberofengine].IsWheelHammerForceWarning = true;
6010+
}
6011+
else
6012+
{
6013+
SteamEngines[numberofengine].IsWheelHammerForceWarning = false;
6014+
}
6015+
}
59866016

59876017
// Account for the position of the crosshead position. In other words it depends upon whether the ExcessBalance is above or below the axle.
59886018
// The crosshead will be -ve for normalised angles between 0 - 180, and +ve for normalised angles between 180 - 360
@@ -7935,7 +7965,7 @@ public override string GetDebugStatus()
79357965
{
79367966
for (int i = 0; i < SteamEngines.Count; i++)
79377967
{
7938-
status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7} \t{8:N0} {9}\n",
7968+
status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7} \t{8:N0} {9}\t{10} \t{11:N0}{12}\n",
79397969
Simulator.Catalog.GetString("Force:"),
79407970
Simulator.Catalog.GetString("Eng#"),
79417971
i + 1,
@@ -7945,7 +7975,10 @@ public override string GetDebugStatus()
79457975
FormatStrings.FormatForce(SteamEngines[i].DisplayTractiveForceN, IsMetric),
79467976
Simulator.Catalog.GetString("DrvWhl"),
79477977
pS.TopM(SteamEngines[i].DriveWheelRevRpS),
7948-
FormatStrings.rpm
7978+
FormatStrings.rpm,
7979+
Simulator.Catalog.GetString("Hammer"),
7980+
FormatStrings.FormatForce(N.FromLbf(SteamEngines[i].HammerForceLbs), IsMetric),
7981+
SteamEngines[i].IsWheelHammerForce ? "!!!" : SteamEngines[i].IsWheelHammerForceWarning ? "???" : ""
79497982
);
79507983

79517984
}

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/SteamEngine.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,26 @@ public enum AuxiliarySteamEngineTypes
366366
/// </summary>
367367
public float MaxIndicatedHorsePowerHP;
368368

369+
/// <summary>
370+
/// Steam Engine unbalanced mass on wheels - per side.
371+
/// </summary>
372+
public float ExcessWheelBalanceLbs;
373+
374+
/// <summary>
375+
/// Steam Engine unbalanced wheel warning.
376+
/// </summary>
377+
public bool IsWheelHammerForceWarning;
378+
379+
/// <summary>
380+
/// Steam Engine unbalanced large overload.
381+
/// </summary>
382+
public bool IsWheelHammerForce;
383+
384+
/// <summary>
385+
/// Steam Engine hammer force per wheel - excessive values of this could cause track deformities.
386+
/// </summary>
387+
public float HammerForceLbs;
388+
369389
/// <summary>
370390
/// Steam Engine drive wheel rev per second
371391
/// </summary>
@@ -699,6 +719,10 @@ public virtual void Parse(STFReader stf)
699719
MaxIndicatedHorsePowerHP = stf.ReadFloatBlock(STFReader.UNITS.Power, null);
700720
MaxIndicatedHorsePowerHP = W.ToHp(MaxIndicatedHorsePowerHP); // Convert input to HP for use internally in this module
701721
break;
722+
case "excesswheelbalance":
723+
var excess = stf.ReadFloatBlock(STFReader.UNITS.Mass, null);
724+
ExcessWheelBalanceLbs = Kg.ToLb(excess); // Convert input to lbs for use internally in this module
725+
break;
702726

703727
case "auxiliarysteamenginetype":
704728
stf.MustMatch("(");
@@ -731,6 +755,7 @@ public void Copy(SteamEngine other)
731755
LPCylindersDiameterM = other.LPCylindersDiameterM;
732756
BoosterCutoff = other.BoosterCutoff;
733757
MaxIndicatedHorsePowerHP = other.MaxIndicatedHorsePowerHP;
758+
ExcessWheelBalanceLbs = other.ExcessWheelBalanceLbs;
734759
BoosterThrottleCutoff = other.BoosterThrottleCutoff;
735760
BoosterGearRatio = other.BoosterGearRatio;
736761
AttachedAxleId = other.AttachedAxleId;

0 commit comments

Comments
 (0)