Skip to content

Commit

Permalink
Merge pull request #949 from peternewell/oil-burner#1
Browse files Browse the repository at this point in the history
Oil Burning Locomotive
  • Loading branch information
peternewell authored Jul 15, 2024
2 parents 3643573 + 8fdc42b commit 3c01d62
Show file tree
Hide file tree
Showing 11 changed files with 1,245 additions and 476 deletions.
49 changes: 48 additions & 1 deletion Source/Documentation/Manual/physics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ locomotive can be thought of in terms of the following broadly defined
components:

- Boiler and Fire (Heat conversion)
- Fuel Type
- Cylinder (Work done)

Boiler and Fire (Heat conversion)
Expand All @@ -1246,7 +1247,7 @@ the Boiler Evaporation Area.
contact with the boiler and the heat tubes running through the boiler.
This area determined the amount of heat that could be transferred to
the water in the boiler. As a rule of thumb a boiler could produce
approximately 12-15 lbs/h of steam per ft\ :sup:`2` of evaporation area.
approximately 12-15 lbs/h of steam per ft\ :sup:`2` of evaporation area (coal fired).
- *Boiler Superheater Area* -- Typically modern steam locomotives are
superheated, whereas older locomotives used only saturated steam.
Superheating is the process of putting more heat into the steam
Expand All @@ -1255,6 +1256,52 @@ the Boiler Evaporation Area.
in steam and fuel usage. In other words a superheated locomotive
tended to be more efficient then a saturated locomotive.

Fuel Type
.........

Different fuel types will produce different levels of heat. For example,
Coal has a fuel calorific value of around 13,800 BTU/lb, whereas Wood may
have values of between 3,000 and 7,000 BTU/lb (depending upon the condition
of the wood fuel), and Oil (Diesel) may have a value up around 17,000 BTU/lb.

Hence the variations in fuel calorific value can dramatically impact the
amount of steam that it is able to produce and ultimately the performance of
the steam locomotive.

Hence Open Rails supports the use of different fuel types for steam locomotives,
and these different fuel types can be configured with the following parameters.

``ORTSSteamLocomotiveFuelType`` - indicates the type of fuel used by the locomotive -
currently Wood, Coal or Oil are available. Defaults to Coal.

``ORTSMaxTenderWoodMass`` - amount of wood mass in tender (in ENG file)

``ORTSTenderWagonWoodMass`` - amount of wood mass in tender (in tender WAG file - overwrites
the above value - non mandatory).

``ORTSSteamLocomotiveFeedwaterSystemType`` - Older steam locomotives were fitted with
motion pumps to transfer water from the tender into the boiler. Steam injectors were
fitted to new locomotives from the 1860s. Currently MotionPump or Injector available.
Defaults to Injector.

*FuelWood* is used in any IntakePoint statements used, and route fuel points need to
be set as wood type.

``ORTSFuelOilHeatingRequired`` - some locomotives required the oil in the tender to be
steam heated, set to 1 (true) if this is the case. Defaults to false.

``ORTSFuelOilSpecificGravity`` - specific gravity of the oil used as fuel on the locomotive.

``ORTSMaxTenderFuelOilVolume`` - volume of oil carried in the tender, typically in gallons
or litres. (in ENG file)

``ORTSTenderWagonFuelOilVolume`` - volume of oil carried in the tender, typically in gallons
or litres. (in tender WAG file - overwrites the above value - non mandatory).

*FuelDiesel* - is used in any IntakePoint statements, and route fuel points need to be set
as diesel type.


Cylinder (Work done)
....................

