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

Residuals blowing up for simple turbulent case

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2016, 22:57
Default Residuals blowing up for simple turbulent case
  #1
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
I am attempting to model turbulent flow over a cylinder. I created an unstructured mesh in pointwise and imported into openFoam. The geometry is dead simple: A sqaure boundary around a circle.

Boundary Conditions:
Circle - wall
top/bottom (y-axis) front/back (z-axis) - empty
front/back (x-axis) - patch

I have set the front (x-axis) as an inlet and back (x-axis) as outlet and am solving using k-epsilon. The domain is 10 x 10 with the circle being 1 in diameter.

0 directory, all files modified versions of pitzDaily example:

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

dimensions      [0 2 -3 0 0 0 0];

internalField   uniform 0.00335;

boundaryField
{
    frontback
    {
        type            empty;
    }
    inlet
    {
        type            fixedValue;
        value           uniform 0.00335;
    }
    outlet
    {
        type            zeroGradient;
    }

    walls
    {
        type            epsilonWallFunction;
        value           uniform 0.00335;
    }

}


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

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

internalField   uniform (3 0 0);

boundaryField
{
    frontback
    {
        type            empty;
    }
    inlet
    {
        type            fixedValue;
        value           uniform (3 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    walls
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

}

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

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

internalField   uniform 0;

boundaryField
{
    frontback
    {
        type            empty;
    }
    inlet
    {
        type            calculated;
        value           uniform 0;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }

    walls
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}


// ************************************************************************* //
nuTilda
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v3.0+                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    frontback
    {
        type            empty;
    }

    inlet
    {
        type            fixedValue;
        value           uniform 0;
    }

    outlet
    {
        type            zeroGradient;
    }


    walls
    {
        type            zeroGradient;
    }

}

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

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

internalField   uniform 0.00555;

boundaryField
{
    frontback
    {
        type            empty;

    }
    inlet
    {
        type            fixedValue;
        value           uniform 0.00555;
    }
    outlet
    {
        type            zeroGradient;
    }

    walls
    {
        type            kqRWallFunction;
        value           uniform 0.00555;
    }

}


// ************************************************************************* //
p
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v3.0+                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    frontback
    {
        type            empty;
    }

    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }


    walls
    {
        type            zeroGradient;
    }


}

// ************************************************************************* //
The case fails on the first time step with infinite residuals and I'm lost as to why.
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: convergence criteria
    field p     tolerance 1e-08
    field U     tolerance 1e-08
    field "(k|epsilon|omega|f|v2)"     tolerance 0.001

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
}

No MRF models present

No finite volume options present


Starting time loop

streamLine streamLines:
    automatic track length specified through number of sub cycles : 5

Time = 0.0001

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = nan, No Iterations 1000
GAMG:  Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG:  Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000


--> FOAM FATAL IO ERROR: 
wrong token type - expected Scalar, found on line 0 the word 'nan'
ss32 is offline   Reply With Quote

Old   April 17, 2016, 11:14
Default
  #2
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
I have changed the top/bottom to patch and assigned them freestream values, still getting the same problem.
ss32 is offline   Reply With Quote

Old   April 18, 2016, 06:59
Default
  #3
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
It looks like you are only solving for Ux, which means you are solving for a 1D problem. Please run checkMesh and make sure you have defined your problem correctly.
tomf is offline   Reply With Quote

Old   April 18, 2016, 09:37
Default
  #4
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
Quote:
Originally Posted by tomf View Post
It looks like you are only solving for Ux, which means you are solving for a 1D problem. Please run checkMesh and make sure you have defined your problem correctly.
Everything looks good, but how do I ensure I'm solving a 2D problem?
Code:
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           42006
    internal points:  0
    faces:            142845
    internal faces:   60225
    cells:            40614
    faces per cell:   5
    boundary patches: 5
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     0
    prisms:        40614
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology
    frontback           81228    42006    ok (non-closed singly connected)
    inlet               398      798      ok (non-closed singly connected)
    outlet              398      798      ok (non-closed singly connected)
    topbottom           398      800      ok (non-closed singly connected)
    walls               198      396      ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-5 -5 0.01) (5 5 0.02)
    Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
    Mesh has 2 solution (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-1.87618e-18 -1.46651e-20 6.08114e-16) OK.
    Max cell openness = 2.42378e-16 OK.
    Max aspect ratio = 6.56347 OK.
    Minimum face area = 5.01428e-05. Maximum face area = 0.0059415.  Face area magnitudes OK.
    Min volume = 5.01428e-07. Max volume = 5.9415e-05.  Total volume = 0.992154.  Cell volumes OK.
    Mesh non-orthogonality Max: 51.6706 average: 8.27031
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.732464 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
ss32 is offline   Reply With Quote

