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

Boundary Layer strange result

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2015, 04:18
Default Boundary Layer strange result
  #1
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
Dear all,
I'm coming to you because I'm facing a boundary layer problem on a simulation...

I'm simulating a body in a flow with an inlet velocity Ux=5m/s. But right from the first iterations, the results close to the body gets strange... This can be seen on the attached pictures.

One can see that the velocity is 0 on the wall, but gets much bigger around the first cell, and then decreases again. And because of this my simulation blows up after a few iterations.

What I've done :
  • Turbulent/laminar simulation
  • Different algorithms (SIMPLE,PISO,PIMPLE, changin nCorrections and nOuterCorrections)
  • Different fvSolutions
  • Different fvSchemes (diffusive schemes for better convergence, and more accurate schemes)
  • OpenFoam 2.1 and 2.3
None of this could solve my problem. The only thing that did work is decreasing the cells' size around the wall. But my goal is to use a wall function so that I can have bigger cells (and increase the timeStep). So reducing the mesh size goes against this goal.


I'm running out of ideas, so if anyone has any hint it would be very appreciated !


Regards,
Daniel
Attached Images
File Type: jpg err_1.jpg (94.3 KB, 34 views)
File Type: jpg err_2.jpg (41.8 KB, 31 views)
fernexda is offline   Reply With Quote

Old   January 14, 2015, 07:07
Default
  #2
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Daniel, what do you need, steady-state or unsteady solutions?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 14, 2015, 07:46
Default
  #3
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
Hi, thanks for the quick reply.

In the end I need an unsteady simulation with moving mesh (with pimpleDyMFoam), but the error occurs for all cases.

I am currently trying with a steady-state simulation to check the mesh convergence (minimum mesh size to have a mesh-independent solution).
fernexda is offline   Reply With Quote

Old   January 14, 2015, 07:47
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
That means simpleFoam? Then post the log output of that until it becomes ugly...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 14, 2015, 08:53
Default
  #5
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
Yes I'm using simpleFoam.

Here a sample of the log :

Code:
Time = 319

smoothSolver:  Solving for Ux, Initial residual = 0.057221157, Final residual = 3.568287e-06, No Iterations 16
smoothSolver:  Solving for Uy, Initial residual = 0.063087545, Final residual = 4.5084555e-06, No Iterations 18
GAMG:  Solving for p, Initial residual = 0.0037987384, Final residual = 2.7417897e-07, No Iterations 23
GAMG:  Solving for p, Initial residual = 0.00020201867, Final residual = 9.5084443e-08, No Iterations 12
time step continuity errors : sum local = 1.6112304, global = -0.03484718, cumulative = -0.77715832
smoothSolver:  Solving for nuTilda, Initial residual = 0.046411558, Final residual = 4.2056708e-06, No Iterations 3
ExecutionTime = 870.68 s  ClockTime = 886 s

forces forcesPaddle0 output:
    sum of forces:
        pressure : (0 0 0)
        viscous  : (2.6813238e+13 5.6435289e+11 -1.4963997)
        porous   : (0 0 0)
    sum of moments:
        pressure : (0 0 0)
        viscous  : (-2.8217644e+11 1.3406619e+13 -2.6081707e+13)
        porous   : (0 0 0)

forceCoeffs forceCoeffsPaddle0 output:
    Cm    = -5.2163414e+11
    Cd    = 5.3626477e+11
    Cl    = 1.1287058e+10
    Cl(f) = -5.1599061e+11
    Cl(r) = 5.2727767e+11

forceCoeffs forceCoeffsPaddle1 output:
    Cm    = -96904.785
    Cd    = -66422.036
    Cl    = 297601.6
    Cl(f) = 51896.014
    Cl(r) = 245705.58

Time = 320

