Computer simulation of the development of foam structures