Optimal Gas Flow Algorithm for Natural Gas Distribution Systems in Urban Environment