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/)
-   -   interFoam, wierd nu. (https://www.cfd-online.com/Forums/openfoam-solving/115584-interfoam-wierd-nu.html)

sharonyue April 2, 2013 19:41

interFoam, wierd nu.
 
3 Attachment(s)
Hi,

In interFoam,I usually simulate a system of non-newtonian fluid. So I just make a test,in tutorial dambreak, I set the lower part of the mesh is all of fluid, and the higher part is air. Actually the fluid is still.

This is my transportProperties Dict:
Code:

phase1
{
    transportModel  HerschelBulkley;
rho            rho [ 1 -3 0 0 0 0 0 ] 989;
HerschelBulkleyCoeffs
{
    nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.19;//  188/989
    tau0          tau0 [ 0 2 -2 0 0 0 0 ] 0.0111;// 11/989  m2/s2 
    k              k [ 0 2 -1 0 0 0 0 ] 0.0283;//    28/989
    n              n [ 0 0 0 0 0 0 0 ] 0.14;
}
}

phase2
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1;
    CrossPowerLawCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m              m [ 0 0 1 0 0 0 0 ] 1;
        n              n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k              k [ 0 0 1 0 0 0 0 ] 99.6;
        n              n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

sigma          sigma [ 1 0 -2 0 0 0 0 ] 0.07;

But in the next time steps,nu becomes all the same all of the fields even where it is air.

Why is this happening?Thanks in advance.

I attach my case,just run
blockMesh
setFields
interFoam
then see the result.

sharonyue April 8, 2013 21:50

5 Attachment(s)
Recently I have tried twophaseeulerfoam,the mesh is totally the same with damBreak.

First I set the liquid is water, the transportDict is:
Code:

phase1
{
    nu              1.6e-05;
    rho            1;
    d              0.003;
}

phase2
{
    nu              1e-6;
    rho            1000;
    d              0.0001;
}

Cvm            0.5;
Cl              0;
Ct              1;

I get the satisfactory result which is been attached.

Then I change the phase nu to be 1 like this:
Code:

phase1
{
    nu              1.6e-05;
    rho            1;
    d              0.003;
}

phase2
{
    nu              1;
    rho            1000;
    d              0.0001;
}

Cvm            0.5;
Cl              0;
Ct              1;

Via result,Its obvious that the velocity is very slow.

So no matter interFoam which the two phase share the same governing equation or twoPhaseeuelrfoam which use their own equations all have this problem, especially when the viscosity ratio is large.

Anyone who would give me some light in the dark I would be very appreciated.Thanks in advance.

sharonyue April 8, 2013 21:52

1 Attachment(s)
This is my case.just run
blockMesh
setFields
twoPhaseeulerfoam

See the result and change the nu make a comparison.

vbchris April 8, 2013 22:02

What are your modeling with a nu=1 and rho =1000?
This would be a material with the consistancy of a ball bearing (ie not fluid) I think this is why you see such low velocities. check wolfram alpha for viscosities of various materials.

Chris

vbchris April 8, 2013 22:08

With respect to the interFoam.

I was using that last week.
I believe it calculated a blended effective viscosity MuEff based on the phase fractions in each cell. So The only way I would see it being equivalent over your mesh is with a prefectly mixed system. From your attached picture I would suggest changing the scales for nu in parafoam and it might tell a different tale.

Chris

sharonyue April 9, 2013 00:04

Quote:

Originally Posted by vbchris (Post 419251)
With respect to the interFoam.

I was using that last week.
I believe it calculated a blended effective viscosity MuEff based on the phase fractions in each cell. So The only way I would see it being equivalent over your mesh is with a prefectly mixed system. From your attached picture I would suggest changing the scales for nu in parafoam and it might tell a different tale.

Chris

Hi Chris,

Thanks for your reply

With respect to dambreakstill case.I check the nu1.in time 0.45.nu1 is equivalent over the field.this is the result:
Code:

dimensions      [0 2 -1 0 0 0 0];

internalField  uniform 0.19;

boundaryField
{
    leftWall
    {
        type            calculated;
        value          uniform 0.19;
    }
    rightWall
    {
        type            calculated;
        value          uniform 0.19;
    }
    lowerWall
    {
        type            calculated;
        value          uniform 0.19;
    }
    atmosphere
    {
        type            calculated;
        value          uniform 0.19;
    }
    defaultFaces
    {
        type            empty;
    }
}

So I think its not the visual problem via paraview.

About nu=1,I just make an assumption,Well,in this threadhttp://www.cfd-online.com/Forums/openfoam-solving/115002-interfoam-different-nu-different-falling-velocity.html,I made a comparision and found that the falling velocity is different as of the nu is changed. I dont know if its because of the VOF model.

sharonyue June 6, 2013 23:58

1 Attachment(s)
I dont know why there is no one concerning about this, no one is doing non-newtonian simulation? I made another test, copy the dambreak tutorial and make only one correction in nu:

Code:

phase1
{
    transportModel  BirdCarreau;
    //nu              nu [ 0 2 -1 0 0 0 0 ] 1e-06;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1000;
    CrossPowerLawCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m              m [ 0 0 1 0 0 0 0 ] 1;
        n              n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-04;
        k              k [ 0 0 1 0 0 0 0 ] 99.6;
        n              n [ 0 0 0 0 0 0 0 ] 0.1003;
    }
}

