CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   About interFoam solver (

zou_mo June 28, 2005 03:11

I am a newbie. The current int
I am a newbie. The current interFoam solver is for incompressible fluids. Is it direct to extend this solver to compressible fluids? What should I do?

Many thanks.

sergei June 28, 2005 12:56

I have a problem with running
I have a problem with running interFoam. Setup is similar to the damBreake case, i.e., 2D with symmetry boundaries, and walls. Mesh is generated in ICEM then exported in STAR (3.2) format (also tried with Fluent v6). The, using mesh utilities, converted to foam. paraFoam "sees" the mesh.
setGamma was compiled and ran on the case, mesh reread done, and in paraFoam I see my mesh and vof-scalar, as it should be.
When starting the solver, after reading enviromentalProperties, I get

--> FOAM FATAL ERROR : Cannot find a cell not on a constraint boundary starting from cell 0

Function: findRefCell(const polyMesh&, const label refCelli)

in file: findRefCell/findRefCell.C at line: 79.

FOAM exiting

Is it incorrect mesh I have imported, or I have somewhere missed some reference cell values?

henry June 28, 2005 13:02

If the mesh is properly 2D, i.
If the mesh is properly 2D, i.e. a slab of cells 1 cell think you can use the empty patch type for the front and back rather than symmetry boundaries which will solve your problem. Look at the definition of the damBreak mesh to see how it was done there.

zou_mo June 28, 2005 21:57

Dear Weller, how about my ques
Dear Weller, how about my question? :-) My current problem is concerning gas and heat transfer.

The VOF idea implemented in interFOam seems to be wonderful.

henry June 29, 2005 06:12

It is not trivial but possible
It is not trivial but possible to extend the interFoam solver for compressible fluids. I have derived all the equations and have a formulation that should work well but I need sponsorship before I can allocate time to do the implementation, testing, FoamX setup etc. etc.

sergei July 5, 2005 12:35

I have a rather simple questio
I have a rather simple question (before going into more details).
In one of the test cases I am running with interFOAM, a two phase flow through a micro channel junction is simulated. There is a T-like junction, which means that I have one inlet boundary (water inflow with a given velocity), and two pressure boundaries (larger cavities). Is it correct to use Outlet (two in my case) boundary condition in FOAM, and to specify a constant value of pd at those outlets?

Thanks in advance

PS. under micro channel I understand channels where capillary effects become pronounced (let say, with typical dimensions of 10-100 mu)

henry July 5, 2005 13:07


sergei July 6, 2005 06:48

Henry, Thanks for the answer
Thanks for the answer in relation to the interFOAM boundary conditions.
I found that my problems were related to the initialization of the solver. It was not enough to define gamma=1 and a certain velocity at the channel inlet. A proper initialization of the flow (some few cell filled with "heavy" fluid, and velocity of the fluid)is required to run interFoam smoothly.
Unfortunately, I found similar advices (by Ali) on the forum after having spent some hour on starring at deltaT going down to some 1.e-10, and even lower, and finally having resolved the problems I had.


henry July 6, 2005 07:08

Yes initialisation is a proble
Yes initialisation is a problem with the current interFoam, you cannot specify an interface (gamma 0->1 transition) at an inlet, but I have managed to find a better way of handling inlets in the interFoam series of codes for the 1.2 release which fixes this problem.

sergei July 7, 2005 04:55

Henry, Thanks for the info ab
Thanks for the info about initialization of interFOAM solver. According to my experience, there is a large number of problems where it is quite important.
May be some dummy iterations to get interface were(?) it should be. This seems however to be problem dependent.
It will be iteresting to see how you have solved the problem in FOAM 1.2.


sergei July 8, 2005 07:05

I have been running some test
I have been running some test with the interFOAM solver, and have a question related to the Courant number. How the maximum Courant number is calculated: based on all the grid cells or only in the cells adjacent to the sharp interface (i.e. were 0<gamma<1)?
Is it possible to choose between the options?


