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

[snappyHexMesh] SnappyHexMesh won't snap to geometry (external flow)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By snak

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2019, 09:54
Default SnappyHexMesh won't snap to geometry (external flow)
  #1
New Member
 
Jad
Join Date: Jun 2013
Posts: 15
Rep Power: 12
JTDN is on a distinguished road
Hi everyone,

I'm new at OpenFoam, using OpenFoam V6 to run a 3D simulation on a modified Ahmed body (for those who don't know, it's a simplified car-like geometry used in automotive external aero).

My problem is that I can't get snappyhexmesh to actually snap the geometry. Basically it acts as if the geometry was not there. Since I'm new at openfoam and even newer at snappyhexmesh, I am sure there must be something obvious I am missing.

My geometry input is a closed stl (ASCII) with decent resolution. Basic patches (inlet, outlet etc) are defined directly in blockMesh.

For troubleshooting I've tried refining the initial blockMesh, changing parameters in surfaceFeaturesDict to get a very high number of feature edges, and finally I've tried a number of different locationInMesh parameters in snappyHexMeshDict, but no luck.

Please if you can let me know what I am missing it would be very helpful. i've included my blockMesh, features and snappy dicts as well as logs.

Thanks,

Jad
Attached Images
File Type: jpg snappyParaView.jpg (198.0 KB, 73 views)
Attached Files
File Type: txt log.snappy.txt (32.1 KB, 7 views)
File Type: txt log.surfaceFeaturesAhmed.txt (2.5 KB, 4 views)
File Type: txt snappyHexMeshDict.txt (4.7 KB, 11 views)
File Type: txt surfaceFeaturesDict.txt (1.0 KB, 15 views)
JTDN is offline   Reply With Quote

Old   June 30, 2019, 05:46
Default
  #2
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,


If you want to use OpenFOAM, you should read the log and messages.


Log from the snappyHexMesh tells the followings;

Code:
    Reading "/home/jtayoun/JT_run/run_openfoam/3_weeks/snappyDebugging/ahmedBody/system/snappyHexMeshDict.castellatedMeshControls.refinementSurfaces" from line 105 to line 106
      Not all entries in refinementSurfaces dictionary were used. The following entries were not used : 1(ahmed_body)
Code:
--> FOAM Warning :
    From function Foam::labelHashSet Foam::polyBoundaryMesh::patchSet(const Foam::UList<Foam::wordRe>&, bool, bool) const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 798
    Cannot find any patch or group names matching "ahmed_body.stl"
--> FOAM Warning :
    From function Foam::layerParameters::layerParameters(const Foam::dictionary&, const Foam::polyBoundaryMesh&)
    in file snappyHexMeshDriver/layerParameters/layerParameters.C at line 268
    Reading "/home/jtayoun/JT_run/run_openfoam/3_weeks/snappyDebugging/ahmedBody/system/snappyHexMeshDict.addLayersControls.layers"
    Layer specification for "ahmed_body.stl" does not match any patch.
Valid patches are
4
(
inlet
outlet
ground
frontAndBack
)

"ahmed_body.stl" does not match any patch.

Please read the snappyHexMeshDict in motorBike tutorial.
In geometry subdict, file name "motorBike.obj" is used and the patch is named as "motorBike".
In refinementSurfaces subsubdict in castellatedMeshControls subdict, patch name "motorBike" is used, not the file name "motorBike.obj".

You used patch name "car" in geometry subdict, and "ahmed_body" in castellatedMeshControls subdict. this is not consistent.

And, in AddLayersControls subdict, you used the geometry fle name "ahmed_body.stl" . This should be patch name (not geometry). There is an caution about this in the motorBike tutorial.

I'm not sure this fix your problem or not. but, at least, this will be a small improvement.
JTDN likes this.
snak is offline   Reply With Quote

Old   June 30, 2019, 12:04
Default
  #3
New Member
 
Jad
Join Date: Jun 2013
Posts: 15
Rep Power: 12
JTDN is on a distinguished road
Quote:
Originally Posted by snak View Post
Layer specification for "ahmed_body.stl" does not match any patch.
Valid patches are
4
(
inlet
outlet
ground
frontAndBack
)
[/CODE]
"ahmed_body.stl" does not match any patch.

Please read the snappyHexMeshDict in motorBike tutorial.
In geometry subdict, file name "motorBike.obj" is used and the patch is named as "motorBike".
In refinementSurfaces subsubdict in castellatedMeshControls subdict, patch name "motorBike" is used, not the file name "motorBike.obj".

You used patch name "car" in geometry subdict, and "ahmed_body" in castellatedMeshControls subdict. this is not consistent.
Thanks a lot for your reply! I had realised that and spent some time fiddling with the motorbike snappyhexmeshdict but couldn't really point to the problem. One question i have is how to define patches directly from an stl? As far as I know there is no way to define patches directly in an ASCII stl file.
Usually I compute the mesh on salome GUI (this is where i define all the patches), export it as .unv and convert it.
This time my only input is the .stl, and i've built the domain using blockMeshDict. Is there a dict in OF where i can define all the .stl surfaces as patches?

Thanks,
JTDN is offline   Reply With Quote

Old   June 30, 2019, 12:16
Default
  #4
New Member
 
Jad
Join Date: Jun 2013
Posts: 15
Rep Power: 12
JTDN is on a distinguished road
I think this thread provides an answer: how to define patches with snappyHexMesh from a STL file ?
JTDN is offline   Reply With Quote

Old   July 1, 2019, 07:17
Default
  #5
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,


I just modified your snappyHexMeshDict as mentioned previous reply.
The name of patch is now consistent in the dict.
Attached Files
File Type: txt snappyHexMeshDict.txt (2.5 KB, 28 views)
snak is offline   Reply With Quote

Reply

Tags
snap to surface, snappyhexmesh 3d, snappyhexmeshdict, stl


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 06:40
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 06:00
About the Reynolds Number and Y-plus in external flow Mason liu CFX 18 November 10, 2014 18:37
[snappyHexMesh] SnappyHexMesh meshes inside and outside of an STL geometry villier OpenFOAM Meshing & Mesh Conversion 17 June 15, 2010 19:51
external flow meshing for a Sedan in pro*am rave Siemens 7 July 17, 2007 09:48


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