CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Can not produce clean mesh at sharp edges (https://www.cfd-online.com/Forums/openfoam-meshing/219233-can-not-produce-clean-mesh-sharp-edges.html)

febrianbaehaqi July 20, 2019 10:39

Can not produce clean mesh at sharp edges
 
1 Attachment(s)
Hi guys, I'm new to OpenFOAM and still learning about it. So I got a problem here. I'm trying to mesh a wing with sharp trailing edge using snappyHexMesh. But It seems that I can not produce a clean mesh at the trailing edge and keep getting jagged trailing edge.

Here are the screenshot and the snappyHexMeshDict that I used. I try to keep the skewness of the mesh as low as possible to keep the accuracy of the results.

Thank you, best regard from me. I appreciate all your answers.

pbrady2013 July 21, 2019 22:58

Have You Tried Surface Orient and Feature Extract
 
Hi,


That can be a limitation with snappy in very sharp edges.


The snappy dictionary that you've included looks to be from the motorbike tutorial and not your case. Did you include the right dictionary?


Either way, when I come across this I double check two things:
  1. surfaceOrient to make sure my STLs all have the same directions
  2. surfaceFeatureExtract to provide a set of locations for snappy to merge to - these get reflected in the snappy dictionary
Beyond that, and while snappy is a great tool, it may not be appropriate for the specific mesh that you are after.


Cheers,
-pete

febrianbaehaqi July 21, 2019 23:31

Hi Pete, thank you for your answer I really appreciate that

Yes, the snappy dictionary came from the motorbike tutorial since I am very new to OpenFOAM and sHM. But I make some adjusment to the dictionary but still can not find the right adjustment to get rid of this sharp edges problems. Or could you give me some recommendation of sHM dict from tutorial that appropriate for my case? I will really appreciate that.

Actually my case is an UAV MALE. The sHM did a good job for meshing the UAV except the trailing edges both the wing and the tail. The fuselage seems fine I guess. Although mesh at the joint between fuselage and the wing is not very satisfying. I also have a very bad mesh at the tip of the wing.

I only have 1 stl file that is the geometry of the UAV because I still confuse how to make patches in OpenFOAM. I guess the surfaceOrient will not work in my case.

Here are my surfaceFeatureExtractDict. Should I change the includedAngle to 180?

Quote:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

iMALE.stl
{
// How to obtain raw features (extractFromFile || extractFromSurface)
extractionMethod extractFromSurface;

// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 150;

subsetFeatures
{
// Keep nonManifold edges (edges with >2 connected faces)
nonManifoldEdges no;

// Keep open edges (edges with 1 connected face)
openEdges yes;
}


// Write options

// Write features to obj format for postprocessing
writeObj yes;
}
Thanks, my best regards.
Febrian

pbrady2013 July 22, 2019 01:30

Suggestions to Proceed
 
Hey,


A couple of things:


surfaceOrient is not really designed to split patches to create boundary conditions. Rather it ensures that all the sub-patches in the STL have the same orientation so that snappy does not see them all as lots of little patches and will mesh cells across.


No, I'd probably start by leaving the included angle at 150 as that will pick up the junction between the wings and main bodies.


If you want to test the edges that are being selected, open up the OBL files in ParaView (or write VTKs) together with the STL. Then you can see if the trailing edge is being selected for refinement. This can be a great way to see the difference when changing the included angles.



I must admit though that while I enjoy the flexibility of snappy, for a case like this it would not be my first choice. For simple geometries I usually start with blockMesh. Other than that I'd jump to an unstructured generator like GMSH or Salome.


Trailing edges and tips can be tough. Adjusting the included angle and refinement should get the wing/body junction OK though.



Cheers,
-pete


All times are GMT -4. The time now is 01:31.