henry July 8, 2005 07:11

based on all the grid cells bu
based on all the grid cells but for some problems it might be useful to calculate a maximum Courant number for the region around the interface which is quite easy to do.

sergei July 11, 2005 05:26

Henry, Thanks for the answer
Thanks for the answer with respect to Courant number in interFOAM. That is actually what I suspected. At the moment, when the flow is driven by a "heavy" phase, performance is quite OK (like in dam breake similar cases, or pipe flow of a fluid "pressed" into a pipe). In tests with a few outlets with different pressure (i.e., when the air flow is also present), computation times are really huge, because time step becomes artificially small. In some cases I have got dt=1e-8, whereas based on the heavy phase it should be about 5e-5.
Henry, is there something to do about it, and do you have intention to implement this in 1.2 version. If not, may be you can give a hint how to do it (may be I will try, which is with my c++ programming skills really an issue).


henry July 11, 2005 09:06

I haven't implemented anything
I haven't implemented anything in 1.2 that will help you with this problem but there is something you can do about it yourself. Take a look at


If you create a copy of this file into a copy of the interFoam directory you can make changes to it and compile your own version of interFoam with those changes. You can now redefine Courant number with any kind of biasing you like, interface, phase-fraction etc. etc. But be careful it isn't only the interface-capturing part of the solution that suffers from a Courant-number limit, the PISO pressure-velocity algorithm also suffers from bad convergence if the Courant number if larger than 1. You will have to play around to find out what you can get away with.

It may be that your problem is near-steady with respect to the air-flow and you could run with a much larger Courant number and still maintain sufficient accuracy. This can be acheived using a transient version of SIMPLE rather than PISO which is more expensive but more robust and doesn't formally have a Courant number limit. I have a test version of interFoam running with transient SIMPLE but it still has some and I don't have time at the moment to finish testing it create a releasable version.

sergei July 11, 2005 10:20

Henry, Thanks, I will look at
Thanks, I will look at the sources, and experiment with it.
I have some experience with VOF in Star (piso) and Comet (simple). My belief is, indeed, that the behavior of PISO is more predictable. However, it is really time consuming (especially when dealing with flows of fluids of very different viscosity, for example). Here, SIMPLE should perform much better, may be because of a reason you have mentioned.
When simulating flows of water-in-air relevant to our problems, I would prefer PISO with control over the Courant number definition, because in those cases interface is still rather dynamic.

Thanks again

vantol July 14, 2005 05:00

Will it be possible to use int
Will it be possible to use interFoam without a second fluid, i.e. simulate one fluid with a free surface in vacuum ?
If this is possible, what should I specify as properties for the second fluid ?

Kind regards,


henry July 14, 2005 05:06

No that is not possible, the V
No that is not possible, the VOF method is a two-fluid approach not a free-surface method.

sergei July 20, 2005 14:13

Hi Henry, I have some few que
Hi Henry,
I have some few questions related to Courant number in interFoam. I have looked at


as you have suggested above. Can you give me some more hints/additional explanations about gamma scalar field definition, which I can use in


Specifically, how the gamma field can be defined/called to use it in the above construction.
What exactly


Thanks in advance

henry July 20, 2005 14:35

The gamma field is a volScalar
The gamma field is a volScalarField but you probably would rather have it interpolated onto the faces which you can do with fvc::interpolate(gamma).

interface.cGamma() simply returns the compression coefficient you specify in the fvSolution dictionary. Take a look at the interfaceProperties.[HC] files supplied with interFoam to see for yourself.

sergei July 20, 2005 16:30

Henry, Thank you, this is wha
Thank you, this is what I was looking for. With interpolation it behaves now "better".
I will try a few bias function to speed up calculations, and compare it to Star with respect to the calculation time.

Thanks again

All times are GMT -4. The time now is 06:26.