Compartment function

Create a compartment.