Then run the case and see the result. It appears that nu is almost the same all over the field, But I wish the nu of liquid is bigger than the air.

sharonyue June 12, 2013 19:42

I check the voscosity model in OpenFOAM, for example CrossPowerLaw code:
Code:

return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_;
Does it mean it do not consider the two phase situation?

olivierG June 13, 2013 09:06

hello,

Quote:

Does it mean it do not consider the two phase situation?
No, if you use InterFoam and Cie, you have nu1 (phase 1) and nu2, and nu which come from "incompressibleTwoPhaseMixture, which is nu1*alpha1+nu2*alpha2.
By defaut, nu is not write. If you use custom law like CrossPowerLaw for phase 1, you will have nu1, but still not nu of the mixture.

You can have large viscosity ratio (like nu1=1, nu2=1e-5), but then use small time step and at least 3 outercorrectors.

regards,
olivier

sharonyue June 13, 2013 09:23

Quote:

Originally Posted by olivierG (Post 433811)
No, if you use InterFoam and Cie,

Hi olivier,

Thats a light from the dark, Thanks. But what is Cie?

Quote:

you have nu1 (phase 1) and nu2, and nu which come from "incompressibleTwoPhaseMixture, which is nu1*alpha1+nu2*alpha2.
Looks like this could explain the high viscosity liquid is droping more slowly, for example: if the nu1 is 500, nu2 is 1, so the nu in the interface is 250, so its turning more viscious, right?

Code:

By defaut, nu is not write. If you use custom law like CrossPowerLaw for phase 1, you will have nu1, but still not nu of the mixture.
But in my case, it write the nu. you could try a case just make the liquid to non-newtonian fluid. So if its nu, I think nu in the liquid and nu in the air is in totally different order, but the result shows no difference on this two different nu.

Thank you again at last.

sharonyue June 18, 2013 03:29

1 Attachment(s)
Quote:

Originally Posted by olivierG (Post 433811)
you have nu1 (phase 1) and nu2, and nu which come from "incompressibleTwoPhaseMixture, which is nu1*alpha1+nu2*alpha2.

Hi,

About this, my opinion is this: look at this image. the four cells in the middle is some kind viscious liquid which viscosity is 1000, the other cells' viscosity is 1, By openfoam's code:
Code:

"nuf",
            (
                alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
              + (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu())
            )/(alpha1f*rho1_ + (scalar(1) - alpha1f)*rho2_)

Does it mean the nuf is 500 in the red line? Actually no matter what kind of this liquid is, they should fall in the same velocity, I think nuf is the point why the liquid is falling slowly, can I just set the nuf to "nu1*0.99+nu2*0.01"? so the nuf is 10.99. or "nu1*0.999+nu2*0.001"?

olivierG June 18, 2013 03:57

hello,

I am not an expert in this field, but this is common to use this linear variation.
You can try to modify this by using some kind of tanh function instead, which would be more continuous. Feel free to share if you get some more info about this.

regards,
olivier

sharonyue June 18, 2013 05:22

Quote:

Originally Posted by olivierG (Post 434571)
hello,

I am not an expert in this field, but this is common to use this linear variation.
You can try to modify this by using some kind of tanh function instead, which would be more continuous. Feel free to share if you get some more info about this.

regards,
olivier

If the liquid's density is 1000, nu is 1000,
gas's density is 1 , nu is 1 ,
By this code, if alpha=0.5, we have nuf=\frac{0.5*1000*1000+0.5*1*1}{0.5*1000+0.5*1}=999
Its almost equals the liquid's viscosity even in where alpha is 0.5.

I dont know whether my thought is right, I will try it by your advise.Thanks!

sharonyue June 26, 2013 20:17

3 Attachment(s)
Quote:

Originally Posted by olivierG (Post 434571)
You can try to modify this by using some kind of tanh function instead, which would be more continuous.

hi olivier,

There are four functions about nu, nuf, mu, muf in the code of twoPhaseMixture.C, I change the function regarding "nuf" and "muf", I think its the viscosity in the face which make the liquid falling slowly. In this new function if alpha is below 0.9 or 0.95, the viscosity in the face is near to the gas's.

I wmake it, succeed. As of I am newbie to programming. So now I only go this far and being stuck by linking this libso to interFoam, But I think its easy for some others, I attached my twoPhaseMixture.C, if you or someone else have an interest into it. try to wmake it and see the result.

I am learning ro program and keep going to handle this.

sharonyue October 30, 2013 21:58

Sorry, very late.

In leisure time, I check this out again, and find this "velocity getting slow" thing is not incurred by the nu. I attached an image using the new nu field. In this solver I make the nu in the liquid boundary is the almost the same as the gas. But velocity is still slow. I think its because the UEqn. And it needs much deeper consideration how to keep the dropping velocity and have a stable liquid phase boundary. Even this is not my project, but I am wondering if VOF can simulate solid ball dropping.
http://fmn.rrimg.com/fmn066/xiaozhan...00393c118f.gif


All times are GMT -4. The time now is 07:34.