Stack assembly comprising: - a hollow external housing having a central axis, the external housing extending from a first end to a second end and enclosing a housing space, wherein the external housing is a pressure vessel; - a membrane stack comprising a plurality of membranes (24, 524), wherein the membrane stack is positionable inside the external housing; - a number of side plates (26, 28, 30, 32) extending substantially parallel to the central axis, wherein each side plate (26, 28, 30, 32) of the number of side plates (26, 28, 30, 32) is associated with a side (22a, 22b, 22c, 22d) of the membrane stack and extending along the associated side (22a, 22b, 22c, 22d); - a number of sealing connectors (34, 36, 38, 40) that extend substantially parallel to the central axis and adjacent with an inner surface of the external housing, wherein each sealing connector (34, 36, 38, 40) of the number of sealing connectors (34, 36, 38, 40) is configured to connect two side plates (26, 28, 30, 32) to each other; wherein the sealing connectors (34, 36, 38, 40) and the side plates (26, 28, 30, 32) cooperate to form an enclosing structure, and wherein, in use of the stack assembly, the enclosing structure encloses the membrane stack, wherein the enclosing structure is connected to the membrane stack for forming a unit, and wherein the enclosing structure is removably positioned in the housing space, wherein the stack assembly comprises a number of flow compartments (42, 44, 46, 48), wherein each flow compartment (42, 44, 46, 48) is delineated by a side of the enclosing structure and an associated part of the inner surface of the external housing that extends from a first sealing connector of the side of the enclosing structure to a second sealing connector of the side of the enclosing structure. - a hollow external housing having a central axis, the external housing extending from a first end to a second end and enclosing a housing space, wherein the external housing is a pressure vessel; - a membrane stack comprising a plurality of membranes (24, 524), wherein the membrane stack is positionable inside the external housing; - a number of side plates (26, 28, 30, 32) extending substantially parallel to the central axis, wherein each side plate (26, 28, 30, 32) of the number of side plates (26, 28, 30, 32) is associated with a side (22a, 22b, 22c, 22d) of the membrane stack and extending along the associated side (22a, 22b, 22c, 22d); - a number of sealing connectors (34, 36, 38, 40) that extend substantially parallel to the central axis and adjacent with an inner surface of the external housing, wherein each sealing connector (34, 36, 38, 40) of the number of sealing connectors (34, 36, 38, 40) is configured to connect two side plates (26, 28, 30, 32) to each other; wherein the sealing connectors (34, 36, 38, 40) and the side plates (26, 28, 30, 32) cooperate to form an enclosing structure, and wherein, in use of the stack assembly, the enclosing structure encloses the membrane stack, wherein the enclosing structure is connected to the membrane stack for forming a unit, and wherein the enclosing structure is removably positioned in the housing space, wherein the stack assembly comprises a number of flow compartments (42, 44, 46, 48), wherein each flow compartment (42, 44, 46, 48) is delineated by a side of the enclosing structure and an associated part of the inner surface of the external housing that extends from a first sealing connector of the side of the enclosing structure to a second sealing connector of the side of the enclosing structure. wherein the sealing connectors (34, 36, 38, 40) and the side plates (26, 28, 30, 32) cooperate to form an enclosing structure, and wherein, in use of the stack assembly, the enclosing structure encloses the membrane stack, wherein the enclosing structure is connected to the membrane stack for forming a unit, and wherein the enclosing structure is removably positioned in the housing space, wherein the stack assembly comprises a number of flow compartments (42, 44, 46, 48), wherein each flow compartment (42, 44, 46, 48) is delineated by a side of the enclosing structure and an associated part of the inner surface of the external housing that extends from a first sealing connector of the side of the enclosing structure to a second sealing connector of the side of the enclosing structure.