CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

OpenFOAM: General thoughts??

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

LinkBack Thread Tools Display Modes
Old   September 7, 2006, 11:40
Default OpenFOAM: General thoughts??
Posts: n/a
Dear All,

I have the following choice very soon. 1) Start from scratch and write a F90 cut-cell code with AMR etc, I already know F90, and have extensive experience with programming parallel finite volume compressible codes (owned by others, hence the re-write). 2) Pick up openfoam and try to learn it. When I say learn I plan serious development at the two-phase flow level for reactive flow, so I'd want to know it to a pretty high level.

I have several key questions with respect to the above, plus I'd like your general thoughts on the code. I'm happy to have responses from anyone, but given by intentions I prefer people who have actually edited the source.

My questions are:

1) How hard is it to move to C++ give only F90/F77 experience?? May be a bit too specific a question...

2) How does one make a mesh for the solver?? Does it have a mesher, or do you need third party software?? Keep in mind before answering that I'm not interested in multi-block structured meshes, I need it to be able to do complex geometry - so cut-cell or tet meshing.

3) how fast is it? I've heard very good arguments about the vectorisation and speed up verses F90.

4)How do you post-process the files, do they write in commercial formats??

5) Can it handle moving geometries, like pistons, without just stretching the mesh, can it re-mesh, adapt??

6) Does it have compressible solvers like Roe HLLC etc, or is it mainly incompressible ??

7) What are the issues with using it commercially?? Is that a no-go?

Any other general thoughts welcome...

  Reply With Quote

Old   September 7, 2006, 12:33
Default Re: OpenFOAM: General thoughts??
Hrvoje Jasak
Posts: n/a

1) Switching should not be too hard. The code is written for easy understanding, customisation and maniipulation. My students usually pick it up without trouble, but a bit of interaction or training definitely helps. Please note that C++ and object orientation requires a different frame of mind - an open outlook on programming is very useful.

2) The mesher in the package is really very simple. However, mesh support is actually polyhedral (OpenFOAM had it first!) and full-tet, cut cell or tessalated meshes work extremely well.

Regarding conversion, Harpoon will output OpenFOAM mesh files natively; available mesh converters include Fluent, Gambit, Star-CD, CFX, tetgen, Ansys etc. Any package I know will give you one of those. I do not know of any really good public domain polyhedral meshers that would make a natural fit.

If you hit a mesh format (especially for a public domain mesh generator) you wish to use and cannot convert it, I promise to personally write a converter free of charge.

3) It is very fast. One of its main usues is for large LES simulations, where (parallel and serial) performance is critical. The algorithms are well written and optimised - feel free to take it to the races.

4) Packaged post-processing includes a Paraview reader module (no file conversion) - that one is public domain and free. There is also an Ensight and Fieldview reader module, as well openDX (that's free as well). Paraview people have included native handling for OpenFOAM data (I think it will be in the next release).

Data conversion apps include Fluent, Ensight, Fieldview and VTK output. For my taste, Paraview is more than enough.

5) Moving deforming mesh works very well: mesh motion is solved automatically based on the boundary motion. Topological changes support includes attach/detach boundaries, cell layer addition/removal and sliding interface. It is fine in serial, parallelisation of topological changes is work in progress. If you are looking for examples, there will a paper on engines modelling with moving valves at SAE 2007 - hope this answers your question.

6) Compressible support is not good. There are pressure-based compressible solvers which work fine, but a fully fledged density-based solver with FMG/FAS acceleration, implicitness, etc is not there. Work in progress, currently not funded.

7) The code is released under GPL - you can do with it whatever you like, including unlimited commercial use including massively parallel. In doing this, I would consider a serious support package.

You can find various papers, presentations, PhD Theses and similar on the web. Try for example

Hope this was useful,


  Reply With Quote

Old   September 8, 2006, 04:59
Default Re: OpenFOAM: General thoughts??
Posts: n/a
Many thanks for your reply. Very detailed and most of what I need. I would ask that anybody else, who is not an author of the code, give their views - I'd be very appreciative!

In particular I have one last question. I've been quoted that 2 months is all it would take to get up to speed with the source and the inner works, such that I could start developing. This is given to me third party, and was the apparent views of current developers. This seems a little optimistic especially given the fact I don't know C++. Does anybody else have any approx. quotes on the speed of the learning curve??

One last thing. Since I require a fully compressible code, with adaptive mesh refinement, I would prefer Cut-cell/AMR, given the last response from the author, do people contest that I would be faster writing my own?? I agree that we must exclude parallel from that question.