Expand Down
4 changes: 4 additions & 0 deletions Source/Documentation/Manual/sound.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ trigger the above triggers.
========= ==============================================================================================================================================================
Trigger Function
========= ==============================================================================================================================================================
90 WaterPump1ON - triggered whenever motion pump 1 turns on
91 WaterPump1OFF - triggered whenever motion pump 1 turns off
92 WaterPump2ON - triggered whenever motion pump 2 turns on
93 WaterPump2OFF - triggered whenever motion pump 2 turns off
101 GearUp : for gear-based engines, triggered by the ``<E>`` key, propagated to all gear-based diesel engines of a train and run also for AI trains
102 GearDown : for gear-based engines, triggered by the ``<Shift+E>`` key, propagated to all gear-based diesel engines of a train and run also for AI trains
103 ReverserToForwardBackward : reverser moved towards the forward or backward position
Expand Down
4 changes: 4 additions & 0 deletions Source/Orts.Formats.Msts/ActivityFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ public class Tr_Activity_Header {
public int FuelWater = 100; // percent
public int FuelCoal = 100; // percent
public int FuelDiesel = 100; // percent
public int FuelWood = 100; // percent
public int FuelSand = 100; // percent
public string LoadStationsPopulationFile;

public Tr_Activity_Header(STFReader stf) {
Expand All @@ -423,7 +425,9 @@ public Tr_Activity_Header(STFReader stf) {
new STFReader.TokenProcessor("workers", ()=>{ Workers = stf.ReadIntBlock(Workers); }),
new STFReader.TokenProcessor("fuelwater", ()=>{ FuelWater = stf.ReadIntBlock(FuelWater); }),
new STFReader.TokenProcessor("fuelcoal", ()=>{ FuelCoal = stf.ReadIntBlock(FuelCoal); }),
new STFReader.TokenProcessor("fuelwood", ()=>{ FuelWood = stf.ReadIntBlock(FuelWood); }),
new STFReader.TokenProcessor("fueldiesel", ()=>{ FuelDiesel = stf.ReadIntBlock(FuelDiesel); }),
new STFReader.TokenProcessor("fuelsand", ()=>{ FuelSand = stf.ReadIntBlock(FuelSand); }),
new STFReader.TokenProcessor("ortsloadstationspopulation", ()=>{ LoadStationsPopulationFile = stf.ReadStringBlock(null); }),
});
}
Expand Down
10 changes: 10 additions & 0 deletions Source/Orts.Simulation/Common/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ public enum Event
WaterInjector1On,
WaterInjector2Off,
WaterInjector2On,
WaterMotionPump1Off,
WaterMotionPump1On,
WaterMotionPump2Off,
WaterMotionPump2On,
BlowdownValveToggle,
SteamHeatChange,
SteamPulse1,
Expand Down Expand Up @@ -372,7 +376,13 @@ public static Event From(Source source, int eventID)
case 66: return Event.Pantograph2Up;
case 67: return Event.Pantograph2Down;


// ORTS only Events
case 90: return Event.WaterMotionPump1On;
case 91: return Event.WaterMotionPump1Off;
case 92: return Event.WaterMotionPump2On;
case 93: return Event.WaterMotionPump2Off;

case 101: return Event.GearUp; // for gearbox based engines
case 102: return Event.GearDown; // for gearbox based engines
case 103: return Event.ReverserToForwardBackward; // reverser moved to forward or backward position
Expand Down
16 changes: 15 additions & 1 deletion Source/Orts.Simulation/Simulation/AIs/AI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,22 @@ public AITrain CreateAITrainDetail(Service_Definition sd, Traffic_Service_Defini

if (Simulator.Activity != null && car is MSTSSteamLocomotive mstsSteamLocomotive)
{

mstsSteamLocomotive.CombinedTenderWaterVolumeUKG = ORTS.Common.Kg.ToLb(mstsSteamLocomotive.MaxLocoTenderWaterMassKG) / 10.0f * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWater / 100.0f;
mstsSteamLocomotive.TenderCoalMassKG = mstsSteamLocomotive.MaxTenderCoalMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;

// Adjust fuel stocks depending upon fuel used - in Activity mode
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Wood)
{
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWood / 100.0f;
}
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Oil)
{
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
}
else // defaults to coal fired
{
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelCoal / 100.0f;
}
}

if (train.InitialSpeed != 0 && car is MSTSLocomotive loco)
Expand Down
2 changes: 1 addition & 1 deletion Source/Orts.Simulation/Simulation/Confirmer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public Confirmer(Simulator simulator, double defaultDurationS)
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
, new string [] { GetString("SmallEjector"), null, null, null, GetString("decrease"), GetString("increase") }
, new string [] { GetString("VacuumExhauster"), GetString("normal"), null, GetString("fast") }
, new string [] { GetString("Tender"), null, null, GetString("Coal re-filled"), null, GetString("Coal level") }
, new string [] { GetString("Tender"), null, null, GetString("Fuel re-filled"), null, GetString("Fuel level") }
, new string [] { GetString("Tender"), null, null, GetString("Water re-filled"), null, GetString("Water level") }
// General
, new string [] { GetString("Water Scoop"), GetString("up"), null, GetString("down") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public enum SoundState
bool WaterScoopSoundOn = false;
public float MaxTotalCombinedWaterVolumeUKG;
public MSTSNotchController WaterController = new MSTSNotchController(0, 1, 0.01f);
public float CombinedTenderWaterVolumeUKG // Decreased by running injectors and increased by refilling
public float CombinedTenderWaterVolumeUKG // Decreased by running injectors or pumps and increased by refilling
{
get { return WaterController.CurrentValue * MaxTotalCombinedWaterVolumeUKG; }
set { WaterController.CurrentValue = value / MaxTotalCombinedWaterVolumeUKG; }
Expand Down
Loading

0 comments on commit 3c01d62

Please sign in to comment.