CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Gerris or Openfoam? (https://www.cfd-online.com/Forums/main/104733-gerris-openfoam.html)

houkensjtu July 14, 2012 03:04

Gerris or Openfoam?
 
Hi there!
I have been writing code to simulate two-phase flow in microchannel. After struggling for 2 years now I finally finished my thesis. To be honest writing code is hard for me and there remain a bunch of problems in my code.
I start to consider using opensource code for several reasons:

1. I am not clever enough to study all the computational technique, coding tricks and test them by myself. It cost me too much time to debug my code which has almost nothing to do with physical phenomena. Opensource code is well coded by professional which is surely far more capable and reliable.

2. Opensource is "hackable". I can hack into any part of it if I want to customize or modify sth. Also user community will offer me useful information if I stuck.

And now I have my question, which to use? My problem can be briefly described as below:

1. Laminar (maybe in the future I will consider for turbulence)
2. Two-phase (usually I focus on single bubble behavior, now I am using VOF in my code)
3. Surface tension (I applied CSF model but under microscale, "parasite current" is a problem)
4. Phase change (expansion of bubbles)
5. I want the code to be "hackable", which means friendly to people who want to change or modify something by themselves

I am not familiar with openfoam or gerris. I know that Openfoam is very strong, and gerris is rather new and capable in dealing with surface tension. Which one will you guys recommend???

ata July 15, 2012 03:51

Hi
I recommend OpenFOAM because of its capabilities and supports in forums.

houkensjtu July 16, 2012 00:01

Quote:

Originally Posted by ata (Post 371487)
Hi
I recommend OpenFOAM because of its capabilities and supports in forums.

Thank you for your suggestion!
I am considering to try both of them and then decide... Gerris seems to be very potential in the future...

pharg_yrartibra August 29, 2012 17:04

Hi houkensjtu,

I'm interested in knowing why you think that Gerris seems more potential for the future? Does it have some feature that OpenFOAM doesn't have? Thanks.

leflix September 2, 2012 09:36

Quote:

Originally Posted by pharg_yrartibra (Post 379392)
Hi houkensjtu,

I'm interested in knowing why you think that Gerris seems more potential for the future? Does it have some feature that OpenFOAM doesn't have? Thanks.

I'm really following the comment of pharg_yrartibra. I do not see what Gerris can do that Openfoam couldn't do.
And I'm more confident in the growing of openfoam in the future compared to the one of Gerris.

leflix September 2, 2012 09:41

Quote:

Originally Posted by houkensjtu (Post 371399)
Hi there!
I have been writing code to simulate two-phase flow in microchannel. After struggling for 2 years now I finally finished my thesis. To be honest writing code is hard for me and there remain a bunch of problems in my code.
I start to consider using opensource code for several reasons:

Hi Hounkensjtu

what you say is true, however what you gained in developping your own code is an invaluable experience in CFD. And even if you turn now for open source codes, you have definitely increased your understanding level of CFD and stuffs which matter.

houkensjtu September 2, 2012 21:27

Quote:

Originally Posted by leflix (Post 379881)
Hi Hounkensjtu

what you say is true, however what you gained in developping your own code is an invaluable experience in CFD. And even if you turn now for open source codes, you have definitely increased your understanding level of CFD and stuffs which matter.

Thank you for your comment!
Yes I do feel developing my own code increased my understanding in CFD. Also my professor suggest me to continue coding, but the issue here is, though it's possible to develop some low-level solver (following text book like Patankar or Versteeg), things become quite difficult when it comes to more complex model like phase-change. The reason why i think so, (actually i have never really code my own phase-change model) is that there will be no text book to follow. Most literature discussing about these models only focus on physical or mathematical properties, but not on coding tech.
what will you suggest to do ?

francesco_capuano September 3, 2012 04:58

Hi houkensjtu,

I've been making some basic comparisons for a simple two-phase problem between OpenFOAM and Gerris with the VOF approach. The results show that the current VOF implementation of OpenFOAM is quite inaccurate with respect to Gerris (see also http://www.uni-ulm.de/fileadmin/webs...s/CLSVOF.pdf); I can email you some pictures of my results, if you want.

If your problems deal with simple, laminar flows, I would definitely go for Gerris. You should also consider that, in the current release, OpenFOAM does not support 2-D adaptive mesh refinement (although it does for 3-D), which, as you might know, is a fundamental feature for a good tracking of the interface. On the other hand, if you have to simulate flows of growing complexity (e.g. turbulence, phase change, etc.), then OpenFOAM is your best bet, especially if you manage to implement a coupled VOF / Level set method (see the above presentation).

Regards,
Francesco

leflix September 3, 2012 09:40

Quote:

Originally Posted by houkensjtu (Post 379931)
but the issue here is, though it's possible to develop some low-level solver (following text book like Patankar or Versteeg), things become quite difficult when it comes to more complex model like phase-change. The reason why i think so, (actually i have never really code my own phase-change model) is that there will be no text book to follow. Most literature discussing about these models only focus on physical or mathematical properties, but not on coding tech.
what will you suggest to do ?

First of all I would like to mention that every codes available on the market, open source codes or comercial ones for most of them come from research codes developped by students like you.
With time, they are improved with some additional new features (compressible, turbulence models, physical models , heat transfer, combustion, two-phase flow, numerical schemes, moving grids, etc...) according the will and the needs of each researcher.
After sveral years (between 10 and 20 years) one obtains codes like OpenFoam, Star-CD, Fluent etc....

The material for undertsanding the models is all the litterature in CFD that you can find in scientific journals.

The first think is to have a good and efficient Navier-Stokes solver in which you are very confident and which works fine.
Then you start to add some new models...
If you are interested in two-phase flows then start to really master VOF method, understand in details how it works, collect and read papers on this topic and when you feel ready start to code it.
You can either find some open source codes like Sola VOF, Gerris,... wich are available on internet and then you can inspire from it.

The other alternative is to use directly an open source code like Gerris , Openfoam which treat this problem.
I have indeed heard that VOF implementation in Gerris was really good. I don't know about Openfoam. I have just seen that dambreak problem was treated as tutorial case in Openfoam. But I guess we can trust Francesco who have tested the both apparently.

pharg_yrartibra September 3, 2012 10:43

Quote:

Originally Posted by francesco_capuano (Post 379967)
I've been making some basic comparisons for a simple two-phase problem between OpenFOAM and Gerris with the VOF approach. The results show that the current VOF implementation of OpenFOAM is quite inaccurate with respect to Gerris (see also http://www.uni-ulm.de/fileadmin/webs...s/CLSVOF.pdf); I can email you some pictures of my results, if you want.

The link in your post is broken, this seems be be the working one... http://www.uni-ulm.de/fileadmin/webs...les/CLSVOF.pdf. So, what VOF implementations are there in OpenFOAM and in Gerris, respectively? I just know that InterFOAM uses something called MULES, which is completely algebraic and apparently supposed to work quite well (better than CICSAM), but maybe InterFOAM is not what you are using. On the other hand PLIC (Youngs' scheme), which is geometric, is supposed to give slighty more accurate results, and if Gerris is using that, then maybe you are right.

houkensjtu September 3, 2012 21:27

Quote:

Originally Posted by francesco_capuano (Post 379967)
Hi houkensjtu,

I've been making some basic comparisons for a simple two-phase problem between OpenFOAM and Gerris with the VOF approach. The results show that the current VOF implementation of OpenFOAM is quite inaccurate with respect to Gerris (see also http://www.uni-ulm.de/fileadmin/webs...s/CLSVOF.pdf); I can email you some pictures of my results, if you want.

If your problems deal with simple, laminar flows, I would definitely go for Gerris. You should also consider that, in the current release, OpenFOAM does not support 2-D adaptive mesh refinement (although it does for 3-D), which, as you might know, is a fundamental feature for a good tracking of the interface. On the other hand, if you have to simulate flows of growing complexity (e.g. turbulence, phase change, etc.), then OpenFOAM is your best bet, especially if you manage to implement a coupled VOF / Level set method (see the above presentation).

Regards,
Francesco

Helpful info!
Yeah I noticed that Gerris supports adaptive mesh refinement which is really smart and that's one of the important reason I thought it's more potential than OpenFOAM.
I'm really new to both Gerris and OpenFOAM, so I have no idea in how they work in phase-change model. Do you have any idea?
One more thing I noticed is: I followed OpenFOAM tutorial's lid-driven cavity case, also I made a same mesh, same time step case in Gerris. Results are similar but Gerris was much much more slower than OpenFOAM. I am wondering why it happens.
Finally my email add: houkensjtu@gmail.com, i am very interesting in comparison result between these two codes. THX!

houkensjtu September 5, 2012 21:16

Quote:

Originally Posted by leflix (Post 380023)
First of all I would like to mention that every codes available on the market, open source codes or comercial ones for most of them come from research codes developped by students like you.
With time, they are improved with some additional new features (compressible, turbulence models, physical models , heat transfer, combustion, two-phase flow, numerical schemes, moving grids, etc...) according the will and the needs of each researcher.
After sveral years (between 10 and 20 years) one obtains codes like OpenFoam, Star-CD, Fluent etc....

The material for undertsanding the models is all the litterature in CFD that you can find in scientific journals.

The first think is to have a good and efficient Navier-Stokes solver in which you are very confident and which works fine.
Then you start to add some new models...
If you are interested in two-phase flows then start to really master VOF method, understand in details how it works, collect and read papers on this topic and when you feel ready start to code it.
You can either find some open source codes like Sola VOF, Gerris,... wich are available on internet and then you can inspire from it.

The other alternative is to use directly an open source code like Gerris , Openfoam which treat this problem.
I have indeed heard that VOF implementation in Gerris was really good. I don't know about Openfoam. I have just seen that dambreak problem was treated as tutorial case in Openfoam. But I guess we can trust Francesco who have tested the both apparently.

Good idea! Also in my opinion it will be important to learn available code like gerris or OpenFOAM--how can one create his own code without learning other people's work! That's also one of the reason I decided to turn to opensource code, at least for a while, not only to use, but also for learning.

francesco_capuano September 6, 2012 05:26

Quote:

Originally Posted by houkensjtu (Post 380077)
Helpful info!
Yeah I noticed that Gerris supports adaptive mesh refinement which is really smart and that's one of the important reason I thought it's more potential than OpenFOAM.
I'm really new to both Gerris and OpenFOAM, so I have no idea in how they work in phase-change model. Do you have any idea?
One more thing I noticed is: I followed OpenFOAM tutorial's lid-driven cavity case, also I made a same mesh, same time step case in Gerris. Results are similar but Gerris was much much more slower than OpenFOAM. I am wondering why it happens.
Finally my email add: houkensjtu@gmail.com, i am very interesting in comparison result between these two codes. THX!

In my opinion, the comparison between the two codes can be briefly summarized as follows: OpenFOAM is a general, multipurpose code, while Gerris has been developed specifically for multiphase flows. About phase-change: as to my knowledge, neither OpenFOAM nor Gerris can simulate phase-change in an Eulerian framework. If you wish to do that with OpenFOAM, you should start from an Eulerian, two-phase solver (e.g. bubbleFoam, interFoam, etc.) and do your own implementation. Some useful suggestions are given in:

http://www.cfd-online.com/Forums/ope...hange-vof.html

Nevertheless I know that OpenFOAM has some phase-change models which can be used in Lagrangian solvers (e.g. sprayFoam).

Regarding the question of performances, in OpenFOAM almost all solvers use efficient segregated algorithms (SIMPLE, PISO, PIMPLE...), which in my experience work incredibly fast, especially for incompressible flows. I don't know much about the Gerris numerical algorithm (you can find all the details in Popinet's paper: http://gfs.sourceforge.net/wiki/index.php/Bibliography), but I know that it is second-order in space and time: have you checked that in OpenFOAM you also used such numerical schemes?

I'll send you an email with the comparison as soon as I can.

Regards,
Francesco

alberto October 18, 2012 21:37

I would be interested in the comparison too :-)

francesco_capuano October 19, 2012 05:39

1 Attachment(s)
Quote:

Originally Posted by alberto (Post 387419)
I would be interested in the comparison too :-)

The case setup is described in

A Orazzo, G Coppola, L de Luca, "Single-wave Kelvin-Helmoltz instability in nonparallel channel flow", Atomization and Sprays 21 (9), 775-785

and the article presents some results obtained with the codes GERRIS and SURFER. I have reproduced the test in OpenFOAM by using interFoam with a 2nd order accurate scheme in space and time on a fixed uniform mesh 800x400. I am attaching the solution after 8e-3 seconds, We = 1e5.

Attachment 16280

The elongated wave provided by OpenFOAM is clearly distorted and reproduced inaccurately with respect to the other two solvers. Such a problem is also shown in the link I gave some posts above.

Regards,
Francesco


All times are GMT -4. The time now is 23:57.