CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Struggling to achieve a smooth cylinder with snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By Alczem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2024, 12:54
Exclamation Struggling to achieve a smooth cylinder with snappyHexMesh
  #1
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
Hi everyone,


I'm struggling to achieve a smooth cylinder using snappyHexMesh. I've also tried using surfaceFeatureExtract, but I haven't had any success. I’m unsure how to properly mesh the cylinder to get 90° edges and perfect surfaces with snappyHexMesh.


I've attached a screenshot of the cylinder and the case file for reference.


Any help would be greatly appreciated.


Thank you in advance!
Attached Images
File Type: jpg 1715603188-cylinder.jpg (130.1 KB, 21 views)
Attached Files
File Type: zip Case_file_3D_AMI.zip (71.0 KB, 2 views)
File Type: zip Case_file_3D_AMI_using_surfaceFeatureExtract.zip (92.1 KB, 2 views)
highpressure is offline   Reply With Quote

Old   May 31, 2024, 05:33
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 241
Rep Power: 5
Alczem is on a distinguished road
Hey,


For your snap controls, try this:


Code:
    nSmoothPatch    2;
    tolerance       2;
    nSolveIter      4;
    nRelaxIter      5;
    nFeatureSnapIter 1;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;

You could also try to use the implicitFeatureSnap but you would need to add resolveFeatureAngle to your castellatedControls.
Alczem is offline   Reply With Quote

Old   May 31, 2024, 11:10
Default
  #3
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
Hello Alczem,

Thank you for your response.

Unfortunately, I've tried both of your suggestions, but neither of them seems to be working.
highpressure is offline   Reply With Quote

Old   May 31, 2024, 11:13
Default
  #4
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
I've also tried using the surfaceCheck command in OpenFOAM, and the log file indicates that the cylinder is not closed (see log file below). Could this be the problem?

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2312                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _e651d635-20240208 OPENFOAM=2312 patch=240220 version=2312
Arch   : "LSB;label=32;scalar=64"
Exec   : surfaceCheck rotating.stl
Date   : May 31 2024
Time   : 16:06:21
Host   : Vostro-3420
PID    : 16667
I/O    : uncollated
Case   : /home/ilyes/OpenFOAM/ilyes-2312/run/Case_file_3D_AMI_updated/constant/triSurface
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

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Reading surface from "rotating.stl" ...

Statistics:
Triangles    : 180 in 1 region(s)
Vertices     : 184
Bounding Box : (-1 -1.5 -1) (1 1.5 1)

Region Size
------ ----
patch0 180


Surface has no illegal triangles.

Triangle quality (equilateral=1, collapsed=0):
    0 .. 0.05  : 0.266667
    0.05 .. 0.1  : 0.622222
    0.1 .. 0.15  : 0.0777778
    0.15 .. 0.2  : 0.0166667
    0.2 .. 0.25  : 0.0166667
    0.25 .. 0.3  : 0
    0.3 .. 0.35  : 0
    0.35 .. 0.4  : 0
    0.4 .. 0.45  : 0
    0.45 .. 0.5  : 0
    0.5 .. 0.55  : 0
    0.55 .. 0.6  : 0
    0.6 .. 0.65  : 0
    0.65 .. 0.7  : 0
    0.7 .. 0.75  : 0
    0.75 .. 0.8  : 0
    0.8 .. 0.85  : 0
    0.85 .. 0.9  : 0
    0.9 .. 0.95  : 0
    0.95 .. 1  : 0

    min 0.000976297 for triangle 130
    max 0.234722 for triangle 177

Edges:
    min 0.136485 for edge 188 points (0.775711 -1.5 0.631088)(0.682553 -1.5 0.730836)
    max 3.0031 for edge 9 points (0.775711 1.5 0.631088)(0.854419 -1.5 0.519584)

Checking for points less than 1e-6 of bounding box ((2 3 2) metre) apart.
Found 0 nearby points.

Surface is not closed since not all edges (362) connected to two faces:
    connected to one face : 184
    connected to >2 faces : 0
Conflicting face labels:184

Number of unconnected parts : 3
Splitting surface into parts ...

Wrote zoning to "./rotating.vtp"

writing part 0 size 92 to "./rotating_0.obj"
writing part 1 size 44 to "./rotating_1.obj"
writing part 2 size 44 to "./rotating_2.obj"

Number of zones (connected area with consistent normal) : 3
More than one normal orientation.
Wrote zoning to "./rotating.vtp"

writing part 0 size 92 to "./rotating_normal_0.obj"
writing part 1 size 44 to "./rotating_normal_1.obj"
writing part 2 size 44 to "./rotating_normal_2.obj"


End
highpressure is offline   Reply With Quote

Old   June 3, 2024, 11:08
Default
  #5
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
Any help ?
highpressure is offline   Reply With Quote

Old   June 3, 2024, 11:53
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,198
Rep Power: 27
Yann will become famous soon enough
Hello,

Yes, the surface not being closed may be the problem.
(this reminds me of this: snappyHexMesh - 90° edges problem)

You can use surfaceHookup and surfacePointMerge utilities to fix your stl file: Surface Check and Repair Utilities - Need Explanation
highpressure likes this.
Yann is offline   Reply With Quote

Old   June 3, 2024, 12:02
Default
  #7
Senior Member
 
Join Date: Dec 2021
Posts: 241
Rep Power: 5
Alczem is on a distinguished road
Hey!


Too bad, but you are right, it probably comes from the STLs.


Since the issue lies with the rotating.stl file, you could try to replace it by a searchableCylinder. That way, you don't have to care about the STL quality. SnappyHexMesh will see no difference.
highpressure likes this.
Alczem is offline   Reply With Quote

Old   June 19, 2024, 10:36
Default
  #8
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello,

Yes, the surface not being closed may be the problem.
(this reminds me of this: snappyHexMesh - 90° edges problem)

You can use surfaceHookup and surfacePointMerge utilities to fix your stl file: Surface Check and Repair Utilities - Need Explanation
Bonjour Yann,

Thank you for your answer !
highpressure is offline   Reply With Quote

Old   June 19, 2024, 10:38
Default
  #9
New Member
 
Ilyes SAYAD
Join Date: Jul 2021
Posts: 21
Rep Power: 5
highpressure is on a distinguished road
Quote:
Originally Posted by Alczem View Post
Hey!


Too bad, but you are right, it probably comes from the STLs.


Since the issue lies with the rotating.stl file, you could try to replace it by a searchableCylinder. That way, you don't have to care about the STL quality. SnappyHexMesh will see no difference.
Hello Alczem;

It finally works ! Thanks a lot for your help
highpressure 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] Cant manage to refine a cylinder with snappyhexmesh. samwise14 OpenFOAM Meshing & Mesh Conversion 4 October 3, 2022 09:08
Cylinder volume trace error rmotwan CONVERGE 1 May 13, 2021 19:29
Cfd simulation on a smooth cylinder (drag coefficient) Simone94 STAR-CCM+ 21 October 31, 2016 11:00
benchmark: flow over a circular cylinder goodegg Main CFD Forum 12 January 22, 2013 12:47
Turbulent steady flow around a circular cylinder Mirek Kabacinski FLUENT 0 July 23, 2003 19:40


All times are GMT -4. The time now is 19:40.