Transonic gas flow in a duct of varying area