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

Question on simulating turbulent flow around a cylinder

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes
  • 1 Post By dlahaye
  • 1 Post By dlahaye
  • 1 Post By saeed jamshidi
  • 1 Post By dlahaye
  • 1 Post By NotOverUnderated
  • 1 Post By Tobermory
  • 1 Post By saeed jamshidi
  • 1 Post By NotOverUnderated
  • 2 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2023, 13:55
Exclamation Question on simulating turbulent flow around a cylinder
  #1
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Hello,

I have simulated flow around a cylinder in turbulent flow (Re=2*10^5) with the K- omega SST in 3D.
However, I have a question about the vorticity field that I have attached. Why there is such let's say noise in the area where I have shown by arrow?!!

I am going to share my fvsolution and fvscheme to have a better discusion.
Could you give me general advice on this matter?

Thank you.

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

solvers
{
    p
    {
        solver          GAMG;
        smoother        DICGaussSeidel;
        tolerance       1e-06;
        relTol          0.05;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    "(U|k|omega|s)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0.1;
    }

    "(U|k|omega|s)Final"
    {
        $U;
        relTol          0;
    }
}


SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;
}

PIMPLE
{
    nOuterCorrectors 1;
    nCorrectors      3;
    nNonOrthogonalCorrectors 1;
    pRefCell        0;
    pRefValue       0;
	momentumPredictor yes;
	correctPhi no;
}

relaxationFactors
{
    fields
    {
    }
    equations
    {
        ".*"        1;
    }
}


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         backward;
}

gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
}

divSchemes
{
    default         none;

    div(phi,U)      Gauss linear;

    div(phi,k)      Gauss limitedLinear 1;

    div(phi,omega) Gauss limitedLinear 1;
	
	div(phi,s) Gauss limitedLinear 1;

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method          meshWave;
    nRequired       yes;
}


// ************************************************************************* //
Attached Images
File Type: jpg mesh.jpg (95.5 KB, 32 views)
File Type: jpg vorticity.jpg (31.8 KB, 40 views)
saeed jamshidi is offline   Reply With Quote

Old   December 21, 2023, 02:09
Default
  #2
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
I'm still looking for your contribution.
saeed jamshidi is offline   Reply With Quote

Old   December 25, 2023, 05:09
Default
  #3
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Any idea 💡??
saeed jamshidi is offline   Reply With Quote

Old   December 26, 2023, 15:48
Default
  #4
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
Is the issue that you raise a mesh sensitive issue? Do artifacts disappear when you make the mesh finer?
dlahaye is offline   Reply With Quote

Old   December 26, 2023, 16:20
Default
  #5
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Thank you dlahaye for the reply,

No it is not the issue of mesh refinement to some what.

Actually, couple of hours ago I found that the problem is very sensitive with div(phi, U) scheme.
What I found is that
Code:
div(phi,U)      Gauss LUST grad(U);
has better performance than
Code:
div(phi,U)      Gauss linear;
saeed jamshidi is offline   Reply With Quote

Old   December 27, 2023, 04:28
Default
  #6
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
I suspect the sensitivity to the discretization scheme to disappear on finer meshes.
dlahaye is offline   Reply With Quote

Old   December 27, 2023, 04:59
Default
  #7
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
I will share my results with different div. Schemes.
Thanks.
saeed jamshidi is offline   Reply With Quote

Old   December 27, 2023, 06:23
Default
  #8
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
Results using various div schemes are hard to make sense of in the absence of a analytical reference solution.

My suggestion again is to try various mesh sizes. I do realize this is a nuisance as

1/ you will need to create various meshes;
2/ you will need to run on various meshes.
saeed jamshidi likes this.
dlahaye is offline   Reply With Quote

Old   December 27, 2023, 07:30
Default
  #9
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
I'll try it.
Thank you again dlahaye.
saeed jamshidi is offline   Reply With Quote

Old   December 27, 2023, 08:02
Default
  #10
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
Cool! Please post your results here for us to have a look at.
saeed jamshidi likes this.
dlahaye is offline   Reply With Quote

Old   January 2, 2024, 11:11
Default
  #11
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Hello everyone,
I hope you have nice days.

I came back after few days in response to previous posts.

As you saw I came across smearing gradients for flow around a cylinder at Re=200000 with the following mesh and discretization scheme:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         backward;
}

gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
}