smoothSolver:  Solving for Ux, Initial residual = 0.052995367, Final residual = 4.8433206e-06, No Iterations 15
smoothSolver:  Solving for Uy, Initial residual = 0.062183782, Final residual = 5.6252108e-06, No Iterations 17
GAMG:  Solving for p, Initial residual = 0.0037642096, Final residual = 3.4332139e-07, No Iterations 21
GAMG:  Solving for p, Initial residual = 0.00017745207, Final residual = 5.9287776e-08, No Iterations 12
time step continuity errors : sum local = 1.085192, global = -0.02221701, cumulative = -0.79937533
smoothSolver:  Solving for nuTilda, Initial residual = 0.061514173, Final residual = 3.6499883e-06, No Iterations 3
ExecutionTime = 874.44 s  ClockTime = 890 s

forces forcesPaddle0 output:
    sum of forces:
        pressure : (0 0 0)
        viscous  : (3.1377491e+13 6.8424339e+11 -1.8496672)
        porous   : (0 0 0)
    sum of moments:
        pressure : (0 0 0)
        viscous  : (-3.421217e+11 1.5688745e+13 -3.0631529e+13)
        porous   : (0 0 0)

forceCoeffs forceCoeffsPaddle0 output:
    Cm    = -6.1263058e+11
    Cd    = 6.2754982e+11
    Cl    = 1.3684868e+10
    Cl(f) = -6.0578814e+11
    Cl(r) = 6.1947301e+11

forceCoeffs forceCoeffsPaddle1 output:
    Cm    = -114884.08
    Cd    = -78823.833
    Cl    = 351014.44
    Cl(f) = 60623.139
    Cl(r) = 290391.3

Time = 321
And some results are shown on the pictures.

And as I said, this simulation works just fine when the mesh on the BL is finer.
Attached Images
File Type: png residuals.png (7.0 KB, 16 views)
File Type: png continuity.png (3.8 KB, 12 views)
File Type: jpg global_view.jpg (10.7 KB, 14 views)
File Type: jpg detailed_view.jpg (28.4 KB, 16 views)
fernexda is offline   Reply With Quote

Old   January 14, 2015, 08:58
Default
  #6
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
1) In my experience your linear solvers take too many iterations in each outer (SIMPLE) iteration. Did you set relTol to 1e-4? This is normally not needed in SIMPLE. But fixing this will make your solver only faster... not better You can post the fvSolution to get some help.
2) Can you post checkMesh output and fvSchemes? What about your boundary conditions? Are you sure, they are correct? If not, you can post them, too.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 14, 2015, 09:18
Default
  #7
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
I'm rather confident about the boundary conditions. After trying many of them, the only one working are those from the motorBike example (with Spalart-Allmaras model).

The problem occurs with different schemes (accurate as well as diffusive schemes).

Same with the tolerances. I've tried with maxIter=1000 (tolerance and relTol = 0) just for fun, and it still doesn't work.

To sum up, the problem appears as soon as I increase the cells size around the body. I understand this could cause troubles with a turbulent case without using a wall function, but it also causes troubles in laminar...

Concerning the wall function, as far as I know I just have to specify the wall function in 0/nut, right ? Are the initial conditions as posted here ok considering I'm using a wall function ?

nut

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       volScalarField;
    location    "0";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;


boundaryField
{
    Inlet
    {
        type            calculated;
        value           uniform 0;
    }
    Outlet
    {
        type            calculated;
        value           uniform 0;
    }
    upperSym
    {
        type            symmetryPlane;
        value           uniform 0;
    }
    lowerSym
    {
        type            symmetryPlane;
        value           uniform 0;
    }
    paddle0
    {
        type            nutUSpaldingWallFunction;
        value           uniform 0;
    }
    paddle1
    {
        type            nutUSpaldingWallFunction;
        value           uniform 0;
    }
    AMI_P0S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_P1S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP0
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP1
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SF
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_FS
    {
        type            cyclicAMI;
        value           $internalField;
    }
}


// ************************************************************************* //
nuTilda

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       volScalarField;
    location    "0";
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField    uniform 0.05;
//internalField   uniform 0.05;

