Numerical modeling of formation of a gas hydrate in a finite-length porous bed purged by a gas