CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

snappyHexMesh in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree13Likes
  • 1 Post By shailesh.nitk
  • 2 Post By Rider
  • 1 Post By Rider
  • 1 Post By Rider
  • 1 Post By Rider
  • 4 Post By Rider
  • 1 Post By Rider
  • 2 Post By case

Reply
 
LinkBack Thread Tools Display Modes
Old   May 23, 2012, 01:37
Default snappyHexMesh in parallel
  #1
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 8
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, 02:37
Default
  #2
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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.
shailesh.nitk and yanxiang like this.
Rider is offline   Reply With Quote

Old   May 24, 2012, 02:22
Default
  #3
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 8
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
shailesh.nitk is offline   Reply With Quote

Old   May 24, 2012, 03:01
Default
  #4
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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 06:45.
Rider is offline   Reply With Quote

Old   May 25, 2012, 06:02
Default mpirun app, foamJob script and RunParallel function
  #5
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 8
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, 05:50
Default
  #6
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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, 06:17
Default
  #7
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 8
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, 06:24
Default
  #8
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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, 06:36
Default
  #9
New Member
 
Shailesh Kumar Gupta
Join Date: May 2009
Posts: 9
Rep Power: 8
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, 06:43
Default
  #10
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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 07:02.
Rider is offline   Reply With Quote

Old   May 29, 2012, 08:58
Default
  #11
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
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!
lovecraft22 is offline   Reply With Quote

Old   May 29, 2012, 09:04
Default
  #12
Member
 
Join Date: Apr 2012
Location: France
Posts: 72
Rep Power: 5
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: 6
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 and neiht like this.
case is offline   Reply With Quote

Old   September 17, 2013, 05: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: 65
Rep Power: 5
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: 4
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: 65
Rep Power: 5
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, 118 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: 4
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: 65
Rep Power: 5
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

Reply

Tags
snappyhexmesh parallel

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SnappyHexMesh in Parallel problem swifty OpenFOAM Meshing & Mesh Conversion 5 February 24, 2015 09:31
SnappyHexMesh OF-1.6-ext crashes on a parallel run norman1981 OpenFOAM Bugs 5 December 7, 2011 13:48
snappyhexmesh parallel Virtual-iCFD OpenFOAM Running, Solving & CFD 1 September 9, 2011 11:33
snappyHexMesh in parallel with cyclics tonyuprm OpenFOAM 1 June 29, 2011 10:43
Parallel mesh generation using snappyHexMesh aki_yafuji OpenFOAM Mesh Utilities 0 December 25, 2010 04:49


All times are GMT -4. The time now is 18:17.