About snappyHexMesh
A page dedicated to describing how to use snappyHexMesh has been finally created at openfoamwiki.net: http://openfoamwiki.net/index.php/SnappyHexMesh
Feel free to contribute to that page. I only gave it a stern kick off, but a lot more can be added to that page! I've stickyfied this thread, to make easier for people to find it. Here can be discussed how to add content to the wiki page and about this thread; but on this specific "About snappyHexMesh" thread will not be answered questions on how to use snappyHexMesh! ;) |
Hey bruno,
I created some sHM tutorials too. Is it possible to link it? |
Hi Tobi,
Like I wrote above: Quote:
Bruno |
Quote:
i updated the wikipage but the changes will not be accepted after save it? What do I wrong? |
Hi Tobi,
Didn't you notice the question on the top after your first save? It asks what OpenFOAM field name file corresponds to the field it asks. It's a captcha question. Best regards, Bruno |
No not really but now I see it :)
Thanks Tobi |
Quote:
|
Quote:
I am new to the wiki and dont see that chapta code at the beginning. But if you know it, its not a problem. Its okay couse I know that spam too. Its a good way to filter it. Good day Tobi |
Quote:
|
Hi,
here are my old Cases: http://holzmann-cfd.de/index.php/en/openfoamen/ I am working on some new cases! Tobi |
Hi
Thank you Tobi for your help :) I think they will be useful for a beginner like me ;) |
Hi all,
please notice that all snappyHexMesh tutorials are now avaiable on my new homepage. http://www.holzmann-cfd.de/index.php/tutorials I updated the wiki, too. Thanks, fun Tobi |
Quote:
|
Hi,
thanks for the hint. The links was wrong (not tutorials --> turorial) :) http://www.holzmann-cfd.de/index.php/tutorial |
Hi All,
I made a dynamic mesh fan and want to share it with you. After I set up my new server I will upload and clean that case :) |
Hi Tobi,
None of your links are working :-| |
Tutorial by Jens H. at personal blog: snappyHexMesh Tutorial (part 1)
link not working |
Quote:
|
STL files
Hello everyone
I want to open a STL file in OpenFoam and proceed with, however, it does not show anything. I'm a but confused how can I do this in snappyHexmesh. Regards |
Meshing of porous cylinder using snappyHexMesh
1 Attachment(s)
Problem statement: Meshing to simulate Flow past porous cylinder using snappyHexMesh utility.
Questions and doubts: How to mesh both porous cylinder (internal + external) as well as surrounding together? I am able to mesh it either inside porous cylinder (mesh from surrounding got removed) or surrounding (mesh inside cylinder got removed) but I am not getting how to get both at the same time. |
Hi,
In snappyHexMeshDict, you need to define the porous cylinder as a cellZone in the refinementSurfaces section: Code:
refinementSurfaces Yann |
Quote:
For your reference i am attaching my case set up. It would be great if you can tell me my mistake. I have tried the approach suggested by you. Regards https://drive.google.com/drive/folde...usp=share_link |
You should have a stl file defined in geometry. I'm going to assume you stl file is named "poroussphere.stl":
Code:
geometry Code:
Interface Yann PS: as your question is pretty specific, you might want to create a dedicated thread to discuss it. |
Problem with extrudeMesh
Hi, I'm new on this forum. I have to do an university exams and i have a problem with the function extrudeMesh. When I compile I have a FATALERROR:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time --> FOAM Warning : From virtual Foam::Istream &Foam::ISstream::read(Foam::word &) in file db/IOstreams/Sstreams/ISstream.C at line 886 Reading "system/controlDict" at line 51 Missing 1 closing ')' while parsing residuals(p, --> FOAM Warning : From static bool Foam::functionObjectList::readFunctionObject(const Foam::string &, Foam::dictionary &, HashSet<Foam::wordRe> &, const Foam::word &) in file db/functionObjects/functionObjectList/functionObjectList.C at line 288 Cannot find functionObject file residuals --> FOAM Warning : Reading "system/controlDict" at line 51 Too many closing ')' ... was a ';' forgotten? --> FOAM FATAL IO ERROR: (openfoam-2212) Unexpected '}' while reading dictionary entry file: system/controlDict at line 64. From static bool Foam::entry::New(Foam::dictionary &, Foam::Istream &, const entry::inputMode, const int) in file db/dictionary/entry/entryIO.C at line 156. FOAM exiting someone can help me? Thanks |
Hello,
There are likely typos in your controlDict: Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Regards, Yann |
Yann, thanks for your help.
I needed to add a Func for WallShearStress so now i put that for controlDict: FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application simpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 3000; deltaT 1; writeControl runTime; writeInterval 3000; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #includeFunc residuals(p, U, k, omega) #includeFunc "wallShearStress" forces { type forces; libs ("libforces.so"); writeControl timeStep; writeInterval 1; log yes; patches (wing); rho rhoInf; rhoInf 1; CofR (0.4974612746 -0.01671895744 0.125); } } and the error now is: Create time --> FOAM Warning : From virtual Foam::Istream &Foam::ISstream::read(Foam::word &) in file db/IOstreams/Sstreams/ISstream.C at line 886 Reading "system/controlDict" at line 51 Missing 1 closing ')' while parsing residuals(p, --> FOAM Warning : From static bool Foam::functionObjectList::readFunctionObject(const Foam::string &, Foam::dictionary &, HashSet<Foam::wordRe> &, const Foam::word &) in file db/functionObjects/functionObjectList/functionObjectList.C at line 288 Cannot find functionObject file residuals --> FOAM Warning : Reading "system/controlDict" at line 51 Too many closing ')' ... was a ';' forgotten? --> FOAM FATAL ERROR: (openfoam-2212) Unknown functionEntry 'includeFunc' in "system/controlDict" near line 53 Valid functionEntries : 10(calc codeStream eval include includeEtc includeIfPresent message sinclude sincludeEtc word) From static bool Foam::functionEntry::execute(const Foam::word &, const Foam::dictionary &, Foam::primitiveEntry &, Foam::Istream &) in file db/dictionary/functionEntries/functionEntry/functionEntry.C at line 161. FOAM exiting Maybe I have to tell you that last week this program worked with Openfoam v10 ... now I have Openfoam v2212 ... maybe it could be usefull for you. Regards, Giuseppe |
This line seems to be wrong:
Code:
#includeFunc residuals(p, U, k, omega) |
Hi,
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } |
I chance this line with
#includeFunc residuals(p,U,k,omega) and seems this one error is resolve but still this Create time --> FOAM Warning : From static bool Foam::functionObjectList::readFunctionObject(const Foam::string &, Foam::dictionary &, HashSet<Foam::wordRe> &, const Foam::word &) in file db/functionObjects/functionObjectList/functionObjectList.C at line 288 Cannot find functionObject file residuals --> FOAM FATAL IO ERROR: (openfoam-2212) Unexpected '}' while reading dictionary entry file: system/controlDict at line 67. From static bool Foam::entry::New(Foam::dictionary &, Foam::Istream &, const entry::inputMode, const int) in file db/dictionary/entry/entryIO.C at line 156. FOAM exiting and i check every } missing ... |
It's strange because when i run one line like "extrudeMesh" i see that:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2212 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ So v2212, but when i open controlDict it's: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ v1812 .... it could be this the error? |
OK so first thing: you are using openFoam-v2212, as you can see here:
Code:
--> FOAM FATAL IO ERROR: (openfoam-2212) The files header not being up to date don't matter, but you might face issues if you try to run cases from an older version to a new one due to syntax or functionalities changes between versions. This being said, the residuals function object has been replaced by solverInfo since v1906 so you should replace this: Code:
#includeFunc residuals(p, U, k, omega) Code:
#includeFunc solverInfo Regards, Yann |
Yann, you're a lifesaver.
So the problem was this line #includeFunc residuals(p, U, k, omega) that change with the new version of Openfoam. I changed with the new line and now it work all well and print me all the dates that i need. Thank you so much for the help. Regards, Giuseppe |
1 Attachment(s)
Dear All,
Could you please provide some advice on better snapping the interface in the picture below! It comes from a temperature probe that I need to put within the fluid pipe flow. All the procedure described by Tobi for a watertight etc. outline geometry has been followed -although meshing at the interface nodes is indeed compatible - it seems not so uniform enough I admit (please check salome file). In the final output a small number of cells are included in opposite zones, e.g fluid/probeWall or probe/fluidWall. I saw that in other versions (I am finally using OF 9 now in Ubunti 22.04 lts under wsl win 11) there are several tricks like "stealing" the problematic cells from one zone to another -so that boundary files are consistent with the supposed geometry the physical problem but I would be very happy to avoid it and have a better cell treatment. My questions are summarized below: 1) How stiff should be a mesh produced by salome in order to avoid "bad or scratched" cells at the interface? Is it adequate that nodes "communicate" or the mesh just behind the interface play a role also? 2) How exactly the combination of the settings work in snappy? (I have gone through Tobi's excellent video series with smoking pipe but I am still confused; perhaps this is my problem, but still some simple rules and guidelines would be very helpful 3) Does this problem has a solution or I am hitting my head to the wall? Case files can be downloaded from here: https://drive.google.com/file/d/1-DA...usp=share_link I think the next step is the edge refinement example (available in Holzmann CFD page). But is there an accompanying pdf for this one? I still cannot undestand how that line was constructed (it does not appear but only in paraview in my case) and also, what is the logic behind this moderate number of steps before exporting the stl files. Finally, does someone needs the blender file as well in order to check how the refinement edge is produced?) Thank you for your time and your awesome work! Alex |
Before any response, I would like to post a link to another excellent video for mesh refinement.
https://holzmann-cfd.com/community/t...haust-manifold Maybe I should look better before bothering you... All the best ! |
Adding layers to interior stls of multiregion meshes in snappyHexMesh
1 Attachment(s)
Dear Foamers,
I'm currently struggling with snappyHexMesh and creating layers on the interior boundary layers of a multiregion mesh, I need to set 30 < y+ < 300. I've tried adjusting various parameters, but so far, I haven't been successful. I was wondering if you could offer any suggestions. The snappyHexMeshDict is observable below: Quote:
Also, I have attached a screenshot from Paraview. Thank you in advance, and please let me know if you need any additional information. |
I think that there is an openfoam tutorial withinh the folder tutorials snappy for meshing a pipe. You could start with that.
In addition, there is a (more complicated) pipe meshing tutorial in Tobias Holzmann page. |
2 Attachment(s)
Thank you dear Alexander;
I've already checked samples. In my opinion this case is different because I can add layers to shell's wall. However, It's impossible to add layer to the interior walls of inner regions. I think the picture was not as clear as enough. So I would like to explain the case further. It involves a shell that surrounds two pipe lines, one in a serpentine shape and the other in a U shape. The mesh used for the simulation is three-dimensional and consists of at least one million cells. I have attached a picture of enclosed regions. I would be grateful for any guidance you can provide. |
Dear Formers,
Finding a way to add a boundary layer mesh to the interior STLs mentioned above is crucial to me. Please let me know if it is impossible to create such parts with snappyHexMesh. I would appreciate it if someone could introduce a better solution, even if it involves using other meshing tools. Thank you in advance. |
Hello,
The answer depends on the OpenFOAM version you are using. (if you are not sure, you can type the foamVersion command in a terminal) Regards, Yann |
Hi,
Dear Yann, I'm grateful for your prompt response. The mesh has been generated through OpenFOAM 7. I appreciate your help. Thank you again. |
All times are GMT -4. The time now is 20:55. |