Stability analysis and improvement in computational fluid dynamics