Want to learn more about C++ and OpenFOAM's source code
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. |
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 |
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?:)
|
Quote:
I am wondering which book do you refer for Samkhaniani book? Could you provide a link or copy? Thanks! Hao |
Quote:
|
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! |
Thank you very much Eric
|
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 :). |
Thank you Jens:)
|
All times are GMT -4. The time now is 00:48. |