The past decade has seen a large increase in the number of computational methods available to better understand the interplay between guest adsorption and host flexibility in framework materials, through molecular simulations at the atomistic level. These numerical methods are based on the statistical mechanics of adsorption in flexible nanoporous materials: the natural thermodynamic ensemble to describe the system is then the osmotic ensemble, (N host , µ i , σ, T ), where the state variables are the number of atoms in the host framework N host , the chemical potential of the adsorbed guests µ i , the external pressure σ (a tensor which can reduce to the scalar pressure P in some cases), and the temperature T .