Challenge

Week 4 Challenge- Compiling C++ libraries

Compiling C++ libraries

1) Copy the solver DPMFoam from the lagrangian library ( $FOAM_SOLVERS ) into your run folder ( $FOAM_RUN ) (use visual studio)

  • Use wmake libso to compile the shared library associated with this, after making the appropriate changes
  • Where is the resulting .so file found? (Attach image of the shared object file location)
  • Write a report on what you did and the challenges you faced

---------------

  • First of all we have entered in openFOAM application/solvers folder using '$FOAM_SOLVERS' command
  • Then ' cp -r D* $FOAM_RUN' command will help us to copy the required folder from openFOAM library to our run folder
  • Now by navigating the run folder we can confirm that the required folder is pasted in the specified folder and further we can proceed

  • Now here we have used 'wmake libso' for compiling the required library file

  • Here is the required '.so' file

Challenges Faced

  • Nothing as such

--------

-------

Write detailed explanations on the following decomposition algorithms:

  1. simple (2 2 1)
  2. scotch (Write a short note about how scotch decomposition is carried out)
  3. hierarchical
Simple Scotch Hierarchical
In this case the compuatational domain is divided into sub-domains using a straightforward geometric approach It aims to balance the computational workload across different processors by partitioning the mesh based on graph theory principles It involves breaking down of the compuational domain into sub-domains in a hierarchical manner.It is used for parallel architectures with varying levels of computing resources
The number in parenthesis indicate that the domain is divided into two parts along x-axis, two parts along y-axis and one part along z-axis The Scotch library is used to partition this graph into subdomains.The objective is to minimize the no.of connections between subdomains while ensuring a rough no of mesh elements in each sub-domain It divides the domain into smaller and more mangeable subdomains in a hierarchical fashion.It involves multiple level of decomposition, allowing for flexibility in adapting to different parallel computing architectures
It works well for simple and regular geometries, but it doesnot provide optimal loading balancing for complex cases It considers the computational cost associated with each mesh element and aims to achieve load balancing among the processors It also aims to achieve load balancing to ensure that each processor has a comparable amount of computational work
To use simple decomposition, we modify method as 'method simple' in decomposepardict To use scotch decomposition, we modify method as 'method scotch' in decomposepardict To use hierarchical decomposition, we modify method as 'method hierarchical' in decomposepardict

--------------------------

3. Take the incompressible/simpleFoam/pitzDaily case and visualize the decomposed mesh (use decomposeParDict) in ParaView for:

  1. simple (2 2 1)
  2. scotch (Write a short note about how scotch decomposition is carried out)
  3. hierarchical

--------------------------

  • First of all we need to create decomposeParDict inside system folder and modify it according to the decompostion method
  • Then 'blockMesh' command is used to create the mesh
  • Then 'decomposePar' command is used to decompose the domain for parallel computing
  • Then ' mpirun -np 4(no of processors) simpleFoam(solver name) -parallel is used to run the simulation
  • At last 'reconstructPar' is used to reconstruct the domain and to visualize the results

Output Result

  • Simple(2 2 1) :

  • Scotch :

  • Hierarchical :

Conclusion

  • According to our analysis, we can conclude that Scotch Decompostion provides better decomposition over other methods
  • Simple and Hierarchical Method are nearly similar in decomposition except the user specification in which the directional split is done in i.e first in y-direction and then in the x-direction for hierarchical case
  • The Hierarchy of precedence of choosing the methods be alike : Manual > Scotch > Hierarchical > Simple
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.