A modified potential method for transonic flow problems