Old   April 18, 2016, 09:49
Default
  #5
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
I take this from your first post

Quote:
Boundary Conditions:
Circle - wall
top/bottom (y-axis) front/back (z-axis) - empty
front/back (x-axis) - patch
Which would explain why it is not solving for Uy and Uz: both are empty.

However you claim to have used freestream for topbottom (redefined as type patch) as well and got the same result? Where did you change the patch type? It should be in constant/polyMesh/boundary.

The topbottom is also not mentioned in your boundary conditions from your first post.

Regards,
Tom
tomf is offline   Reply With Quote

Old   April 18, 2016, 11:23
Default
  #6
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
I went into pointwise and redefined the top and bottom and updated all of the relevant files in 0 as well.

constant/polyMesh/boundary
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}

5
(
    frontback
    {
        type empty;
        nFaces 81228;
        startFace 60225;
    }
    inlet
    {
        type patch;
        nFaces 398;
        startFace 141453;
    }
    outlet
    {
        type patch;
        nFaces 398;
        startFace 141851;
    }
    topbottom
    {
        type patch;
        nFaces 398;
        startFace 142249;
    }
    walls
    {
        type wall;
        nFaces 198;
        startFace 142647;
    }
)
simpleFoam log
Code:
Create time

Create mesh for time = 0


SIMPLE: convergence criteria
    field p      tolerance 1e-05
    field U      tolerance 1e-05
    field nuTilda        tolerance 1e-05

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model SpalartAllmaras
Selecting patchDistMethod meshWave
SpalartAllmarasCoeffs
{
    sigmaNut        0.66666;
    kappa           0.41;
    Cb1             0.1355;
    Cb2             0.622;
    Cw2             0.3;
    Cw3             2;
    Cv1             7.1;
    Cs              0.3;
}

No MRF models present

No finite volume options present


Starting time loop

Time = 0.01

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = nan, No It                                                                             erations 1000
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = nan, No It                                                                             erations 1000
DICPCG:  Solving for p, Initial residual = nan, Final residual = nan, No Iterati                                                                             ons 1001
DICPCG:  Solving for p, Initial residual = nan, Final residual = nan, No Iterati                                                                             ons 1001


--> FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 0 the word 'nan'

file: /home/user/OpenFOAM/user-v3.0+/run/tutorials/incompressible/simpleFoam/c                                                                             ylinder/system/data.solverPerformance.p at line 0.

    From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::doubleSc                                                                             alar&)
    in file lnInclude/Scalar.C at line 93.

FOAM exiting
edit: Let me try changing to k-epsilon and try that...
ss32 is offline   Reply With Quote

Old   April 18, 2016, 13:27
Default
  #7
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
Same results for k-epsilon
ss32 is offline   Reply With Quote

Old   April 19, 2016, 00:15
Default
  #8
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
In case anyone runs into a similar problem, running renumbermesh first did the trick.
ss32 is offline   Reply With Quote

Old   April 19, 2016, 02:58
Default
  #9
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
That can't be right, renumberMesh should not influence the result.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   April 19, 2016, 10:40
Default
  #10
Member
 
Join Date: Apr 2016
Posts: 39
Rep Power: 10
ss32 is on a distinguished road
Quote:
Originally Posted by akidess View Post
That can't be right, renumberMesh should not influence the result.
Well it did. I don't know if it was a memory issue at the start or what was happening, but a case that wouldn't run past the first time step runs to completion after using
Code:
renumberMesh -overwrite
I've successfully run a few cases of different turbulence models and meshes that previously failed for the same reason.
ss32 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
judging convergence through residuals MachZero Main CFD Forum 7 December 25, 2012 13:18
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
Validation case for turbulent flow Ratan Main CFD Forum 0 October 4, 2005 04:03
Validation case for turbulent flow Ratan Main CFD Forum 0 October 4, 2005 04:02
Turbulent Flat Plate Validation Case Jonas Larsson Main CFD Forum 0 April 2, 2004 11:25


All times are GMT -4. The time now is 13:06.