CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

2 fixed inlet velocities lead to steady time step decrease in interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By saddy
  • 1 Post By saddy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2017, 11:07
Default 2 fixed inlet velocities lead to steady time step decrease in interFoam
  #1
New Member
 
Join Date: Feb 2017
Posts: 4
Rep Power: 9
rheise is on a distinguished road
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).



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
Attached Images
File Type: png geometry.png (22.7 KB, 58 views)
rheise is offline   Reply With Quote

Old   May 28, 2017, 14:04
Default
  #2
New Member
 
Join Date: Feb 2017
Posts: 4
Rep Power: 9
rheise is on a distinguished road
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
rheise is offline   Reply With Quote

Old   May 30, 2017, 16:26
Smile diverging problem solution
  #3
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10
saddy is on a distinguished road
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.
saddy is offline   Reply With Quote

Old   May 31, 2017, 17:41
Default Thanks
  #4
New Member
 
Join Date: Feb 2017
Posts: 4
Rep Power: 9
rheise is on a distinguished road
Hi Saddy!

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

Robert
Attached Files
File Type: zip 0.zip (4.9 KB, 53 views)
rheise is offline   Reply With Quote

Old   June 1, 2017, 06:47
Default problems in your bc
  #5
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10
saddy is on a distinguished road
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
vivek05 likes this.

Last edited by saddy; June 1, 2017 at 06:48. Reason: mistakenly typed wrong
saddy is offline   Reply With Quote

Old   June 2, 2017, 12:58
Default
  #6
New Member
 
Join Date: Feb 2017
Posts: 4
Rep Power: 9
rheise is on a distinguished road
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
rheise is offline   Reply With Quote

Old   June 27, 2017, 06:57
Default
  #7
New Member
 
Join Date: Nov 2016
Posts: 1
Rep Power: 0
Alex Cze is on a distinguished road
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
Alex Cze is offline   Reply With Quote

Old   July 3, 2017, 07:24
Default
  #8
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 10
saddy is on a distinguished road
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
vivek05 likes this.
saddy is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 42 May 8, 2024 00:17
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
InterFoam negative alpha karasa03 OpenFOAM 7 December 12, 2013 04:41
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 08:56


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