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

[snappyHexMesh] snappyHexMesh in parallel

Register Blogs Community New Posts Updated Threads Search

Like Tree32Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2012, 02:37
Default snappyHexMesh in parallel
  #1
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 17
shailesh.nitk is on a distinguished road
Hi,

I can run SnappyHexMesh in serial. I would like to know how to run snappyHexMesh in parallel.

I have gone through the docs http://www.openfoam.org/docs/user/ru...s-parallel.php. If I have mesh that can be broken broken into pieces and allocated to separate processors for solution using with decomposePar then we can run mpi to solve the solution.

If I want to generate SnappyHexMesh in parallel. Could you please tell me What steps I need to follow to run snappyHexMesh in parallel.

Best regards,
Shailesh
y_jiang likes this.
shailesh.nitk is offline   Reply With Quote

Old   May 23, 2012, 03:37
Default
  #2
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Hi,

I don't know your study but I think that you can do these steps :

- decomposePar
- foamJob -parallel -screen snappyHexMesh
- reconstructParMesh -time 1 (it reconstructs the "castellatedMesh" step)
- reconstructParMesh -time 2 (it reconstructs the "snap" step)
- reconstructParMesh -time 3 (it reconstructs the "addLayers" step)

To know how many "time" file you should reconstruct, you can open the file "processor0" in your case and see how many "time" file you have.

May be it's not the best solution, but it works for me.
Rider is offline   Reply With Quote

Old   May 24, 2012, 03:22
Default
  #3
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 17
shailesh.nitk is on a distinguished road
Dear Rider,

I would like to thank you for your reply.
I am able to run snappyHexMesh in parallel. I am using -latestTime to know how many "time" file should reconstruct.

reconstructParMesh -latestTime -mergeTol 1E-06 -noZero

I think this will help to re construct mesh. Thank you again for your help.

Best regards,
Shailesh
Kummi and jadidi.cfd like this.
shailesh.nitk is offline   Reply With Quote

Old   May 24, 2012, 04:01
Default
  #4
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Your welcome.

Yes, I use latestTime too. But, I tell you to look how may "time's files" you have to understand how the command ligne works .

Best regards,
Rider.
shailesh.nitk likes this.

Last edited by Rider; May 24, 2012 at 07:45.
Rider is offline   Reply With Quote

Old   May 25, 2012, 07:02
Default mpirun app, foamJob script and RunParallel function
  #5
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 17
shailesh.nitk is on a distinguished road
We can run snappyHexMesh in parallel using with mpirun app or foamJob script or RunParallel function. I would like to know the difference between mpirun app, foamJob script and RunParallel function and which one would be better option to run SHM in parallel.
shailesh.nitk is offline   Reply With Quote

Old   May 29, 2012, 06:50
Default
  #6
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Sorry, but I don't know the real reason. I only use foamJob with snappyHexMesh and with simpleFoam solver.
shailesh.nitk likes this.
Rider is offline   Reply With Quote

Old   May 29, 2012, 07:17
Default
  #7
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 17
shailesh.nitk is on a distinguished road
Thank you Rider for your reply.

I have tried with mpirun and foamJob to run SHM in parallel. i could not able to find the difference between them. I was using only np #2 in my machine only.

I want to run solver in parallel with decomposed mesh. I need to reconstruct mesh and again decompose to run for solver.

Can I run directly on the decomposed mesh ? How can I assign fields to the decomposed meshes that I have generated with snappyhexmesh in parallel?
shailesh.nitk is offline   Reply With Quote

Old   May 29, 2012, 07:24
Default
  #8
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
I'm in the same case, I need to reconstruct mesh and again decompose to run for solver .

Currenlty, I don't find a solution to this porblem. But I did the different step with a script, it's less boring ...
shailesh.nitk likes this.
Rider is offline   Reply With Quote

Old   May 29, 2012, 07:36
Default
  #9
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 17
shailesh.nitk is on a distinguished road
How did you run the solver after parallel meshing ?
shailesh.nitk is offline   Reply With Quote

