How To Learn CFD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

How to start learning CFD?

I am proficient enough in programming using C and MATLAB but when I open any CFD text book, all
i find is calculus. I want to slowly learn writing my own code but the books don't give any idea how to
proceed with those hifi mathematical schemes

Shreyas Ragavan · University of Leeds

A strong or atleast functional understanding of calculus and numerical techniques is required to truly
understand the code behind CFD and program a solver. Familiarity with C, C++, Python and
MATLAB will definitely help in this direction. The programming codes are written to implement
mathematical schemes.

Text Books : You can refer to 'Versteeg and Malalasekara' for a good introduction and specific
guidelines/ an example to programming a pressure based algorithm. I also recommend using John
Anderson's - Introduction to CFD, which is a great book for the theory with a gradual progression in
the complexity of the mathematics involved. Another book that should help relate to the coding is
'Applied CFD - Rainald Lohner'.

A simply worded introduction to CFD , focused on concepts and much less mathematics (and a free
ebook) >http://bookboon.com/en/textbooks/energy-environment/computational-fluid-dynamics

To understand Fluid Mechanics on a fast(er) track, try the videos and notes at
> http://web.mit.edu/hml/ncfmf.html

Some very nice sources for coding examples :http://storify.com/ShreyasRagavan/software-and-


code-related
Once you get along, you might want to plunge into open source CFD applications like OpenFOAM
and SU2.
I'd recommend playing around with SU2 before going for openFOAM.

Have a look at the resources I've collated >http://cfdrevolutions.weebly.com/resources.html


The 'open access' and 'mathematics' sections have resources that can help with streamlining your
understanding of the required calculus. The links I've posted above are spread across different
sections and are available in the website.

Chennakesava Kadapa · Swansea University


Your intention is commendable. But let me ask you some questions to make you understand the
underlying intricacies.

1.) Do you have ample time?


2.) Are you excellent at programming, in the sense to decide which data structures and algorithms
are the best and know in and out of them?
3.) Are you good at MPI programming ?
4.) Are you really good at matrix algebra and numerical techniques for matrix computations?
5.) Do you really think you can develop a code which runs faster than that of ANSYS or FLUENT or
any available commercial package?

If your answer is YES to all of the above questions then you can go ahead. Unless you need your
own codes to integrate into some other physics or want to have capabilities which are not available
in commercial SWs, its absolute waste of time to do what you want to do. There is no end to what
one defines 'Optimized' when it comes to coding.

Coding for some basic problems to understand the numerical techniques would be okay.

If you can spend one or two weeks you should be able to perform parallel processing with ANSYS.

A CFD professional outside academics does not really bother about what goes inside the "blackbox",
unless one involves in code development team. CFD / FEM related jobs are completely different
outside academics. Most of them(90%) are like 'Mesh and Run' type.

 lad to be of help, Surya.


Thanks Majid. However, I'm very very far away from being a legend.

I concur with Mr Gilbert's comments.


Doing simulations is important. I've found that , though it is difficult, a balanced approach, with focus
on theoretical as well as simulation setup aspects, works best. Completing simulations and tutorials
also provides motivation and a heightened sense regarding, which part of the theory is important.

