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

Study material for CFD using Matlab

  1. May 22, 2013 #1
    I want to learn some basics of Computational Fluid Dynamics.But most of the books that I found dealt mostly with the theory of it with very less examples or problems to be solved numerically. I know Matlab and am pretty good at coding too.So, I am searching for a book from which I can learn CFD where there are plenty of examples and problems solved in Matlab. I will be really grateful if someone recommends some books with the above features.
     
  2. jcsd
  3. May 23, 2013 #2

    boneh3ad

    User Avatar
    Science Advisor
    Gold Member

    You probably won't find much. People don't use Matlab for this sort of thing because Matlab is a nice, easy language but it is incredibly inefficient at large problems and most CFD problems cannot really be solved on a typical desktop computer anyway. They usually get solved on a cluster or a supercomputer.
     
  4. May 23, 2013 #3
    First things first...
    I suggest you start by studying the book titled "Computational Fluid Dynamics; The basics with applications" by J.D. Anderson (McGraw Hill).
    However, most of the programming in CFD is done in Fortran. That is not restrictive though. Knowing MATLAB, wouldn't it be difficult for you to program the applications in matlab instead of fortran. The rationale (the rules, the equations etc) are the same, only the programming language is different.
     
  5. May 27, 2013 #4
    You could try this book:
    http://www.cfmbyexample.com/
    which has matlab codes
    I don't know if it's any good, but you can download the matlab source for free and study it. I would also recommend you first study the book of Anderson, or the book of Ferziger and Peric, it also has source code examples, in fortran I believe.

    Aero_UoP is right: most CFD codes are actually written in Fortran or c++. Also, when you know how CFD works, it doesn't matter in which language you write it in (up to a certain degree). But the nice thing about matlab is that you don't have to worry (a lot, in the beginning) about a lot of stuff and you can get a CFD code running quite fast (in terms of implementation time).
    Boneh3ad, you're a bit pessimistic: If you have a quad-core with 16 GB of memory, you can already do some interesting stuff, say 2M cell meshes and k-epsilon as a turbulence model. I have a 12-core Z800 with 100GB memory and it suffices for most engineering CFD simulations.
     
  6. May 27, 2013 #5

    boneh3ad

    User Avatar
    Science Advisor
    Gold Member

    And even on that beast of a workstation how long does that take?

    This is also assuming you feel that k-ε is a sufficient model for you, meaning flows with small pressure gradients (i.e. no inlets or compressors or certain airfoil geometries) and situations where you are fine averaging out the finer physics of the flow.

    Basically if you are trying to get approximate, engineering results, I suppose you could get a reasonable amount done on a powerful workstation. If you want to probe the physics then you need a lot more. Even a lot of k-ε simulations take a long time to run on anything but a cluster or better. Using Matlab to do this would exacerbate the issue since it is several orders of magnitude slower than an equivalent Fortran program.

    Now add in the additional runs require on the same problems for iterative and grid convergence and you are talking lots of time required to get an answer.
     
    Last edited: May 27, 2013
  7. May 27, 2013 #6
    Thank you boneh3ad, Aero_UoP and bigfooted for your reply. It was a really great help. I have started with Anderson's CFD: The basics with Applications.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook