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

how can i start writing CFD code?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools 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: 7
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: 8
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
New Member
 
Dominic Chandar
Join Date: Mar 2009
Location: Singapore
Posts: 20
Rep Power: 8
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's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 244
Blog Entries: 6
Rep Power: 9
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: 7
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: 7
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about cfd code, free or for payment John M Main CFD Forum 6 September 15, 2003 08:59
CFD Design...The CFD Future John C. Chien Main CFD Forum 19 October 6, 1999 11:57
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 13:46.