Old   May 29, 2012, 07:43
Default
  #10
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
I use this method :

- blockMesh
- decomposePar
- foamJob -parallel -screen snappyHexMesh
- reconstructParMesh -latestTime
- "I use linux command lines to copy my boundary condition in the latestTime's file"
- decoposePar
- foamJob -parallel -screen simpleFoam
- reconstructParMesh -latestTime

Last edited by Rider; May 29, 2012 at 08:02.
Rider is offline   Reply With Quote

Old   May 29, 2012, 09:58
Default
  #11
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Quote:
Originally Posted by Rider View Post
- "I use linux command lines to copy my boundary condition in the latestTime's file"
Does that mean that you copy your U, P, k, Omega/epsilon/whatever files from the original 0 folder to the latest folder you get after reconstructParMesh?

Thank you for your help!
Kummi likes this.
lovecraft22 is offline   Reply With Quote

Old   May 29, 2012, 10:04
Default
  #12
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 14
Rider is on a distinguished road
Quote:
Originally Posted by lovecraft22 View Post
Does that mean that you copy your U, P, k, Omega/epsilon/whatever files from the original 0 folder to the latest folder you get after reconstructParMesh?

Thank you for your help!
Yes, exactly
lovecraft22 likes this.
Rider is offline   Reply With Quote

Old   November 30, 2012, 08:48
Default
  #13
New Member
 
Case Bakker
Join Date: Mar 2011
Location: Cape Town, South Africa
Posts: 5
Rep Power: 15
case is on a distinguished road
try using the command

snappyHexMesh -overwrite

in order to not have to copy the files from the last time folder back to the original "0" folder.
JR22, neiht and Kummi like this.
case is offline   Reply With Quote

Old   September 17, 2013, 06:48
Default snappyHexMesh in parallel
  #14
New Member
 
Join Date: Jul 2013
Posts: 1
Rep Power: 0
frag_mo is on a distinguished road
Hi everyone,

Im currently running sHM in parallel for rather large meshes. If I want to actually use the generated mesh for a simulation, I have to reconstructParMesh the latest mesh and then decompose it again for the actual run (so that initial fields etc are correctly assigned). Is there anyway around these two steps (i.e. reconstructParMesh and decomposePar)? Since the mesh is already decomposed for sHM I figure it should be possible to use this decomposition for the actual run as well without doing the lengthy reconstruction followed by lengthy decomposition.

I have seen Rider etc having the same question on a previous thread, but no solution was yet given.

Thanks a lot for any suggestions....
frag_mo is offline   Reply With Quote

Old   December 23, 2013, 01:38
Default allrun in parallel
  #15
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 15
laurent98 is on a distinguished road
hi
i'am back on openFoam after flew months break.
here to give a example of my "allrun_in_parallel" script:
Quote:
runApplication blockMesh
# run parallel
runApplication decomposePar
runParallel snappyHexMesh 8 -overwrite
runApplication reconstructParMesh -constant

