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.
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.
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.
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.
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.
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.
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.
I have a best solution for this.. if u want to learn CFD go to http://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
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 >
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...
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.....
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.
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.
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 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.
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.
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/
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
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.
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.
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.
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.
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 .
CFD being a rising branch has lots of online sources to start with. The best source so far is CFD online, I also guide beginners to get expertise in CFD coding and GUI packages. You can contact me in case needed.
For future reference, if you are familiar with Matlab then the FEATool Multiphysics toolbox might be an easy way to start. With the toolbox you can start your CFD modeling with the Matlab GUI, then save the model as a m-script file which you can inspect and edit to see how the Matlab functions and commands are used to build up and solve the model.
I have a blog post on the topic of getting started with CFD discussing software, workflow & ease-of-use, and quality based on 15+ years of experience. Additional resources can be found on the page, including a breakdown of costs as well as some other discussions of specific applications.
Start with something very simple that has analytic solutions, such as in one spatial dimension. The advection-diffusion is a good problem to begin. Do NOT try comolicatied problems atfirst.