CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

mesh refinement

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2023, 05:34
Default mesh refinement
  #1
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Hi,
I have simulated flow over cylinder in Re=200 in openfoam, and I have used snappyHexMesh, but it looks there are sharp variations in velocity field in the regions that mesh switches from one level to another.
I have attached my mesh and velocity contour for your consideration.
Thanks in advance.
Attached Images
File Type: jpg Screenshot (100).jpg (171.7 KB, 17 views)
File Type: jpg Screenshot (99).jpg (181.8 KB, 14 views)
File Type: jpg Screenshot (107).jpg (87.7 KB, 26 views)

Last edited by saeed jamshidi; August 19, 2023 at 02:00.
saeed jamshidi is offline   Reply With Quote

Old   August 18, 2023, 06:00
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
Hello Saeed,

In paraView, try visualizing cell values rather than point values, to see if there is really an issue with the simulation. (see screenshot)

Yann
Attached Images
File Type: png screenshot.png (5.7 KB, 6 views)
Yann is offline   Reply With Quote

Old   August 18, 2023, 07:30
Default
  #3
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Dear Yann, thank you for your response.
As you can see nothing has changed by visualizing cell values!
Attached Images
File Type: jpg Screenshot (110).jpg (88.8 KB, 12 views)
saeed jamshidi is offline   Reply With Quote

Old   August 18, 2023, 07:39
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
OK then maybe you can have a look at your numerical setup in fvSolution and fvSchemes files.
Yann is offline   Reply With Quote

Old   August 18, 2023, 07:45
Default
  #5
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Everything looks good!

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         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         Gauss linear;

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

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}


// ************************************************************************* //
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      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver           GAMG;
        smoother         DICGaussSeidel;
        tolerance        1e-6;
        relTol           0.01;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.1;
    }

    UFinal
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    nNonOrthogonalCorrectors 0;
    nCorrectors         2;
}


// ************************************************************************* //
saeed jamshidi is offline   Reply With Quote

Old   August 21, 2023, 11:11
Default
  #6
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Hi,
I'm still looking for your opinion about the mentioned problem.
thank you.
saeed jamshidi is offline   Reply With Quote

Old   August 21, 2023, 11:27
Default
  #7
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
Hello Saeed,

Since the issues are located around the cell refinement transitions, I would tend to think you get this effect due to your numerical schemes setup.
Your current setup is based on a tutorial using structured mesh (made with blockMesh) while you have now an unstructured mesh.

I don't have a full setup to advise at the moment, but you can have a look to the tutorials and try other setup to see if it solves your issue.

Let us know if you still get the same issue or if it helps changing schemes.

Yann
Yann is offline   Reply With Quote

Old   August 21, 2023, 11:37
Default
  #8
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Dear Yann, thank you for your response.
Yes, it is obvious that the problem is because of snappyHexMesh feature. when i tried blockMesh i didn't see such problem.
Do you mean I should use simplefoam or pisoFoam tutorials?
saeed jamshidi is offline   Reply With Quote

Old   August 21, 2023, 12:02
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
I don't remember which solver you use, but you can check numerical schemes from the same solver you are using or other solvers too, if you pay attention to the differences between solvers.

For instance on divSchemes, we usually see common setup for div(phi,U) like Gauss upwind (1st Order) or Gauss linearUpwind (2nd order).
There are some resources in the documentation. For instance on the divScheme example: https://doc.openfoam.com/2306/tools/...ence/example/#

More generally: https://doc.openfoam.com/2306/quicks...discretisation
This should lead you to plenty of examples for each operator.

OpenFOAM offers tons of options for numerical setup, so playing around with it can be really time consuming, and this is why I was recommending to check some tutorials to have some examples to base your tests on.

Yann
saeed jamshidi likes this.
Yann 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
[snappyHexMesh] snappyHexMesh sticking point natty_king OpenFOAM Meshing & Mesh Conversion 11 February 20, 2024 09:12
[snappyHexMesh] Celllevel does not satisfy 2:1 constraint zippy OpenFOAM Meshing & Mesh Conversion 0 January 3, 2023 12:47
[snappyHexMesh] Sphere tutorial - refined mesh fails nikosb OpenFOAM Meshing & Mesh Conversion 0 March 17, 2022 15:49
[snappyHexMesh] Edge Refinement fracasce OpenFOAM Meshing & Mesh Conversion 3 December 2, 2017 13:30
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 08:54


All times are GMT -4. The time now is 00:47.