Hi Tony ,
Russel has already told you the primary purpose of the dome on a steam locomotive .
The mechanism inside most domes is the regulator . This controls the amount of steam flowing from boiler to cylinders . It is usually worked by a rod which goes to the back of the boiler and out through a gland to an operating handle in the cab .
There are numerous designs of regulator . The most common are variations of a disc with a hole uncovering a steam port by varying amounts and ones based on a slide valve like the one at the cylinders . Less common types have screw down valves and poppet valves . Regulators need not always be in the dome – some, especially more modern engines , have the regulator in the smokebox .
A secondary but quite important purpose for the dome is to give access to the internals of the boiler during major repairs – some of the domes on early engines where so big that with the cover and regulator removed an apprentice could clamber in .
MW