Skip to content

Commit 1307dc9

Browse files
committed
Add adhesion diagnostic information
1 parent f4df6f4 commit 1307dc9

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

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

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ public override void LoadFromWagFile(string wagFilePath)
308308
// Check force assumptions set for diesel
309309
if (Simulator.Settings.VerboseConfigurationMessages)
310310
{
311-
311+
float CalculatedMaxContinuousForceN = 0;
312312
float ThrottleSetting = 1.0f; // Must be at full throttle for these calculations
313313
if (TractiveForceCurves == null) // Basic configuration - ie no force and Power tables, etc
314314
{
315-
float CalculatedMaxContinuousForceN = ThrottleSetting * LocomotiveMaxRailOutputPowerW / SpeedOfMaxContinuousForceMpS;
315+
CalculatedMaxContinuousForceN = ThrottleSetting * LocomotiveMaxRailOutputPowerW / SpeedOfMaxContinuousForceMpS;
316316
Trace.TraceInformation("Diesel Force Settings (BASIC Config): Max Starting Force {0}, Calculated Max Continuous Force {1} @ speed of {2}", FormatStrings.FormatForce(MaxForceN, IsMetric), FormatStrings.FormatForce(CalculatedMaxContinuousForceN, IsMetric), FormatStrings.FormatSpeedDisplay(SpeedOfMaxContinuousForceMpS, IsMetric));
317317
Trace.TraceInformation("Diesel Power Settings (BASIC Config): Prime Mover {0}, Max Rail Output Power {1}", FormatStrings.FormatPower(MaximumDieselEnginePowerW, IsMetric, false, false), FormatStrings.FormatPower(LocomotiveMaxRailOutputPowerW, IsMetric, false, false));
318318

@@ -326,7 +326,7 @@ public override void LoadFromWagFile(string wagFilePath)
326326
{
327327
float StartingSpeedMpS = 0.1f; // Assumed starting speed for diesel - can't be zero otherwise error will occurr
328328
float StartingForceN = TractiveForceCurves.Get(ThrottleSetting, StartingSpeedMpS);
329-
float CalculatedMaxContinuousForceN = TractiveForceCurves.Get(ThrottleSetting, SpeedOfMaxContinuousForceMpS);
329+
CalculatedMaxContinuousForceN = TractiveForceCurves.Get(ThrottleSetting, SpeedOfMaxContinuousForceMpS);
330330
Trace.TraceInformation("Diesel Force Settings (ADVANCED Config): Max Starting Force {0} Calculated Max Continuous Force {1}, @ speed of {2}", FormatStrings.FormatForce(StartingForceN, IsMetric), FormatStrings.FormatForce(CalculatedMaxContinuousForceN, IsMetric), FormatStrings.FormatSpeedDisplay(SpeedOfMaxContinuousForceMpS, IsMetric));
331331
Trace.TraceInformation("Diesel Power Settings (ADVANCED Config): Prime Mover {0}, Max Rail Output Power {1} @ {2} rpm", FormatStrings.FormatPower(DieselEngines.MaxPowerW, IsMetric, false, false), FormatStrings.FormatPower(DieselEngines.MaximumRailOutputPowerW, IsMetric, false, false), MaxRPM);
332332

@@ -343,6 +343,20 @@ public override void LoadFromWagFile(string wagFilePath)
343343
Trace.TraceInformation("!!!! Warning: MaxPower {0} is less then continuous force calculated power {1} @ speed of {2}, please check !!!!", FormatStrings.FormatPower(MaxPowerW, IsMetric, false, false), FormatStrings.FormatPower(CalculatedContinuousPowerW, IsMetric, false, false), FormatStrings.FormatSpeedDisplay(SpeedOfMaxContinuousForceMpS, IsMetric));
344344
}
345345

346+
// Check Adhesion values
347+
var maxforcekN = MaxForceN / 1000.0f;
348+
var designadhesionzerospeed = maxforcekN / (Kg.ToTonne(DrvWheelWeightKg) * 10);
349+
var calculatedmaxcontinuousforcekN = CalculatedMaxContinuousForceN / 1000.0f;
350+
var designadhesionmaxcontspeed = calculatedmaxcontinuousforcekN / (Kg.ToTonne(DrvWheelWeightKg) * 10);
351+
var zerospeed = 0;
352+
var configuredadhesionzerospeed = (Curtius_KnifflerA / (zerospeed + Curtius_KnifflerB) + Curtius_KnifflerC);
353+
var configuredadhesionmaxcontinuousspeed = (Curtius_KnifflerA / (SpeedOfMaxContinuousForceMpS + Curtius_KnifflerB) + Curtius_KnifflerC);
354+
var dropoffspeed = CalculatedContinuousPowerW / (MaxForceN * 3.6f);
355+
var configuredadhesiondropoffspeed = (Curtius_KnifflerA / (dropoffspeed + Curtius_KnifflerB) + Curtius_KnifflerC);
356+
357+
Trace.TraceInformation("Apparent (Design) Adhesion: Zero - {0:N2} @ {1}, Max Continuous Speed - {2:N2} @ {3}, Drive Wheel Weight - {4}", designadhesionzerospeed, FormatStrings.FormatSpeedDisplay(zerospeed, IsMetric), designadhesionmaxcontspeed, FormatStrings.FormatSpeedDisplay(SpeedOfMaxContinuousForceMpS, IsMetric), FormatStrings.FormatMass(DrvWheelWeightKg, IsMetric) );
358+
Trace.TraceInformation("OR Calculated Adhesion Setting: Zero Speed - {0:N2} @ {1}, Dropoff Speed - {2:N2} @ {3}, Max Continuous Speed - {4:N2} @ {5}", configuredadhesionzerospeed, FormatStrings.FormatSpeedDisplay(zerospeed, IsMetric), configuredadhesiondropoffspeed, FormatStrings.FormatSpeedDisplay(dropoffspeed, IsMetric), configuredadhesionmaxcontinuousspeed, FormatStrings.FormatSpeedDisplay(SpeedOfMaxContinuousForceMpS, IsMetric));
359+
346360
Trace.TraceInformation("===================================================================================================================\n\n");
347361
}
348362

@@ -399,14 +413,6 @@ public override void Initialize()
399413

400414
base.Initialize();
401415

402-
// If DrvWheelWeight is not in ENG file, then calculate drivewheel weight freom FoA
403-
404-
if (DrvWheelWeightKg == 0) // if DrvWheelWeightKg not in ENG file.
405-
{
406-
DrvWheelWeightKg = MassKG; // set Drive wheel weight to total wagon mass if not in ENG file
407-
InitialDrvWheelWeightKg = MassKG; // // set Initial Drive wheel weight as well, as it is used as a reference
408-
}
409-
410416
// Initialise water level in steam heat boiler
411417
if (CurrentLocomotiveSteamHeatBoilerWaterCapacityL == 0 && IsSteamHeatFitted)
412418
{

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,16 @@ public override void LoadFromWagFile(string wagFilePath)
504504
Trace.TraceWarning("{0} locomotive's CabView references non-existent {1}", wagFilePath, CVFFileName);
505505
}
506506

507+
DrvWheelWeightKg = InitialDrvWheelWeightKg;
508+
509+
// If DrvWheelWeight is not in ENG file, then set drivewheel weight the same as locomotive mass
510+
511+
if (DrvWheelWeightKg == 0) // if DrvWheelWeightKg not in ENG file.
512+
{
513+
DrvWheelWeightKg = MassKG; // set Drive wheel weight to total wagon mass if not in ENG file
514+
InitialDrvWheelWeightKg = MassKG; // // set Initial Drive wheel weight as well, as it is used as a reference
515+
}
516+
507517
CorrectBrakingParams();
508518
CheckCoherence();
509519
GetPressureUnit();
@@ -1461,7 +1471,6 @@ public override void Initialize()
14611471
base.Initialize();
14621472
if (DynamicBrakeBlendingEnabled) airPipeSystem = BrakeSystem as AirSinglePipe;
14631473

1464-
DrvWheelWeightKg = InitialDrvWheelWeightKg;
14651474
}
14661475

14671476
//================================================================================================//

0 commit comments

Comments
 (0)