A great way of plunging into openFOAM and other open source CAE/CFD applications, is by using
CAE-Linux , which has a huge range of applications, pre-installed. You can dual boot with windows
or run it virtually within windows ( see : http://storify.com/ShreyasRagavan/open-source-os )

In addition to the forums on CFD-online, Linked-in also has a great CFD community which is worth
checking out.

Apr 15, 2012

Haris Hameed Mian · Northwestern Polytechnical University

Hi
do anyone knows about similar site for strucutral analysis code...

Apr 19, 2012


Sangeeth Simon · Indian Institute of Technology Bombay

Hey Surya,
I am also a beginner like you in CFD and from my exploration, 2 books seems to be providing sound
fundamentals for this: Numerical Heat Transfer and Fluid Flow by Suhas V Patankar ( who
interestingly is one of the forefathers of CFD) and Introduction to CFD by Anil W Datte. In the second
book, simple programming are also included and hence helps a great deal to correlate between
theory and application. My only suggestion is, follow ONLY one book( instead on confusing yourself
with lots of good books). Cheers.

Apr 25, 2012

Shreyas Ragavan · University of Leeds

Hi Sangeeth,

Thanks for your suggestion. I've come across Datte's book, but have not had a chance to read it.
Patankar's book is definitely a great resource for those interested in CFD.

However, I think what intimidates most people from getting intimate with CFD, is that it looks quite
complicated with differential calculus and physics spread all over the place. Very few books actually
approach the subject with simple and progressive examples of developing CFD code.

Developing that kind of code is by itself quite complicated. This linked discussion and the comment
by Ian Eames sums it up pretty well. (http://www.linkedin.com/groups/book-on-CFD-introduction-
beginning-66032.S.101876547?qid=96877ce9-5415-4dbb-b5f7-
5f035c53dbe5&trk=group_items_see_more-0-b-ttl )

Following One textbook may be one way to approach the study, but I've found that different authors
come up with their own language, style, examples, etc. It makes sense to stick to a 'good' book, but
also have a look at the way the same concepts are explained by other authors, as well as look at
different material, for example videos/course material, to gain better insight and absorb things in a
more profound or if you like, Universal manner.
May 1, 2012

Mohammad Shakil Ahmmed · University of New South Wales

The easiest way to know about cfd for beginner is to read the book introduction to cfd by Anderson .

May 14, 2012

Chennakesava Kadapa · Swansea University

I second Shreyas thoughts. If you want learn CFD or FEM first learn some basics and then run some
simulations on the existing softwares. That gives a glimpse into the methodologies.

But when it comes to coding on your own, you need to think about it once again. Its not as easy it
might seem. In CFD, even simple advection-diffusion problems pose lot of issues. And if you are a
beginner and are not aware much of matrix algebra, then don't use programming languages like
C++, JAVA etc. Better to use MATLAB where all the matrix algebra routines are readily available.

If you want to learn CFD or FEM for the sake of job then learn basics and use any of the SWs.
Unless there is further purpose of using your codes I don't recommend coding on your own because
coding is an entirely different paradigm.

May 16, 2012

Vijai Kumar · Madras Institute of Technology

I have a best solution for this.. if u want to learn CFD go


tohttp://nptel.iitm.ac.in/courses/112105045/ this is similar and better than the open course ware by
MIT and was basically started by a consortium of IIT's and IISC.. around 40 lectures, each of 1 hour
is given by Dr.suman chakraborthy.. its everything u need and more.. learn cfd.. and CFD is fun
May 18, 2012

Shreyas Ragavan · University of Leeds

Hi Vijai

That's a Great link and yes, CFD is very fun, not to mention intriguing.

However, I think MIT's open course ware, is quite comprehensive in it's own right.
In fact, Prof Lorena Barba of Boston University has been conducting online CFD courses via a portal
called Piazza and it's been extremely popular and very useful. All the lessons are available in the
youtube channel >
> http://www.youtube.com/watch?list=PL30F4C5ABCE62CB61&feature=player_embedded&v=cDy5
XGOokBY

May 18, 2012

Vijai Kumar · Madras Institute of Technology

hai shreyas,

I found your link to be really helpful... i said NPTEL is better because MIT doesn't give away anything
and sadly for indian students who are in undergrad or beginning post grad level and trying to learn
something MIT's OCW is not very helpful.That is where NPTEL plays a major role by giving away
everything u need to understand a particular course. Offcourse everything has its own use and
purpose and i am not being judgemental. Its just that i like NPTEL a lot...

And for the person who posted this question mr. surya
if you are into programming or developing CODES i have something to say "Nobody is going to
appreciate you for reinventing the wheel". so use a COMMERCIAL code like ANSYS FLUENT or
COMSOL or some opensource codes like OPENFOAM, Code Saturne. Write a code only when
there is a need. Don't waste your time...
May 18, 2012

surya narayana Agnimitra · Indian Institute of Technology Bombay

u see i want to learn wats going on inside...i want to reduce the processing time and all optimize my
memory allocation strategy .A CFD professional who doesnot care about the system compatibility
and processing cost and time is no good.....and i have been playing around with ANSYS and
COMSOL ..it isnt easy to run them on parallel cores......i have jumped into PYTHON...it is cool...
Thanks evryone for your valuable advice.....

May 18, 2012

Chennakesava Kadapa · Swansea University

Your intention is commendable. But let me ask you some questions to make you understand the
underlying intricacies.

1.) Do you have ample time?


