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/)
-   -   2 fixed inlet velocities lead to steady time step decrease in interFoam (https://www.cfd-online.com/Forums/openfoam-solving/188208-2-fixed-inlet-velocities-lead-steady-time-step-decrease-interfoam.html)

rheise May 25, 2017 10:07

2 fixed inlet velocities lead to steady time step decrease in interFoam
 
1 Attachment(s)
Hello everyone,

I have a problem running my multi-phase model (water, air) with two inlets using two different fixed fluid-velocities (water) and the interFoam solver (and I'm relatively new to openFoam). The turbulence model used is RAS - kOmegaSST.

I want to simulate a constant water flow through those two inlets until more or less steady state conditions are reached. This works quite well for 0.2 seconds of simulation time and then the time steps decrease constantly (stopped the simulation at deltaT = XXe-80). I tried a lot of things like increasing Courant numbers up to exorbitant high values, coarsening my mesh, or applying different initial water conditions through setFieldsDict. I also played around with different PIMPLE-values (nOuterCorrectors, nCorrectors, nNonOrthogonalCorrectors) but nothing helped.

Since DeltaT = (deltaX/U)*C, I suspect that the inlet velocities seem to be too high (even though they are really low compared to the mesh size) until flow within the channel has been developed to a stable state.

The velocity boundaries are:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform (0 0 0);

boundaryField
{
    wall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    inlet1
    {
        type            fixedValue;
        value          uniform (0.4572 0 0);
    }
    inlet2
    {
        type            fixedValue;
        value          uniform (0.762 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
    }
}


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

As you can see, there are two different relatively small inlet velocities of 0.45 and 0.76 m/s. The mesh that I used for this model should definitely be coarse enough so that those velocities should not lead to any problem.

A file with the base geometry is attached. My base model consists of two inlets (red, black), atmospheric top (yellow), one outlet (green) and a geometry which serves as a wall (blue).

https://picload.org/image/riaddodw/geometry.png

Another assumption is that this problem might be solvable with different solvers or schemes. I tried to improve both, fvSolution and fvSchemes without any success. I hope that someone using this forum might have suggestions on how to improve my model in order to fix this problem.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{

    "alpha.water.*"
    {
        nAlphaCorr      2;
        nAlphaSubCycles 1;
        alphaOuterCorrectors yes;
        cAlpha          1;

        MULESCorr      yes;
        nLimiterIter    3;

        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-8;
        relTol          0;
    }

    pcorr
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-10;
        relTol          0;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-07;
        relTol          0.05;
    }

    p_rghFinal
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-07;
        relTol          0;
    }

    "(U|k|omega)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-06;
        relTol          0;
    }

    "(U|k|omega)Final"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0;
    }
}

PIMPLE
{
// momentumPredictor                yes;
    nOuterCorrectors            2;
    nCorrectors                1;
    nNonOrthogonalCorrectors    1;
    pRefCell                    0;
    pRefValue                  0;

    residualControl
    {
        "(p|U|k|omega)"
        {
            tolerance 1e-2;
            relTol 0;
        }
    }
}


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

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    div(rhoPhi,U)  Gauss linear;
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss interfaceCompression;
    div(phi,k)      Gauss upwind;
    div(phi,omega)  Gauss upwind;
   
    div(phi,R)      Gauss upwind;
    div(R)          Gauss linear;
    div(phi,nuTilda) Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;

    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p_rgh;
    pcorr;
    alpha;
}

wallDist
{
    method meshWave;
}

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

Thanks,
Robert

rheise May 28, 2017 13:04

UPDATE:

Added in fvSchemes:

Code:

gradSchemes
{
    ...
    grad(U)        cellLimited Gauss linear 1; //NEW
}

Code:

divSchemes
{
    ...
    div(rhoPhi,U)  Gauss linearUpwindV grad(U);
}

This change led to an immense improvement and I was able to run the simulation up to a bit over 5 seconds simulation time. Unfortunately after those 5 seconds, again, the time step decreases up to a far to small value (killed the process at deltaT = XXe-10).

I think that further improvement of the numerical schemes might eventually lead to a stable solution, any ideas?

Thank you!
Robert

saddy May 30, 2017 15:26

diverging problem solution
 
yours is a fairly simple problem. i have solved this problem successfully in vertical pipe flow with two inlets and single outlet without any divergence problem.
my advise is//; your error doesnt lie in fvschemes. no need tochange the fvschemes or system directory files
your error its in your boundary conditions.
just upload your bc files and i would be happy to help.

rheise May 31, 2017 16:41

Thanks
 
1 Attachment(s)
Hi Saddy!

Thanks for your reply. I attached my 0 folder in case you want to have a look at it.

Robert

saddy June 1, 2017 05:47

problems in your bc
 
in my opinion, ur errors in bc conditions are as under

1, alpha.water.org
inlet1
{
type fixedValue;
value uniform 1;
}

inlet2
{
type fixedValue;
value uniform 1;
}
how come both inlet are providing alpha.water as 1?? as far as i understand inlet 1 is for water inlet 2 is for air...right? so change "value uniform 0" for air inlet

though atmosphere outlet can be treated as inletoutlet as u have given
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
its better to just specify "outflow condition" using zerogradient


2. k file
though you are correctly specifying most values correctly
its better to write internal field as 3e-4 just like u hv written and give follwing syntax in below
wall
{
type kqRWallFunction;
value $internalField;
}
this adjusts changes itself as per internal field

similarly in case of nut, omega replace '' value uniform 0;" by "value $internalField"

4.Pressure
your pressure boundary conditions seem okay to me

5.U
Try changing atmosphere conditions to zero gradent. in case your solution diverges again.


about courant number exceeding 1, CFL no must not exceed 1, so take of following conditions
1. make a good quality mesh...its utmost important
2. calculate smallest cell division and calculate courant no equal to 1. take a time step size smaller than your smallest cell size..rule of thumb

hopefully it will help

rheise June 2, 2017 11:58

Thanks Saddy,

I'll try it the next days and let you know if it was successful.

Robert

Sent from my SM-G920F using CFD Online Forum mobile app

Alex Cze June 27, 2017 05:57

Hello Saddy,

I have a similar problem with my boundarie conditions as the discussed problem.
I was trying your suggestions and it is working pretty good but i have a question about the velocity BC.

you said u would apply a "pressureInletOutletVelocity" BC for the outlet velocity but u dont specify the pressure at the outlet. Isnt that mandatory to aplpy that velocity BC??

Kind Regarts

saddy July 3, 2017 06:24

hello Alex
thanks for reply. actually there is a syntax specified for all boundary conditions that are specified in openfoam. what u need to do is to take a look at the synatax of boundary conditions using this document im providing: http://www.nextfoam.co.kr/lib/downlo...idx=135033&sid...
just download and read
also u are asking whether we need to specify pressure at outlet or not?? right
the answer is: since our flow is incompressible therefore openfoam will calculate pressure from inlet to outlet automatically. here only pressure drop is of our interest


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