The paper presents a model of grain-boundary diffusion, which can be used to describe the process of oxygen penetration from the surface into the depth of the material during oxidation. We believe that the sample temperature can be regulated over time. The sample material in the model is represented by alternating grains with explicitly defined triple junctions between them. The model includes the parameter of the ratio of grain sizes and the distance between them, so that it allows studying diffusion in a material with micro and nanostructure.