Skip to content

Commit d4acd11

Browse files
committed
Refactor Steam Tables
1 parent 23243be commit d4acd11

File tree

6 files changed

+654
-565
lines changed

6 files changed

+654
-565
lines changed

Source/Orts.Simulation/Common/SteamTable.cs

Lines changed: 460 additions & 451 deletions
Large diffs are not rendered by default.

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ public void UpdateCarSteamHeat(float elapsedClockSeconds)
24072407
car.CarHeatCompartmentPipeAreaM2 = CarCompartmentPipeAreaM2 + CarDoorPipeAreaM2;
24082408

24092409
// Pipe convection heat produced - steam is reduced to atmospheric pressure when it is injected into compartment
2410-
float CompartmentSteamPipeTempC = C.FromF(mstsLocomotive.SteamHeatPressureToTemperaturePSItoF[0]);
2410+
float CompartmentSteamPipeTempC = C.FromF(mstsLocomotive.SaturatedSteamHeatPressureToTemperaturePSItoF[0]);
24112411
car.CarCompartmentSteamPipeHeatConvW = (PipeHeatTransCoeffWpM2K * car.CarHeatCompartmentPipeAreaM2 * (CompartmentSteamPipeTempC - car.CarInsideTempC));
24122412

24132413
// Pipe radiation heat produced
@@ -2426,7 +2426,7 @@ public void UpdateCarSteamHeat(float elapsedClockSeconds)
24262426
float HeatTransCoeffConnectHoseBTUpFt2pHrpF = 0.04f * car.ConvectionFactor; // rubber connecting hoses - BTU / sq.ft. / hr / l in / °F. TO BE CHECKED
24272427

24282428
// Calculate Length of carriage and heat loss in main steam pipe
2429-
float CarMainSteamPipeTempF = mstsLocomotive.SteamHeatPressureToTemperaturePSItoF[car.CarSteamHeatMainPipeSteamPressurePSI];
2429+
float CarMainSteamPipeTempF = mstsLocomotive.SaturatedSteamHeatPressureToTemperaturePSItoF[car.CarSteamHeatMainPipeSteamPressurePSI];
24302430
car.CarHeatSteamMainPipeHeatLossBTU = Me.ToFt(car.CarLengthM) * (MathHelper.Pi * Me.ToFt(car.MainSteamHeatPipeOuterDiaM)) * HeatTransCoeffMainPipeBTUpFt2pHrpF * (CarMainSteamPipeTempF - C.ToF(car.CarOutsideTempC));
24312431

24322432
// calculate steam connecting hoses heat loss - assume 1.5" hose
@@ -2474,7 +2474,7 @@ public void UpdateCarSteamHeat(float elapsedClockSeconds)
24742474
}
24752475

24762476
// Calculate steam flow rates and steam used
2477-
SteamFlowRateLbpHr = (ProgressiveHeatAlongTrainBTU / mstsLocomotive.SteamHeatPSItoBTUpLB[mstsLocomotive.CurrentSteamHeatPressurePSI]) + pS.TopH(car.CarHeatSteamTrapUsageLBpS) + pS.TopH(car.CarHeatConnectingSteamHoseLeakageLBpS);
2477+
SteamFlowRateLbpHr = (ProgressiveHeatAlongTrainBTU / mstsLocomotive.SaturatedSteamHeatPSItoBTUpLB[mstsLocomotive.CurrentSteamHeatPressurePSI]) + pS.TopH(car.CarHeatSteamTrapUsageLBpS) + pS.TopH(car.CarHeatConnectingSteamHoseLeakageLBpS);
24782478
mstsLocomotive.CalculatedCarHeaterSteamUsageLBpS = pS.FrompH(SteamFlowRateLbpHr);
24792479

24802480
// Calculate Net steam heat loss or gain for each compartment in the car

