Skip to content

Commit b49a693

Browse files
committed
Adjust back pressure operation
1 parent b191a54 commit b49a693

File tree

4 files changed

+48
-62
lines changed

4 files changed

+48
-62
lines changed

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public enum CABViewControlTypes
140140
WATER_INJECTOR1,
141141
WATER_INJECTOR2,
142142
SMALL_EJECTOR,
143+
BACK_PR,
143144
STEAM_PR,
144145
STEAMCHEST_PR,
145146
TENDER_WATER,

Source/Orts.Simulation/Common/SteamTable.cs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,31 +1088,6 @@ public static Interpolator LiveSteamInjectorWaterFedForSteamUsedAtPressureInterp
10881088
1.0f, 1.0f, 1.0f, 0.988f, 0.965f, 0.912f, 0.859f, 0.800f, 0.753f, 0.706f, 0.659f, 0.612f, 0.571f, 0.535f, 0.500f, 0.471f, 0.447f, 0.433f, 0.424f, 0.420f, 0.410f, 0.410f
10891089
};
10901090

1091-
// Indicated HorsePower -
1092-
static float[] IndicatedHorsepowerIHP = new float[]
1093-
{
1094-
0.0f, 200.0f, 500.0f, 1000.0f, 1250.0f, 1500.0f, 1750.0f, 2000.0f, 2500.0f, 3000.0f,
1095-
3500.0f, 4000.0f, 4500.0f, 5000.0f, 5500.0f, 6000.0f, 6500.0f, 7000.0f, 7500.0f
1096-
};
1097-
1098-
// BackPressure - Saturated locomotive - Ref Principles of Locomotive Operation and Train Operation - Fig 73 - pg 178 - Assume atmospheric -
1099-
// extrapolated beyond 1800IHP with test results from PRR Test reports
1100-
//
1101-
static float[] BackPressureSatPSI = new float[]
1102-
{
1103-
1.0f, 1.5f, 2.0f, 3.0f, 3.75f, 4.5f, 5.6f, 7.0f, 10.0f, 12.8f,
1104-
15.5f, 18.5f, 22.0f, 26.0f, 30.0f, 35.0f, 40.0f, 45.0f, 50.0f
1105-
};
1106-
1107-
// BackPressure - Superheated locomotive - Ref Principles of Locomotive Operation and Train Operation - Fig 73 - pg 178 - Assume atmospheric
1108-
// extrapolated beyond 1800IHP with test results from PRR Test reports
1109-
//
1110-
static float[] BackPressureSuperPSI = new float[]
1111-
{
1112-
0.0f, 0.25f, 0.5f, 1.0f, 1.5f, 2.0f,2.5f, 2.8f, 3.5f,4.5f,
1113-
6.0f, 7.5f, 10.0f, 14.0f, 18.0f, 25.0f, 30.0f , 35.0f, 40.0f
1114-
};
1115-
11161091
// Indicator Diagram - Cylinder Events
11171092

11181093
// Indicator Diagram Event - Exhaust Open - Perwall program - http://5at.co.uk/index.php/references-and-links/software.html
@@ -1145,19 +1120,6 @@ public static Interpolator SuperheatTempLimitInterpolatorXtoDegF()
11451120
return new Interpolator(CutOffFractionTableX, SuperheatCondenstationLimitTableDegF);
11461121
}
11471122

1148-
// Saturated Backpressure - Ref Principles of Locomotive Operation
1149-
public static Interpolator BackpressureSatIHPtoPSI()
1150-
{
1151-
return new Interpolator(IndicatedHorsepowerIHP, BackPressureSatPSI);
1152-
}
1153-
1154-
// Superheated Backpressure - Ref Principles of Locomotive Operation
1155-
public static Interpolator BackpressureSuperIHPtoPSI()
1156-
{
1157-
return new Interpolator(IndicatedHorsepowerIHP, BackPressureSuperPSI);
1158-
}
1159-
1160-
11611123
// Saturated Speed factor - ie drop in TE as speed increases due to piston impacts - Ref American locomotive Company
11621124
public static Interpolator SaturatedSpeedFactorSpeedDropFtpMintoX()
11631125
{

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

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ public enum AuxiliarySteamEngineTypes
522522
/// </summary>
523523
public float CylinderSteamUsageLBpS;
524524

525+
/// <summary>
526+
/// Steam usage per steam engine per hour
527+
/// </summary>
528+
public float CylinderSteamUsageLBpH;
529+
525530
/// <summary>
526531
/// Steam usage per steam engine steam cocks
527532
/// </summary>

0 commit comments

Comments
 (0)