mv log.decomposePar log.decomposePar1
mv log.reconstructParMesh log.reconstructParMesh1
mkdir 0
cp -r 0.org/* 0
runApplication setFields

#-delete processor directory
ls -d processor* | xargs -i rm -rf ./{} $1
runApplication decomposePar
runParallel potentialFoam 8 -noFunctionObjects -writep
runParallel `getApplication` 8

runApplication reconstructParMesh -constant
runApplication reconstructPar -latestTime
it s run ok, but at time 0 in paraFoam the apha1 field is not correct, wonder why???
i hope it's help Laurent

Last edited by laurent98; December 23, 2013 at 17:36.
laurent98 is offline   Reply With Quote

Old   January 5, 2014, 23:26
Default parallel snappyHexMesh
  #16
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
Hello All,
Pardon me for the slightly different question:

I have tried the LTSInterFoam wigleyHull example on a single processor and it works. I then tried doing the same run in parallel. Here are the steps I followed:

[1.] ran blockMesh
[2.] copied 0/alpha1.org to 0/alpha1
[3.] changed system/decomposeParDict by commenting "method simple;" and adding the line "method scotch;" I then ran decomposePar to get the four partitions.
[4.] I commented "method scotch;" in decomposeParDict and replaced it with "method ptscotch;" I then ran snappyHexMesh -parallel -overwrite on 4 processors.
[5.] I then ran setFields -parallel on 4 processors.

I saw the following problem in step [5.]:

[0] --> FOAM FATAL IO ERROR:
[0] Cannot find patchField entry for hull_wall
[1] [0]

I then checked the processor{0,1,2,3}/0/alpha1.gz files and I found that these files do not have the hull_wall entry

hull_wall
{
type zeroGradient;
}

that is present in the original (before mesh partition) 0/alpha1 file!

It is very likely that I am missing something in going from sequential to parallel. Could any of you please let me know where I am going wrong?

Cheers,
Albert
Abracurcix is offline   Reply With Quote

Old   January 6, 2014, 04:08
Default
  #17
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 15
laurent98 is on a distinguished road
hi Albert,
i am not a specialist, but may be you should reconstruct before doing setFields
here my allrun files
hope this will help you
cheers LL
Attached Files
File Type: txt Allrun_in_parall.txt (1.0 KB, 483 views)
laurent98 is offline   Reply With Quote

Old   January 6, 2014, 04:37
Default
  #18
New Member
 
Albert Pinto
Join Date: May 2013
Posts: 16
Rep Power: 13
Abracurcix is on a distinguished road
Quote:
Originally Posted by laurent98 View Post
hi Albert,
i am not a specialist, but may be you should reconstruct before doing setFields
here my allrun files
hope this will help you
cheers LL
Thanks, Laurent! I'll try out what you have suggested. However, the incompressible/pisoFoam/les/motorBike/motorBike example suggests that we can do all the steps, from snappyHexMesh onwards, without having to go through the reconstructPar step. Also, it becomes a bit impractical for very large meshes is one has to do a reconstructPar followed by decomposePar, before running the solver.

Cheers,
Albert
Abracurcix is offline   Reply With Quote

Old   January 6, 2014, 07:13
Default
  #19
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 15
laurent98 is on a distinguished road
hi Albert,
no pb happy to help if i can. just if i didn t make mistake, in motobike there is no need of setFields because there is no alpha1 variable. with air and water you must set the value of alpha, i thought it could be done even on a decomposed case but i didn't find how... so since now between shm and the solver i reconstruct, setfields and decompose...
a+ LL
laurent98 is offline   Reply With Quote

Old   November 25, 2018, 09:32
Default
  #20
New Member
 
Sergio
Join Date: Nov 2018
Posts: 2
Rep Power: 0
SAI_ is on a distinguished road
Hello,

I am able to run snappyhexmesh in serial without problems, but when I try running in parallel, it fails to snap to edges and doesn't add layers. Does someone what the problem could be?
I attached the mesh that resulted from the serial and parallel runs, the snappyhexmeshDict which was the same for both and the log from the parallel run.

I am counting on you, forum

Thanks very much in advance!

EDIT: Nevermind, changing the type of the front and back planes from empty to patch fixed it!
Attached Images
File Type: jpg serial.jpg (185.9 KB, 194 views)
File Type: jpg parallel.jpg (138.0 KB, 187 views)
sourav90 likes this.

Last edited by SAI_; November 25, 2018 at 14:57.
SAI_ is offline   Reply With Quote

Reply

Tags
snappyhexmesh parallel


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
Error running openfoam in parallel fede32 OpenFOAM Programming & Development 5 October 4, 2018 17:38
[snappyHexMesh] SnappyHexMesh in parallel missing 0 folder libindaniel2000 OpenFOAM Meshing & Mesh Conversion 0 May 26, 2016 23:46
[snappyHexMesh] SnappyHexMesh in Parallel problem swifty OpenFOAM Meshing & Mesh Conversion 10 November 6, 2015 05:40
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 12:58
snappyHexMesh in parallel with AMI louisgag OpenFOAM Pre-Processing 8 September 15, 2014 03:57


All times are GMT -4. The time now is 22:09.