Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Preparation for Computational Fluid Dynamics (CFD)

  1. Jul 3, 2011 #1
    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!
  2. jcsd
  3. Jul 3, 2011 #2


    User Avatar
    Science Advisor
    Gold Member

    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.
  4. Jul 3, 2011 #3
    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?


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

  5. Jul 3, 2011 #4


    User Avatar
    Science Advisor
    Gold Member

    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).
  6. Jul 3, 2011 #5
    What ever code you write should be able to scale to multiple processors. Multicore gpu programming seems to be an area that is expanding.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook