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

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

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

Like Tree5Likes
  • 1 Post By adambarfi
  • 1 Post By eric.m.tridas
  • 3 Post By jhoepken

Reply
 
LinkBack Thread Tools 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: 3
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: 314
Rep Power: 6
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: 3
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: 62
Rep Power: 2
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: 314
Rep Power: 6
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: 6
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: 3
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: 156
Rep Power: 8
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 and zahraa 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: 3
zahraa is on a distinguished road
Thank you Jens
zahraa 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
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 04:59
OpenFOAM Under a Lesser GPL (LGPL) License hjasak OpenFOAM 24 February 14, 2012 13: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 11:51.