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

Big jumps in pressure distribution over surface

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2023, 00:04
Default Big jumps in pressure distribution over surface
  #1
New Member
 
Ben
Join Date: Feb 2023
Posts: 8
Rep Power: 3
Ben0000 is on a distinguished road
Hello. I'm trying to analyse the flow over a semi-cylindrical structure. I have found that on the windward edge the pressure varies wildly between neighbouring cells, with the pressure increasing and decreasing rapidly in a non-physical manner. I was wondering what would be the cause of this error, and how I would go about fixing this. I'm using the LES Smagorinsky turbulence model, if that is relevant. Some screenshots are attached. Thanks.
Attached Images
File Type: jpg PressureDistribution1.jpg (182.9 KB, 26 views)
File Type: png PressureDistribution2.PNG (105.3 KB, 20 views)
Ben0000 is offline   Reply With Quote

Old   May 17, 2023, 03:14
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,068
Rep Power: 26
Yann will become famous soon enough
Hello,

Have you meshed your case with snappyHexMesh? How does your STL look like?

Yann
Yann is offline   Reply With Quote

Old   May 17, 2023, 19:04
Default
  #3
New Member
 
Ben
Join Date: Feb 2023
Posts: 8
Rep Power: 3
Ben0000 is on a distinguished road
Hi Yann,
Thanks for the quick response. I have meshed this case using snappyHexMesh. I believe my stl is of a decent quality but perhaps not, I've attached it to this reply (I've just changed the file type to .txt so I could attach it to this reply directly). Below is my snappyHexMeshDict:
Code:
FoamFile
{
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}

castellatedMesh on;
snap            on;
addLayers       off;
mergeTolerance     1e-6;

geometry
{
    domain
    {
        type closedTriSurfaceMesh;
        file "Domain.stl";
        regions
        {
            inlet            {name inlet; }
            outlet            {name outlet; }
            free            {name free; }
            floor            {name floor; }
            buildingWall    {name buildingWall; }
        }
    }
};

castellatedMeshControls
{
    maxGlobalCells    20000000;
    maxLocalCells    2000000;
    minRefinementCells    0;
    resolveFeatureAngle    15;
    nCellsBetweenLevels    5;
    allowFreeStandingZoneFaces    false;
    locationInMesh (0.123 0.123 0.123);
    
    features
    (
        {
           file "Domain.eMesh";
           level 0;
        }
    );

    refinementSurfaces
    {
        domain
        {
            level (0 0);
            regions
            {
                floor                { level (0 3); patchInfo { type wall; } }
                buildingWall        { level (3 3); patchInfo { type wall; } }
                free                { level (0 0); patchInfo { type patch; } }
                inlet                { level (0 0); patchInfo { type patch; } }
                outlet                { level (0 0); patchInfo { type patch; } }
            }
        }
    }
}

