Modeling heterogeneous media with microstructures of different scales