Skip to content

Commit aac0de8

Browse files
committed
Add wood combustion rate
1 parent ce2bbe1 commit aac0de8

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

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

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,11 @@ public class MSTSSteamLocomotive : MSTSLocomotive
294294
SmoothedData FuelRateOil = new SmoothedData(3); // Oil Stoker is more responsive and only takes x seconds to fully react to changing needs.
295295
SmoothedData FuelRateStoker = new SmoothedData(15); // Stoker is more responsive and only takes x seconds to fully react to changing needs.
296296
SmoothedData FuelRateCoal = new SmoothedData(45); // Automatic fireman takes x seconds to fully react to changing needs for coal firing.
297-
SmoothedData CoalBurnRateSmoothKGpS = new SmoothedData(150); // Changes in BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat.
298-
SmoothedData OilBurnRateSmoothKGpS = new SmoothedData(6); // Changes in Oil BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat. Oil faster then steam
299-
SmoothedData OilBurnRateReductionSmoothKGpS = new SmoothedData(0.25f); // When in reduction we would expect the heat to drop off rapidly for an oil fire
297+
SmoothedData BurnRateCoalSmoothKGpS = new SmoothedData(150); // Changes in BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat.
298+
SmoothedData BurnRateOilSmoothKGpS = new SmoothedData(6); // Changes in Oil BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat. Oil faster then steam
299+
SmoothedData BurnRateWoodSmoothKGpS = new SmoothedData(20); // Changes in Wood BurnRate take x seconds to fully react to changing needs - models increase and decrease in heat.
300+
301+
SmoothedData BurnRateOilReductionSmoothKGpS = new SmoothedData(0.25f); // When in reduction we would expect the heat to drop off rapidly for an oil fire
300302

301303
float FuelFeedRateSmoothedKGpS = 0.0f; // Smoothed Fuel feedd Rate
302304
public float FuelBurnRateSmoothedKGpS; // Smoothed fuel burning rate
@@ -1228,8 +1230,9 @@ public override void Restore(BinaryReader inf)
12281230
ControllerFactory.Restore(SmallEjectorController, inf);
12291231
ControllerFactory.Restore(LargeEjectorController, inf);
12301232
FuelBurnRateSmoothedKGpS = inf.ReadSingle();
1231-
CoalBurnRateSmoothKGpS.ForceSmoothValue(FuelBurnRateSmoothedKGpS);
1232-
OilBurnRateSmoothKGpS.ForceSmoothValue(FuelBurnRateSmoothedKGpS);
1233+
BurnRateCoalSmoothKGpS.ForceSmoothValue(FuelBurnRateSmoothedKGpS);
1234+
BurnRateOilSmoothKGpS.ForceSmoothValue(FuelBurnRateSmoothedKGpS);
1235+
BurnRateWoodSmoothKGpS.ForceSmoothValue(FuelBurnRateSmoothedKGpS);
12331236
BoilerHeatSmoothedBTU = inf.ReadSingle();
12341237
BoilerHeatSmoothBTU.ForceSmoothValue(BoilerHeatSmoothedBTU);
12351238
FuelFeedRateSmoothedKGpS = inf.ReadSingle();
@@ -3938,28 +3941,33 @@ private void UpdateFirebox(float elapsedClockSeconds, float absSpeedMpS)
39383941
oilburnrate = MaxFiringRateKGpS; // burning rate can never be more then the max firing rate
39393942
}
39403943

3941-
OilBurnRateReductionSmoothKGpS.Update(elapsedClockSeconds, oilburnrate);
3942-
OilBurnRateSmoothKGpS.Update(elapsedClockSeconds, oilburnrate);
3944+
BurnRateOilReductionSmoothKGpS.Update(elapsedClockSeconds, oilburnrate);
3945+
BurnRateOilSmoothKGpS.Update(elapsedClockSeconds, oilburnrate);
39433946

39443947
if (previousThrottle < throttle)
39453948
{
39463949
// Fire combustion drops rapidly if throttle closed (assume fuel feed is reduced rapidly)
3947-
FuelBurnRateSmoothedKGpS = OilBurnRateReductionSmoothKGpS.SmoothedValue;
3948-
OilBurnRateSmoothKGpS.ForceSmoothValue(oilburnrate);
3950+
FuelBurnRateSmoothedKGpS = BurnRateOilReductionSmoothKGpS.SmoothedValue;
3951+
BurnRateOilSmoothKGpS.ForceSmoothValue(oilburnrate);
39493952
}
39503953
else
39513954
{
39523955
// Fire combustion is normal
3953-
FuelBurnRateSmoothedKGpS = OilBurnRateSmoothKGpS.SmoothedValue;
3956+
FuelBurnRateSmoothedKGpS = BurnRateOilSmoothKGpS.SmoothedValue;
39543957
}
39553958

39563959
previousThrottle = throttle;
39573960

39583961
}
3962+
else if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Wood)
3963+
{
3964+
BurnRateWoodSmoothKGpS.Update(elapsedClockSeconds, BurnRateRawKGpS);
3965+
FuelBurnRateSmoothedKGpS = BurnRateWoodSmoothKGpS.SmoothedValue;
3966+
}
39593967
else
39603968
{
3961-
CoalBurnRateSmoothKGpS.Update(elapsedClockSeconds, BurnRateRawKGpS);
3962-
FuelBurnRateSmoothedKGpS = CoalBurnRateSmoothKGpS.SmoothedValue;
3969+
BurnRateCoalSmoothKGpS.Update(elapsedClockSeconds, BurnRateRawKGpS);
3970+
FuelBurnRateSmoothedKGpS = BurnRateCoalSmoothKGpS.SmoothedValue;
39633971
}
39643972

39653973
FuelBurnRateSmoothedKGpS = MathHelper.Clamp(FuelBurnRateSmoothedKGpS, 0.0f, MaxFuelBurnGrateKGpS); // clamp burnrate to max fuel that can be burnt within grate limit
@@ -4013,7 +4021,14 @@ private void UpdateFirebox(float elapsedClockSeconds, float absSpeedMpS)
40134021
FuelBoost = true; // boost shoveling
40144022
if (!StokerIsMechanical && IsPlayerTrain) // Don't display message if stoker in operation
40154023
{
4016-
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is getting low. Your fireman will shovel faster, but don't wear him out."));
4024+
if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Wood)
4025+
{
4026+
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is getting low. Your fireman will add fuel faster, but don't wear him out."));
4027+
}
4028+
else
4029+
{
4030+
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is getting low. Your fireman will shovel faster, but don't wear him out."));
4031+
}
40174032
}
40184033
}
40194034
}
@@ -4025,7 +4040,14 @@ private void UpdateFirebox(float elapsedClockSeconds, float absSpeedMpS)
40254040
FuelBoost = false; // disable boost shoveling
40264041
if (!StokerIsMechanical && IsPlayerTrain) // Don't display message if stoker in operation
40274042
{
4028-
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is back within limits. Your fireman will shovel as per normal."));
4043+
if (SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Wood)
4044+
{
4045+
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is back within limits. Your fireman will add fuel as normal."));
4046+
}
4047+
else
4048+
{
4049+
Simulator.Confirmer.Message(ConfirmLevel.Warning, Simulator.Catalog.GetString("FireMass is back within limits. Your fireman will shovel as per normal."));
4050+
}
40294051
}
40304052
}
40314053
}

0 commit comments

Comments
 (0)