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

[snappyHexMesh] sHM not successful with -overwrite

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2019, 08:32
Default sHM not successful with -overwrite
  #1
Member
 
Joe lee
Join Date: Nov 2018
Posts: 59
Rep Power: 8
Jinjolee is on a distinguished road
I tried to copy the directories in motorBike as a reference, and use them for the simulation for my own bike model. After modifying the dictionaries, I seperately executed command in terminal as follow:

>> surfaceFeatures
>> blockMesh
>> decomposePar
>> snappyHexMesh

I entered paraFoam and the mesh was successfully created as in the figure below.


I then tried to make a script similar with Allrun, but just with the meshing processes, namely "Meshrun". The Meshrun script is as follow:

--------------------------------------------------------------------------
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

runApplication surfaceFeatures

runApplication blockMesh

runApplication decomposePar -copyZero
runParallel snappyHexMesh -overwrite
------------------------------------------------------------------------

However, for this script, I could not see the mesh for my model in paraFoam. Only the blockMesh exist, just like the image below.

There is no error appeared in log.snappyHexMesh.

Does anyone know what might be the possible cause? I could provide further information of my setup if required. Thanks a lot!!!
Jinjolee is offline   Reply With Quote

Old   April 15, 2019, 07:16
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,200
Rep Power: 28
Yann will become famous soon enough
Hello Jinjolee,

If you have run this exact sequence :

Code:
>> surfaceFeatures
>> blockMesh
>> decomposePar
>> snappyHexMesh
Then it means you have run snappyHexMesh in serial mode. To run it in parallel you should run something like that, if you run it on 4 cpus :

Code:
mpirun -np 4 snappyHexMesh -parallel
If you run snappyHexMesh in serial without the "overwrite" option, the resulting mesh will be written in timeSteps folders (i.e: 1,2,3) for each snappyHexMesh step (castellated, snap, layers)
If you run is in serial with the overwrite option, the mesh will be written in constant/polyMesh. (and it will overwrite the initial blockMesh mesh)

When running snappyHexMesh in parallel, it works exactly the same way, except the directories 0,1,2,3 and constant will be written in every "processor*" subdirectory.

In paraView, you can choose whether you want to load a reconstructed (serial) case or a decomposed (parallel) case by selecting it in the "Case Type" option of the properties tab, before clicking on "Apply".

In your case, switching the "Case Type" from "Reconstructed Case" to "Decomposed Case" in paraView should allow you to visualize the mesh generated by your Allrun script. If you don't have the "Case Type" option, you might need to run "paraFoam -builtin" instead of "paraFoam".


Yann
Attached Images
File Type: png paraView.png (30.3 KB, 11 views)
Yann is offline   Reply With Quote

Old   April 15, 2019, 08:31
Default
  #3
Member
 
Joe lee
Join Date: Nov 2018
Posts: 59
Rep Power: 8
Jinjolee is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Jinjolee,

If you have run this exact sequence :

Code:
>> surfaceFeatures
>> blockMesh
>> decomposePar
>> snappyHexMesh
Then it means you have run snappyHexMesh in serial mode. To run it in parallel you should run something like that, if you run it on 4 cpus :

Code:
mpirun -np 4 snappyHexMesh -parallel
If you run snappyHexMesh in serial without the "overwrite" option, the resulting mesh will be written in timeSteps folders (i.e: 1,2,3) for each snappyHexMesh step (castellated, snap, layers)
If you run is in serial with the overwrite option, the mesh will be written in constant/polyMesh. (and it will overwrite the initial blockMesh mesh)

When running snappyHexMesh in parallel, it works exactly the same way, except the directories 0,1,2,3 and constant will be written in every "processor*" subdirectory.

In paraView, you can choose whether you want to load a reconstructed (serial) case or a decomposed (parallel) case by selecting it in the "Case Type" option of the properties tab, before clicking on "Apply".

In your case, switching the "Case Type" from "Reconstructed Case" to "Decomposed Case" in paraView should allow you to visualize the mesh generated by your Allrun script. If you don't have the "Case Type" option, you might need to run "paraFoam -builtin" instead of "paraFoam".


Yann
Thanks a lot. It works.
Jinjolee is offline   Reply With Quote

Old   April 15, 2019, 08:39
Default
  #4
Member
 
Joe lee
Join Date: Nov 2018
Posts: 59
Rep Power: 8
Jinjolee is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Jinjolee,

If you have run this exact sequence :

Code:
>> surfaceFeatures
>> blockMesh
>> decomposePar
>> snappyHexMesh
Then it means you have run snappyHexMesh in serial mode. To run it in parallel you should run something like that, if you run it on 4 cpus :

Code:
mpirun -np 4 snappyHexMesh -parallel
If you run snappyHexMesh in serial without the "overwrite" option, the resulting mesh will be written in timeSteps folders (i.e: 1,2,3) for each snappyHexMesh step (castellated, snap, layers)
If you run is in serial with the overwrite option, the mesh will be written in constant/polyMesh. (and it will overwrite the initial blockMesh mesh)

When running snappyHexMesh in parallel, it works exactly the same way, except the directories 0,1,2,3 and constant will be written in every "processor*" subdirectory.

In paraView, you can choose whether you want to load a reconstructed (serial) case or a decomposed (parallel) case by selecting it in the "Case Type" option of the properties tab, before clicking on "Apply".

In your case, switching the "Case Type" from "Reconstructed Case" to "Decomposed Case" in paraView should allow you to visualize the mesh generated by your Allrun script. If you don't have the "Case Type" option, you might need to run "paraFoam -builtin" instead of "paraFoam".


Yann
BTW, after I successfully reconstruct the mesh, I created a slice and got these:


Is this a poor mesh? I do not know how to identify a "good" mesh.
Thanks a lot!!
Jinjolee is offline   Reply With Quote

Reply

Tags
mesh, overwrite, parafoam, snappyhexmesh


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
[snappyHexMesh] SHM not snapping to some surfaces Swift OpenFOAM Meshing & Mesh Conversion 13 January 4, 2016 02:56
[snappyHexMesh] 2D AMI Moving Mesh with sHM; How hard can this be? ADGlassby OpenFOAM Meshing & Mesh Conversion 18 June 18, 2013 07:07
[snappyHexMesh] troubles with sHM and parallel Tobi OpenFOAM Meshing & Mesh Conversion 1 August 30, 2012 18:54
[snappyHexMesh] Multi Region Meshing with sHM marango OpenFOAM Meshing & Mesh Conversion 3 March 27, 2012 01:51
[snappyHexMesh] sHM with cyclic patch on stl geometry johannesk OpenFOAM Meshing & Mesh Conversion 2 August 21, 2009 10:08


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