CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   InterMixingFoam - Gravity Currents (bug?) (

msabger September 9, 2010 01:02

InterMixingFoam - Gravity Currents (bug?)
1 Attachment(s)

I've already posted in the "OpenFOAM Running / Solving / CFD" section about this issue, but I'm starting to think that may be there is a bug in the interMixingFoam.

I tried to test the interMixingFoam solver when studing gravity currents. So I took the tutorial example but changing the initial alpha fields. The initial condition is a horizontal free surface, and two separated phases, with different densities (I attach the whole example).

I expected to see the gravity currents due the difference in density, but both liquid phases behave as they have the same properties.

What could it be wrong?



mattijs September 9, 2010 04:12

We've finally got a proper bug reporting system :-)
Please report any OpenFOAM bugs on

nbadano September 28, 2010 12:02

InterMixingFoam - Gravity Currents Bug-fix
4 Attachment(s)
Dear Martin,

There's indeed a bug in interMixingFoam. The solvers incorrectly assigns the properties of phase 2 to phase 3, so both are identical, preventing the development of any density current.

I found the bug in threePhaseMixture.C, located under /opt/openfoam171/applications/solvers/multiphase/inaMixingFoam/incompressibleThreePhaseMixture/

In lines 79 to 88 you should replace this piece of the constructor code:



by this:



After that, just recompile the solver with wmake.

I was able to run your test case without any problem after this modification. It works beautyfully. I've uploaded a couple of pics of the resulting alpha3.

Hope this helps.

Best regards!


nbadano November 11, 2010 13:21

Bug fixed!
Although we never actually reported the bug officially, it seems to be corrected in the last 1.7.x version of OpenFOAM!


sarahk April 1, 2011 10:01

Hey guys,

i know my probelm doesnt fit that well in this Thread, but as you used interMixingFoam already i thought you might be able to help me ;)

i have a huge vessel with a tap (an electrical arc furnace). So, inside i have steel, slag and air. And i wanna simulate at wich level the slag flows into the tap. and I dont want steel and slag to mix (D=0, am i right??).

my bcs:
phase 2 and 3 are slag and steel.
the field has a really small velocity in -y
g (0 -9,81 0) at beginning.

what happens is, that Foam stops after the first time step (0,005) and i have a velocity from 600 m/s at the Outlet.

Any Ideas?

Thanks in advance


nbadano April 1, 2011 10:51

Hey Sarah,

I don't really know much about metallurgy but; do slag and steel behave as separate phases (with sharp interface maintained by surface tension)?? If that's the case I think you should use multiphaseInterFoam instead of interMixingFoam. multiphaseInterFoam solves for n inmiscible phases. Maybe D=0 is not very interMixingFoam friendly!

On the other hand, 600 m/s in 0.005 secs sounds like an inconsistency in BCs or a mesh problem (any bad elements according to checkMesh?). Can't really pinpoint anything more concrete without having a look at the actual case directory.

Hope this helps!

Best regards


sarahk April 4, 2011 02:59

HEy Nico,

thanks ill give multiphaseInterFoam a try ;)

the Mesh is ok (i did the calculation in fluent before), but i think it really has a problem with the D=0, and how you use the phases. I changed steel against air (just to try it) and it worked much better (solution was senseless, anyway ;) )

do you if there is still a bug in gravity? When i checked my Solutions i had air blowing through the tap in the steel, without patching any velocity ...



All times are GMT -4. The time now is 01:09.