2.) Are you excellent at programming, in the sense to decide which data structures and algorithms
are the best and know in and out of them?
3.) Are you good at MPI programming ?
4.) Are you really good at matrix algebra and numerical techniques for matrix computations?
5.) Do you really think you can develop a code which runs faster than that of ANSYS or FLUENT or
any available commercial package?

If your answer is YES to all of the above questions then you can go ahead. Unless you need your
own codes to integrate into some other physics or want to have capabilities which are not available
in commercial SWs, its absolute waste of time to do what you want to do. There is no end to what
one defines 'Optimized' when it comes to coding.

Coding for some basic problems to understand the numerical techniques would be okay.

If you can spend one or two weeks you should be able to perform parallel processing with ANSYS.
A CFD professional outside academics does not really bother about what goes inside the "blackbox",
unless one involves in code development team. CFD / FEM related jobs are completely different
outside academics. Most of them(90%) are like 'Mesh and Run' type.

May 19, 2012

Omar Eladel Mahmoud · Ain Shams University

@Chennakesava:

Thank you for your reply but I have some notes on it.

For the first 4 questions, I agree with you in them, but for 5th question, I think that it might not be the
goal of the software developed to be faster or more optimum than ANSYS or FLUENT because the
goal of programming may be to know what "really happens under the table" so as to make the most
use of the commercial software available and know how it works so if a problem in the theoretical
basis faced the user, he could be able to solve it technically right.

May 19, 2012

Chennakesava Kadapa · Swansea University

@Omar: I am sorry. I found it hard to understand what you wanted to say.

May 19, 2012

Omar Eladel Mahmoud · Ain Shams University

I'm really sorry.


I have a comment on your 5th question which is about the speed of the developed code vs. the
commercial software available. It might not be the goal of developing a software from scratch is to
compete with commercial software but the goal may be that you want to deeply understand the
theory of these software and know how they run in a right way, also by developing your own code,
you understand the basic mathematical model of CFD used and when you use a commercial
software and you face a problem, you know its theoretical reason (not the operation mistake that
have been done in the software).

I hope that my point is clear now.


Thank you.

May 19, 2012

Shreyas Ragavan · University of Leeds

Hi,

I think the questions posed by Chennakesava are quite valid, from the point of view that it throws
light on the aspects that one must look into if he wants to get 'behind the scene' with respect to CFD
and program a solver.

However, I must also say that we are rarely born with all the skill sets that we need, to do something
worth doing. The answers to All those questions cannot be Yes. I also think that a CFD professional
must be knowledgable about what's inside the black box, so that he can figure out ways to improve
it.

As Omar says, developing code makes a lot of things clearer, which 'push-button' software like
Ansys/Comsol do not; atleast not without effort. For example, after having used Fluent, when I tried
openFOAM, I felt a lot more technical expertise was required to get it right.

The code and numerical technique is the driving force behind any CFD application and it's definitely
worth the time to understand it's implementation. At any rate, relevant UDF's and macros can be
hooked up to commercial software to accomplish what we need.

May 22, 2012


Chennakesava Kadapa · Swansea University

@Omar and @Shreyas: Thank you.

I agree. It would be unwise for an individual trying to compete with already existing SWs. As Shreyas
said the questions I asked give an idea of the inherent difficulties underlying in developing an
'optimized' code. Thats why I said, if one wants to understand whats going on inside the box, just do
some basic coding for simple problems. That should be good enough. If you face any difficulties
later, while simulating complex problems, you better go back to theory and understand it then rather
than 'inventing the wheel again'.

