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] snapControls is undefined in dictionary (https://www.cfd-online.com/Forums/openfoam-meshing/250870-snapcontrols-undefined-dictionary.html)

jeffer7 July 13, 2023 13:56

snapControls is undefined in dictionary
 
2 Attachment(s)
Hi

I'm trying to mesh the 3D elbow with snappyHexMesh, I created an overall mesh that wraps around the elbow, I run surfaceFeatures and after applying sHM I get an error saying:

--> FOAM FATAL IO ERROR:
keyword snapControls is undefined in dictionary "/home/elbow/system/snappyHexMeshDict"

file: /home/elbow/system/snappyHexMeshDict from line 17 to line 361.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 1008.

FOAM exiting


I already saw the syntax of snappyHexMesh, specifically in snapControls, but I can't see where the error is

Any suggestions?

Thanks in advance

AtoHM July 14, 2023 02:07

There is a ":" instead of ";" at line 193 which probably causes it.
Code:

level    ((1e-4 1)): // distance from the surface patch-refinement level
Usually, if you get a - lets say clearly misleading - error message like that (because the key is obviously present), its related to syntax errors. If the above does not solve the problem, grab a fresh dict you know is working and add in your stuff again gradually to see where it fails.


Addition: Regarding the entries there, the comment appears to be wrong (or I do not understand it correctly): the first number is just a placeholder, the second number determines how many splits of the background mesh cells are done in the volume enclosed by the region. The size at the surface of this region is determined in the refinementSurfaces subdictionary, where you also defined (1 1) - thus get the same size and there is another syntax error there at line 140:
Code:

level    level (1 1);
Hint #3: do not use insidePoint (0.0 0.0 0.0); . This point has to never coincide with a face or node of the mesh during the whole meshing process. It is recommended to use slightly off float numbers like 0.0142 for each component to decrease the odds of hitting a face or node during meshing.

jeffer7 July 14, 2023 13:37

1 Attachment(s)
I corrected the error and it didn't run, but when I change 'distance' to 'inside' I manage to run sHM and get the mesh,
{
mode inside;
level 1;
}
my other error must be in the 'distance' syntax I still don't understand how it works I'll keep watching the guide.

Thanks for your help

Edit: I already saw the error, I had missed an 's' in level
elbow
{
mode distance;
levels ((1e-4 1)); // distance from the surface patch-refinement level

}

AtoHM July 14, 2023 15:23

Oh sorry, I completely overlooked the mode setting there. Of course, with distance the comment makes sense!

maruusa February 29, 2024 02:20

I am impressed with your article. The information you share will be an important document for me to learn more about this topic. fnf


All times are GMT -4. The time now is 10:34.