CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   twoLiquidMixingFoam (

maolongliu June 19, 2010 10:28

Hi, because the twoLiquidMixingFoam in OpenFoam is a transent solver. I was trying to change it to a steady state solver according to simpleFoam and twoLiquidMixingFoam.
Now the new solver can run successfully and it seems that the calculation result is correct. I compared u with experiment result and previous transient result.

But the problem is that there is a converge problem. After run a long time, pressure, k, epsilon etc. are all converged, but onlu u does not converge.

Time = 30575

DILUPBiCG: Solving for alpha1, Initial residual = 5.30999e-08, Final residual = 5.30999e-08, No Iterations 0
Phase 1 volume fraction = 0.500002 Min(alpha1) = 0 Max(alpha1) = 1
DILUPBiCG: Solving for Ux, Initial residual = 0.135853, Final residual = 1.4931e-08, No Iterations 6
DILUPBiCG: Solving for Uy, Initial residual = 0.0184276, Final residual = 1.39218e-08, No Iterations 5
GAMG: Solving for p_rgh, Initial residual = 3.33005e-07, Final residual = 3.33005e-07, No Iterations 0
time step continuity errors : sum local = 6.94663e-09, global = -1.76227e-11, cumulative = 2.20847e-08
DILUPBiCG: Solving for epsilon, Initial residual = 9.27893e-08, Final residual = 9.27893e-08, No Iterations 0
DILUPBiCG: Solving for k, Initial residual = 3.85187e-07, Final residual = 1.09717e-08, No Iterations 1
ExecutionTime = 22.01 s ClockTime = 22 s

Can anyone give me any advice? Thanks.

balkrishna August 9, 2010 05:20

Do try changing the relaxation values ....

maolongliu August 9, 2010 05:31

Thank you for your reply. I modified the U equation
UEqn== -fvc::grad(p)


UEqn== fvc::reconstruct
according to the twoLiquidMixingFoam, and now this problem has been solved.

Now I am trying to speed up the convergence because my mesh number is really huge.
Now the procedure of this solver is
first solver U eqn
and then p eqn
and then alpha1 eqn.
Also I change the relax method of alpha eqn just like p eqn (restore alpha1 and relax alpha1 instead alpha1 eqn).

How do you think of it?
Thank you!

Originally Posted by balkrishna (Post 270779)
Do try changing the relaxation values ....

balkrishna August 9, 2010 05:45

thats a nice modification .... relaxing alpha1 after every loop does converge faster ....
I am working on something similar and facing a ver different problem ... pls do help ...
link to thread discussion here .:

maolongliu August 9, 2010 05:52

If you don't mind, please send me your code, so I can help to check.


Originally Posted by balkrishna (Post 270786)
thats a nice modification .... relaxing alpha1 after every loop does converge faster ....
I am working on something similar and facing a ver different problem ... pls do help ...
link to thread discussion here .:

balkrishna August 9, 2010 05:56

whats ur email ???

maolongliu August 9, 2010 05:58


Originally Posted by balkrishna (Post 270788)
whats ur email ???

balkrishna August 11, 2010 01:23

In the twoLiquidMixingFoam what exactly is alpha1 ?? according to the o/p statement ,
it represents volume fraction , but how is the conservation equation formed on the basis of volume fraction ?
i mean conservation equation is :
d/dt(rho_fluid*mass_K) + divergence(rho_fluid*U*mass_K)= convection + source terms ....
where rho_fluid is density of the mixture ....
mass_K is the mass fraction of the Kth component ....
How is this written in terms of the volume fraction alpha ????

balkrishna August 11, 2010 04:05

got it ... the formulation is correct ....

phinallydone October 27, 2010 21:26

Has anyone seen negative values for alpha1 in twoLiquidMixingFoam? If so, any idea what changes I can make to correct the problem? I'm runnig a simulation of a pipe with RE around 2000 that has water and a higher viscosity fluid (~25cP). Any help is appreciated.

Thanks in advance!

Phase 1 volume fraction = 0.000377962 Min(alpha1) = -2.37485 Max(alpha1) = 1

balkrishna October 28, 2010 02:39

that is not possible .... ur solution will diverge ....

phinallydone October 28, 2010 11:00

That's just it... it's not diverging. I've tried refining the mesh, relaxing alpha1, and adjustnig tols. Any ideas?

karasa03 November 12, 2012 18:25

Hey Maolong,

Can you tell me how you changed the solver to steady state. I am working on a similar problem and my delta T is really small and will like to make it steady state to avoid the Courant number restriction.

All times are GMT -4. The time now is 18:17.