FDS Mesh Bisector Utility for Parallel Computing

90 views
Skip to first unread message

Jan-Michael Cabrera

unread,
Jul 20, 2021, 3:02:53 PM7/20/21
to FDS and Smokeview Discussions
Hello All,

When working on a large parallel job I ended up writing a simple mesh bisecting utility in Python that I think may be useful to others.

A word of caution; the simple program does not yet perform simple checks to see if the number of cells in a direction is an integer, etc.

A quick example (from mesher_example.py):

     from fds_mesher import MESH

     test = MESH(X1=0,X2=5.0,Y1=-2.5,Y2=2.5,Z1=0,Z2=3,cell_size=0.1, bisections=3)
     test.mesh_divide()

     print(test.all_mesh_text)

Output:
     &MESH IJK=25,25,15, XB=0.000,2.500,-2.500,0.000,0.000,1.500, MPI_PROCESS=0 / 
     &MESH IJK=25,25,15, XB=0.000,2.500,-2.500,0.000,1.500,3.000, MPI_PROCESS=1 / 
     &MESH IJK=25,25,15, XB=0.000,2.500,0.000,2.500,0.000,1.500, MPI_PROCESS=2 / 
     &MESH IJK=25,25,15, XB=0.000,2.500,0.000,2.500,1.500,3.000, MPI_PROCESS=3 / 
     &MESH IJK=25,25,15, XB=2.500,5.000,-2.500,0.000,0.000,1.500, MPI_PROCESS=4 / 
     &MESH IJK=25,25,15, XB=2.500,5.000,-2.500,0.000,1.500,3.000, MPI_PROCESS=5 / 
     &MESH IJK=25,25,15, XB=2.500,5.000,0.000,2.500,0.000,1.500, MPI_PROCESS=6 / 
     &MESH IJK=25,25,15, XB=2.500,5.000,0.000,2.500,1.500,3.000, MPI_PROCESS=7 /
mesher_example.py
fds_mesher.py

Kevin McGrattan

unread,
Jul 25, 2021, 10:12:25 AM7/25/21
to fds...@googlegroups.com
Thanks for sharing.

A comment: if the domain is a large rectangular parallelepiped and you want to divide it into equally sized MESHes, use the MULT feature. You do not need to add MPI_PROCESS to the MESH lines if each MESH is to be assigned to its own unique MPI process, which is usually the case. Having many MESH lines can clutter the input file and is more likely to contain mistakes. There is also a feature of MULT that allows one to skip meshes so as to add finer meshes near the fire using a second pair of MESH and MULT.

Emanuele Gissi

unread,
Jul 26, 2021, 7:49:12 AM7/26/21
to FDS and Smokeview Discussions
Hi Jan,
I took a look to your script, I see that you used an object oriented approach.

1) This is exactly what you find ready-made in BlenderFDS. All the objects are scriptable in Python.
Let me know if you find this interesting. Here is the link: blenderfds.org
If you see potential applications, I could add a wiki page on Python scripting with BlenderFDS.

2) I like your idea of bisecting the MESHes. Here is a related issue in BlenderFDS:

Best,
Emanuele

Lukas Arnold

unread,
Jul 28, 2021, 6:55:04 AM7/28/21
to fds...@googlegroups.com
Dear all,

just to add other options / approaches, here is the (Python) script I use for domain decomposition:

https://github.com/FireDynamics/LectureFireSimulation/blob/main/book/content/tools/02_hpc/decompose_fds_mesh.py

It takes the original 'MESH-line' and outputs the new ones, see an example given here:

https://firedynamics.github.io/LectureFireSimulation/content/tools/02_hpc/03_parallel_fds.html#mesh-decomposition

Best
Lukas
> --
> You received this message because you are subscribed to the Google Groups "FDS and Smokeview Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fds-smv+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fds-smv/2f27558c-25cf-4308-bc8e-ce57a116d4een%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages