CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Question about interface flow and adaptive mesh (https://www.cfd-online.com/Forums/openfoam-solving/59643-question-about-interface-flow-adaptive-mesh.html)

Luckyluke (Luckyluke) January 3, 2005 20:28

Hi,everyone.I am a newbie to
 
Hi,everyone.I am a newbie to OpenFOAM and attracted by its fancy features.

I want to simulate some interface flows. I know current FOAM has several sovlers on interface capturing(VOF). But I am not sure for some problems of FOAM's use.

(a).If I want to model the interface between two compressible fluids,will it be boring to code?
(b).Can I use adaptive mesh when I model interface flow?
(c).If I want to build a new interface capturing technique(e.g. Level Set method), what should I do?

Will you be so kind to give me some advice?

Niklas Wikstrom (Wikstrom) January 4, 2005 03:40

Hi there, will try to answ
 
Hi there,

will try to answer some of it

(a) Coding is fun by nature :-) So the answer is no. It is more or less there already. Seems to be working fairly well, although I have used the CICSAM scheme by Ubbink (from an older foam version) to keep the interface sharp. There might be a bug in the CICAM in OpenFOAM, which we will report as soon as we are certain. Presently I am working with a very old Foam version, but will move to open foam before spring and by then I could post a CICSAM based interFoam that works very well for me.

(b) Yes, but I have not tried it with the present foam versions new mesh handling. Things like this tend to be plesantly easy with FOAM. However, there are allways surprises, and you will not get the hang of it right away...

(c) LevelSet relies, in my experience, rather heavily on (W)ENO schemes, and I do not think any such scheme is implemented in the release. I tried a couple of years ago to create a second order ENO, but it was a cheaty implementation that only worked OK on cartesian meshes. Everything is possible, but some things gets tricky on unstrictured meshes when you want to know your neighbours neighbour. In my opinion a WENO scheme woiuld be great in OpenFOAM! (Maby some of the GammaXXX schemes are useful??)

Cheers
N

Henry Weller (Henry) January 4, 2005 03:56

(a) The CICSAM scheme has lon
 
(a) The CICSAM scheme has long since been superceeded by a much more accurate, stable, flexible and reliable approach I developped a few years ago which is used in the current version of interFoam included in the OpenFOAM release. CICSAM is no longer supported and will be removed in subsequent releases.

Niklas Wikstrom (Wikstrom) January 4, 2005 06:10

(a) Ubbinks scheme is indeed
 
(a) Ubbinks scheme is indeed bahaving very well, and it would be a pity to remove it from OpenFOAM, but as said; There was a bug in it (a typo I think, which remained at least up to foam2.1) that was fixed by Eric, making it MUCH better. Further I do not know how well OpenFOAM would cavitate using the "explicit" compression in the present interFoam.

Henry Weller (Henry) January 4, 2005 06:21

There are many problems with
 
There are many problems with the traditional VOF scheme in particular for stationary bubbles and for cases with high surface tension. My new approach has solved these and other problems and has enabled us to solve a wide range of problems we simply could not do with the old method for example a 20micron ink-jet and the LES of a Diesel spray breakup.

I do not understand why you think my new method will not do cavitation as well as the old method.
What problems have you experienced with the new algorithm? So far we have had no complaints and as far as I am aware it is better in every way to the old VOF method but still not anywhere near perfect.

The old VOF method is not supported in OpenFOAM and has not been released in the commercial versions of FOAM for some years and we do not intend to reinstate it. If you wish to release and support your VOF work using CICSAM please feel free to do so.

Niklas Wikstrom (Wikstrom) January 4, 2005 07:21

I know it's a good scheme, th
 
I know it's a good scheme, the new one. I'm not saying that I don't think it will work with mass transfer; Only that I don't know that it will, as I have not tried it for a long time. I will before long though, and I hope it will work nicely.

To be honest, I'm can't say that i KNOW that the old vof+cavitation method is working either, but from time to time I get results...

Anyway, I feel free :-)

Ali (Ali) January 4, 2005 14:08

I also believe there maybe a
 
I also believe there maybe a problem in CICSAM implementation in OpenFOAM. If you try a static bubble and use interface tracking to see how big the spurious currents become, interFoam does perform well and it goes on a long time without a very sharp increase in spurious currents in time. However, if you use the CICSAM version that's in OpenFOAM, after a short time it kind of blows up, timestep decreases orders of magnitude and it simply doesn't proceed in time anymore.

From what I've experienced with other VOF methods, CICSAM shouldn't perform so awful, even with worse VOF methods and worse surface tension models, it shouldn't blow like that, the magnitude of spurious currents should be higher if you use crappy VOF or surface tension models, but not 5 orders of magnitude anyway.

I don't know, but I just suspect there still may be a problem in CICSAM implementation in OpenFOAM. I'm saying this because Ubbink has tested stationary bubble in his thesis and at least it didn't blow like that in such a short time.

Niklas, could you please say what was the bug that you fixed? I need to check whether it's been removed from OpenFOAM or not.

Ali (Ali) January 4, 2005 14:10

Also, what's your idea of sch
 
Also, what's your idea of schemes that act similar to WENO in OpenFOAM, is there such a scheme similar to WENO in openFOAM?

Henry Weller (Henry) January 4, 2005 14:15

There is no problem with CICS
 
There is no problem with CICSAM in OpenFOAM it's just that the code it was supposed to be used with isn't released with FOAM anymore and it absolutely definitely positively should not be used with the new interFoam in OpenFOAM which uses a completely different approach to interface compression. If you do it will blow-up -- definitely!

I have also run the bubble cases with the new interFoam and got very good results but you do have to make good choices for the discretisation schemes and interface compression coefficient.

Ali (Ali) January 4, 2005 14:48

Which code has been eliminate
 
Which code has been eliminated? Does FOAM2.2 has those code as FOAM2.2 is the oldest one I have. It would be really cool to compare them.

For pure VOF advection tast cases (without solving NS equations) such as the shear flow in Ubbink's JCP paper, from what I tried, interFoam did not keep the interface as good as CICSAM. That's why I don't understand which code has been removed from OpenFOAM. Since interFoam (at least with schemes and coefficients that I tried and the schemes were similar to damBreak case), didn't perform as good as CICSAM in putre advection cases. But when you turn on the NS equation solver, the reverse happens. CICSAM blows very soon.

May i know the optimum schemes and coefficients please?

Henry Weller (Henry) January 4, 2005 14:55

I originally introduced the c
 
I originally introduced the current interFoam as newInterFoam and maintained the old code using CICSAM called interFoam. However, it quickly became apparent that the new code was at least as good as the old code for simple problems and much better at more difficult problems and we decided there was no point in maintaining the old code so I removed it and renamed newInterFoam as interFoam. This change occured before FOAM2.2.

The optimum schemes and coefficients depends on the case and what you are trying to achieve with respect to interface capturing, mesh distortions etc. If there was a simple optimum choice for all cases I would have harded-coded it.

Henry Weller (Henry) January 4, 2005 14:59

P.S. To remove any posibilit
 
P.S. To remove any posibility for confusion in the future I have now deleted the CICSAM scheme from OpenFOAM because the release does not include any codes for which this scheme is appropriate.

Ali (Ali) January 4, 2005 15:05

From what I understand, I can
 
From what I understand, I can easily reoproduce CICSAM by removing the third term in gammEqn.H so we don't need the term containing 'phirb' anymore. And then remaking it as another application say interFoamCICSAM.

And in fvSchemes, simply define Gamma CICSAM 0.5 as the scheme for div(phi,gamma). We don't need to define div(phirb,gamma) anymore.

I think that's about it. Is there anything else I should do to get CICSAM?

I needed to know the optimum schemes and coefficients for pure VOF test cases such as shear flow in Ubbink's JCP paper. Seems the interFoam with default schemes that are used in damBreak, don't perform as good as CICSAM.

Henry Weller (Henry) January 4, 2005 15:21

After Onno Ubbink left Imperi
 
After Onno Ubbink left Imperial College I spent a VERY long time trying to get the VOF approach with CICSAM to work reliably for a wide range of application in particular for cases with high surface tension and ones with a stationary interface. For the latter case CICSAM (and other numerical compression schemes) the interface breaks-up in the presence of divergent flow and this is a fundamental limitation of the approach as noticed by Onno himself. To solve these and other problems I created the new algorithm which does not use a compressive convection scheme in order to sharpen the interface thus avoiding the limitations of the VOF/CICSAM approach altogether. For obvious reasons I no longer work on or support CICSAM.

You will have to investigate the best choices of schemes for the new interFoam as is required in all areas of CFD.

Vatant (Vatant) January 4, 2005 16:57

Hello How can the interF
 
Hello

How can the interFoam be used to simulate a cavitating Flow ? I couldnt see any test cases for cavitating flow simulation in OpenFoam. Can someone let me know how cavitation model can be implemented in interFoam?

Thanks

Niklas Wikstrom (Wikstrom) January 4, 2005 17:05

Sorry Ali, I'm presently pani
 
Sorry Ali, I'm presently panicking about a report thats far from finished and cannot answer right now. When I've calmed down somewhat me and Eric will look into the stuff not yet erased from my drive and see how it looks. Send me an email-reminder soon please!, so we can talk about it "off the record" :-)

As to the ENO/WENO: Not a clue. As said: they are rare on unstructured meshes, I believe. Try! Maby implement a reinitialisation equation solve (as in Level-Set) and try solving it with different schemes :-)

/Niklas

Henry Weller (Henry) January 4, 2005 17:05

What cavitation model do you
 
What cavitation model do you wish to use?

Vatant (Vatant) January 4, 2005 17:12

I would like to use a homogen
 
I would like to use a homogenous model . Since, a VOF formulated model with interface trackingof the cavitation bubbles would be computationally demanding and expensive or is it ?

Is it possible to use a homogenous model with interfoam with 3 phases, the liquid , its vapor and the air outside. I have some formulations but Im finding it hard to include them into the codes.

Henry Weller (Henry) January 4, 2005 17:33

It is not appropriate to use
 
It is not appropriate to use the Barotropic eqn of state approach with HEM with interface compression because the interface should not neccessarily be sharp because the model doesn't require it. This is both an advantage and disagvantage of the HEM. However, ther rest of the components of a VOF code can be used.

I have written a 2-phase caviation code based on the Barotropic eqn of state and hope to release it in the next version of OpenFOAM if I get enough time to integrate it and add the pre/post-processing stuff. I haven't yet extended it to include the presence of a third phase and will only do so if I can find sponsorship for this work.

Ali (Ali) January 4, 2005 17:58

Henry, I know interFoam is
 
Henry,

I know interFoam is better than CICSAM in most cases, but anyway it's good to have two interface capturing instead of one if they can exist together in the code. I would appreciate if you let me know if my idea is correct or not about converting the code run CICSAM. Isn't it enough to just change gamma equation and use compressive schemes in convection term in order to get CICSAM? What other codes are removed that are necessary for CICSAM to work?

Niklas,
Thanks, I'll contact in few days.

Henry Weller (Henry) January 4, 2005 18:07

The original VOF code Onno de
 
The original VOF code Onno developed based on the initial work of me and Hrvoje ended up being very complicated indeed because the high-order schemes he was developing including CICSAM have a tendency to generate unboundedness in the solution. Onno added layer after layer of post-fix code to try to sort this out. However, the basic principle is as you have described.

Luckyluke (Luckyluke) January 7, 2005 10:41

The adapative solver is also
 
The adapative solver is also my interest. I know the commercial code FLUENT has a excellent implementation for the adaptive feature which can provide boundary, gradient and isovalue adaptions. I want to know if the OpenFOAM provide such features. For example, can the computational domain with triangular or tetrahedral grids be re-fined whithin the region contained shocks? From Jasak's thesis, I find that after refinement the vertexes of the new refined element locate on the centers of the faces of the corresponding coarser mesh. Can this be avoided if using triangular or tetrahedral grids? That is to say, after refinement, no vertex of a element is the center of the face of another cell. If the answer is yes, I want to take FOAM as my research tool.

Can anybody understand me? http://www.cfd-online.com/OpenFOAM_D...part/happy.gif. Please give me some detail instruction of the adaptive solver provided by FOAM. Your help will be great for me.

Mattijs Janssens (Mattijs) January 7, 2005 11:03

> Can this be avoided if usin
 
> Can this be avoided if using triangular or tetrahedral grids?

The refinement methods that have been implemented in Foam all are based on splitting of hexes. This introduces these 'hanging vertices' which are actually no problem numerically.

No work has been done on refining tetrahedra as far as I know but it should not be too hard to implement using the topology change mechanism.

