Discuss the principles of computational fluid dynamics (CFD) and its applications in mechanical engineering.