A self-adaptive-grid method with application to airfoil flow