boundaryField
{
    Inlet
    {
        type            fixedValue;
        value           uniform 0.05;
    }
    Outlet
    {
        type            inletOutlet;
        inletValue      uniform 0.05;
        value           uniform 0.05;
    }
    upperSym
    {
        type            symmetryPlane;
    }
    lowerSym
    {
        type            symmetryPlane;
    }
    paddle0
    {
        type            fixedValue;
        value           uniform 0;
    }
    paddle1
    {
        type            fixedValue;
        value           uniform 0;
    }
    AMI_P0S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_P1S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP0
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP1
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SF
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_FS
    {
        type            cyclicAMI;
        value           $internalField;
    }
}


// ************************************************************************* //
U

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 (5 0 0);

boundaryField
{
    Inlet
    {
      type              fixedValue;
      value             uniform (5 0 0);
    }
    Outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (5 0 0);
    }
    upperSym
    {
        type            symmetryPlane;
    }

    lowerSym
    {
        type            symmetryPlane;
    }
    paddle0
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    paddle1
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    AMI_P0S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_P1S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP0
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP1
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SF
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_FS
    {
        type            cyclicAMI;
        value           $internalField;
    }

}


// ************************************************************************* //
p

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       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    Inlet
    {
        type            zeroGradient;
    }
    Outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    upperSym
    {
        type            symmetryPlane;
    }
    lowerSym
    {
        type            symmetryPlane;
    }
    paddle0
    {
        type            fixedValue;
        value           uniform 0;
    }
    paddle1
    {
        type            fixedValue;
        value           uniform 0;
    }
    AMI_P0S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_P1S
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP0
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SP1
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_SF
    {
        type            cyclicAMI;
        value           $internalField;
    }
    AMI_FS
    {
        type            cyclicAMI;
        value           $internalField;
    }

}


// ************************************************************************* //
fernexda is offline   Reply With Quote

Old   January 14, 2015, 09:20
Default
  #8
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
paddle0 and paddle1 are walls? If so, why did you set pressure to zero and not zerogradient?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 14, 2015, 09:25
Default
  #9
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
Oh my god............

I hadn't noticed, it the same for all simulations I've run......... I guess I'm sometimes being confused with all the files... This could definitely create problems...

I change this and I keep you posted. Thank you for seeing this !
fernexda is offline   Reply With Quote

Old   January 14, 2015, 09:28
Default
  #10
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
And concerning the wall function definition, do you agree on what I've put ?
fernexda is offline   Reply With Quote

Old   January 14, 2015, 09:29
Default
  #11
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
I don't use SA-model but the airfoil2d tutorial uses it the same way.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 15, 2015, 07:14
Default
  #12
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
Ok, that was the problem... Everything works just fine now !

I would never have thought the error could come from initial conditions... Thanks a lot for this, you saved me many hours of work !

Regards,
Daniel
fernexda is offline   Reply With Quote

Old   January 15, 2015, 07:16
Default
  #13
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Maybe just a typo, but it should be "boundary" not "initial" conditions in your last post.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   January 15, 2015, 07:18
Default
  #14
Member
 
daniel fernex
Join Date: Oct 2014
Location: Braunschweig, Germany
Posts: 36
Rep Power: 11
fernexda is on a distinguished road
You don't miss anything

It's boundary condition indeed.
fernexda is offline   Reply With Quote

Old   January 15, 2015, 07:21
Default
  #15
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Now you can tune your solver settings to get rid of these horrible iterations. If you need any consecutive help or are not sure just post again.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply

Tags
boundary layer, diverging, openfoam


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
[snappyHexMesh] Snappy creates strange cells far away from boundary vainilreb OpenFOAM Meshing & Mesh Conversion 3 December 16, 2020 05:11
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner panpanzhong OpenFOAM Meshing & Mesh Conversion 5 July 3, 2018 05:53
Divide Prismatic Boundary Layer Mesh causes overlapping faces SilentRunner42 enGrid 4 May 4, 2015 03:37
[GAMBIT] 3D boundary layer and meshing problem in GAMBIT 2.4.6 prashanthreddyh ANSYS Meshing & Geometry 1 December 20, 2011 00:35


All times are GMT -4. The time now is 22:53.