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/)
-   -   Different nu effects the amount of gravity? (https://www.cfd-online.com/Forums/openfoam-solving/147796-different-nu-effects-amount-gravity.html)

SkunkWorks January 29, 2015 09:01

Different nu effects the amount of gravity?
 
Hi look at http://youtu.be/ueMCheEpMrk

interMixingFoam with nu=1; in the square hanging in the air (marked as other. The colon on the left side have nu=1e-6 equal to water.
The colon are falling faster than the square. It should be the other way around of the fact that the square just have air under and not water.

And look at http://youtu.be/oKsIfmoJc6w

interMixingFoam with nu=1e-6 in the square hanging in the air (marked as other. The colon on the left side have nu=1e-6 equal to water.
The colon are now falling equal fast as the square, which it didn't in the other video http://youtu.be/ueMCheEpMrk .

Is something wrong with the software? Or have I done some thing wrong?

Here is the changes of the interMixingFoam :
(I ran both it in parallel with 8 cores, but that should not effect the result. it took app. 45 minutes.)

In transportProperties
Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

phases (air other water);

air
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0] 1.48e-05;
    rho            rho [1 -3 0 0 0 0 0] 1;
}

other
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0]  1; //change this to 1e-6 to get the ohter simulation.
    rho            rho [1 -3 0 0 0 0 0] 1010;
}

water
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0]  1e-6;
    rho            rho [1 -3 0 0 0 0 0] 1000;
}

// Surface tension coefficients
sigma12          sigma12 [1 0 -2 0 0 0 0] 0.05;
sigma13          sigma13 [1 0 -2 0 0 0 0] 0.04;

// Diffusivity between miscible phases
D23              D23  [0 2 -1 0 0 0 0]  3e-09;

// ************************************************************************* //

in setFieldsDict

Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha.air 1
    volScalarFieldValue alpha.other 0
    volScalarFieldValue alpha.water 0
);

regions
(
    boxToCell
    {
        box (0 0 -1) (0.1461 0.292 1);
        fieldValues
        (
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.other 0
            volScalarFieldValue alpha.water 1
        );
    }
    boxToCell
    {
        box (0.2 0.3 -1) (0.4 0.5 1);
        fieldValues
        (
            volScalarFieldValue alpha.air 0
            volScalarFieldValue alpha.other 1
            volScalarFieldValue alpha.water 0
        );
    }
);


// ************************************************************************* //

controlDict
Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    interMixingFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        5;

deltaT          0.0001;

writeControl    adjustableRunTime;

writeInterval  0.01;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression compressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep  yes;
//adjustTimeStep  no;

maxCo          0.5;
maxAlphaCo      0.5;

maxDeltaT      1;


// ************************************************************************* //

blockMeshDict
Code:


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.146;

vertices
(
    (0 0 0)
    (2 0 0)
    (2.16438 0 0)
    (4 0 0)
    (0 0.32876 0)
    (2 0.32876 0)
    (2.16438 0.32876 0)
    (4 0.32876 0)
    (0 4 0)
    (2 4 0)
    (2.16438 4 0)
    (4 4 0)
    (0 0 0.1)
    (2 0 0.1)
    (2.16438 0 0.1)
    (4 0 0.1)
    (0 0.32876 0.1)
    (2 0.32876 0.1)
    (2.16438 0.32876 0.1)
    (4 0.32876 0.1)
    (0 4 0.1)
    (2 4 0.1)
    (2.16438 4 0.1)
    (4 4 0.1)
);

blocks
(
    hex (0 1 5 4 12 13 17 16) (92 32 1) simpleGrading (1 1 1)
    hex (2 3 7 6 14 15 19 18) (76 32 1) simpleGrading (1 1 1)
    hex (4 5 9 8 16 17 21 20) (92 168 1) simpleGrading (1 1 1)
    hex (5 6 10 9 17 18 22 21) (16 168 1) simpleGrading (1 1 1)
    hex (6 7 11 10 18 19 23 22) (76 168 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    leftWall
    {
        type wall;
        faces
        (
            (0 12 16 4)
            (4 16 20 8)
        );
    }
    rightWall
    {
        type wall;
        faces
        (
            (7 19 15 3)
            (11 23 19 7)
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
            (0 1 13 12)
            (1 5 17 13)
            (5 6 18 17)
            (2 14 18 6)
            (2 3 15 14)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (8 20 21 9)
            (9 21 22 10)
            (10 22 23 11)
        );
    }
);

mergePatchPairs
(
);

// ************************************************************************* //


wyldckat January 29, 2015 15:57

Greetings Rickard,

This is so cool! It looks like a magic trick :eek:!
My best guesses without testing are:
  1. A fluid with nu=1 has a good gliding capability, since the fluid particles don't tear apart.
  2. The pressure is not homogeneous enough at the initial time.
  3. The solver might not be usable for such a high nu value.

I'll have a look into it during this coming weekend. But first a few questions:
  1. Which OpenFOAM version are you using?
  2. Are you using the tutorial "multiphase/interMixingFoam/laminar/damBreak" as a basis?
Best regards,
Bruno

SkunkWorks January 29, 2015 16:47

Hi!
And thanks! :)

I use OpenFOAM 2.3.1
Kubuntu 14.04
i7 3.2Ghz (the first edition)
24Gb RAM
(It took 45 minutes used all 8 core)

Regards / Rickard Hidefjäll

---------------

Sorry!
Yes I do use the interMixingFoam tutorial case from start.

wyldckat January 31, 2015 08:12

Hi Rickard,

Well this is certainly an interesting test case that can showcase the importance of the dynamic viscosity (mu) between fluids. Here's an example of what I'm referring to:
Code:

air
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0] 1.48e-05;
    rho            rho [1 -3 0 0 0 0 0] 1;
}

other
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0]  1.48e-1;
    rho            rho [1 -3 0 0 0 0 0] 1000;
}

water
{
    transportModel  Newtonian;
    nu              nu [0 2 -1 0 0 0 0]  1e-6;
    rho            rho [1 -3 0 0 0 0 0] 1000;
}

Now, in case you're not aware, this is briefly explained here: http://openfoamwiki.net/index.php/FA...ble_solvers.3F

  • \mu is the dynamic viscosity (mu).
  • \rho is the fluid's density (rho).
  • \nu=\frac{\mu}{\rho} is the kinematic viscosity (nu).
And why is the dynamic viscosity important? If you look at the values in the example above:
  • air: \mu={1.481 \times 10^{-5}} \times 1.0 = 1.48 \times 10^{-5}
  • other: \mu={1.48 \times 10^{-1}} \times 1000.0 = 1.48 \times 10^{2}
  • water: \mu={1 \times 10^{-6}} \times 1000.0 = 1 \times 10^{-3}
Now, if you subtract the largest from the smallest: 1.48e2 - 1.48e-05 = 147.9999852
Notice anything strange yet? Well, it's simple: the solver was not designed to compensate for such large numerical discrepancies, because "147.9999852" is almost identical to "148", which means that the number of computational errors that occur due to this very small difference are far greater than the remaining values being calculated.

If you increase even more to \nu=1.48 \times 10^{3}, the block barely moves. As time progresses, it then happens something very similar to this: http://www.cfd-online.com/Forums/ope...ckerboard.html


Note: the reason for choosing \nu=1.48 \times 10^{-1} for the "other" fluid was because I was confusing how dynamic and kinematic viscosity relate to each other.


Conclusion: this is not a bug. It simply means that the solver was not designed to handle such large differences in the fluids' properties.

Best regards,
Bruno

SkunkWorks February 1, 2015 17:09

Thanks a lot!
 
Hi and Thanks for a fast and lightning response!

Do you have a suitable solver in mind? :)
My goal is to simulate a new kind of toilette.

Best regards / Rickard Hidefjäll

wyldckat February 3, 2015 14:58

Hi Rickard,

I've never used it myself, but perhaps multiphaseEulerFoam can get the job done?
For more details: http://www.cfd-online.com/Forums/ope...eulerfoam.html

Best regards,
Bruno

SkunkWorks February 3, 2015 14:59

Lots ofta tank :) !!!


All times are GMT -4. The time now is 10:16.