@@ -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
@@ -1018,6 +1020,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
10181020 case "engine(ortscylinderefficiencyrate": CylinderEfficiencyRate = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
10191021 case "engine(ortscylinderinitialpressuredrop": InitialPressureDropRatioRpMtoX = new Interpolator(stf); break;
10201022 case "engine(ortscylinderbackpressure": BackPressureIHPtoPSI = new Interpolator(stf); break;
1023+ case "engine(ortscylinderbackpressurevssteamoutput": BackPressuretoSteamOutput = new Interpolator(stf); break;
10211024 case "engine(ortsburnrate": NewBurnRateSteamToFuelLbspH = new Interpolator(stf); break;
10221025 case "engine(ortsboilerefficiency": BoilerEfficiencyGrateAreaLBpFT2toX = new Interpolator(stf); break;
10231026 case "engine(ortscylindereventexhaust": CylinderExhausttoCutoff = new Interpolator(stf); break;
@@ -1190,6 +1193,7 @@ public override void Copy(MSTSWagon copy)
11901193 CylinderEfficiencyRate = locoCopy.CylinderEfficiencyRate;
11911194 InitialPressureDropRatioRpMtoX = new Interpolator(locoCopy.InitialPressureDropRatioRpMtoX);
11921195 BackPressureIHPtoPSI = new Interpolator(locoCopy.BackPressureIHPtoPSI);
1196+ BackPressuretoSteamOutput = new Interpolator(locoCopy.BackPressuretoSteamOutput);
11931197 NewBurnRateSteamToFuelLbspH = new Interpolator(locoCopy.NewBurnRateSteamToFuelLbspH);
11941198 BoilerEfficiency = locoCopy.BoilerEfficiency;
11951199 SteamGearRatioLow = locoCopy.SteamGearRatioLow;
@@ -2101,22 +2105,31 @@ public override void Initialize()
21012105 // Assign default steam table values if table not in ENG file
21022106 // Back pressure increases with the speed of the locomotive, as cylinder finds it harder to exhaust all the steam.
21032107
2104- if (BackPressureIHPtoPSI = = null)
2108+ if (BackPressureIHPtoPSI ! = null)
21052109 {
2106- if (HasSuperheater)
2107- {
2108- BackPressureIHPtoPSI = SteamTable.BackpressureSuperIHPtoPSI();
2109- if (Simulator.Settings.VerboseConfigurationMessages)
2110- Trace.TraceInformation("BackPressureIHPtoAtmPSI (Superheated) - default information read from SteamTables");
2111- }
2112- else
2113- {
2114- BackPressureIHPtoPSI = SteamTable.BackpressureSatIHPtoPSI();
2115- if (Simulator.Settings.VerboseConfigurationMessages)
2116- Trace.TraceInformation("BackPressureIHPtoAtmPSI (Saturated) - default information read from SteamTables");
2117- }
2110+ if (Simulator.Settings.VerboseConfigurationMessages)
2111+ 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.");
21182112 }
21192113
2114+ // if no user input provided then assign default values
2115+ if (BackPressuretoSteamOutput == null)
2116+ {
2117+ float tempMaxBackPressurePSI = 0.0002762f * pS.TopH(TheoreticalMaxSteamOutputLBpS);
2118+
2119+ // Create a new default back pressure table based upon default information
2120+ float[] TempSteamOutputRate = new float[]
2121+ {
2122+ 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)
2123+ };
2124+
2125+ float[] TempBackPressure = new float[]
2126+ {
2127+ 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)
2128+ };
2129+
2130+ BackPressuretoSteamOutput = new Interpolator(TempSteamOutputRate, TempBackPressure);
2131+ }
2132+
21202133 // Confirm Injector type
21212134 if (Injector1Type == "Unknown" )
21222135 {
@@ -2199,7 +2212,7 @@ public override void Initialize()
21992212 }
22002213
22012214 var RefFeedwaterTempF = 65.0f;
2202- var maxExhaustPressure = BackPressureIHPtoPSI[maxIndicatedHorsePowerTemp ];
2215+ var maxExhaustPressure = BackPressuretoSteamOutput[pS.TopH(TheoreticalMaxSteamOutputLBpS) ];
22032216
22042217 if (ActualInjector1NozzleSizeMM == 0)
22052218 {
@@ -3073,6 +3086,7 @@ public override void Update(float elapsedClockSeconds)
30733086 // Steam Flow (lb/hr) = 24.24 x Press(BoilerPressure + Atmosphere(psi)) x ChokeDia^2 (in) - this needs to be multiplied by Num Cyls
30743087 SteamBoosterPressurePSI = (BoilerPressurePSI + OneAtmospherePSI) * BoosterPressureFactor;
30753088 SteamEngines[i].CylinderSteamUsageLBpS = pS.FrompH(SteamEngines[i].NumberCylinders * (24.24f * (SteamBoosterPressurePSI) * BoosterIdleChokeSizeIn * BoosterIdleChokeSizeIn));
3089+ SteamEngines[i].CylinderSteamUsageLBpH = pS.TopH(SteamEngines[i].CylinderSteamUsageLBpS);
30763090 HuDBoosterSteamConsumptionLbpS = SteamEngines[i].CylinderSteamUsageLBpS;
30773091
30783092 }
@@ -5439,14 +5453,14 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
54395453 // (d) - Exhaust (Back) Pressure (For LP equates to point m)
54405454 // LP Cylinder
54415455 // Cylinder back pressure will be decreased depending upon locomotive speed
5442- SteamEngines[numberofengine].LPPressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5456+ SteamEngines[numberofengine].LPPressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
54435457
54445458 SteamEngines[numberofengine].LogLPBackPressurePSI = SteamEngines[numberofengine].LPPressure_d_AtmPSI - OneAtmospherePSI; // Value for recording in log file
54455459 SteamEngines[numberofengine].LogLPBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogLPBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogLPBackPressurePSI); // Clamp so that LP Back pressure does not go negative
54465460
54475461 // HP Cylinder
54485462
5449- SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5463+ SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
54505464
54515465 SteamEngines[numberofengine].LogBackPressurePSI = SteamEngines[numberofengine].Pressure_d_AtmPSI - OneAtmospherePSI; // Value for log file
54525466 SteamEngines[numberofengine].LogBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogBackPressurePSI); // Clamp so that Back pressure does not go negative
@@ -5729,7 +5743,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
57295743
57305744 // (m) - LP exhaust pressure
57315745 // LP Cylinder back pressure will be increased depending upon locomotive speed
5732- SteamEngines[numberofengine].LPCompPressure_m_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
5746+ SteamEngines[numberofengine].LPCompPressure_m_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
57335747
57345748 SteamEngines[numberofengine].LogLPBackPressurePSI = SteamEngines[numberofengine].LPCompPressure_m_AtmPSI - OneAtmospherePSI; // Value for recording in log file
57355749 SteamEngines[numberofengine].LogLPBackPressurePSI = MathHelper.Clamp(SteamEngines[numberofengine].LogLPBackPressurePSI, 0.00f, SteamEngines[numberofengine].LogLPBackPressurePSI); // Clamp so that LP Back pressure does not go negative
@@ -6056,7 +6070,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
60566070
60576071
60586072 // (d) - Back Pressure
6059- SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressureIHPtoPSI [SteamEngines[numberofengine].IndicatedHorsePowerHP ] + OneAtmospherePSI;
6073+ SteamEngines[numberofengine].Pressure_d_AtmPSI = BackPressuretoSteamOutput [SteamEngines[numberofengine].CylinderSteamUsageLBpH ] + OneAtmospherePSI;
60606074
60616075 if (throttle < 0.02f)
60626076 {
@@ -6376,6 +6390,7 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
63766390 // usage calculated as moving average to minimize chance of oscillation.
63776391 // Decrease steam usage by SuperheaterUsage factor to model superheater - very crude model - to be improved upon
63786392 SteamEngines[numberofengine].CylinderSteamUsageLBpS = (0.6f * SteamEngines[numberofengine].CylinderSteamUsageLBpS + 0.4f * CalculatedCylinderSteamUsageLBpS);
6393+ SteamEngines[numberofengine].CylinderSteamUsageLBpH = pS.TopH(SteamEngines[numberofengine].CylinderSteamUsageLBpS);
63796394 MeanEffectivePressurePSI = SteamEngines[numberofengine].MeanEffectivePressurePSI; // for display purposes
63806395
63816396 SteamReleasePressure_AtmPSI = SteamEngines[numberofengine].Pressure_c_AtmPSI; // for steam and smoke effects
@@ -7537,9 +7552,9 @@ private void UpdateWaterInjection(float elapsedClockSeconds)
75377552 }
75387553 else // Exhaust steam injector
75397554 {
7540- if (throttle > 0.01 && BackPressureIHPtoPSI[IndicatedHorsePowerHP ] > 1)
7555+ if (throttle > 0.01 && BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ] > 1)
75417556 {
7542- Injector1CorrectedPressurePSI = BackPressureIHPtoPSI[IndicatedHorsePowerHP ];
7557+ Injector1CorrectedPressurePSI = BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ];
75437558 ActualInjector1FlowRateLBpS = Injector1Fraction * Injector1NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMaximaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector1CorrectedPressurePSI));
75447559 Inj1MinimaFlowRateLBpS = Injector1Fraction * Injector1NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMinimaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector1CorrectedPressurePSI));
75457560
@@ -7635,9 +7650,9 @@ private void UpdateWaterInjection(float elapsedClockSeconds)
76357650 }
76367651 else // Exhaust steam injector
76377652 {
7638- if (throttle > 0.01 && BackPressureIHPtoPSI[IndicatedHorsePowerHP ] > 1)
7653+ if (throttle > 0.01 && BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ] > 1)
76397654 {
7640- Injector2CorrectedPressurePSI = BackPressureIHPtoPSI[IndicatedHorsePowerHP ];
7655+ Injector2CorrectedPressurePSI = BackPressuretoSteamOutput[pS.TopH(CylinderSteamUsageLBpS) ];
76417656 ActualInjector2FlowRateLBpS = Injector2Fraction * Injector2NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMaximaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector2CorrectedPressurePSI));
76427657 Inj2MinimaFlowRateLBpS = Injector2Fraction * Injector2NozzleCorrectionFactor * pS.FrompH(ExhaustSteamInjectorMinimaWaterDeliveryLBatPSIandF.Get(tenderTemperatureF, Injector2CorrectedPressurePSI));
76437658
@@ -8101,6 +8116,9 @@ public override float GetDataOf(CabViewControl cvc)
81018116 case CABViewControlTypes.STEAM_PR:
81028117 data = ConvertFromPSI(cvc, BoilerPressurePSI);
81038118 break;
8119+ case CABViewControlTypes.BACK_PR:
8120+ data = ConvertFromPSI(cvc, -1 * BackPressuretoSteamOutput[CylinderSteamUsageLBpH]);
8121+ break;
81048122 case CABViewControlTypes.STEAMCHEST_PR:
81058123 data = ConvertFromPSI(cvc, CabSteamChestPressurePSI);
81068124 break;
0 commit comments