I have extensive experience with CFD, and I wonder whether or not implementing a fully compressible density-based solver with obviously Roe etc which can't be in there, plus the fact that I can't adapt meshes, so would need to write that too, whether or not for me this is a good idea?? Given also that I have no real wish to lean C++...

I'd really appreciate other feed back....clearly I want to make the right decision.


  Reply With Quote

Old   September 8, 2006, 14:24
Default Re: OpenFOAM: General thoughts??
Posts: n/a

question? what is dimension 2d or 3d, do you deal with complex geometry or simple one (for 3d complex geo there is not cartesian cau cell generator as opensource and writing such code is really tedious, needs state of the art computational geometry background, e.g. see aftosmis et al paper in AIAA journal). also what is the details of your problem (you talk about moving boundary, combustion, Row solver, do you need to develop general purpose code or need to solve especial problem).

* For more about OpenFOAM put your massage in OpenFOAM disscussion form and contact with its users (not on this form).

also, there are alternative opensource tool:

1. gerris: AMR cut cell solver in C (with OOP like programming style), it has cut cell cartesian mesh generator over complex triangulated surface (must be water-tight) and has its post processor, it solve incompressible flow, but you probably can modify it for compressible (but i think that mastering gerris is not simple).

2. BOX library and its related tools, have hyperbolic solver with AMR support but don't support cut cell.

3. Chombo: extension of BOX library supporting cut cell and multiblock.

4. If you are US citizen the best choice is using CART3D code (not source code), has mesh generator and compressible Euler solver with AMR and cut cell support.

- I belive that writing in-house code (AMR cut cell) in short time (2 month) is not possible or easy for expert CFDMan and programmer (chance of success is low).

Mastering C++ for scientific computing is not hard also OpenFOAM is high level language based on C++ and don't need deep C++ information (like matlab) but simplicity of further extension on it especially when computational kernel needs modification is not simple (my predict, i don't try, i only run some example with it), because usually OOP codes has hierartical nature and mastering code take long time and tedious work (non-OOP program is mastered in few hours for expert people) sometimes modification needs massive modification (it is function of its design quality), sometimes OOP project are failed due to weakness in this field.

Finally i can't give explicit answer to your question?

  Reply With Quote

Old   September 9, 2006, 06:45
Default Re: OpenFOAM: General thoughts??
Posts: n/a
I do have extensive background in the required solid model area, and I'm more than well read on aftosmis' papers. In my head the only part that needs some work is cutting general polygon shapes, and how to do it?? If you can recommend any papers that would help? I've written a fully 3D compressible turbulent reactive flow solver, so that part doesn't phase me. All my work will be on complex 3D models, for reactive flow.

In short the parts that I will need to work on are: cutting cells once the Cartesian mesh has been built, but there are a few papers and theses that gives hits on this: and parallel, I'm going to have to think about implementing lam-mpi.

Basically, I'm wondering whether C++ on top of all of this is going to be too much!?! Additionally, since the code in question, openfoam, doesn't have two of the main requirements of my outline, I need to work out if writing them in C++, which I need to learn, in a code I need to learn, is slower than just going it alone in F90???


  Reply With Quote

Old   September 9, 2006, 08:08
Default Re: OpenFOAM: General thoughts??
Posts: n/a
>>In my head the only part that needs some work is cutting general polygon shapes, and how to do it??

what do you mean about general polygone? in cut cell method intersection of triangle (triangulated surface) with Hexahedral Cartesian cell is only required.

Anyhow if you seek for this i knowe one good refrence:


In this paper authors present method for calculation of accupied volume below surface in arbitrary unstructured polygone, they use this for accessing to 2nd order VOF method in arbitrarry unstructured mesh. Previously i download it online, if you need it and don't find it give your mail i will send it to you.

Also, i belive that robustness of aftosmise method is in question, especially when we have intersection of some triangles in on cell (final leaf), my treatment for this is simply generation of very fine cartesian cell (z-buffering algorithm,witouth cut cell, is very fast more than 10^8 cell per second on traditional desktop computer), then convert it to coarse cut cell mesh, for this conting in/out fine mesh that located in coarce interfacial cell and then extract partial volume and wetted surfaces, this work fine and converge to exact value with high order accuracy.

Comparison of C++ and F90 and fast conculation is not as simple as you do (your conculation is very old and is not acceptable recently), you can read several online literatures on this.

  Reply With Quote


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
OpenFOAM general doubt?? forsumit OpenFOAM Running, Solving & CFD 2 April 14, 2010 10:30
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 05:33
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 13:50
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 22:07

All times are GMT -4. The time now is 08:14.