Preparation for Computational Fluid Dynamics (CFD)

Click For Summary

Discussion Overview

The discussion centers around preparing for Computational Fluid Dynamics (CFD) studies, particularly focusing on programming skills and recommended resources. Participants share insights on programming languages commonly used in CFD and suggest books for further learning.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants suggest that Fortran and C++ are common programming languages for CFD, while Matlab is seen as less efficient for larger problems.
  • Others argue that Matlab is suitable for smaller projects due to its ease of use and built-in mathematical features, although it may not be as fast as C or Fortran for complex simulations.
  • There is a mention that engineers tend to use Matlab more frequently, while physicists may still prefer Fortran.
  • One participant notes that C++ can be cumbersome to work with, but it offers object-oriented capabilities, whereas C is simpler but lacks these features.
  • Participants recommend various books for learning programming, including "Headfirst Java" for Java and "Mastering Matlab 7" for Matlab, though opinions on specific CFD resources are not unanimous.
  • There is a suggestion that any code developed should be scalable to multiple processors, with an emphasis on the growing field of multicore GPU programming.

Areas of Agreement / Disagreement

Participants express differing views on the suitability of programming languages for CFD, with no consensus on which language is definitively better. The discussion remains unresolved regarding the best approach to learning and applying programming in CFD.

Contextual Notes

Participants highlight the importance of understanding the specific requirements of CFD projects when choosing programming languages, indicating that the choice may depend on project complexity and scale.

Who May Find This Useful

Individuals preparing for studies in Computational Fluid Dynamics, particularly those interested in programming and mathematical applications in engineering and physics.

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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
17K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 9 ·
Replies
9
Views
2K