You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
+77-77Lines changed: 77 additions & 77 deletions
Original file line number
Diff line number
Diff line change
@@ -1461,6 +1461,34 @@ public override void Initialize()
1461
1461
1462
1462
CylinderSteamUsageLBpS = 1.0f; // Set to 1 to ensure that there are no divide by zero errors
1463
1463
1464
+
if (BoilerEvapRateLbspFt2 == 0) // If boiler evaporation rate is not in ENG file then set a default value
1465
+
{
1466
+
if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Wood)
1467
+
{
1468
+
BoilerEvapRateLbspFt2 = 11.5f; // Default rate for evaporation rate. Assume a default rate of 12 lbs/sqft of evaporation area
1469
+
}
1470
+
else if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Oil)
1471
+
{
1472
+
BoilerEvapRateLbspFt2 = 18.0f; // Default rate for evaporation rate. Assume a default rate of 18 lbs/sqft of evaporation area
1473
+
}
1474
+
else
1475
+
{
1476
+
BoilerEvapRateLbspFt2 = 15.0f; // Default rate for evaporation rate. Assume a default rate of 15 lbs/sqft of evaporation area
1477
+
}
1478
+
}
1479
+
BoilerEvapRateLbspFt2 = MathHelper.Clamp(BoilerEvapRateLbspFt2, 7.5f, 30.0f); // Clamp BoilerEvap Rate to between 7.5 & 30 - some modern locomotives can go as high as 30, but majority are around 15.
1480
+
TheoreticalMaxSteamOutputLBpS = pS.FrompH(Me2.ToFt2(EvaporationAreaM2) * BoilerEvapRateLbspFt2); // set max boiler theoretical steam output
if (BoilerVolumeCheck > 15) // If boiler volume is not in ENG file or less then a viable figure (ie high ratio figure), then set to a default value
1484
+
{
1485
+
BoilerVolumeFT3 = Me2.ToFt2(EvaporationAreaM2) / 8.3f; // Default rate for evaporation rate. Assume a default ratio of evaporation area * 1/8.3
1486
+
// Advise player that Boiler Volume is missing from or incorrect in ENG file
1487
+
if (Simulator.Settings.VerboseConfigurationMessages)
1488
+
Trace.TraceWarning("Boiler Volume not found in ENG file, or doesn't appear to be a valid figure, and has been set to {0} Ft^3", BoilerVolumeFT3);
1489
+
}
1490
+
1491
+
1464
1492
// Set up boiler water defaults
1465
1493
1466
1494
// Water Gauge Length - always use OR entered value as first preference
@@ -1469,11 +1497,46 @@ public override void Initialize()
1469
1497
// Boiler Length - always use OR entered value as first preference
1470
1498
BoilerLengthM = ORBoilerLengthM;
1471
1499
1500
+
// If OR value hasn't been set, then use MSTS value if present
1501
+
if (BoilerLengthM == 0 && MSTSBoilerLengthM > 0)
1502
+
{
1503
+
if (MSTSBoilerLengthM > 0.4f * CarLengthM && MSTSBoilerLengthM < CarLengthM) // Check validity of MSTS value
1504
+
{
1505
+
BoilerLengthM = MSTSBoilerLengthM;
1506
+
}
1507
+
else
1508
+
{
1509
+
BoilerLengthM = Me.FromFt(20.0f); // limit default boiler length to 20 ft
1510
+
}
1511
+
1512
+
if (Simulator.Settings.VerboseConfigurationMessages)
1513
+
{
1514
+
Trace.TraceInformation("Boiler Length set as per MSTS default = {0}", FormatStrings.FormatDistance(BoilerLengthM, IsMetric));
1515
+
}
1516
+
}
1517
+
else if (BoilerLengthM == 0 && MSTSBoilerLengthM == 0)
1518
+
{
1519
+
if (HasTenderCoupled)
1520
+
{
1521
+
BoilerLengthM = 0.48f * CarLengthM; // Set default boiler length for tank locomotives
1522
+
}
1523
+
else
1524
+
{
1525
+
BoilerLengthM = 0.6f * CarLengthM; // Set default boiler length for tender locomotives
1526
+
}
1527
+
1528
+
if (Simulator.Settings.VerboseConfigurationMessages)
1529
+
{
1530
+
Trace.TraceInformation("Boiler Length set to default = {0}", FormatStrings.FormatDistance(BoilerLengthM, IsMetric));
1531
+
}
1532
+
}
1533
+
1472
1534
if (BoilerDiameterM == 0)
1473
1535
{
1474
-
BoilerDiameterM = Me.FromFt(6.0f); // Set default boiler diameter to 6 ft
1536
+
BoilerDiameterM = 3.3f * (float)Math.Sqrt(Me3.FromFt3(BoilerVolumeFT3) / (float)(Math.PI * BoilerLengthM)); // Set default boiler diameter based upon boiler volume and length
1537
+
1475
1538
if (Simulator.Settings.VerboseConfigurationMessages)
1476
-
Trace.TraceWarning("Boiler Diameter not found in ENG file and has been set to {0}", FormatStrings.FormatDistance(BoilerDiameterM, IsMetric)); // Advise player that Boiler Diameter is missing from ENG file
1539
+
Trace.TraceWarning("Boiler Diameter not found in ENG file and has been set to {0}", FormatStrings.FormatDistance(BoilerDiameterM, IsMetric));
1477
1540
}
1478
1541
1479
1542
// Water model - locomotive boilers require water level to be maintained above the firebox crown sheet
@@ -1492,37 +1555,10 @@ public override void Initialize()
1492
1555
{
1493
1556
BoilerCrownCoverageHeightM = Me.FromIn(3.0f); // Set default crown coverage height to 3"
1494
1557
if (Simulator.Settings.VerboseConfigurationMessages)
1495
-
Trace.TraceWarning("Boiler Crown Coverage Height not found in ENG file and has been set to {0}", FormatStrings.FormatVeryShortDistanceDisplay(BoilerCrownCoverageHeightM, IsMetric)); // Advise player that Boiler Crown Coverage Height is missing from ENG file
1558
+
Trace.TraceWarning("Boiler Crown Coverage Height not found in ENG file and has been set to {0}", FormatStrings.FormatVeryShortDistanceDisplay(BoilerCrownCoverageHeightM, IsMetric));
1496
1559
}
1497
1560
1498
-
// Initialise Boiler parameters
1499
-
1500
-
// If OR value hasn't been set, then use MSTS value if present
1501
-
if (BoilerLengthM == 0 && MSTSBoilerLengthM > 0)
1502
-
{
1503
-
if (MSTSBoilerLengthM > 0.4f * CarLengthM && MSTSBoilerLengthM < CarLengthM)
1504
-
{
1505
-
BoilerLengthM = MSTSBoilerLengthM;
1506
-
}
1507
-
else
1508
-
{
1509
-
BoilerLengthM = Me.FromFt(20.0f); // Set default boiler length to 20 ft
1510
-
}
1511
-
1512
-
if (Simulator.Settings.VerboseConfigurationMessages)
1513
-
{
1514
-
Trace.TraceInformation("Boiler Length set as per MSTS default = {0}", FormatStrings.FormatDistance(BoilerLengthM, IsMetric));
1515
-
}
1516
-
}
1517
-
else if (BoilerLengthM == 0 && MSTSBoilerLengthM == 0)
1518
-
{
1519
-
BoilerLengthM = Me.FromFt(20.0f); // Set default boiler length to 20 ft
1520
-
1521
-
if (Simulator.Settings.VerboseConfigurationMessages)
1522
-
{
1523
-
Trace.TraceInformation("Boiler Length set to default = {0}", FormatStrings.FormatDistance(BoilerLengthM, IsMetric));
1524
-
}
1525
-
}
1561
+
// Initialise Boiler parameters, if not found in Eng file
1526
1562
1527
1563
// If OR value hasn't been set, then use MSTS value if present
@@ -1569,34 +1605,6 @@ public override void Initialize()
1569
1605
1570
1606
float MaxWaterFraction = BoilerWaterFractionAbs; // Initialise the max water fraction when the boiler starts
1571
1607
1572
-
if (BoilerEvapRateLbspFt2 == 0) // If boiler evaporation rate is not in ENG file then set a default value
1573
-
{
1574
-
if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Wood)
1575
-
{
1576
-
BoilerEvapRateLbspFt2 = 11.5f; // Default rate for evaporation rate. Assume a default rate of 12 lbs/sqft of evaporation area
1577
-
}
1578
-
else if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Oil)
1579
-
{
1580
-
BoilerEvapRateLbspFt2 = 18.0f; // Default rate for evaporation rate. Assume a default rate of 18 lbs/sqft of evaporation area
1581
-
}
1582
-
else
1583
-
{
1584
-
BoilerEvapRateLbspFt2 = 15.0f; // Default rate for evaporation rate. Assume a default rate of 15 lbs/sqft of evaporation area
1585
-
}
1586
-
}
1587
-
BoilerEvapRateLbspFt2 = MathHelper.Clamp(BoilerEvapRateLbspFt2, 7.5f, 30.0f); // Clamp BoilerEvap Rate to between 7.5 & 30 - some modern locomotives can go as high as 30, but majority are around 15.
1588
-
TheoreticalMaxSteamOutputLBpS = pS.FrompH(Me2.ToFt2(EvaporationAreaM2) * BoilerEvapRateLbspFt2); // set max boiler theoretical steam output
else if (CurrentWaterGaugeFraction <= 0.55 && CurrentWaterGaugeFraction > 0.50 && !InjectorLockedOut) // turn injector 1 on 25% if water level in boiler drops between 0.5 and 0.55 water gauge
else if (CurrentWaterGaugeFraction <= 0.50 && CurrentWaterGaugeFraction > 0.45 && !InjectorLockedOut) // turn injector 1 on 50% if water level in boiler drops between 0.5 and 0.45
else if (CurrentWaterGaugeFraction <= 0.45 && CurrentWaterGaugeFraction > 0.40 && !InjectorLockedOut) // turn injector 1 on 100% if water level in boiler drops between 0.4 and 0.45
0 commit comments