SnappyHexMeshing SnakeRiverCanyon tutorial
Hi,
Iīve been trying to use snappyHexMesh on the SnakeRiverCanyon tutorial using the instructions posted by AlanR. My snappy file runs and creates output files but no īsnapī of the mesh appears to have taken place. I have inserted my snappyHexMeshDict below and would really appreciate any pointers or hints what I might be doing wrong. Thanks for your help. Thom Code:
FoamFile |
Hi, Sorry problem solved. Turns out when I viewed my STL image and blockmesh together they did not overlap as I had taken my grid from the blockmesh file from the dynamicmesh tutorial.
Thomas |
2 Attachment(s)
Hi everyone,
I've now managed to SHM the snake canyon tutorial stl file and another terrain file which I have created. However my problem is that each terrain created appears is very blocky (see image)s and whenever I checkMesh the output the mesh fails in 5 places. Is solving this problem just an issue of increasing maxLocalCells and MaxGlobal cells or are there any other settings I should be adjusting as I am not confident at which settings I should adjust to fix this issue. Can anyone suggest any solutions no matter how trivial! Thanks, Thom |
Hi Thom.
Remember that snappyHexMesh generates new time-directories, so to check your mesh, remember to check the '3'-directory (assuming you are using a time step of unity). If you are using foamToVTK and paraview do this: foamToVTK -latestTime;paraview and if things look good cp -r ./3/polyMesh/* ./constant/polyMesh /Mads |
Thanks Mads, I've never used VTK before. Its alot quicker to load and view!
However my meshes are still of very poor quality. Will my meshes/errors improve with greater maxLocalCells and MaxGlobal cells resolution? Sorry I cannot answer these questions myself as the current machine I am using tells me it has run out of virtual memory when I increase these properties! Thanks again guys, Thom |
Thom,
Yeah, I am using the VTK-approach all the time. You are pointing out a major issue of the current snappyHexMesh: memory use is very high for even moderate meshe sizes. I believe it is partly due to the fact that a lot of cells are spent on areas which are cut away later on - but I have no knowledge of the implementation. SHM is a very clever tool and hopefully it will be improved even more in coming versions. Anyway, in principle, SHM is capable of generating high quality meshes. Try to apply the following approach: 1. generate a VERY coarse mesh with blockMesh 2. use very small refinement levels in snappyHexMeshDict (say 2 2) 3. check with blockMesh;snappyHexMesh;checkmesh -latestTime in point 3 you check your mesh count and quality and go back to item 1-2 and refine. Another possibility is to do a refineWallLayer which refines your near-STL-wall-layer. I can only do one refinement though and then the cells collapse, but you might try that. Also play with layers to get enough cells near walls. /Mads |
2 Attachment(s)
Hi everybody,
Mads you were quite right about the time directory. Although paraFoam was displaying time step number 2 or 3 it was still displaying the mesh from timestep 1. I have now been able to get the snakecanyon tutorial to mesh correctly but with my own example it appears to be meshing fine in the x axis but is not creating a smooth mesh on the y (see pictures). Can anyone speculate why this may be happening? I've been trying to sort this for a few days and any help would be most welcome! Thanks Thom |
help
I want to make a 3d geometry like a tube using blockMesh utility. but it seems like there is no internal mesh in the geometry. is it possible to use the blockmesh to create 3D meshes?
|
Running SHM in parallel for SnakeRiverCanyon but having problems
I've been working with the snappyHexMesh version of the SnakeRiverCanyon tutorial. First of all, thanks very much to all the contributors to this thread. It has been an enormous help. I have followed Thom's original setup as closely as possible, the only difference being that I had to run SHM in parallel (4 tasks) because it ran out of memory running single process. I think I'm close, but have run into some warnings and then a segmentation fault trying to reassemble the mesh using reconstructPar.
(Before getting to this stage it was necessary to copy files from the constant directory into the processor directories using this script: Code:
#!/bin/csh The quoted text below is what I am seeing when I run reconstructPar. Obviously the segfault is the show-stopper, but I'm also wondering about the set of 4 warnings that precede it. Are these to be expected or might they be part of the problem too? I would very much appreciate any suggestions. Also wondered: does anyone know of documentation or explanatory text for the SnakeRiverCanyon tutorial? There appear to be just the files themselves at the link http://repo.or.cz/w/OpenFOAM-1.6.x.git/tree/HEAD:/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon . Thanks! Quote:
|
Solution to Thom's Problem
1 Attachment(s)
Thom,
Did you solve your problems with snappy? I had exactly the same results as you posted June 9th. It turned out that starting from the motorBike tutorial was not the right approach. The problem was system directory files (fvSolution and fvSchemes) and/or constant directory files (dynamicMeshDict and transportProperties). Try the setup in the attached example (you can run the example first like a tutorial). If you already figured this out, the solution is posted for others. Alan |
How to run snappyHexMesh in parallel?
Hi michalakes,
could you post how you managed to run snappyHexMesh in parallel? I do the following: 1) blockMesh 2) decomposePar my case (with metis and/or simple) 3) mpirun -np 8 snappyHexMesh -parallel Error (snippet): ---------------------------------------------- [7] --> FOAM FATAL ERROR: [7] You have selected decomposition method decompositionMethod which is not parallel aware. Please select one that is (hierarchical, parMetis) [7] [7] From function snappyHexMesh [7] in file snappyHexMesh.C at line 341. [7] FOAM parallel run exiting ---------------------------------------------- Using hierarchical it starts running correctly (don't know how to use parMetis though, as there is no line in the decomposeParDict saying parMetis, and no coefficients section; and metis doesn't work either), but this crashes when I reconstruct it because of a missing file: --> FOAM FATAL IO ERROR: cannot open file file: ...casedir/snappy_partest/processor0/2/polyMesh/pointProcAddressing at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 61. FOAM exiting Edit: Just saw your script in your posting, will try that now. Anyway, the selection of methods still is not clear to me. What did you use? 2nd Edit: Get the same segmentation fault as you. Did you solve the problem? Thank you and best regards Pascal. |
Hi Pascal,
try using reconstructParMesh utility to rebuild your mesh. I used only the hierarchical method to run snappyHexMesh in parallel, anyway if you look at the parMetisDecomp.C source code you'll see something like this: ---- // Check for user supplied weights and decomp options if (decompositionDict_.found("metisCoeffs")) { const dictionary& metisCoeffs = decompositionDict_.subDict("metisCoeffs"); .... --- Therefore this method will look for the metisCoeff subDict. Kind regards Norman |
Once I give the moveDynamicMesh, what should I do, then??
|
river bank
2 Attachment(s)
Hi:
Just to let you know that I tried AlanR suggestion to create a mesh for a river using an stl file for the bathymetry and it worked perfect for me. Attached you will find some pictures for the mesh using SHM and AlanR case files. Just make sure that the stl file covers more area than the hex mesh, otherwise, it will not work properly. Thanks AlanR. Christian |
river bank stl
1 Attachment(s)
Christian,
Your screenshots are exactly what I am shooting for. However, the .stl file in AlanR's example looks quite different than your example... Also, could you elaborate a bit on the "oversized" .stl comment regarding the mesh creation? Thanks! Jeff |
river bank stl
I ran across this tutorial website which may have explained why the stl file should be larger than the mesh block.
Essentially, the stl forms an internal surface inside the block where the mesh is to be refined. If the block is larger than the stl surface, the mesh generation routine will have to "make a guess" as to what the internal characteristics of the mesh should be like, and this can lead to some unpleasant results... |
1 Attachment(s)
Quote:
Regarding to your stl. I upload my case using moveDynamicMesh. To those who need it. Thanks for you stl. opps, file is too large. If anyone is interested into this just Email me. |
All times are GMT -4. The time now is 17:47. |