divSchemes
{
    default         none;

    div(phi,U)      Gauss linear;

    div(phi,k)      Gauss limitedLinear 1;

    div(phi,omega) Gauss limitedLinear 1;
	
	div(phi,s) Gauss limitedLinear 1;

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

wallDist
{
    method          meshWave;
    nRequired       yes;
}


// ************************************************************************* //
Screenshot (210).jpg

However, in order to get rid of this issue I employed various methods in openfoam.

The procedures are as below:

1) Studing the effects of the mesh refinement and transition between cells (Number of cells between layers):
I adopted the same numerical scheme and used refinement level of (6,6) instead of level of (5,5) for cylinder, Nevertheless, there was not significant changes!
Of course mesh refinement plays an important role in CFD, but it was not the issue at least in this case.
Results: Screenshot (218).jpg and Screenshot (223).jpg
2) Studing the effects of different numerical schemes on the same mesh:
In this state, I consider previuos mesh with refinement level of (5,5) and utilized different discretization scheme whether spatial or temporal. I tested various methods for ddtSchemes (Time) , gradSchemes (Gradient) and divSchemes (Divergence) ; what I found is that just applying different methods for divergence of velocity (U) considerably affects the solution of our problem.
I used Gauss linear for divergence of U and employed leastSquares and cellMDLimmited Gauss linear 1 as a gradient schhemes; as you can see there isn't noticeably progress:
Results: Screenshot_(209).jpg and Screenshot_(213).jpg
...

Last edited by saeed jamshidi; January 4, 2024 at 02:25.
saeed jamshidi is offline   Reply With Quote

Old   January 3, 2024, 01:30
Default
  #12
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Due to attachment restrictions, I have to make multiple posts, So I apologise for that.

2)
Besides, once again on the previous mesh with a refinement level of (5,5); the Gauss linear method was kept constant as a gradient Scheme and different divergence schemes were utilized:
Results: Screenshot (203).jpg, Screenshot (204).jpg, Screenshot (205).jpg, Screenshot (206).jpg & Screenshot (207).jpg
saeed jamshidi is offline   Reply With Quote

Old   January 3, 2024, 01:36
Default
  #13
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
...2)

Results indicate that Gauss linearUpwind grad(U) scheme has the best performance among all utilized schemes. Also, this (second-order upwind) is the most common scheme which is used in Ansis Fluent as a second-order scheme for spatial discretisation.
Rest of the Results: Screenshot (208).jpg & Screenshot (236).jpg
saeed jamshidi is offline   Reply With Quote

Old   January 3, 2024, 02:06
Default
  #14
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
3) Studing the effects mesh topology:

All of the previous results were taken on the mesh which was generated with the snappyHexMesh utility:
Screenshot (225).jpg
Now, we are going to observe the results of O-Grid type which is created by just blockMesh in openfoam. Here is the topology of the mesh:
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2112                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _6e1fca0e-20220610 OPENFOAM=2112 patch=220610 version=2112
Arch   : "LSB;label=32;scalar=64"
Exec   : checkMesh
Date   : Jan 03 2024
Time   : 09:15:08
Host   : DESKTOP-TK3D7CI
PID    : 567
I/O    : uncollated
Case   : /mnt/e/OpenFoam/Run/cylinder3D1
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Time = 0

Mesh stats
    points:           740740
    faces:            2076200
    internal faces:   1931800
    cells:            668000
    faces per cell:   6
    boundary patches: 7
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     668000
    prisms:        0
    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
    inlet               1600     1771     ok (non-closed singly connected)
    outlet              1600     1771     ok (non-closed singly connected)
    cylinder            2400     2640     ok (non-closed singly connected)
    top                 2600     2871     ok (non-closed singly connected)
    bottom              2600     2871     ok (non-closed singly connected)
    back                66800    67340    ok (non-closed singly connected)
    front               66800    67340    ok (non-closed singly connected)

Checking faceZone topology for multiply connected surfaces...
    No faceZones found.

Checking basic cellZone addressing...
    No cellZones found.

Checking geometry...
    Overall domain bounding box (-0.4 -0.4 -0.01) (1 0.4 0.01)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-4.41575e-18 -7.09869e-18 1.66212e-14) OK.
    Max cell openness = 9.0192e-16 OK.
    Max aspect ratio = 65.3413 OK.
    Minimum face area = 1.5997e-08. Maximum face area = 0.000174079.  Face area magnitudes OK.
    Min volume = 3.20006e-11. Max volume = 3.48158e-07.  Total volume = 0.0223749.  Cell volumes OK.
    Mesh non-orthogonality Max: 44.1889 average: 7.86983
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.434082 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

saeedfoam@DESKTOP-TK3D7CI:/mnt/e/OpenFoam/Run/cylinder3D1$
Screenshot (229).jpg & Screenshot (230).jpg

Again I used Gauss linear and linearUpwind grad(U) schemes, as you can see linearUpwind grad(U) showed its superiority than Gauss linear. Furthermore, when we use this mesh all of the smearing gradients disappear!
Results: Screenshot (232).jpg & Screenshot (234).jpg

In conclusion, linearUpwind grad(U) scheme along with the O-Grig type was the best choice.
If you have any complementary opinions and ideas it would be really welcome.
Best Regards,
Saeed Jamshidi
Tobermory likes this.
saeed jamshidi is offline   Reply With Quote

Old   January 3, 2024, 11:23
Default
  #15
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
Congrats for your results.

