CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

how can i start writing CFD code?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2009, 16:25
Exclamation how can i start writing CFD code?
  #1
New Member
 
ali
Join Date: Sep 2009
Posts: 3
Rep Power: 16
alirezavatandoust is on a distinguished road
hi ,
i'm trying to start writeing a CFD code by C++, but I dont know what the steps are. is anybody there to help me please?cheers
alirezavatandoust is offline   Reply With Quote

Old   September 30, 2009, 17:25
Default
  #2
New Member
 
Nate Salpeter
Join Date: Apr 2009
Posts: 4
Rep Power: 16
nsalpeter is on a distinguished road
If you are really wanting to write something on your own (*shudders at painful memories*) your first step might be sitting down with "Numerical Heat Treansfer and Fluid Flow" by Suhas Patankar.

This book is largely regarded as the bible of CFD. It won't get into the most nitty gritty of turbulence models, but it will give you some pretty clear numerical methods and strategies for going about writing your own code.
nsalpeter is offline   Reply With Quote

Old   September 30, 2009, 19:44
Default
  #3
Member
 
Dominic Chandar
Join Date: Mar 2009
Location: United Kingdom
Posts: 31
Rep Power: 17
dominic is on a distinguished road
Send a message via Skype™ to dominic
Some of the important points are
* Know what you want to do and what you are doing. You must be clear on what you want to formulate and solve.

*Write down a small algorithm, or something like a structure of the code.. like what are the inputs required.. what is your time stepping.... what is your discretization scheme used... etc. Think of what parameter you are interested to monitor and print out finally.

*Initially don't bother about syntax errors. Just write in the code as if you are writing in plain English. At places where you feel that, the block of code would be large, just replace it by a function call.... say solve(). Do not worry about declaring variables now..

*After you are having an idea of your code structure, now you can correct your code, by declaring the variables, defining the functions etc..

Also take a look at many CFD codes (small) available in the web or in books for you to get a feel.

Happy coding !
Dominic
dominic is offline   Reply With Quote

Old   September 30, 2009, 22:45
Default
  #4
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 342
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
In addition to the previous advice:

Start with a 1-D code. Solve some problems like quasi-1D nozzle, etc

Then go to 2-D. Flate plate, lid-driven cavity, maybe an airfoil, etc.

By this time, you would have a pretty good idea.

Then 3-D.

You seem to be totally new to this. Start with very simple things. Anderson's CFD book is quite good for beginners. Initially write a lot of code on your own. Then start looking at other people's codes. Many of them are freely available on the internet.
praveen is offline   Reply With Quote

Old   October 2, 2009, 07:41
Thumbs up
  #5
New Member
 
ali
Join Date: Sep 2009
Posts: 3
Rep Power: 16
alirezavatandoust is on a distinguished road
hi everyone !
thanks for your help
those were realy helpful.
cheers
alirezavatandoust is offline   Reply With Quote

Old   October 2, 2009, 07:43
Default
  #6
New Member
 
ali
Join Date: Sep 2009
Posts: 3
Rep Power: 16
alirezavatandoust is on a distinguished road
hi!
should I use any modeller and mesher software?which one is more suitable?
thanks
alirezavatandoust is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD Design...The CFD Future John C. Chien Main CFD Forum 20 November 19, 2015 23:40
about cfd code, free or for payment John M Main CFD Forum 6 September 15, 2003 08:59
Which is better to develop in-house CFD code or to buy a available CFD package. Tareq Al-shaalan Main CFD Forum 10 June 12, 1999 23:27
cfd job Dr. Don I anyanwu Main CFD Forum 20 May 17, 1999 15:13
Commercial CFD code Hanson G. He Main CFD Forum 1 October 15, 1998 08:49


All times are GMT -4. The time now is 19:14.