CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Want to learn more about C++ and OpenFOAM's source code

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By adambarfi
  • 1 Post By eric.m.tridas
  • 5 Post By jhoepken

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2014, 08:38
Question Want to learn more about C++ and OpenFOAM's source code
  #1
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
Hi
I am new to openFoam and now i am working on C++ and cfd. now i want to know what should i do if i want to be a professional. i studied many tutorials and many parts of user guide so far and i am familiar with chtmultiregionFoam.
zahraa is offline   Reply With Quote

Old   August 12, 2014, 09:00
Default
  #2
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Hi Zahraa,

I'm not an openFoam expert but I think you should do different projects. that make you to have struggle with it and it's the best way to learn. also surfing this forum and the wiki and http://foam.sourceforge.net/docs/cpp/ website could help you to extend your knowledge.
Also the textbook written by Nima Samkhaniani would help you a lot.

Regards,
Mostafa
zahraa likes this.
adambarfi is offline   Reply With Quote

Old   August 12, 2014, 15:29
Default
  #3
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
Thank you. Samkhaniani book was useful but now i want to be able to write code and understand the structure of openfoam, how it works exactly.what i should do to understand?
zahraa is offline   Reply With Quote

Old   August 13, 2014, 07:21
Default
  #4
Member
 
Hao Chen
Join Date: Aug 2014
Posts: 66
Rep Power: 0
hchen is on a distinguished road
Quote:
Originally Posted by zahraa View Post
Thank you. Samkhaniani book was useful but now i want to be able to write code and understand the structure of openfoam, how it works exactly.what i should do to understand?
Hi,

I am wondering which book do you refer for Samkhaniani book?

Could you provide a link or copy?

Thanks!

Hao
hchen is offline   Reply With Quote

Old   August 13, 2014, 08:31
Default
  #5
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by hchen View Post
Hi,

I am wondering which book do you refer for Samkhaniani book?

Could you provide a link or copy?

Thanks!

Hao
It's a Persian textbook and only exist in Iran.
adambarfi is offline   Reply With Quote

Old   August 13, 2014, 17:09
Default
  #6
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 48
Rep Power: 14
eric.m.tridas is on a distinguished road
How familiar are you with C++? OpenFOAM frequently exploits some of the more complex C++ programming concepts. When I first started with OpenFOAM and was looking into the source code it all looked alien to me. In the mean time I worked on some other projects that really improved my C++ skills. Additionally, I read a few books about C++. When I revisited the code I realized that I could understand a lot more of what was going on.

I based the first code I wrote on code from other solvers and just explored the source code to get an idea of how to use the different classes.

I would just suggest reading some C++ books or taking a class on it then just look at the source code for all of the classes (found in the src folder of your OpenFOAM install) and the solvers (in the applications/solvers folder of your OF install).

Good luck!
zahraa likes this.
eric.m.tridas is offline   Reply With Quote

Old   August 14, 2014, 07:59
Default
  #7
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
Thank you very much Eric
zahraa is offline   Reply With Quote

Old   August 14, 2014, 08:29
Default
  #8
Senior Member
 
Jens Höpken
Join Date: Apr 2009
Location: Duisburg, Germany
Posts: 159
Rep Power: 17
jhoepken is on a distinguished road
Send a message via Skype™ to jhoepken
I can only agree with the Eric. Having at least a basic understanding of C++, OOP and maybe even some design patterns is of great help, when you are trying to learn do code with OpenFOAM.

Rather than starting with programing a new library, I suggest you start with programming some pre- or post-processing applications, to get familiar with OpenFOAM data structures. Tomislav has written a nice tutorial on how to write a new application from scratch, maybe you find that helpful: http://www.sourceflux.de/blog/howto-...n-in-openfoam/

Otherwise there is no real hands-on guide for developing with OpenFOAM, yet. You'll have to rely on the free tutorials available online, written by other enthusiasts .
kmooney, vigneshTG, zahraa and 2 others like this.
__________________
Blog: sourceflux.de/blog
"The OpenFOAM Technology Primer": sourceflux.de/book
Twitter: @sourceflux_de
Interested in courses on OpenFOAM?
jhoepken is offline   Reply With Quote

Old   August 17, 2014, 17:04
Default
  #9
New Member
 
zahra
Join Date: Jun 2014
Location: Iran-Tehran
Posts: 28
Rep Power: 11
zahraa is on a distinguished road
Thank you Jens
zahraa 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
how to use Doxygen to generate a PDF with OpenFOAM's source code documentation? Rajshekar OpenFOAM Installation 10 June 10, 2014 03:18
Code Documentation? openfoam1 OpenFOAM 2 January 29, 2014 03:59
OpenFOAM Under a Lesser GPL (LGPL) License hjasak OpenFOAM 24 February 14, 2012 12:18
How to modify discrete scheme crammer008 OpenFOAM 10 October 28, 2010 12:25
OpenCFD enhances OpenFOAM's parallel communications OpenFOAM discussion board administrator OpenFOAM Announcements from ESI-OpenCFD 0 October 2, 2006 08:36


All times are GMT -4. The time now is 01:34.