Week 4 Challenge- Compiling C++ libraries
- 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
ANS:
We will open and copy the lagrangian folder which contains the DPMFoam file.
TUT->applications->solvers->lagrangian->denseParticleFoam->Copy the folder ->mySolvers

.so file location:

Running wmake in Visual studio code:

2. Write detailed explanations on the following decomposition algorithms:
- simple (2 2 1)
- scotch (Write a short note about how scotch decomposition is carried out)
- hierarchical
ANS:
Decomposition algorithms are used in parallel computing to divide a large computational domain into smaller subdomains, which can be distributed across multiple processors. This allows multiple processors to work simultaneously on different parts of the problem, which can significantly reduce the overall computation time.
- Simple (2 2 1) Decomposition:
The simple (2 2 1) decomposition algorithm is a basic algorithm that divides a computational domain into two subdomains in the x-direction, two subdomains in the y-direction, and one subdomain in the z-direction. This results in a total of four subdomains, which can be distributed across four processors in a parallel computing system. This decomposition algorithm is useful for simple problems that do not require a more complex decomposition scheme.
The simple (2 2 1) decomposition algorithm can be carried out using the decomposition utility in OpenFOAM. The decomposition utility reads in the computational mesh and the desired number of subdomains, and then creates a decomposition of the mesh based on the specified number of subdomains. The resulting decomposition is stored in a set of files that can be used in parallel computations.
- Scotch Decomposition:
Scotch is a parallel graph partitioning library that is commonly used in scientific computing. It can be used to partition a computational domain into multiple subdomains, which can be distributed across multiple processors for parallel computations. The scotch decomposition algorithm works by first constructing a graph that represents the connectivity of the computational mesh, and then partitioning the graph into multiple subgraphs using a multi-level recursive bisection algorithm.
The scotch decomposition algorithm is carried out in several steps.
- First, the computational mesh is converted into a graph representation, where each node in the graph represents a cell in the mesh, and each edge in the graph represents the connection between adjacent cells.
- Next, the graph is partitioned into multiple subgraphs using a multi-level recursive bisection algorithm. This algorithm works by recursively partitioning the graph into smaller subgraphs, until the desired number of subgraphs is reached. The resulting subgraphs represent the subdomains that can be distributed across multiple processors for parallel computations.
The scotch decomposition algorithm is implemented in the OpenFOAM decomposition utility using the Scotch library. The decomposition utility reads in the computational mesh and the desired number of subdomains, and then uses the Scotch library to partition the mesh into the specified number of subdomains.
- Hierarchical Decomposition:
The hierarchical decomposition algorithm is a more complex decomposition algorithm that is designed to handle large computational domains with complex geometries. The hierarchical decomposition algorithm works by first dividing the computational domain into a hierarchy of nested subdomains, and then distributing these subdomains across multiple processors for parallel computations.
The hierarchical decomposition algorithm can be carried out in several steps. First, the computational domain is divided into a hierarchy of nested subdomains using a recursive subdivision algorithm. This algorithm works by dividing the computational domain into smaller subdomains, and then recursively dividing each subdomain into even smaller subdomains until a desired level of subdivision is reached. Next, the subdomains at the lowest level of the hierarchy are distributed across multiple processors for parallel computations. Finally, the results from each subdomain are combined to produce the overall solution.
The hierarchical decomposition algorithm is implemented in the OpenFOAM decomposition utility using the scotch library. The decomposition utility reads in the computational mesh and the desired number of subdomains, and then uses the hierarchical decomposition algorithm to partition the mesh into the specified number of subdomains.
3. Take the incompressible/simpleFoam/pitzDaily case and visualize the decomposed mesh (use decomposeParDict) in ParaView for:
- simple (2 2 1)
- scotch (Write a short note about how scotch decomposition is carried out)
- hierarchical
ANS:
TUT->compressible->rhoSimpleFaom->heatTransfer->chtMultiRegionFoam->shellandTubeHeatExchanger->system->decomposeParDict


We will use notepad.exe command to open the notepad to modify
simple (2 2 1):

In PARAVIEW:

scotch:

In PARAVIEW:

hierarchical:

In PARAVIEW:
