Вы находитесь на странице: 1из 44

Introduction/History Current state Use cases Future development - discussion

OpenFOAM-extend on SourceForge.net
Bernhard F.W. Gschaider1
1 ICE

Martin Beaudoin2

Strmungsforschung o Leoben, Austria

2 Institut

de recherche dHydro-Qubec e Varennes, Canada

4th OpenFOAM-Workshop 1st-4th June

bgschaid, mbeaudoin

OpenFOAM-extend

1/44

Introduction/History Current state Use cases Future development - discussion

Outline
1

Introduction/History How it started SourceForge.net Subversion The OpenFOAM-extend project Current state What is there Usage/Community Contacts

Use cases The user The patch contributor The utility developer Collaborative development Contributing to the dev Future development - discussion Future development Points for discussion

bgschaid, mbeaudoin

OpenFOAM-extend

2/44

Introduction/History Current state Use cases Future development - discussion

How it started SourceForge.net Subversion The OpenFOAM-extend project

Before OpenFOAM-extend - circa 2006


Context: New OpenFOAM versions are released about once a year OpenFOAM patches and bugxes are distributed through a discussion Forum Hrvs development version is available only through large tarballs from Zagreb FSB ftp server Keeping your OpenFOAM version up-to-date is a bit painful...

First OpenFOAM Workshop in Zagreb in January 2006:


Some of the many interesting ideas put forward:
How about a public source code repository for OpenFOAM? OpenFOAM Workshops are more fun at sub-zero temperatures...

bgschaid, mbeaudoin

OpenFOAM-extend

3/44

Introduction/History Current state Use cases Future development - discussion

How it started SourceForge.net Subversion The OpenFOAM-extend project

Getting people involved - December 2006


Henry Weller was contacted to check OpenCFDs interest in a

public source code repository for OpenFOAM


No resources available to participate Needed sponsoring to get involved, even for in-kind

contributions Doing it the Open Source way: People started to get involved
Hrovje Jasak, Hkan Nilsson a Bernhard Gschaider, Martin Beaudoin The main objective: Introduce a collaborative tool that would benet a growing community The result: The OpenFOAM-extend project : http://openfoam-extend.sourceforge.net
bgschaid, mbeaudoin OpenFOAM-extend 4/44

Introduction/History Current state Use cases Future development - discussion

How it started SourceForge.net Subversion The OpenFOAM-extend project

Why SourceForge.net?
The worlds largest open source

software development web site


Over 230,000 software projects

registered
Over 2,000,000 registered users

Everything you need to start and grow

an Open Source project


Revision control systems

(Subversion, CVS, Git, etc) Project Web site, Wiki Mailing lists, Forums Bug tracking tools Many hosted applications

bgschaid, mbeaudoin

OpenFOAM-extend

5/44

Introduction/History Current state Use cases Future development - discussion

How it started SourceForge.net Subversion The OpenFOAM-extend project

Why Subversion?
Subversion: A stable and mature revision control system User interface available for many platforms A fairly large user base Subversion repository available for SourceForge.net projects Easy to download/maintain svn repository subtrees Why dont you switch to Git? SourceForge.net now oers Git repository Git downloads are impressively fast Git cant do partial checkout (subdirectory) If it aint broke, dont x it...

bgschaid, mbeaudoin

OpenFOAM-extend

6/44

Introduction/History Current state Use cases Future development - discussion

How it started SourceForge.net Subversion The OpenFOAM-extend project

The OpenFOAM-extend project - The mission

The goal of this project is to

open the OpenFOAM CFD toolbox to community contributed extensions, in the spirit of the Open Source development model.

bgschaid, mbeaudoin

OpenFOAM-extend

7/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

In the SVN
The major parts of the svn are: The Breeder Collection of assorted utilities and other contributions. Amongst others: The Turbomachinery Sig stu funkySetFields, simpleFunctionObjects and groovyBC ... and others. But not as many as we hoped for The Core or dev-version Hrvs development version The patch branch Collection of bug-xes. Retired because the Git made it obsolete (which is a good thing)

bgschaid, mbeaudoin

OpenFOAM-extend

8/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

Mailing-lists
openfoam-extend-general A list for discussions about the OpenFOAM-extend-project, not OpenFOAMTM itself openfoam-extend-announce Announcements of new software openfoam-extend-submit This mailing-list receives a mail every time something is submitted to the Svn Special topic lists Public (for instance for the Ship Hydrodynamics SIG Teaching SIG Turbomachinery SIG Turbulence SIG ) or closed (for the workshop-organizers) lists
bgschaid, mbeaudoin OpenFOAM-extend 9/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

A contribution by the Teaching SIG


OpenFOAM SLAX A fully congured binary OpenFOAM-1.5-dev platform based on a live Linux distro called SLAX
a modern, portable, small and fast Linux operating system can run from from CD/DVD, USB Flash Key, Hard Drive, etc. Available at the Download section of

OpenFOAM-extend
Available on your Montreal

Workshop USB stick

bgschaid, mbeaudoin

OpenFOAM-extend

10/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

Notication of updates

There are three ways to get notications of updates in the

Svn
The mailing-list A Irc-channel 3 A Rss-feed
1 2

More details can be found in the presentation The

OpenFOAM-extend project on SourceForge: current status from the last workshop in Milano

bgschaid, mbeaudoin

OpenFOAM-extend

11/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

What is not there. And why.

Bugtracker Under discussion. Could be worth a test drive. Other binary distributions Would need someone willing to maintain them Forum software Dont want to create a parallel structure to the ocial forum Documentation The Wiki is the place for this Bugxes: OpenFOAM-1.5.x The Git repository is the place for this 24/7 support Because we all have a day job...

bgschaid, mbeaudoin

OpenFOAM-extend

12/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

Usage statistics
Usage of the Svn as reported by SourceForge.net

bgschaid, mbeaudoin

OpenFOAM-extend

13/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

Who contributed
Contribution percentage (metric: number of commits) for the whole OpenFOAM-extend

Subversion repository
From May 2008 to May 2009

More than 10 dierent contributers so far, directly or indirectly The objective for 2010: pushing Hrvs contribution below 50% !

bgschaid, mbeaudoin

OpenFOAM-extend

14/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

Who is in charge

Currently the administrators for the project are (in

alphabetical order)

Martin Beaudoin Bernhard Gschaider Hrovje Jasak Hkan Nilsson a

bgschaid, mbeaudoin

OpenFOAM-extend

15/44

Introduction/History Current state Use cases Future development - discussion

What is there Usage/Community Contacts

How to get write access to the Svn

1 2

Get a SourceForge.net-account Contact one of the project-admins with this information:


Your SourceForge.net-account-name Your real-life identity A description what you need the write access for (Contribute

bugx to project XY, Add a new utility ...)


A description of your previous work/experience in

OpenFOAMTM if we dont know you in person

bgschaid, mbeaudoin

OpenFOAM-extend

16/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Disclaimer

Theorem: No two people are alike Lemma: No two users are alike Well try to describe some typical cases anyway

bgschaid, mbeaudoin

OpenFOAM-extend

17/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

The user

Wants to use some utility, etc from OpenFOAM-extend Doesnt want to program An admirable trait.1

We all hope to reach that level some day


bgschaid, mbeaudoin OpenFOAM-extend 18/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Basic Workow

1 2

Locate it in the repository Get it


Directly via Svn As a tarball

Compile it
According to chapter 3.2 of the OpenFOAMTM user-guide Using wmake, or by following the provided documentation

bgschaid, mbeaudoin

OpenFOAM-extend

19/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Svn for non-developers


With SVN you are always in a client/server situation

Client your machine. The data there is called local copy Server the repository (in our case SourceForge.net) Software is dened by a unique location on the server
Can be found by Browsing from the base URL with Web browser:
http://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend

Copying from the announcement (on the Forum, the Wiki, your local newspaper) The location of the local copy does not matter The most common program for using Svn is a command-line

tool called (surprise!) svn


The actual action is signied by the second word (checkout,

update ...)
Guis exist, but are to complicated for read-only users
bgschaid, mbeaudoin OpenFOAM-extend 20/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Getting software via SVN


Getting the notorious funkySetFields
1 > cd T H E _ D I R E C T O R Y _ W H E R E _ I _ S T O R E _ M Y _ A P P S > svn checkout https :// openfoam - extend . svn . sourceforge . net / svnroot / openfoam extend / trunk / Breeder_1 .5/ utilities / postProcessing / FunkySetFields A Fu nkySetFields / funkySetFields A Fu nkySetFields / funkySetFields / funkySetFields . C A Fu nkySetFields / funkySetFields / GeneratedFiles .... A Fu nkySetFields / examples / s e t L o w e r H a l f A n d A T u b e . f u nk y Se tF i el d sD ic t U FunkySetFields Checked out revision 1234. > cd FunkySetFields / > wmake

3 5 7 9 11

A bug x was promised and we want to get it


1 3 5 > cd T H E _ D I R E C T O R Y _ W H E R E _ I _ S T O R E _ M Y _ A P P S / FunkySetFields / > svn update U Fu nkySetFields / funkySetFields / funkySetFields . C Updated to revision 1235 > wmake bgschaid, mbeaudoin OpenFOAM-extend 21/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Tarballs
If you cant use svn because Your SysAdmin wont install it Your boss looked up the denition of Subversion in Merriam-Webster Your doctor said youre using too many command-line tools already The whole SVN-repository can be browsed using the Url
http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/

If you found the directory you want press the Download GNU

tarball-link at the bottom


The whole contents will be downloaded as a complete archive Extract and compile where you see t

Disadvantage: updates of software are not as easy as with svn (copy

directories around ...)

bgschaid, mbeaudoin

OpenFOAM-extend

22/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Downloading a tarball

bgschaid, mbeaudoin

OpenFOAM-extend

23/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

The patch contributor

His motivation 1 Is using some OpenFOAM utility 2 Found a bug in it


(Strange things happen ;) )
3 4

Knows how to x it Wants to share the x with the world


Report bug to the developer Commit it directly to the Svn

bgschaid, mbeaudoin

OpenFOAM-extend

24/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Reporting the patch


If you 1 found a bug 2 dont want to use svn

this is the way to go Procedure:


1 2

Find out who is in charge Prepare all the stu that is necessary
1 Description of the problem (maybe with a testcase) 2 Necessary changes (either the whole source-les or

dis/patches)
3

Send it to the maintainer

bgschaid, mbeaudoin

OpenFOAM-extend

25/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Generating a patch
This is quite easy if your sources are in a SVN local copy

Finding out what you changed


1 3 5 7 9 11 13 > cd T H E _ D I R E C T O R Y _ W H E R E _ I _ S T O R E _ M Y _ A P P S / FunkySe tFields / > svn diff Index : funkySetF ields / funkySetFields . C =================================================================== --- funkySetFields / f unkySetFields . C ( revision 1234) +++ funkySet Fields / funkyS etFields . C ( working copy ) @@ -212 ,7 +212 ,7 @@ if (! args . options (). found (" time ") && ! args . options (). found (" latestTime ")) { FatalErrorIn (" main ()") << args . executable () << ": time / latestTime option is required " << endl + << ": time or latestTime option is required " << endl << exit ( FatalError ); }

Preparing the actual patch to send


> svn diff > Th i s I s W r o n g B e r n h a r d . patch

bgschaid, mbeaudoin

OpenFOAM-extend

26/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Commiting to the Svn

Preliminaries: 1 You have write access (technical level) 2 You checked with the maintainer (social level) 3 Youre sure that youre only commiting what you want to (embarrassment level) Make sure that you read some basic tutorial on Svn before Doesnt have to be a book

bgschaid, mbeaudoin

OpenFOAM-extend

27/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

A commit to the Svn


Checking the changes and commiting them
1 3 5 7 9 11 13 15 17 19 > cd T H E _ D I R E C T O R Y _ W H E R E _ I _ S T O R E _ M Y _ A P P S / FunkySetFields / > svn status M fu nkySetFields / funkySetFields . C > svn diff funkySetFields / funkySetFields . C Index : fu nkySetFields / funkySetFields . C =================================================================== --- fun kySetFields / funkySetFields . C ( revision 1234) +++ funkySetFields / funkySetFields . C ( working copy ) @@ -212 ,7 +212 ,7 @@ if (! args . options (). found (" time ") && ! args . options (). found (" latestTime ")) { FatalErrorIn (" main ()") << args . executable () << ": time / latestTime option is required " << endl + << ": time or latestTime option is required " << endl << exit ( FatalError ); } > svn commit -m " This is the promised fix " Sending funkySetFields / funkySetFields . C Transmitting file data ....... Committed revision 1235.

bgschaid, mbeaudoin

OpenFOAM-extend

28/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Your contribution will be noticed

The main developer will add your name to the README le of

that utility
if the contribution is large enough Fixing a typo in an error message is not 1 Fixing a missing scaling factor of 2 probably is

Your name will appear in the svn log message

bgschaid, mbeaudoin

OpenFOAM-extend

29/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

The utility developer

Wrote a new utility and woke up one day thinking

I think this can improve the lives of others (or maybe even prevent global warming). I think I want to share it
Is willing to face the public opinion ... and improve the code ... x bugs ... write at least a little bit of documentation

bgschaid, mbeaudoin

OpenFOAM-extend

30/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Its not only the code that is important

NB: This slide is not here to discourage you, it is here to save us all some trouble
Think about whether you want to share the stu Consider the implications of the GNU Public License Check with your employer whether it is OK to share the stu The exact implications may dier according to your country (legal system), your contract, etc but it boils down to:
If someone paid you while doing it, then that someone has some say about it

bgschaid, mbeaudoin

OpenFOAM-extend

31/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

The GPL in 1 minute 23 seconds


The GPL is all about distribution of software If you are modifying software that was distributed under the

Gpl (GNU Public License) this software is also under the Gpl
OpenFOAMTM is published under the Gpl Consequently on openfoam-extend you should only publish

software under the Gpl You dont have to publish your work if it is based on

Gpl-software
... but youll have to make the source available to whoever

you are distributing it to (no binary-only distribution)

bgschaid, mbeaudoin

OpenFOAM-extend

32/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

How to upload it

Get write access (you probably already got it) Locate the proper place in the repository If in doubt: ask Add and commit your stu to the repository Make sure that nothing unwanted is there Write a meaningful commit-message Write documentation (at least a README)

bgschaid, mbeaudoin

OpenFOAM-extend

33/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Denition of unwanted stu

Rule of thumb: Everything that was not generated by human

intervention (with a text editor)


Examples: Everything in Make/linux64GccOpt (or whatever your platform is) The .dep-les Backup-les from your text-editor (*~ for the Emacsists) For example-cases:
Everything in constant/polyMesh except for blockMeshDict All time-steps except the rst

bgschaid, mbeaudoin

OpenFOAM-extend

34/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Adding a new utility


The ultimate utility
2 4 6 8 10 12 14 16 18

> cd M Y _ S F _W OR K IN G _C OP Y / utilities / preprocessing > cp -r ~/ M Y _ P E R S O N A L _ D E V _ F O L D E R / s e t S e n s i b l e B o u n d a r y C o n d i t i o n s . > wclean s e t S e n s i b l e B o u n d a r y C o n d i t i o n s ; rm ~ all > svn add s e t S e n s i b l e B o u n d a r y C o n d i t i o n s A setSensibleBoundaryConditions A s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / setBC . C A s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / notUsedAnymore . H A s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make A s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make / files A s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make / options > svn revert s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / notUsedAnymore . H > svn commit -m " No more excuses for wrong boundary conditions " s e t S e n s i b l e B o u n d a r y C o n d i Adding setSensibleBoundaryConditions Adding s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / setBC . C Adding s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make Adding s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make / files Adding s e t S e n s i b l e B o u n d a r y C o n d i t i o n s / Make / options Transmitting file data ....... Committed revision 1236.

Next project: A cure for the common cold


bgschaid, mbeaudoin OpenFOAM-extend 35/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

What is expected of a developer

Make the code readable Conforming to the OpenFOAM-conventions (Personal note: I didnt like them in the beginning, too) Provide documentation A README-le Documentation on the Wiki Maintain it

bgschaid, mbeaudoin

OpenFOAM-extend

36/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

The joint project


Several people want to collaborate on some project from dierent organizations/countries Want to be sure that everyone of them always has access to

