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

Where has the code documentation gone

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mturcios777

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 18, 2014, 13:10
Default Where has the code documentation gone
  #1
New Member
 
Will
Join Date: Dec 2011
Posts: 17
Rep Power: 15
willzyba is on a distinguished road
I'm find my self doing more and more customisation of OpenFOAM 2.3x and I'm gradually figuring things out, however every time I open a file I can't help but wonder where the in-code documentation has gone.

Surely the original authors would have documented what they were doing, even odd hints about the logic of the structure and why it was done one way over another. If nothing else but to help them in a future release/revision.

I do appreciate I'm a mere mortal looking at code from the Gods. But even the more basic coding standard say you should document it.

So I'm left assuming that there must be a version of OpenFOAM somewhere that does has documentation, but when they release it to the masses they delete all comments and paste in the copyright notices. If this is the case, then can I get a copy of the documented code, or is that propitiatory?
willzyba is offline   Reply With Quote

Old   September 19, 2014, 04:26
Default
  #2
New Member
 
mohsen cheraghi
Join Date: Jun 2010
Location: Switzerland
Posts: 28
Rep Power: 16
mohsen cheraghi is on a distinguished road
Quote:
Originally Posted by willzyba View Post
I'm find my self doing more and more customisation of OpenFOAM 2.3x and I'm gradually figuring things out, however every time I open a file I can't help but wonder where the in-code documentation has gone.

Surely the original authors would have documented what they were doing, even odd hints about the logic of the structure and why it was done one way over another. If nothing else but to help them in a future release/revision.

I do appreciate I'm a mere mortal looking at code from the Gods. But even the more basic coding standard say you should document it.

So I'm left assuming that there must be a version of OpenFOAM somewhere that does has documentation, but when they release it to the masses they delete all comments and paste in the copyright notices. If this is the case, then can I get a copy of the documented code, or is that propitiatory?
Hi, I am also looking for such documentation. But, there is not, unfortunately. This is the nature of open source codes
mohsen cheraghi is offline   Reply With Quote

Old   September 19, 2014, 13:02
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Have you looked at the Doxygen documentation? A lot of the comments you are looking for will be there. The most up to date version is always at:

http://www.openfoam.org/docs/cpp
mohsen cheraghi likes this.
mturcios777 is offline   Reply With Quote

Old   September 19, 2014, 13:27
Default
  #4
New Member
 
Will
Join Date: Dec 2011
Posts: 17
Rep Power: 15
willzyba is on a distinguished road
yes the DOxygen documentation is a good start, which explains some bits in great detail, but most bits not at all. DOxygen also has a great ability to pick up variable names of functions and class members, and it would be great to see this in the documentation you mentioned.

To give an example. We've integrated Lagrangian Particle Tracking within WaveFoam. Now works like a dream if anyone wants the code. The actual modifications were not particular hard, though I am boggled by the code structure: seems as though there is twice as much code as needed - I digress....

So I come across these lines in solidParticle.C:
Code:
            scalar rhop = td.cloud().rhop();
            scalar magUr = mag(Uc - U_);
            
            scalar ReFunc = 1.0;
            scalar Re = magUr*d_/nuc;

            if (Re > 0.01)
            {
                ReFunc += 0.15*pow(Re, 0.687);
            }

            scalar Dc = (24.0*nuc/d_)*ReFunc*(3.0/4.0)*(rhoc/(d_*rhop));

            U_ = (U_ + dt*(Dc*Uc + (1.0 - rhoc/rhop)*td.g()))/(1.0 + dt*Dc);
This is clearly a calculation of Drag and the acceleration on my particles. But where has this formulation come from? Turns out there are half a dozen similar, but subtly different, solutions. So it would be great if the author had commented on what standard or even website they had copied it from. And I'll bet the author probably even has a paper on this - but I don't even know who they are..

As I do start to document bits, where should this be posted. And how might we encourage all users of OpenFOAM to start document any bits they do understand. I'm sure some base work by all would accelerate the development of OpenFOAM. And we're happy to do our part.
willzyba is offline   Reply With Quote

Old   September 21, 2014, 13:48
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Will:
  1. Feel free to contribute to the (unofficial) OpenFOAM Wiki: http://openfoamwiki.net - In your case, the following locations might be of interest:
  2. May it be open or closed source, most source code is usually always lacking the comments we need, either because the programmer had to fix/implement a feature in a hurry, or because it was a lengthy implementation.
  3. OpenFOAM's source code is sometimes more documented than you might expect, but also only explained in the location where you might be least expecting. Many times you need to track back to the original class from which the current class is deriving from, in order to see the comment that details what this class is all about. Searching for methods with an identical name usually helps to check what the methods are.
  4. Beyond this, OpenFOAM is open-source, but its evolution can only proceed based on sponsorship, usually from those commercially interested in having new features implemented. This makes sense, at least from the point of view of giving focus to the main development team, as well as a means to live and survive in the real-not-very-free-nor-open-source-world we live in
    This to say that those who hire commercial support and/or attend their training sessions, can more easily get the answers they're looking for.
  5. In addition, if not all classes/solvers are properly documented, its most likely because the sponsorship didn't fully cover the implementation of said class/solver, or because it comes from very old code which is already detailed in one of the original thesis for its development. For example, if you look at all of the RAS turbulence models implemented in OpenFOAM, some of them are barely documented, while others are fully documented.
  6. Keep in mind that even though things might be free or completely open, Time is always unrelenting in the way it keeps going forward .
  7. As for "solidParticle.C": the programmers/authors could very likely be using a hybrid formulation based on more than one paper, based on the validation results they've achieved. The respective validation+support documentation might not have been published in a paper and/or might only have been published for the original sponsor.
  8. Another hypothesis is that the paper(s) is/are only indicated in the release notes for one of the versions. If I'm not mistaken, solid particle formulation is mentioned a few times in some of the release notes... try using in Google:
    Code:
    site:www.openfoam.org release notes
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   September 21, 2014, 17:07
Default
  #6
New Member
 
mohsen cheraghi
Join Date: Jun 2010
Location: Switzerland
Posts: 28
Rep Power: 16
mohsen cheraghi is on a distinguished road
Quote:
Originally Posted by mturcios777 View Post
Have you looked at the Doxygen documentation? A lot of the comments you are looking for will be there. The most up to date version is always at:

http://www.openfoam.org/docs/cpp
Thank you, I did not care about this documentation. But, It seems to be very useful
mohsen cheraghi is offline   Reply With Quote

Old   September 21, 2014, 19:01
Default
  #7
New Member
 
Will
Join Date: Dec 2011
Posts: 17
Rep Power: 15
willzyba is on a distinguished road
wyldckat, thanks for the detailed suggestions.

OpenFoamWiki seems to be a great starting point. Clearly needs a lot of work. As we document all the major changes we make on our own wiki, and it not a major step to upload to openfoamwiki also. I'll put up what we've learnt on LPT.

Will.
willzyba is offline   Reply With Quote

Reply

Tags
documentation


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
Give me some advice CFD in Fortran code or Matlab code. tringuyenttt Main CFD Forum 4 May 29, 2013 09:32
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 13:30
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 16:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44


All times are GMT -4. The time now is 16:38.