@@ -294,6 +294,7 @@ public class MSTSSteamLocomotive : MSTSLocomotive
294294 float FuelFeedRateKGpS;
295295 float DesiredChange; // Amount of change to increase fire mass, clamped to range 0.0 - 1.0
296296 public float CylinderSteamUsageLBpS;
297+ public float CylinderSteamUsageLBpH;
297298 public float NewCylinderSteamUsageLBpS;
298299 public float BlowerSteamUsageLBpS;
299300 public float FuelOilHeatingSteamUsageLbpS;
@@ -405,7 +406,8 @@ public class MSTSSteamLocomotive : MSTSLocomotive
405406 float LPCylinderSweptVolumeFT3pFT; // Volume of LP steam Cylinder
406407 float CylinderCondensationFactor; // Cylinder compensation factor for condensation in cylinder due to cutoff
407408 float BlowerSteamUsageFactor;
408- Interpolator BackPressureIHPtoPSI; // back pressure in cylinders given usage
409+ Interpolator BackPressureIHPtoPSI; // back pressure in cylinders given usage - this value needs to be deprerecated
410+ Interpolator BackPressuretoSteamOutput; // back pressure in cylinders given steam usage
409411 Interpolator CylinderSteamDensityPSItoLBpFT3; // steam density in cylinders given pressure (could be super heated)
410412 Interpolator WaterDensityPSItoLBpFT3; // water density given pressure
411413 Interpolator WaterHeatPSItoBTUpLB; // total heat in water given pressure
@@ -1038,6 +1040,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
10381040 case "engine(ortscylinderefficiencyrate": CylinderEfficiencyRate = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
10391041 case "engine(ortscylinderinitialpressuredrop": InitialPressureDropRatioRpMtoX = new Interpolator(stf); break;
10401042 case "engine(ortscylinderbackpressure": BackPressureIHPtoPSI = new Interpolator(stf); break;
1043+ case "engine(ortscylinderbackpressurevssteamoutput": BackPressuretoSteamOutput = new Interpolator(stf); break;
10411044 case "engine(ortsburnrate": NewBurnRateSteamToFuelLbspH = new Interpolator(stf); break;
10421045 case "engine(ortsboilerefficiency": BoilerEfficiencyGrateAreaLBpFT2toX = new Interpolator(stf); break;
10431046 case "engine(ortscylindereventexhaust": CylinderExhausttoCutoff = new Interpolator(stf); break;
@@ -1210,6 +1213,7 @@ public override void Copy(MSTSWagon copy)
12101213 CylinderEfficiencyRate = locoCopy.CylinderEfficiencyRate;
12111214 InitialPressureDropRatioRpMtoX = new Interpolator(locoCopy.InitialPressureDropRatioRpMtoX);
12121215 BackPressureIHPtoPSI = new Interpolator(locoCopy.BackPressureIHPtoPSI);
1216+ BackPressuretoSteamOutput = new Interpolator(locoCopy.BackPressuretoSteamOutput);
12131217 NewBurnRateSteamToFuelLbspH = new Interpolator(locoCopy.NewBurnRateSteamToFuelLbspH);
12141218 BoilerEfficiency = locoCopy.BoilerEfficiency;
12151219 SteamGearRatioLow = locoCopy.SteamGearRatioLow;
@@ -2092,22 +2096,31 @@ public override void Initialize()
20922096 // Assign default steam table values if table not in ENG file
20932097 // Back pressure increases with the speed of the locomotive, as cylinder finds it harder to exhaust all the steam.
20942098
2095- if (BackPressureIHPtoPSI = = null)
2099+ if (BackPressureIHPtoPSI ! = null)
20962100 {
2097- if (HasSuperheater)
2098- {
2099- BackPressureIHPtoPSI = SteamTable.BackpressureSuperIHPtoPSI();
2100- if (Simulator.Settings.VerboseConfigurationMessages)
2101- Trace.TraceInformation("BackPressureIHPtoAtmPSI (Superheated) - default information read from SteamTables");
2102- }
2103- else
2104- {
2105- BackPressureIHPtoPSI = SteamTable.BackpressureSatIHPtoPSI();
2106- if (Simulator.Settings.VerboseConfigurationMessages)
2107- Trace.TraceInformation("BackPressureIHPtoAtmPSI (Saturated) - default information read from SteamTables");
2108- }
2101+ if (Simulator.Settings.VerboseConfigurationMessages)
2102+ Trace.TraceInformation("ORTSCylinderBackPressure read. This is an inaccurate and depreceated value. It is thereofre suggested that either the OR default value is used (leave the ORTSCylinderBackPressure out) or use ORTSCylinderBackPressureVsSteamoutput instead.");
21092103 }
21102104
2105+ // if no user input provided then assign default values
2106+ if (BackPressuretoSteamOutput == null)
2107+ {
2108+ float tempMaxBackPressurePSI = 0.0002762f * pS.TopH(TheoreticalMaxSteamOutputLBpS);
2109+
2110+ // Create a new default back pressure table based upon default information
2111+ float[] TempSteamOutputRate = new float[]
2112+ {
2113+ 0.0f, pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.1f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.2f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.3f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.4f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.5f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.6f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.7f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.8f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 0.9f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 1.0f), pS.TopH(TheoreticalMaxSteamOutputLBpS * 1.1f)
2114+ };
2115+
2116+ float[] TempBackPressure = new float[]
2117+ {
2118+ 0.0f, tempMaxBackPressurePSI* (float)Math.Pow(0.1f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.2f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.3f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.4f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.5f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.6f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.7f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.8f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(0.9f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(1.0f, 2.0f), tempMaxBackPressurePSI* (float)Math.Pow(1.1f, 2.0f)
2119+ };
2120+
2121+ BackPressuretoSteamOutput = new Interpolator(TempSteamOutputRate, TempBackPressure);
2122+ }
2123+
21112124 // Confirm Injector type
21122125 if (Injector1Type == "Unknown" )
21132126 {
@@ -2190,7 +2203,7 @@ public override void Initialize()
21902203 }
21912204
21922205 var RefFeedwaterTempF = 65.0f;
2193- var maxExhaustPressure = BackPressureIHPtoPSI[maxIndicatedHorsePowerTemp ];
2206+ var maxExhaustPressure = BackPressuretoSteamOutput[pS.TopH(TheoreticalMaxSteamOutputLBpS) ];
21942207
21952208 if (ActualInjector1NozzleSizeMM == 0)
21962209 {
@@ -3062,6 +3075,7 @@ public override void Update(float elapsedClockSeconds)
30623075 // Steam Flow (lb/hr) = 24.24 x Press(BoilerPressure + Atmosphere(psi)) x ChokeDia^2 (in) - this needs to be multiplied by Num Cyls
30633076 SteamBoosterPressurePSI = (BoilerPressurePSI + OneAtmospherePSI) * BoosterPressureFactor;
30643077 SteamEngines[i].CylinderSteamUsageLBpS = pS.FrompH(SteamEngines[i].NumberCylinders * (24.24f * (SteamBoosterPressurePSI) * BoosterIdleChokeSizeIn * BoosterIdleChokeSizeIn));
3078+ SteamEngines[i].CylinderSteamUsageLBpH = pS.TopH(SteamEngines[i].CylinderSteamUsageLBpS);
30653079 HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
30663080
30673081 }
@@ -5484,14 +5498,14 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
54845498 // (d) - Exhaust (Back) Pressure (For LP equates to point m)
54855499 // LP Cylinder
54865500 // Cylinder back pressure will be decreased depending upon locomotive speed
5487- SteamEngines[numberofengine].LPPressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5501+ SteamEngines[numberofengine].LPPressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
54885502
54895503 SteamEngines[numberofengine].LogLPBackPressurePSI = SteamEngines[numberofengine].LPPressure_d_AtmPSI - OneAtmospherePSI; // Value for recording in log file
54905504 SteamEngines[numberofengine].LogLPBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogLPBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogLPBackPressurePSI); // Clamp so that LP Back pressure does not go negative
54915505
54925506 // HP Cylinder
54935507
5494- SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5508+ SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
54955509
54965510 SteamEngines[numberofengine].LogBackPressurePSI = SteamEngines[numberofengine].Pressure_d_AtmPSI - OneAtmospherePSI; // Value for log file
54975511 SteamEngines[numberofengine].LogBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogBackPressurePSI); // Clamp so that Back pressure does not go negative
@@ -5774,7 +5788,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
57745788
57755789 // (m) - LP exhaust pressure
57765790 // LP Cylinder back pressure will be increased depending upon locomotive speed
5777- SteamEngines[numberofengine].LPCompPressure_m_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5791+ SteamEngines[numberofengine].LPCompPressure_m_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
57785792
57795793 SteamEngines[numberofengine].LogLPBackPressurePSI = SteamEngines[numberofengine].LPCompPressure_m_AtmPSI - OneAtmospherePSI; // Value for recording in log file
57805794 SteamEngines[numberofengine].LogLPBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogLPBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogLPBackPressurePSI); // Clamp so that LP Back pressure does not go negative
@@ -6101,7 +6115,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
61016115
61026116
61036117 // (d) - Back Pressure
6104- SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
6118+ SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
61056119
61066120 if (throttle < 0.02f)
61076121 {
@@ -6421,7 +6435,8 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
64216435 // usage calculated as moving average to minimize chance of oscillation.
64226436 // Decrease steam usage by SuperheaterUsage factor to model superheater - very crude model - to be improved upon
64236437 SteamEngines[numberofengine].CylinderSteamUsageLBpS = (0.6f * SteamEngines[numberofengine].CylinderSteamUsageLBpS + 0.4f * CalculatedCylinderSteamUsageLBpS);
6424- MeanEffectivePressurePSI = SteamEngines[numberofengine].MeanEffectivePressurePSI; // for display purposes
6438+ SteamEngines[numberofengine].CylinderSteamUsageLBpH = pS.TopH(SteamEngines[numberofengine].CylinderSteamUsageLBpS);
6439+ MeanEffectivePressurePSI = SteamEngines[numberofengine].MeanEffectivePressurePSI; // for display purposes
64256440
64266441 SteamReleasePressure_AtmPSI = SteamEngines[numberofengine].Pressure_c_AtmPSI; // for steam and smoke effects
64276442
@@ -7641,9 +7656,9 @@ private void UpdateWaterInjection(float elapsedClockSeconds)
76417656 }
76427657 else // Exhaust steam injector
76437658 {
7644- if (throttle > 0.01 && BackPressureIHPtoPSI[IndicatedHorsePowerHP ] > 1)
7659+ if (throttle > 0.01 && BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ] > 1)
76457660 {
7646- Injector1CorrectedPressurePSI = BackPressureIHPtoPSI[IndicatedHorsePowerHP ];
7661+ Injector1CorrectedPressurePSI = BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ];
76477662 ActualInjector1FlowRateLBpS = Injector1Fraction * Injector1NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMaximaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector1CorrectedPressurePSI));
76487663 Inj1MinimaFlowRateLBpS = Injector1Fraction * Injector1NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMinimaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector1CorrectedPressurePSI));
76497664
@@ -7739,9 +7754,9 @@ private void UpdateWaterInjection(float elapsedClockSeconds)
77397754 }
77407755 else // Exhaust steam injector
77417756 {
7742- if (throttle > 0.01 && BackPressureIHPtoPSI[IndicatedHorsePowerHP ] > 1)
7757+ if (throttle > 0.01 && BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ] > 1)
77437758 {
7744- Injector2CorrectedPressurePSI = BackPressureIHPtoPSI[IndicatedHorsePowerHP ];
7759+ Injector2CorrectedPressurePSI = BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ];
77457760 ActualInjector2FlowRateLBpS = Injector2Fraction * Injector2NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMaximaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector2CorrectedPressurePSI));
77467761 Inj2MinimaFlowRateLBpS = Injector2Fraction * Injector2NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMinimaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector2CorrectedPressurePSI));
77477762
@@ -8205,6 +8220,9 @@ public override float GetDataOf(CabViewControl cvc)
82058220 case CABViewControlTypes.STEAM_PR:
82068221 data = ConvertFromPSI(cvc, BoilerPressurePSI);
82078222 break;
8223+ case CABViewControlTypes.BACK_PR:
8224+ data = ConvertFromPSI(cvc, -1 * BackPressuretoSteamOutput[CylinderSteamUsageLBpH]);
8225+ break;
82088226 case CABViewControlTypes.STEAMCHEST_PR:
82098227 data = ConvertFromPSI(cvc, CabSteamChestPressurePSI);
82108228 break;
0 commit comments