Skip to content

Commit a37ff44

Browse files
committed
Automatic merge of T1.5.1-757-gef6c1a8c8 and 16 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 #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at 74466d9: feat: Add notifications to Menu - Pull request #886 at 1b88d7a: Scene viewer extension to TrackViewer - Pull request #888 at b20b888: docs: Document player application model - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 5ff1e73: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #898 at e271395: Extra line with all the arguments for debugging purposes in logfile - Pull request #899 at 0c11dc0: Duplex steam engines - Booster Engine addition
18 parents 146b772 + ef6c1a8 + 3539862 + d00beb9 + f8dbeab + 43bf33e + f92de76 + a055bca + 74466d9 + 1b88d7a + b20b888 + 1f5ba4c + bf8876b + 5ff1e73 + 5866028 + 0a9d939 + e271395 + 0c11dc0 commit a37ff44

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

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

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ public float TenderCoalMassKG // Decreased by firing and increased
542542
const int CylStrokesPerCycle = 2; // each cylinder does 2 strokes for every wheel rotation, within each stroke
543543
float CylinderEfficiencyRate = 1.0f; // Factor to vary the output power of the cylinder without changing steam usage - used as a player customisation factor.
544544
public float CylCockSteamUsageLBpS = 0.0f; // Cylinder Cock Steam Usage if locomotive moving
545-
public float CylCockSteamUsageStatLBpS = 0.0f; // Cylinder Cock Steam Usage if locomotive stationary
546545
public float CylCockSteamUsageDisplayLBpS = 0.0f; // Cylinder Cock Steam Usage for display and effects
547546
float CylCockDiaIN = 0.5f; // Steam Cylinder Cock orifice size
548547
float CylCockPressReduceFactor; // Factor to reduce cylinder pressure by if cocks open
@@ -2170,6 +2169,7 @@ public override void Update(float elapsedClockSeconds)
21702169
TractiveForceN = 0; // reset tractiveforceN in preparation to calculating a new value
21712170
MotiveForceN = 0;
21722171
CylinderSteamUsageLBpS = 0;
2172+
CylCockSteamUsageLBpS = 0;
21732173

21742174
for (int i = 0; i < SteamEngines.Count; i++)
21752175
{
@@ -2227,6 +2227,7 @@ public override void Update(float elapsedClockSeconds)
22272227
BoilerHeatOutBTUpS += SteamEngines[i].CylinderSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB);
22282228
CumulativeCylinderSteamConsumptionLbs += SteamEngines[i].CylinderSteamUsageLBpS * elapsedClockSeconds;
22292229
CylinderSteamUsageLBpS += SteamEngines[i].CylinderSteamUsageLBpS;
2230+
CylCockSteamUsageLBpS += SteamEngines[i].CylCockSteamUsageLBpS;
22302231

22312232
SteamEngines[i].MeanEffectivePressurePSI = MeanEffectivePressurePSI;
22322233

@@ -3947,7 +3948,7 @@ private void UpdateSuperHeat()
39473948

39483949
}
39493950

3950-
private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cutoff, float absSpeedMpS, int numberofengine)
3951+
private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cutoff, float absSpeedMpS, int numberofengine)
39513952
{
39523953
// Calculate speed of locomotive in wheel rpm - used to determine changes in performance based upon speed.
39533954
DrvWheelRevRpS = absSpeedMpS / (2.0f * MathHelper.Pi * SteamEngines[numberofengine].AttachedAxle.WheelRadiusM);
@@ -4878,6 +4879,22 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
48784879

48794880
if (CylinderCocksAreOpen) // Don't apply steam cocks derate until Cylinder steam usage starts to work
48804881
{
4882+
// The cock steam usage will be assumed equivalent to a steam orifice - it is initially updated ,and then recalculated again
4883+
// Steam Flow (lb/hr) = 24.24 x Press(Cylinder + Atmosphere(psi)) x CockDia^2 (in) - this needs to be multiplied by Num Cyls
4884+
4885+
if (throttle > 0.00 && absSpeedMpS > 0.1) // if regulator open & train moving
4886+
{
4887+
SteamEngines[numberofengine].CylCockSteamUsageLBpS = pS.FrompH(SteamEngines[numberofengine].NumberCylinders * (24.24f * (CylinderCocksPressureAtmPSI) * CylCockDiaIN * CylCockDiaIN));
4888+
}
4889+
else if (throttle > 0.00 && absSpeedMpS <= 0.1) // if regulator open and train stationary
4890+
{
4891+
SteamEngines[numberofengine].CylCockSteamUsageLBpS = pS.FrompH(SteamEngines[numberofengine].NumberCylinders * (24.24f * (SteamEngines[numberofengine].Pressure_b_AtmPSI) * CylCockDiaIN * CylCockDiaIN));
4892+
}
4893+
else
4894+
{
4895+
4896+
}
4897+
48814898
if (HasSuperheater) // Superheated locomotive
48824899
{
48834900
CylCockPressReduceFactor = ((SteamEngines[numberofengine].CylinderSteamUsageLBpS / SuperheaterSteamUsageFactor) / ((SteamEngines[numberofengine].CylinderSteamUsageLBpS / SuperheaterSteamUsageFactor) + SteamEngines[numberofengine].CylCockSteamUsageLBpS)); // For superheated locomotives temp convert back to a saturated comparison for calculation of steam cock reduction factor.
@@ -5202,7 +5219,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
52025219
else if (CylinderExhaustOpenFactor > forwardCylinderPosition) // pressure will be in expansion section of cylinder
52035220
{
52045221
// In section of cylinder between cutoff and release, pressure follows a PV variation.
5205-
forwardCylinderPressure = (slipCutoffPressureAtmPSI) * (cutoff + CylinderClearancePC) / (forwardCylinderPosition + CylinderClearancePC);
5222+
forwardCylinderPressure = (slipCutoffPressureAtmPSI) * (slipcutoff + CylinderClearancePC) / (forwardCylinderPosition + CylinderClearancePC);
52065223
// Check factor to calculate volume of cylinder for new volume at exhaust
52075224
}
52085225
else // Pressure will be in the exhaust section of the cylinder
@@ -5349,6 +5366,8 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
53495366
{
53505367
totalDrvWeightN += N.FromLbf(excessBalanceForcelbf - verticalThrustForcelbf);
53515368
}
5369+
5370+
// Trace.TraceInformation("Excess {0} Vertical {1}", excessBalanceForcelbf, verticalThrustForcelbf);
53525371
}
53535372

53545373
SteamEngines[numberofengine].AttachedAxle.AxleWeightN = totalDrvWeightN + 9.81f * SteamEngines[numberofengine].AttachedAxle.WheelWeightKg;
@@ -5691,35 +5710,18 @@ private void UpdateAuxiliaries(float elapsedClockSeconds, float absSpeedMpS)
56915710
VacuumPumpChargingRateInHgpS = 0.0f;
56925711
}
56935712
}
5694-
56955713
}
56965714

