A closed system is a natural physical system that does not allow transfer of matter in or out of the system, although - in the contexts of physics, chemistry, engineering, etc. - the transfer of energy (e.g. as work or heat) is allowed.
In nonrelativistic classical mechanics, a closed system is a physical system that doesn't exchange any matter with its surroundings, and isn't subject to any net force whose source is external to the system. A closed system in classical mechanics would be equivalent to an isolated system in thermodynamics. Closed systems are often used to limit the factors that can affect the results of a specific problem or experiment.
Thermodynamic system
In thermodynamics, a closed system can exchange energy (as heat or work) but not matter, with its surroundings.
An isolated system cannot exchange any heat, work, or matter with the surroundings, while an open system can exchange energy and matter. (This scheme of definition of terms is not uniformly used, though it is convenient for some purposes. In particular, some writers use 'closed system' where 'isolated system' is used here.)
For a simple system, with only one type of particle (atom or molecule), a closed system amounts to a constant number of particles. However, for systems which are undergoing a chemical reaction, there may be all sorts of molecules being generated and destroyed by the reaction process. In this case, the fact that the system is closed is expressed by stating that the total number of each elemental atom is conserved, no matter what kind of molecule it may be a part of. Mathematically:
where is the number of j-type molecules, is the number of atoms of element in molecule and is the total number of atoms of element in the system, which remains constant, since the system is closed. There will be one such equation for each different element in the system.
In thermodynamics, a closed system is important for solving complicated thermodynamic problems. It allows the elimination of some external factors that could alter the results of the experiment or problem thus simplifying it.