how lpg solenoids work

A solenoid is an electrically-controlled valve, it converts electrical energy into mechanical energy and permits for remote, and autonomous operation of a valve. The mechanism varies from linear action, plunger-type actuators to pivoted-armature actuators and rocker actuators. Since LPG systems use plunger-type actuators to control the flow of gas, we'll focus on that.

In a sailboat LPG system with a solenoid valve, the LPG tank valve is left open, removing the need to physically go outside to turn the valve on and off. It's the job of the solenoid valve to protect the system and to regulate the flow of gas. The controller for the solenoid valve is placed inside the cabin and is operated remotely from there. Some controllers are equipped with automatic shut-offs, triggered by a sniffer when detecting leaks in a system which will send a signal back to the controller to switch the solenoid valve off.

LPG solenoids have two-port valves, with gas coming in one way and out from another, with a plunger obstructing the flow of gas when the solenoid isn't energized(no power).

There are two types of valves:
Normally Open - N.O.
Normally Closed - N.C.

In LPG systems N.C valves are required, so that if the power source goes out the valve closes, isolating the tank from the appliance.

Screenshot from Solenoid Basics Explained(YouTube) by The Engineering Mindset.

How N.C. Plunger-Type Actuators Work

The flow of gas is obstructed by a metal plunger, with a spring forcing it into a closed position. The plunger and spring are contained within a large copper coil.

When current is applied to a straight wire, the magnetic field moves in a circular pattern around the wire, but when the wire is shaped into a coil the magnetic field intensifies and is concentrated in the center. This magnetic field causes the metal plunger, attracted by the pull of the magnetic field, to slide upward against the spring, opening the valve and allowing the gas to pass.

When the current is turned off, the magnetic field collapses and the spring forces the plunger back into its original resting position.