This is a simple model of a piston in a cylinder:
The translational flange is connected to the piston, the cylinder has a flowPort at the bottom.
The position of the piston within the cylinder goes from 0 at the bottom to L (length of the cylinder) at the top of the cylinder. If the piston leaves the cylinder, an assertion is triggered.
The piston is considered without mass.
Note: Take care of the initial conditions. The position of the piston (relative to the support) should be in the range (0, L). The position of the flange (as well as of the support, if useSupport=true) is influenced by connected components.