@@ -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