As asked in the review: the engine is the class SteamEngine, with its parameters, state, controls and the angle of
its cranks, and its load(), raise_steam(), cool_down(), update() and starting_force(), in place of the free functions
of the namespace steam. The namespace keeps the steam tables and the plain data of the engine; the parts of an update
are the class's helpers in steam.cpp. The vehicle has one SteamEngine Steam in place of SteamParameters, Steam,
SteamControls and SteamCrankAngle.
Nothing changes in what the engine does: the unit tests and the scenario cases ty2_td_timetable and eu07_td_timetable
give the very same figures. The loops of the steam tests count in whole steps rather than in floating time (Sonar
S2193).
Assets: none.
The valve gear of a steam locomotive may give a shorter full gear running backwards than forwards: the Ty23's gives
84 % forwards and 70 % backwards (its drawing 21.03, valve gear results). The new optional Steam: key
CutoffMaxReverse sets it; without it, backwards takes CutoffMax as before.
A unit test defines the Ty23 from its drawings at Stacja Muzeum (1.03/1.05 main data, 21.03), with no more than the
data of the Steam: section: its starting force comes out 228.6 kN, 5.8 % over the 22 030 kg of the drawing's formula,
as the Ty2's 214 kN of the DR's tables is over the same formula. The model takes other two-cylinder simple-expansion
locomotives with Heusinger gear by their data alone (the Ty23 and the Pt31 of that collection).
Assets: none. A .fiz may add CutoffMaxReverse to its Steam: line.
EngineType=SteamEngine was read and did nothing: no force, no controls, no AI. A vehicle of that type now runs
a lumped model of its engine (McZapkie/steam.h), driven by TMoverParameters::steam_Update() every step:
- the boiler: its pressure the saturation pressure of its water (the steam tables), the heat of the fire, the
steam taken, the feed water warmed up and the heat lost; the level in the glass with its swell, priming over
the top of the glass, the fusible plug melting under the bottom; the safety valves;
- the fire: the coal burned as the exhaust, the blower and a little natural draught let it, the efficiency
falling with the firing rate, the heat reaching the water with a delay;
- the regulator as a throttle into the steam chest, choked under the critical pressure ratio, so the chest
pressure falls at speed with the regulator part open;
- the cylinders: the indicator diagram (admission to the cutoff, hyperbolic expansion, the back pressure of the
blast pipe, the clearance), wire drawing with speed, the steam taken a revolution, the force swinging with the
cranks at low speed; the pressure equalisers drifting;
- the automatic fireman keeping the pressure and the water, the injectors and the blower; by hand in
SteamControls;
- the master controller works the regulator, the secondary controller the cutoff (0 full gear, the last
position the shortest cutoff), the reverser at 0 is mid gear;
- CompressorPower=Engine (and the legacy Main) of a steam locomotive is its steam air pump, running with the
boiler over 3 bar;
- a locomotive in steam keeps its physics awake, its boiler going on with no one in the cab.
The new optional Steam: section of the .fiz sets a locomotive's own figures; without it they are those of the
PKP Ty2 (DRB class 52). steam_doc.md lists the keys and what is still to come. No vehicle of the game data uses
EngineType=SteamEngine, so nothing changes for any of them.
Unit tests (tests/unit/test_steam.cpp): the steam tables, the starting force of the Ty2 (214 kN), a boiler kept
standing by the fireman, the fusible plug, priming, the power the boiler keeps up at 65 km/h (about 1280 kW
indicated), and the Ty2 of data/steam_ty2.json taking 1200 t up to about 61 km/h on the level.
Game data: a placeholder Ty2 to drive, made in the SVN working copy and not committed there:
dynamic/pkp/ty2_v1/ with ty2.fiz, ty2.mmd, ty2.t3d, ty2-1.tga (the locomotive) and ty2t.fiz, ty2t.mmd,
ty2t.t3d, ty2t-1.tga (its tender), textures.txt. The code needs none of it.