Modelling the formation of geopolymers