The continuity conditions across a junction between a grain-boundary and a free surface are discussed for the coupled surface and grain-boundary diffusion problem. An appropriate treatment of the continuity is proposed, which forms the basis of a numerical procedure for an arbitrary network of grains containing pores of arbitrary shape and size. The analysis technique, when combined with a suitable time integration algorithm, is able to simulate physical processes such as powder sintering, diffusional void growth and creep crack propagation etc. which are dominated by the coupled diffusion mechanism under many practical circumstances. Currently only two-dimensional problems are discussed. The basic principles proposed in this paper, however, are also valid for three-dimensional situations. Simple numerical examples of powder sintering are given while the full potential of the numerical technique for the above physical problems will be exploited in a forthcoming paper.