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

Load balancing with topoChanger LayerAdditionRemoval Piston movement solver

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 6 Post By Bloerb
  • 1 Post By blttkgl
  • 1 Post By blttkgl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 22, 2017, 06:00
Default Load balancing with topoChanger LayerAdditionRemoval Piston movement solver
  #1
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
A while ago I wrote a mesh motion solver with layer addition and removal. It moves a patch based on a specified velocity and deletes or adds cells based on the direction of the movement velocity. It does hence only change the mesh near the moving wall. Applicable to e.g a piston in an engine or a bicycle pump. This is e.g helpful for interFoam simulations where a simple compression of cells would lead to high aspect ratios for large deformations.

A test case and the solver can be found here (for older OpenFOAM versions replace Function1 with DataEntry):
https://github.com/bloerb/linearMotionLayersFvMesh

I have recently looked at this again and hence uploaded it. Since it deletes or adds cells the solver will eventually run into problems on parallel runs. If all cells on a processor are deleted it will naturally crash. With proper decomposition it will run fine in parallel though. This does however often demand a manual decomposition. My aim is hence to do load balancing. This is done with fvMeshDistribute and mapDistributePolyMesh as far as I can tell.
I basically just want to redistribute it each time the processor my patch is on will run out of cells. The redistribution would suffice if it would simply call redistributePar on runTime. Maybe someone has looked into this before and give me some pointers. A draft can be found in the balance part of linearMotionLayersFvMesh.C. I have this nagging felling that I am missing something that can essentially be done in a few lines of codes.

Best regards
Bloerb is offline   Reply With Quote

Old   January 9, 2019, 04:32
Default
  #2
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Hey,



Thanks for the code. I used it to validate some 2D reacting compression autoignition and it works quite nice. In addition to the problem of ranks "running out of cells" problem during parallel run, I have also noticed that the simulation is quite dependent on decomposition method itself as well. I tried to run a 2D X-Z case with compression in Z direction(picture attached) and decomposed it in the X direction so all ranks will have some cells throughout the simulation. In this decomposition x direction is 75 mm and I use 8 processors, which gave me these "wedges" in the geometry rank boundary (red circles) and moveDynamicMesh crashed. However, if I divide it by 5 rank then the division exactly correspond to cell boundary faces and everything runs smoothly.


Have you experienced something like this in your tests. I have managed to avoid this problem by manually decomposing this simple 2D geometry, but as geometry gets more complex this might not be a viable solution.


Best,


Bulut
Attached Images
File Type: png screenshot.png (12.9 KB, 57 views)
File Type: jpg zoomed.jpg (80.3 KB, 52 views)
blttkgl is offline   Reply With Quote

Old   January 9, 2019, 05:17
Default
  #3
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
Yes this is exactly what i experienced. I also used manual decomposition to circumvent this error. I have however not looked any further into the load balancing that would remove the crashes due to it. If your geometry allows it the best way might be to use a solver that does not use topology changes like displacementInterpolation. For large deformations your aspect ratio might increase drastically though
Bloerb is offline   Reply With Quote

Old   January 9, 2019, 07:40
Default
  #4
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Thanks for the reply. Not changing the mesh topology is of course easier but it then leads to quite high aspect ratio cells if the compression ratio is too high, as you mentioned.



I managed to manually decompose my domain using the idea given in this post: Manual decomposition using setFields . As for dynamic load balancing, we have implemented it for chemistry calculations, although finite-rate chemistry calculation is restricted to individual cell and does not need neighbor info. I'll keep this post updated if I manage to solve this issue.


Best,


Bulut
Sean95 likes this.
blttkgl is offline   Reply With Quote

Old   January 25, 2019, 10:57
Default
  #5
Member
 
Sean Gorry
Join Date: Feb 2018
Posts: 48
Rep Power: 8
Sean95 is on a distinguished road
I'm just wondering if anyone has got load balancing working. I have run into similar issues with the decomposition of my fluid domain, and as such have only been able to run my case in parallel with four processors. I have tried scotch but it doesn't perfectly spilt the cells between the processors and crashes. My fluid domain has over a million cells so manual decomp is out.
Attached Images
File Type: jpg cellDist.jpg (26.4 KB, 40 views)
Sean95 is offline   Reply With Quote

Old   February 18, 2019, 14:14
Default
  #6
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Hey,


Why would manual decomposition would be out? It has nothing to do with number of cells, the only problem is to use setFields properly. If you look at the manual decomposition thread I linked above, I successfully used that idea to decompose domains for over 5M cells to use layer removal and compression at the same time. The trick is each rank should have a continuous straight edge with the its neighboring rank in the direction of compression (see the above figure).


I ended up abandoning this method for other reasons but you should be able to manually decompose your domain using manual decomposition if your mesh is uniform.


Bulut
Sean95 likes this.
blttkgl is offline   Reply With Quote

Old   February 25, 2019, 14:37
Default
  #7
Member
 
Sean Gorry
Join Date: Feb 2018
Posts: 48
Rep Power: 8
Sean95 is on a distinguished road
I tried the method you linked and it worked perfectly, thanks
I used rotatedBoxToCell instead of boxToCell in setFieldsDict, I should be able to use the same approach for greater levels of decompostion, i.e. 16,32,64.
Attached Images
File Type: png unnamed.png (5.2 KB, 20 views)
Sean95 is offline   Reply With Quote

Old   February 25, 2019, 15:01
Default
  #8
Member
 
Join Date: Oct 2015
Location: Finland
Posts: 39
Rep Power: 10
blttkgl is on a distinguished road
Glad it worked out fine. I ended up not using this since I have non-uniform refinement regions within my 3D mesh that'd be hard to decompose as smooth as a uniform one, but as long as you have a somewhat structured mesh it should work nicely.


Bulut
blttkgl is offline   Reply With Quote

Old   March 19, 2024, 23:14
Unhappy
  #9
Member
 
Michael Sukham
Join Date: Mar 2020
Location: India
Posts: 79
Rep Power: 6
2538sukham is on a distinguished road
Which version is this @Bloerb? I want to try this out on OpenFoam v2212. So far, there are sphereDrop case and movingCone for dynamic layer addition/removal. But I am not able to achieve linearValveLayersFvMesh in the above said version. =sad=
2538sukham is offline   Reply With Quote

Reply


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
applying point load ..solidDisplacmentFoam solver raagh77 OpenFOAM Running, Solving & CFD 1 September 14, 2011 11:01
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
Load balancing pre- and during computation madad2005 OpenFOAM 1 October 29, 2009 05:23
load balancing in parallel computation shyamdsundar Main CFD Forum 0 September 2, 2009 23:53
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32


All times are GMT -4. The time now is 19:42.