Well done!
saeed jamshidi likes this.
dlahaye is offline   Reply With Quote

Old   January 3, 2024, 17:05
Default
  #16
Senior Member
 
NotOverUnderated's Avatar
 
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5
NotOverUnderated is on a distinguished road
linear scheme is second-order unbounded. That's why you are getting those oscillations. You should never use linear scheme for divergence terms under any circumstances for RANS simulations.

Regards

Update: Specified that linear scheme is not suitable for RANS simulations.
saeed jamshidi likes this.
__________________
Don't keep making the same mistakes. Try to make new mistakes.

Last edited by NotOverUnderated; January 4, 2024 at 07:39.
NotOverUnderated is offline   Reply With Quote

Old   January 4, 2024, 06:27
Default
  #17
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14
Tobermory will become famous soon enough
Nice thread, but let me just address the following:

Quote:
Originally Posted by NotOverUnderated View Post
[You should never use linear scheme for divergence terms under any circumstances.
this is too sweeping. There are plenty of situations where it is acceptable, or even necessary to apply linear for divergence terms, since it provides a cleaner discretisation than linearUpwind (linearUpwind is more diffusive or dispersive than central differencing ... I forget which) - LES or DNS simulations are an example. You're right, though, that for the majority of RANS simulations, linearUpwind can be a more stable scheme, but this comes at a slight accuracy cost (you don't get anything for free in this life!) so pick what works best for you and be careful with the linearUpwind gradient limiter ... which will also lower the accuracy of the scheme.
NotOverUnderated likes this.
Tobermory is offline   Reply With Quote

Old   January 4, 2024, 07:10
Default
  #18
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8
saeed jamshidi is on a distinguished road
Thank all of you for the opinions.

I want to add another type of divergence scheme which is frequently used in openfoam tutorials for the Detached Eddy Simulation, like
Code:
surfaceMountedCube
.

Quote:
Example of the DEShybrid scheme specification using linear within the LES region and linearUpwind within the RAS region:
Code:
    divSchemes
    {
        .
        .
        div(phi,U)      Gauss DEShybrid
            linear                    // scheme 1
            linearUpwind grad(U)      // scheme 2
            hmax                      // LES delta name, e.g. 'delta', 'hmax'
            0.65                      // DES coefficient, typically = 0.65
            30                        // Reference velocity scale
            2                         // Reference length scale
            0                         // Minimum sigma limit (0-1)
            1                         // Maximum sigma limit (0-1)
            1.0e-03;                  // Limiter of B function, typically 1e-03
        .
        .
    }
Notes:

Scheme 1 should be linear (or other low-dissipative schemes) which will be used in the detached/vortex shedding regions.

Scheme 2 should be an upwind/deferred correction/TVD scheme which will be used in the free-stream/Euler/boundary layer regions.
According to the above scheme, it seems that linearUpwind is a good choice for the RAS regions.

Also, I employed this scheme and it gave me satisfactory result for the IDDES method:
Screenshot (237).jpg
Tobermory likes this.
saeed jamshidi is offline   Reply With Quote

Old   January 4, 2024, 07:40
Default
  #19
Senior Member
 
NotOverUnderated's Avatar
 
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5
NotOverUnderated is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
Nice thread, but let me just address the following:



this is too sweeping. There are plenty of situations where it is acceptable, or even necessary to apply linear for divergence terms, since it provides a cleaner discretisation than linearUpwind (linearUpwind is more diffusive or dispersive than central differencing ... I forget which) - LES or DNS simulations are an example. You're right, though, that for the majority of RANS simulations, linearUpwind can be a more stable scheme, but this comes at a slight accuracy cost (you don't get anything for free in this life!) so pick what works best for you and be careful with the linearUpwind gradient limiter ... which will also lower the accuracy of the scheme.
Thank you for your input. I have updated the my post above to specify the RANS context.
Tobermory likes this.
__________________
Don't keep making the same mistakes. Try to make new mistakes.
NotOverUnderated is offline   Reply With Quote

Old   January 4, 2024, 08:02
Default
  #20
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14
Tobermory will become famous soon enough
Yep - that makes sense Saeed: linear in the LES regions and linearUpwind in the RANS regions.
Tobermory 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
Ncrit for a glider Xfoil. How to use it. GPT4 answer AlanMattanó Main CFD Forum 0 April 10, 2023 13:16
How much does the source code for this turbulent flow CFD code worth in US $? Dr Youssef Hafez Main CFD Forum 43 January 4, 2023 02:13
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
About Some Concepts:Laminar flow, turbulent flow, steady flow and time-dependent flow Jing Main CFD Forum 8 October 5, 2018 18:02
Drag force coefficient too high for a flow past a cylinder using komega sst Scabbard OpenFOAM Running, Solving & CFD 37 March 21, 2016 17:16


All times are GMT -4. The time now is 15:18.