Multilayer modeling of porous grain surface chemistry - I. The GRAINOBLE model