the latest version


Want to be able to backtrack changes Who inserted THAT change? Have no problem that other people watch their work

progressing
Examples: The stu from the Turbomachinery SIG The alternateChemistry-library The simpleFunctionObjects-library
bgschaid, mbeaudoin OpenFOAM-extend 37/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Growing up in public

Basically the same rules as for the utility developer apply Be aware that other people might use your stu - try to keep

it in a usable state
Try to submit an approximately working version with your rst

commit
Coordinate yourself, so that you dont break each others

changes
If major changes are planned: do them in a branch

bgschaid, mbeaudoin

OpenFOAM-extend

38/44

Introduction/History Current state Use cases Future development - discussion

The user The patch contributor The utility developer Collaborative development Contributing to the dev

Rules for contributing to the dev


Once you are ready to contribute there, you will know them. We recommend you read through the instructions we have written in

the Wiki at OpenFOAM-extend, as well as the README les that can be found in the svn. Basically:
Learn to use svn correctly, if you dont know it already Stick to the Breeder. We have actually not come far enough ourselves

to go to the Forge.
Give some time to think about the structure of your directories and

les. Ask if unsure.


Clean up before committing, and commit no binary les Dont commit to directories that other people are working on unless

you have a permission to do so.


Discuss with us before committing anything else than your specic

developments.

bgschaid, mbeaudoin

OpenFOAM-extend

39/44

Introduction/History Current state Use cases Future development - discussion

Future development Points for discussion

Future development - Test loops


Compilation test-loops Nigthly Builds Continuous Builds Experimental Builds Execution test-loops OpenFOAM tutorials SIGs test cases Based on free software Kitware CMake, CTest, CDash Will be available on openfoam-extend CMake/CTest scripts With a public CDash Web service

bgschaid, mbeaudoin

OpenFOAM-extend

40/44

Introduction/History Current state Use cases Future development - discussion

Future development Points for discussion

What we want from you


Contribute your bug xes Share and document your test cases Share your test loops results Contribute your source code Contribute documentation and Howtos Keep on helping on the Forum Register to SIGs mailing lists Participate in SIGs All contributions are valuable!!!!

bgschaid, mbeaudoin

OpenFOAM-extend

41/44

Introduction/History Current state Use cases Future development - discussion

Future development Points for discussion

Compatibility to the upstream version


Hrv is taking great care of syncing his dev version when a

major version release of OpenFOAM is published.


Keeping upstream compatibility is a key factor of OpenFOAM

1.5-dev Still, downstream compatibility is sometimes a problem when

developing for both versions


Some header les are dierent between 1.5-dev and 1.5.x 1.5-dev: repatch.H 1.5.x: repatchPolyTopoChanger.H Some classes are only present in 1.5-dev See Hrvs presentation for an overview of the numerous enhancements oered by OpenFOAM-1.5-dev Some useful features are only present in 1.5-dev Tolerance switches in the main controlDict
bgschaid, mbeaudoin OpenFOAM-extend 42/44

Introduction/History Current state Use cases Future development - discussion

Future development Points for discussion

The FOAM DEV environment variable to the rescue


From simpleFunctionObjects/Make/options
1 3 5 7 9 11 13 15 17 19 LIB_LIBS = \ - lfiniteVolume \ - lmeshTools \ - lsampling \ - ltriSurface \ - llagrangian ifdef FOAM_DEV F OA M_ DEV_OPTION = - DFOAM_DEV endif EXE_INC = \ $ ( F OA M_DEV_OPTION ) \ - I$ ( LIB_SRC )/ finiteVolume / lnInclude \ - I$ ( LIB_SRC )/ meshTools / lnInclude \ - I$ ( LIB_SRC )/ sampling / lnInclude \ - I$ ( LIB_SRC )/ triSurface / lnInclude \ - I$ ( LIB_SRC )/ lagrangian / basic / lnInclude

bgschaid, mbeaudoin

OpenFOAM-extend

43/44

Introduction/History Current state Use cases Future development - discussion

Future development Points for discussion

Conclusion

Thanks for:
your attention your feedback your (future) contributions

bgschaid, mbeaudoin

OpenFOAM-extend

44/44

Вам также может понравиться