Developing codes on your own is always good to understand how things work. There is no doubt.
My opinion is that learn the theory behind and use a SW if one wants to learn CFD. I am not saying
that just use a SW at first shot. Learn the theory first, may be develop few simple codes to get an
understanding, then use SW.

Unless one needs own codes to do some specific tasks its not worth developing own codes. Its
matter of time, resources and the requirement. As per Suryanarayana's requirements, he can follow
a book Versteeg or any other basic CFD book and develop basic codes.

May 23, 2012

Laurence Griffiths · University of Bristol

I realise this post is a little old now, but in case you do embark on coding up your own solver, you
might want to take a look at some projects where the code is available (as others have already
suggested). Also especially useful if you don't know where to start, you'll notice many codes follow a
similar structure, favour certain integration methods, although covered well in the literature, the
discretisation of certain terms sometimes is not. I would highly recommend reading up on numerical
methods first, such as coding up integration schemes and solving PDEs before attempting to code
up a CFD solver - If you understand these basics reading CFD books makes a lot more sense.
Here's a list of a few opensource (in as far as the code is visible, not sure on licencing on all of the
projects for commercial use!)
For a full description go to the respective sites, my comments next to each project arnt terribly
consistent.

Xfoil: 2D viscous/inviscid interactive code.http://web.mit.edu/drela/Public/web/xfoil/ . More of a low


computational cost design code.
AVL: 3D vortex lattice code: http://web.mit.edu/drela/Public/web/avl/ . Another code with low
computational overhead.
OpenFoam: 3D, very versatile code. Active user community. Various pre-build packages as
well. http://www.openfoam.com/
XLR5: http://xflr5.sourceforge.net/xflr5.htm wings/aerofoil code. Again aimed more at the low
computational effort/disgn scenario.
FreeCFD: http://www.freecfd.com/ open source CFD project. . 3D implicit density based solver. Site
also has a forum.
Gerris : http://gfs.sourceforge.net/wiki/index.php/Main_Page . supported by National Institute of
Water and Atmospheric research, lots of multi phase stuff, immersed boundary conditions etc. Good
users guide/example cases.
SU stanford univeristy OpenSource CFD code http://su2.stanford.edu/
Code Saturn: http://code-saturne.blogspot.co.uk/ finite volume CFD

Mesh generators:
Qhull: http://www.qhull.org/
Triangle: http://www.cs.cmu.edu/~quake/triangle.html
Gmsh: http://geuz.org/gmsh/ (uses tetgen and netgen algorithms)
Tetgen: http://tetgen.berlios.de/
netgen: http://www.hpfem.jku.at/netgen/
sumo: http://www.larosterna.com/sumo.html - highly recommend this! comes with many geometries
already loaded of full aircraft. Volume mesh generation via tetgen.
http://engits.eu/en/engrid: volume grid generation with CFD in mind.

Finally if you just want to play about with some CFD, i recommend installing CAE linux (also
available on a live CD). As this comes with Code Saturn and OpenFoam installed, including many
other engineering packages and mesh generation. CAE linux is just Ubuntu (one of the LTS
versions) with a lot of engineering/FEA/CFD software installed with it. http://www.caelinux.com

Jul 15, 2012


Laurence Griffiths · University of Bristol

Also, very useful is:


"Kroll, N. and Jain, R. K. (1987). Solution of Two-Dimensional Euler Equations -
Experience with a finite volume code. Forschungsbericht, DFVLR-FB 87-41, Braunschweig,
Germany."

Jul 15, 2012

Gautam Dudeja · Auburn University

I am new to CFD and for a class project I am suppose to use CFD for improving cooling systems
efficiency for data centers. Is their any resources which I can use for understanding CFD. I searched
but couldn't find the resources I need for using CFD in Data Center environment in particular.

Feb 13, 2013

N.C. Markatos · National Technical University of Athens

You need a good book (e.g.Versteeg and Malalasekara) a good code ( e.g.PHOENICS,Fluent ,etc)
and a lot of practice ,applying them to simple cases.I assume you master elementary fluid
mechanics of course.

Oct 14, 2013

Messaoud Kermiche · Badji Mokhtar - Annaba University

