|
[Sponsors] |
August 24, 2012, 21:30 |
cfd codes in c language?
|
#1 |
New Member
nikhil
Join Date: Aug 2012
Posts: 2
Rep Power: 0 |
can anyone please help me how to start with c coding in cfd, i.e any study material which has good number of examples with codes.
|
|
August 25, 2012, 10:26 |
|
#2 |
Member
Yon Han Chong
Join Date: Jun 2012
Posts: 77
Rep Power: 13 |
Openfoam is written with C++ and open source. You should be able to see the source code but I don't know why you want to write CFD code in C as it will take a huge effort.
|
|
August 25, 2012, 10:33 |
|
#3 |
Senior Member
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20 |
C or Fortran are the languages of choice for efficient codes, so writing one in C is not a bad idea!
|
|
August 25, 2012, 10:37 |
|
#4 |
Member
Yon Han Chong
Join Date: Jun 2012
Posts: 77
Rep Power: 13 |
Sorry I did not meant the choice of language was wrong but rather why do you want to write a CFD code any way.
|
|
August 25, 2012, 11:13 |
|
#5 |
New Member
nikhil
Join Date: Aug 2012
Posts: 2
Rep Power: 0 |
THANKS for the sugestions but none of you have answered my question, please help me.let me know a good study material or website for the above purpose.
|
|
August 25, 2012, 11:28 |
|
#6 | |
Senior Member
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20 |
Quote:
You should rather encourage him It is the best and only way to truly learn CFD! Anyone doing CFD should be forced to write a least a simple 2 code in my opinion! regarding the question of study material for a C cfd code...I'm afraid there is none, at least I have never seen something. Is your focus on learning CFD (then you will find some good books in the section here in the forum) or learning C? Then there are certainly a lot of free resources on the web... I guess the short answer is: If you want to learn CFD, then take a class or read some books / papers. If you want to learn how to program, just program = |
||
August 25, 2012, 11:31 |
|
#7 | |
Senior Member
Join Date: Aug 2011
Posts: 272
Rep Power: 15 |
Quote:
First you have to master the language by learning it, in a general context, not CFD. Second start to learn CFD and discretization methods,schemes and algorithm. The book from Gribel http://books.google.fr/books/about/N...cC&redir_esc=y is very good for that. Especially because after you can get his code Nast2D. As it is written in C it should fulfil your will http://home.arcor.de/drklaus.bauerfe.../eNaSt2DA.html Good luck ! |
||
August 25, 2012, 11:58 |
|
#8 |
Member
Yon Han Chong
Join Date: Jun 2012
Posts: 77
Rep Power: 13 |
I also don't know any textbook with CFD code listing in C.
However, if you are willing to learn Fortran, I used a book called "Computer-Aided Engineering: Heat transfer and fluid flow" by Gosman, Launder and Reece when I was an undergrad. They are the force behind Start CD. Fortran style in the book is now very old but Fortran is still very useful language for scientic code so I don't think it is a complete waste of time to learn the language. |
|
August 25, 2012, 13:15 |
|
#9 |
Senior Member
Join Date: Aug 2011
Posts: 272
Rep Power: 15 |
||
August 25, 2012, 21:39 |
|
#10 |
Member
Yon Han Chong
Join Date: Jun 2012
Posts: 77
Rep Power: 13 |
I wasn' t saying he shouldn't be learning C. I am saying he could learn Fortran as well.
I think people talk too much about which languages to use but most of the tasks can be done with any language including BASIC. However C and Fortran are the most common and you should learn both if you are serious about programming. Frankly I have seen more Fortran than C but that's because I am working in an engineering company not software company and old fashioned. :-) |
|
August 26, 2012, 10:15 |
|
#11 |
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 414
Rep Power: 17 |
Thank you for this comment! I could not agree with you more. You hear a lot these days that you should not write your own CFD code because of tools like openfoam. Seriously, if you want to be a CFD developer or even an "expert" CFD user you need to write at least one code yourself, even if it is a simple one... not to be confused with SIMPLE
|
|
August 26, 2012, 12:23 |
|
#12 | |
Senior Member
Join Date: Aug 2011
Posts: 272
Rep Power: 15 |
Quote:
Because it's only when you put your hands in dirty oil that you become a good car mechanic Theory is good but practice is invaluable! So please let nikhilbagalkot conducting his own experience... It would be great for him. |
||
August 26, 2012, 15:43 |
|
#13 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,781
Rep Power: 71 |
Quote:
I have no idea of a book where you can find example of C++ applied in CFD, expecially for newcomer in CFD ...I think to only C++ program-language book that treat general topics maybe an idea could be to use Maple programming a general algorithm and then use the translate function in C ... However, see Ref at page 22 of http://powerlab.fsb.hr/ped/kturbo/op...s/C++Intro.pdf |
||
August 26, 2012, 18:24 |
|
#14 |
Senior Member
Join Date: Aug 2011
Posts: 272
Rep Power: 15 |
nikhilbagalkot is not seeking for C++ code but C code. And I gave him the reference of NaSt2D code written in C.
If he wants C++ Openfoam is a must...but perhaps a bit difficult to start with when you do not have a sufficient experience. iNavier is also in C++ and I guess there exist others... |
|
September 10, 2012, 09:56 |
|
#15 |
New Member
Jet Power
Join Date: May 2012
Posts: 3
Rep Power: 14 |
There are CFD solvers written by C. I'm sure. If you want to develop a new solver for a company or an institue, the choose of C is also a good way.
For learning or hoppy, in my opinion, Python is better. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD codes ICARE and N3S (Navier-Stokes) | Aeolus | Main CFD Forum | 0 | January 13, 2007 17:20 |
CFD CODES FOR MARINE APPLICATIONS | 1995JAL | Main CFD Forum | 2 | August 19, 2006 07:40 |
CFD codes and books: need your opinion | Giovanni Mattarolo | Main CFD Forum | 3 | February 4, 2006 22:52 |
is there any money in CFD? | T | Main CFD Forum | 35 | May 9, 2001 19:35 |
PC vs. Workstation | Tim Franke | Main CFD Forum | 5 | September 29, 1999 15:01 |