snapControls
{
    nSmoothPatch 5;
    tolerance 2.0;
    nSolveIter 500;
    nRelaxIter 15;
    nFeatureSnapIter 50;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

addLayersControls
{
    layers
    {
    }

    relativeSizes       true;
    expansionRatio      1.2;
    finalLayerThickness 0.5;
    minThickness        1e-3;
    featureAngle         30;
    nGrow                1;
    maxFaceThicknessRatio    0.5;
    nBufferCellsNoExtrude    0;
    nLayerIter            50;
}

meshQualityControls
{
    maxNonOrtho                65;
    maxBoundarySkewness     20;
    maxInternalSkewness        4;
    maxConcave                80;
    minFlatness             -1;
    minVol                    1e-13;
    minTetQuality            1e-15;
    minArea                    -1;
    minTwist                0.02;
    minDeterminant             0.001;
    minFaceWeight             0.05;
    minVolRatio                0.01;
    minTriangleTwist        -1;
    nSmoothScale            4;
    errorReduction            0.75;
}

writeFlags
(
);
Attached Files
File Type: txt Domain.txt (22.2 KB, 5 views)
Ben0000 is offline   Reply With Quote

Old   May 18, 2023, 09:42
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,068
Rep Power: 26
Yann will become famous soon enough
Hello Ben,

Thanks for sharing your files.
The triangles on your STL are pretty elongated. Can you remesh your STL with smaller triangles?
Something like the right cylinder part on this image: http://dawningresearch.org/img2/crea...aorticroot.png

I cannot guarantee it, but I remember a Tips & Tricks session at an OpenFOAM conference where this exact problem was mentioned: elongated triangles on a curved STL surface caused weird pressure jumps even if the OpenFOAM mesh looked OK.

Hope this helps,
Yann
Attached Images
File Type: jpg screenshot.jpg (79.1 KB, 14 views)
Yann is offline   Reply With Quote

Old   May 18, 2023, 22:30
Default
  #5
New Member
 
Ben
Join Date: Feb 2023
Posts: 8
Rep Power: 3
Ben0000 is on a distinguished road
Hi Yann,


Thanks for the suggestion. Unfortunately, I've remeshed and rerun the analysis with a refined stl file with no elongated triangles and the results have come back pretty much the same. However, I've done some more investigating and found that the values of nut vary in the same manner as pressure, changing rapidly along the surface (see image nut1). I then looked at how nut varies along the floor, and I was surprised to see that it changes drastically whenever the mesh size changes (see image nut2). Looking back at the building, it's clear that the varying nut occurs when there are changes in the size of the mesh elements (see image nut3). I'm assuming these changes are what's driving the varying pressure distribution. Would you (or anyone else) know why nut changes so drastically with mesh size? Is this an error or am I misinterpreting something? Below is a copy of my 0/nut file.

Code:
FoamFile
{
    format      binary;
    class       volScalarField;
    location    "0";
    object      nut;
}

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

internalField   uniform 0;

boundaryField
{
    buildingWall
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
    inlet
    {
        type            calculated;
        value           uniform 0;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    free
    {
        type            calculated;
        value           uniform 0;
    }
    floor
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
}
Attached Images
File Type: jpg nut1.jpg (45.7 KB, 22 views)
File Type: jpg nut2.jpg (162.3 KB, 20 views)
File Type: jpg nut3.jpg (151.2 KB, 17 views)
Ben0000 is offline   Reply With Quote

Old   May 21, 2023, 06:28
Default
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Your surface is not smooth. Calculate the curvature and plot it - it will show you what’s going on.

With a smooth mesh it will be fine
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

Last edited by hjasak; May 21, 2023 at 06:50. Reason: Typo
hjasak is offline   Reply With Quote

Old   May 21, 2023, 18:34
Default
  #7
New Member
 
Ben
Join Date: Feb 2023
Posts: 8
Rep Power: 3
Ben0000 is on a distinguished road
Hi Hrvoje,


Could you elaborate on how I would calculate curvature? And how I would generate a smooth mesh? Is snappyHexMesh able to do this or would I need some other tool? Thanks.
Ben0000 is offline   Reply With Quote

Old   May 24, 2023, 01:28
Default
  #8
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Ben0000 View Post
I'm using the LES Smagorinsky turbulence model, if that is relevant. .



This is most probably relevant as you can see that viscosity in this case is control volume dependent and you can see the jumps. The pressure follows the viscosity as you noted.



Try the calculation without LES model and if these jumps disappear then it is the reason why this is happening.
arjun is offline   Reply With Quote

Old   May 24, 2023, 01:41
Default
  #9
New Member
 
Ben
Join Date: Feb 2023
Posts: 8
Rep Power: 3
Ben0000 is on a distinguished road
Hi Arjun,
I did actually try this model earlier using RANS as the turbulence model instead of LES. It gave me quite similar results and the jumps in pressure were still there, although they were slightly less pronounced due to the "smearing" RANS does. I haven't run the model without a turbulence model yet, and I agree with you that this would probably solve the problem. Unfortunately, the flow is most definitely turbulent given my wind speed, so a laminar analysis would be quite inaccurate. I was hoping to fix this issue in general too, not just for this particular case.
I think at this point the best way to fix this issue would be with a better quality mesh. I've tried changing the minVolumeRatio parameter in snappyHexMesh dict, but I still get these sudden cell volume changes along the surface of the obstacle. Perhaps an external meshing tool like Salome is necessary.
Ben0000 is offline   Reply With Quote

Old   May 24, 2023, 03:35
Default
  #10
Senior Member
 
Join Date: Dec 2021
Posts: 207
Rep Power: 5
Alczem is on a distinguished road
I would give cfMesh a try too, if you think the mesh is the culprit here. Your geometry looks simple enough that it won't take long to generate a decent mesh.
Alczem is offline   Reply With Quote

Old   May 25, 2023, 04:21
Default
  #11
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Well the idea of laminar flow is to see if turbulent viscosity is causing it.

What you describe about the behaviour of turbulence models here makes sense because in LES the turbulent viscosity is function of velocity gradients and volume and in RANS models while control volume does not play direct role, the flow gradients certainly decide the turbulent viscosity.

Now flow gradients do depend on the control volumes and aspect ration and skew etc. So I believe this is what is causing the jump in turbulent viscosity and correspondingly jumps in pressure.

In the solvers that are Rhie and Chow based, many times this variation is reflected in momentum coefficient used in flux calculation and this causes this type of behaviour (Still can't say yet if this is really causing here but mostly seen this case cause in other simulations based on experience).




Quote:
Originally Posted by Ben0000 View Post
Hi Arjun,
I did actually try this model earlier using RANS as the turbulence model instead of LES. It gave me quite similar results and the jumps in pressure were still there, although they were slightly less pronounced due to the "smearing" RANS does. I haven't run the model without a turbulence model yet, and I agree with you that this would probably solve the problem. Unfortunately, the flow is most definitely turbulent given my wind speed, so a laminar analysis would be quite inaccurate. I was hoping to fix this issue in general too, not just for this particular case.
I think at this point the best way to fix this issue would be with a better quality mesh. I've tried changing the minVolumeRatio parameter in snappyHexMesh dict, but I still get these sudden cell volume changes along the surface of the obstacle. Perhaps an external meshing tool like Salome is necessary.
arjun 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
Pressure fields in FOAM, p field, total pressure, etc. Tobi OpenFOAM Post-Processing 9 March 25, 2022 01:33
Generate convective pressure fluctuation Bananenflanke CFX 10 May 12, 2021 18:33
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
pressure distribution in water flow, differences in icoFoam and COMSOL deniggo OpenFOAM Running, Solving & CFD 14 September 30, 2010 03:48
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 22:02


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