A grid refinement technique for high resolution magnetohydrodynamical
flows is described. It is based on the use of multiple nested grids ha
ving successively higher resolution. The numerical algorithm is formul
ated in such a way that the advection part of the hydrodynamical equat
ions are solved in conservative form on the whole integration domain.
In particular, the divergence free constraint for the magnetic field,
del . B = 0, is fulfilled during the simulation. Several numerical tes
ts are presented demonstrating the applicability of the nested grid co
de to many astrophysical problems including phenomena in which steep g
radients such as shocks or contact discontinuities appear.