Source/Orts.Simulation/Simulation/RollingStocks/MSTSDieselLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ public override string GetDebugStatus()
10321032
Simulator.Catalog.GetString("Press"),
10331033
FormatStrings.FormatPressure(CurrentSteamHeatPressurePSI, PressureUnit.PSI, MainPressureUnit, true),
10341034
Simulator.Catalog.GetString("StTemp"),
1035-
FormatStrings.FormatTemperature(C.FromF(SteamHeatPressureToTemperaturePSItoF[CurrentSteamHeatPressurePSI]), IsMetric, false),
1035+
FormatStrings.FormatTemperature(C.FromF(SaturatedSteamHeatPressureToTemperaturePSItoF[CurrentSteamHeatPressurePSI]), IsMetric, false),
10361036
Simulator.Catalog.GetString("StUse"),
10371037
FormatStrings.FormatMass(pS.TopH(Kg.FromLb(CalculatedCarHeaterSteamUsageLBpS)), IsMetric),
10381038
FormatStrings.h,

Source/Orts.Simulation/Simulation/RollingStocks/MSTSElectricLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public override string GetDebugStatus()
416416
Simulator.Catalog.GetString("Press"),
417417
FormatStrings.FormatPressure(CurrentSteamHeatPressurePSI, PressureUnit.PSI, MainPressureUnit, true),
418418
Simulator.Catalog.GetString("StTemp"),
419-
FormatStrings.FormatTemperature(C.FromF(SteamHeatPressureToTemperaturePSItoF[CurrentSteamHeatPressurePSI]), IsMetric, false),
419+
FormatStrings.FormatTemperature(C.FromF(SaturatedSteamHeatPressureToTemperaturePSItoF[CurrentSteamHeatPressurePSI]), IsMetric, false),
420420
Simulator.Catalog.GetString("StUse"),
421421
FormatStrings.FormatMass(pS.TopH(Kg.FromLb(CalculatedCarHeaterSteamUsageLBpS)), IsMetric),
422422
FormatStrings.h,

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ public float CurrentLocomotiveSteamHeatBoilerWaterCapacityL
226226

227227
// Carriage Steam Heating Parameters
228228
public float MaxSteamHeatPressurePSI; // Maximum Steam heating pressure
229-
public Interpolator SteamHeatPressureToTemperaturePSItoF;
229+
public Interpolator SaturatedSteamHeatPressureToTemperaturePSItoF;
230230
public Interpolator SteamDensityPSItoLBpFT3; // saturated steam density given pressure
231-
public Interpolator SteamHeatPSItoBTUpLB; // total heat in saturated steam given pressure
231+
public Interpolator SaturatedSteamHeatPSItoBTUpLB; // total heat in saturated steam given pressure
232232
public bool IsSteamHeatingBoilerFitted = false; // Flag to indicate when steam heat boiler van is fitted
233233
public float CalculatedCarHeaterSteamUsageLBpS;
234234

@@ -1580,9 +1580,9 @@ public override void Initialize()
15801580
IsSteamHeatFitted = true;
15811581
}
15821582

1583-
SteamHeatPressureToTemperaturePSItoF = SteamTable.SteamHeatPressureToTemperatureInterpolatorPSItoF();
1583+
SaturatedSteamHeatPressureToTemperaturePSItoF = SteamTable.SaturatedSteamHeatPressureToTemperatureInterpolatorPSItoF();
15841584
SteamDensityPSItoLBpFT3 = SteamTable.SteamDensityInterpolatorPSItoLBpFT3();
1585-
SteamHeatPSItoBTUpLB = SteamTable.SteamHeatInterpolatorPSItoBTUpLB();
1585+
SaturatedSteamHeatPSItoBTUpLB = SteamTable.SaturatedSteamHeatInterpolatorPSItoBTUpLB();
15861586

15871587
// Check to see if water scoop elements have been configured
15881588
if (WaterScoopFillElevationM == 0)

0 commit comments

Comments
 (0)