This indian website contains a great lectures on engineering domainshttp://nptel.ac.in/ take a look

Jan 31, 2014


Chinedu Nwaigwe · The University of Warwick

Since you already know how to program, my opinion is that you pick a good introductory book on
Numerical methods. When you understand the basics of Numerical methods, then you can start
reading books on CFD. If you can understand and program numerical methods, the rest of CFD is
then fluid dynamics and that is why you then need to move into reading good books on CFD. But
first, learn numerical methods and their programming.

Apr 3, 2014

Rogerio Maestri · Universidade Federal do Rio Grande do Sul

.
A basic question that nobody did:
.
What is your level of knowledge of Fluid Mechanics?
.
In view of this it is possible to suggest a way.
.

Apr 22, 2014

Weidong Li · Old Dominion University

1) know about enough basic CFD knowledge.


2) know about enough Fluid mechanics.
2)Know well about the problem you want to solve. It is what kind of problem. Generally, it is a
compressible or incompressible problem.
3) On developing a compressible solver, I suggeste you reading J.Blazek's book.
4)On developing a in comprssible flow solver, I suggeste you learn M.Peric's book.
CFD needs not only theories, but more important practices.
Apr 23, 2014

Rogerio Maestri · Universidade Federal do Rio Grande do Sul

.
@ Li
.
Is correct for your requirements menu, I just pass the item (2) to position (1), and add in (3) a good
knowledge of the boundary conditions.
.

Apr 23, 2014

Weidong Li · Old Dominion University

@ Maestri
In my menu, all are on equal terms.
In addition, for comprssible flow and incompressible flow, the attributes of the governing equation is
different, so the sloving strategies of course are different. That's why I give 3) and 4).
You are right. a good knowledge of the boundary conditions is very very important.

Apr 24, 2014

Hasan Celik · Izmir Institute of Technology

I would suggest you Prof. Patankar's book. It is a good source for both beginners as well as
experienced people.

Apr 24, 2014


Shrish Shukla · Indian Institute of Technology Delhi

As already mention some good books of cfd i would like to suggest a best book for a cfd learner is :-
" Tackling Turbulent Flows in Engineering " by A. Dewan
you first start with this book then ones you gain some details knowledge about cfd mathematical
equations then may refer books malyashekhra & patankar .

May 31, 2014

Hoskoti L

Hii,

Following links would be good source to learn Fluid Mechanics and CFD

CFD and Fluid Mechanics- ANSYS

http://www.ansys.com/Industries/Academic/Tools/Curriculum+Resources/Tutorials,+Examples+&+C
urriculum

 Lecturer notes -Professor, Department of Mechanical Engineering, Indian Institute of Technology


Kanpur

http://nptel.ac.in/courses/Webcourse-contents/IIT-KANPUR/FLUID-MECHANICS/ui/Course_home-
11.htm

 Notes on Introduction to Fluid Mechanics _University of LEEDS

http://www.efm.leeds.ac.uk/CIVE/FluidsLevel1/Unit01/T1.html

 Good source for computational Fluid Dynamics

http://www.cfd-online.com/Links/education.html
 other source pdf notes

http://www.freestudy.co.uk/

 Notes from IIT Khargpur

http://nptel.ac.in/courses/Webcourse-contents/IIT-%20Guwahati/fluid_mechanics/

you can find some more links from the blog

http://cfd-resources.blogspot.in/2014/06/computational-fluid-dynamics-cfd-open.html

Jul 19, 2014

Chandra Sekhar · Rutgers, The State University of New Jersey

Hi

I cant add anything new to what everyone has said, but I want to put forth an idea (this is not related
to the asked question). I am a CFD enthusiast and I would very much like to pursue it as a hobby
first and then hopefully a career later. I am currently developing a GPU code for 3d navier stokes
flow (I think gpu are the future in CFD:) ). I would like to know if anyone is interested in
collaborating.

After some research I have realized that CFD is not difficult but painstakingly elaborate and vast, so
would be awesome if anyone would like to collaborate.if interested please reply to this message or
email me at [email protected].

You might also like