Development of a method for numerical calculation of wave refraction