A thermodynamic system is a quantity of matter of fixed identity, around which we can draw a boundary. The boundaries may be fixed or moveable. Work or heat can be transferred across the system boundary. Everything outside the boundary is the surroundings.
When working with devices such as engines it is often useful to define the system to be an identifiable volume with flow in and out. This is termed a control volume.
A closed system is a special class of system with boundaries that matter cannot cross. Hence the principle of the conservation of mass is automatically satisfied whenever we employ a closed system analysis. This type of system is sometimes termed a control mass.