5697-
// Calculate cylinder cock steam Usage if turned on
5698-
// The cock steam usage will be assumed equivalent to a steam orifice
5699-
// Steam Flow (lb/hr) = 24.24 x Press(Cylinder + Atmosphere(psi)) x CockDia^2 (in) - this needs to be multiplied by Num Cyls
5715+
// Calculate cylinder cock steam Usage impact if turned on
5716+
57005717
if (CylinderCocksAreOpen == true)
57015718
{
5702-
if (throttle > 0.00 && absSpeedMpS > 0.1) // if regulator open & train moving
5703-
{
5704-
CylCockSteamUsageLBpS = pS.FrompH(MSTSNumCylinders * (24.24f * (CylinderCocksPressureAtmPSI) * CylCockDiaIN * CylCockDiaIN));
5705-
BoilerMassLB -= elapsedClockSeconds * CylCockSteamUsageLBpS; // Reduce boiler mass to reflect steam usage by cylinder steam cocks
5706-
BoilerHeatBTU -= elapsedClockSeconds * CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5707-
BoilerHeatOutBTUpS += CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5708-
CylCockBoilerHeatOutBTUpS = CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5709-
TotalSteamUsageLBpS += CylCockSteamUsageLBpS;
5710-
CylCockSteamUsageDisplayLBpS = CylCockSteamUsageLBpS;
5711-
}
5712-
else if (throttle > 0.00 && absSpeedMpS <= 0.1) // if regulator open and train stationary
5713-
{
5714-
CylCockSteamUsageLBpS = 0.0f; // set usage to zero if regulator closed
5715-
CylCockSteamUsageLBpS = pS.FrompH(MSTSNumCylinders * (24.24f * (CylinderCocksPressureAtmPSI) * CylCockDiaIN * CylCockDiaIN));
5716-
BoilerMassLB -= elapsedClockSeconds * CylCockSteamUsageStatLBpS; // Reduce boiler mass to reflect steam usage by cylinder steam cocks
5717-
BoilerHeatBTU -= elapsedClockSeconds * CylCockSteamUsageStatLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5718-
BoilerHeatOutBTUpS += CylCockSteamUsageStatLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5719-
CylCockBoilerHeatOutBTUpS = CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5720-
TotalSteamUsageLBpS += CylCockSteamUsageStatLBpS;
5721-
CylCockSteamUsageDisplayLBpS = CylCockSteamUsageStatLBpS;
5722-
}
5719+
BoilerMassLB -= elapsedClockSeconds * CylCockSteamUsageLBpS; // Reduce boiler mass to reflect steam usage by cylinder steam cocks
5720+
BoilerHeatBTU -= elapsedClockSeconds * CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5721+
BoilerHeatOutBTUpS += CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5722+
CylCockBoilerHeatOutBTUpS = CylCockSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by cylinder steam cocks
5723+
TotalSteamUsageLBpS += CylCockSteamUsageLBpS;
5724+
CylCockSteamUsageDisplayLBpS = CylCockSteamUsageLBpS;
57235725
}
57245726
else
57255727
{

0 commit comments

Comments
 (0)