CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   What solver for two immiscible fluids? (

Hectux May 5, 2009 08:47

What solver for two immiscible fluids?

I am wondering which solver would be the best to simulate two immiscible fluids e.g. in a pipe.

Any sugestions. I thought about interFoam oder rasInterFoam but I had some problems with defining the two phases.

Best regards

Hectux May 5, 2009 09:01

I tried a test.
T-Pipe. 2 Inlets, 1 Outlet.

I defined for Inlet 1 Gamma 0 and for Inlet 2 Gamma1.

I thought that I will have 2 Phases (1 Phase at Inlet 1 - Gamma 0 and 1 Phase at Inlet 2 - Gamma 1).

Actually the simmulation was like a simulation with 1 phase. In paraview my Gamma field was always the same at Inlet 2.

kwardle May 5, 2009 11:33

Have you had a look at the damBreak tutorial? Probably something is wrong with your setup. If you are using interFoam, there is only one gamma field with a value of 0 or 1. One thing to keep in mind is that you need to initialize the correct gamma values on your inlet patches--at least I think this is still true. This can be done using setFields as in the damBreak tutorial to set the initial distribution for gamma.

Hectux May 6, 2009 03:47

So I have to use the SetFieldsDict initialize the Distribution?
The Gamma 1 Boundary condition at Inlet 1 is not enough?

Hectux May 6, 2009 06:35

I have checked it several times.

I cannot find the mistake. But the problem is still the same.
My Gamma Field is always the same. The distribution of the fraction is always the same.

I have made an initial distribution of Gamma 1 in the centre of my pipe. Now the fluid flows around that region. Actually I thought that the gamma field will change in the direction of the fluid flow.

kwardle May 6, 2009 08:53

As to your first question, unless this is not true for current versions, yes, you have to initialize the gamma field on your inlets.

If you are willing to post your case, I could take a quick look at the setup and see if I notice anything.

Hectux May 6, 2009 09:12

I have packed it.

You can ignore the files for rasInterFoam like k or epilon BCs or RASproperties.
Actually I run this case in interFoam.

I have uploaded it on RapidShare:

kwardle May 6, 2009 12:56

a few strange things
OK, I noticed a few things that seemed strange.

1. You scales are screwy. You have the geometric domain on the order of 200 meters but your inlet velocity is 0.1 mm/second. To have a useful physical problem your domain needs to be smaller and your inlet velocities bigger. Try to run ' transformPoints -scale "(0.01 0.01 0.01)" ' to scale to cm and then change your inlet velocities to something like 0.1 m/s. (You will have to change the bounds in your setFieldDict too) The way you had it, of course nothing is moving--your inflow only travels a tenth of a millimeter in the 1 s of simulation time you had set in controlDict.

2. Perhaps this is intentional, but your gamma on both inlets was set to 0, so you have inflow of air only. Also, you had gravity set to zero. Like I said, maybe this was intentional. Based on your initial gamma field, are you trying to simulate the entrained flow of a single droplet?

3. About that, if you do want to simulate a single droplet, your mesh resolution is perhaps a little too coarse. The initial gamma field poorly resolves the curvature of your droplet.

Anyway, give these things a try. Even with the mesh you had, with these settings I was able to see movement of the droplet (not much for 0.1 m/s inflow) but you will have to run for a few seconds of flow time. You may want to increase your maxCo to ~0.2 and your nGammaSubCycles to ~5. You could also try starting with a larger slug instead of your small droplet and see what happens, this is a little more interesting.

Hope this is helpful.

Hectux May 7, 2009 05:24

Real thanks for your help.

I have forgot that I had this time the bigger geometry.
The last days I ran simulations with geometries in mm scale. So I forgot the adjust the BCs. Actually I should have noticed it.

Now it works fine. I nice water slug is moving through the pipe.

All times are GMT -4. The time now is 19:39.