Challenge

Week 4 Challenge- 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

To copy the file from $FOAM_SOLVER directory to the $FOAM_RUN directory do the following steps:

You can move the copied solver folder from your Run folder manually to your mySolver folder too.

Then navigate to your mySolver folder and in your copied solver folder go to the Make/files folder and do the respective changes.

Then run the wmake command to create execute file.

Resulting file location:

As we have changed the EXE file location to USER_APPBIN, the execute file is located there itself

Problems faced during this process:

If you dont create a platforms folder in your space and dont change the EXE location to $FOAM_USER_APPBIN and only like this you run the wmake command then the file will not get execute as writting permission will not be valid. Because some of the us will not have the permission to do changes in the root folder. That is why one have to create the platforms folder and change the execute file location to execute the modifications.

2. 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

1. Simple Decomposition (simple):
Description:
The simple decomposition algorithm divides the computational domain into subdomains using a regular Cartesian grid. It is the most basic decomposition method and is suitable for simple cases or when the workload is evenly distributed across the domain. The decomposition is specified using three integers: (nx, ny, nz), representing the number of subdomains in each direction.

  • Differences:
    - Simple decomposition is straightforward and easy to implement. It works well for small and regular geometries with a relatively uniform distribution of cells.
    - However, simple decomposition does not consider the distribution of workload or the geometric complexity of the domain, which may lead to load imbalance in parallel computations.
  • When to Use:
    Use the simple decomposition when:
    - Working with small and regular geometries.
    - The computational domain can be evenly divided into subdomains without much variation in workload.

2. Scotch Decomposition (scotch):
Description:
The Scotch decomposition algorithm utilizes the Scotch graph partitioning library, which focuses on minimizing communications and load imbalances in parallel computations. Scotch first constructs a graph representation of the domain, where nodes represent cells, and edges represent neighboring relationships. The graph is then partitioned using various algorithms to achieve load balancing and minimize inter-processor communications.

  • How Scotch Decomposition is Carried Out:
    - The domain is represented as a graph, and the edges between nodes (cells) represent neighboring relationships.
    - Scotch uses graph partitioning algorithms to divide the graph into subgraphs, which correspond to subdomains in the computational domain.
    - The graph partitioning process aims to minimize the cut size (number of edges between subdomains) and achieve a balanced workload distribution.
  • Differences:
    - Scotch decomposition takes into account the domain's connectivity and communication patterns, leading to improved load balancing and reduced inter-process communication overhead compared to simple decomposition.
    - Scotch is more suitable for complex geometries and cases with varying cell sizes, ensuring efficient parallel computations.
  • When to Use:
    Use the Scotch decomposition when:
    - Dealing with complex geometries with varying cell sizes.
    - Seeking better load balancing and reduced communication overhead in parallel simulations.

3. Hierarchical Decomposition (hierarchical):
Description:
Hierarchical decomposition combines multiple decomposition algorithms to achieve better load balancing and scalability. It involves nested subdomains, where larger subdomains are further divided into smaller subdomains. This approach allows for better workload distribution and adaptability to different hardware configurations.

  • Differences:
    - Hierarchical decomposition provides a flexible and adaptive approach, suitable for a wide range of computational resources, from small clusters to large supercomputers.
    - The use of nested subdomains enhances the scalability and allows for optimal parallelization on various hardware configurations.
  • When to Use:
    Use the hierarchical decomposition when:
    - Simulating on a variety of hardware configurations, from small to large clusters or supercomputers.
    - Wanting a more flexible and scalable decomposition method that adapts to different computational resources.

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
  • simple (2 2 1)

Copy the tutorial aachenBomb from lagragian/sprayFoam.

Then navigate to the system folder of the copied tutorial and go to decomposeParDict

run the blockMesh command and then run the decomposePar command to execute the decompose utility,

Paraview View:

  • Scotch:

Paraview View:

  • Hierarchical

Paraview View:

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.