Process-based upscaling of reactive flow in geological formations