Preparation for Computational Fluid Dynamics (CFD)

AI Thread Summary
The discussion centers on the transition from theoretical mathematics to practical applications in Computational Fluid Dynamics (CFD) for a Master's program. Key programming languages highlighted include Fortran, C++, and Matlab. Fortran and C++ are preferred for complex CFD projects due to their efficiency and speed, while Matlab is noted for its simplicity and utility in smaller problems. Users emphasize that Matlab is often used in engineering courses, but it may not handle larger computational tasks as effectively as Fortran or C++. C is recognized for its straightforwardness but lacks object-oriented features, which can be beneficial in simulations. Recommendations for learning resources include "Mastering Matlab 7" for Matlab and various "Headfirst" books for programming fundamentals. The conversation also touches on the importance of scalability in coding for modern multi-core and GPU programming environments.
joe_f
Messages
6
Reaction score
0
Hi all,

I have just completed my undergraduate studies in Mathematics from a UK university (specialising the Mathematical Physics and Fluid Dynamics) and will be continuing on a Masters programme in Applied Mathematics come fall. For my Masters, I would like to do something on CFD but the thing is, a lot of the courses I have taken for the past few years are very theoretical in nature and I have very little skills in programming (some background in Maple and Matlab).

What books do you guys suggest I plough through just so that I can have a better understanding on CFD and programming in general. Also, what are the main programming languages used by CF dynamicists? Matlab? ForTran? C++?

Thank you!
 
Physics news on Phys.org
Fortran and C++ are common, as Matlab is way too bulky to solve the really beefy problems. The basic languages are more efficient. I can't recommend any books just because I am not a CFD guy myself (experimental/theoretical) but those languages get used a lot.
 
I think it depends on what exactly the project is. For smaller projects, I head people use Matlab. For more complicated projects, people use c/c++/Fortran. They're not as fast as streamlined for calculations as Matlab but for more complicated projects, I understand the code produces output faster.

Plenty of physicists still use Fortran from what I can tell, but I think engineers have moved more towards Matlab. My friend in civil engineering has taken courses in c and MATLAB but no Fortran as far as I know.

I hear plenty of people use C++ but that it is a pain to work with. C is simpler but lacks object oriented capabilities which can be useful in simulations. However, C++ can be used just like C if you just choose to not use any of the object oriented features. C also is capable of handling memory issues.

Matlab is fairly simple to learn. Useful too. Engineers at my school are required a course in Matlab and use it in course afterwards. It is specialized for mathematical computation and has built in features for math problems (row reducing matrices, integrating, solving some simpler differential equations, etc.). If I remember right, Matlab is based off Java which is based off C, so if you pick up one, you should be able to work with the other.

This is all from me looking up which languages would be useful. I don't have any experience with Fortran or C++ but I have messed around with C a little and I am familiar with Matlab and Java.

As for books, I learned Java from Headfirst Java and I thought it was very good. Maybe there are other Headfirst books that would fit your needs?

https://www.amazon.com/gp/search/re...=UTF8&qid=1309734198&rnid=5&tag=pfamazon01-20

I learned Matlab from Mastering Matlab 7. It's pretty thorough and can be used as a pretty good reference later on.

https://www.amazon.com/dp/0131430181/?tag=pfamazon01-20
 
Matlab is used all over engineering but usually for fairly small problems. It is optimized for fast programming, not efficient executing. Any real CFD problem would require something more basic like C++ or Fortran. In my experience, Fortran seems to be referred (no idea why).
 
What ever code you write should be able to scale to multiple processors. Multicore gpu programming seems to be an area that is expanding.
 
Hey, I am Andreas from Germany. I am currently 35 years old and I want to relearn math and physics. This is not one of these regular questions when it comes to this matter. So... I am very realistic about it. I know that there are severe contraints when it comes to selfstudy compared to a regular school and/or university (structure, peers, teachers, learning groups, tests, access to papers and so on) . I will never get a job in this field and I will never be taken serious by "real"...
Yesterday, 9/5/2025, when I was surfing, I found an article The Schwarzschild solution contains three problems, which can be easily solved - Journal of King Saud University - Science ABUNDANCE ESTIMATION IN AN ARID ENVIRONMENT https://jksus.org/the-schwarzschild-solution-contains-three-problems-which-can-be-easily-solved/ that has the derivation of a line element as a corrected version of the Schwarzschild solution to Einstein’s field equation. This article's date received is 2022-11-15...
Back
Top