How would you like to refine tetrahedra?
- naive decomposition of tet into 4 subtets? This will make the tets worse aspect ratio every iteration.
- some kind of red-green type refinement (sorry, don't know the theory in 3D, only 2D)

What does Fluent do? Do they remesh (since they have a delaunay mesher)?

Do you want to use an external tet mesher with steerable mesh density? (e.g. tetgen)

Mattijs

Luckyluke (Luckyluke) January 11, 2005 02:00

Thank your for your message,
 
Thank your for your message, Mattijs. I want to use adaptive mesh for my simulation of time-dependent interface-flow. I want to timely change the mesh density in the region containing the interface between two fluids in order to precisely capture the position and shape of the interface. I hope that the FOAM has implemented the similar feature.

Luckyluke (Luckyluke) January 11, 2005 08:19

Hi,Jasak or someone else, can
 
Hi,Jasak or someone else, can you give me a detail description for the implementation of a new time-dependent solver using the adaptive meshing(similar to the example given in jasak's thesis)?

int main()
{
//error estimate?
//markers setting?
//remesh?
//mapping solution?
......
}

I fail to solve my problem with the FLUENT code. I came to know OpenFOAM a few day ago and I want to know if this new and novel code can meet my need. Who can help me? It is somewhat urgent and your help will be great for me.

Thank you in advance!

Mattijs Janssens (Mattijs) January 11, 2005 09:37

Hi Luke, are you sure you w
 
Hi Luke,

are you sure you want to do this fully dynamic? This will be quite difficult, especially with a sensitive algorithm like interface tracking.

If it can be done non-dynamic:
- write a simple application to do an error estimate (either using Hrvoje's error estimation methods or just do some gradient of a field) and collect a 'cellset' from the cells you want to refine
- run the refineMesh -dict
utility to refine all the cells in the cellSet
- run mapFields (see the User Guide) to map the solution from the old to the new mesh.

I have a sample application to write a cellSet based on field values.

Mattijs

Luckyluke (Luckyluke) January 11, 2005 21:00

Dear Mattijs, what your "non-
 
Dear Mattijs, what your "non-dynamics" means? If I condider a tme-dependent flow,you mean that I should obtain a coarse solution first? Then I do an error estimate on the old solution and collect the cells that should refine and run the refineMesh....... Finaly, I should run the main solver once more to compute on the new mesh? Do you mean that? It seems that this will save time and decrease the numerical error compared to do a refinement work each time step.

Is it difficult if I do this fully dynamic? Why?

Luckyluke (Luckyluke) January 12, 2005 01:17

I find the sovler in the foll
 
I find the sovler in the following directory:
"/home/user0/OpenFOAM/adou-1.0/run
/tutorials/lesInterFoam/nozzleFlow2D"

There are two dicts named refineMeshDict and cellSetDict. Can anybody tell me how to run this simulation step by step (in particular I want to know when the utility 'refineMesh' should be run)?It seems that this example contains the "refine" feature.

Chris Greenshields (Chris) January 12, 2005 03:34

All the tutorial application
 
All the tutorial application subdirectories (e.g. tutorials/icoFoam) contain scripts called Allrun and Allclean.

Allrun executes commands to run the cases step by step. Simply look at the contents of the script to see what it does.

Allclean resets the cases, i.e. returns it to its original form in the OpenFOAM release by deleting generated field data etc.

The tutorial directory itself (tutorials) contains both an Allrun and Allclean script that execute in sequence ALL the Allrun and Allclean scripts, respectively, in the subdirectories for each application. So executing the tutorials/Allrun script will run ALL the tutorial cases supplied with OpenFOAM.

Mattijs Janssens (Mattijs) January 13, 2005 04:05

Hi Luke, about doing fully
 
Hi Luke,

about doing fully dynamic mesh adaptation: yes that is still quite difficult.

The alternative way of stopping and refining and mapping and restarting is indeed not perfect but at least already in OpenFOAM1.0.2.

(sample dictionaries, e.g. for refineMesh are usually found in the source directory of the application (so $FOAM_UTILITIES/mesh/manipulation/refineMesh) - we haven't had time to include all these into the FoamX configuration so these applications cannot be used from FoamX)

Mattijs

lr103476 May 31, 2007 09:05

Hi Mattijs, So you have a
 
Hi Mattijs,

So you have a sample application to write a cellSet based on field values (like gradients of velocity...). Could you please share that sample, I would like to play some with the mesh refinement.

Are there any improvement in the new OF version 1.4, such that unsteady (dynamic) mesh refinement will be possible?

Regards, Frank

msrinath80 June 13, 2007 04:12

Hi all, Does anyone know ho
 
Hi all,

Does anyone know how to use adaptive meshing (either dynamic or using cellsets) with interFoam? If so I would appreciate if you could provide some pointers.

Thanks!


All times are GMT -4. The time now is 12:47.