Week 4 Challenge- Compiling C++ libraries
EXERCISE 1:
Step number one: For user developed solvers, I created a folder in $WM_PROJECT_USER_DIR called "applications" and another folder "solvers" within applications: $WM_PROJECT_USER_DIR/applications/solvers/
Step number two: I copied the solver DPMFoam into this new created folder "solvers": $WM_PROJECT_USER_DIR/applications/solvers/DPMFoam/
Step number three: I changed the name of DPMFoam to myDPMFoam by using the bash comman "mv DPMFoam myDPMFoam"
Step number four: I changed the name of the source code DPMFoam.C to myDPMFoam.C
Step number five: Within Make directory, I opened the file called "files" and changed again the name of the solver (refering to the source code at the beggining of the file in the first line and at the path preceding the path: $FOAM_APPBIN/DPMFoam.C) as in step four: DPMFoam.C to myDPMFoam.C.
Step number six: In the next line where the path of standard applications ($FOAM_APPBIN) is defined, I redefined it as the path of the applications developed-by-the-user ($FOAM_USER_APPBIN).
Step number seven: I returned to the solver folder and executed "wmake" to compile the new solver.
Finally, the resulting .so file (shared file) of the new solver can be found in the directory $FOAM_USER_APPBIN where all new compiled applications by the users, such as solvers and utilities are stored. $FOAM_USER_APPBIN lies within $WM_PROJECT_USER_DIR
EXERCISE 2:
1. Algorithm simple (2 2 1): simple geometric decomposition in which the domain is split into pieces by direction, in this case: 2 pieces in the “x – direction” and 2 pieces in the “y – direction”.
2. Algorithm scotch: scotch decomposition requires no geometric input from the user and attempts to minimize the number of processor boundaries. This is achieved thanks to the “graph partitioning”, in which the mesh is treated as a graph, and the elements or cells as nodes, and the connections in between as edges. When partitioning, the graph is chunked into smaller graphs, while minimizing the edges between the smaller graphs.
3. Algorithm hierarchical: this decomposition method divides the domain hierarchically based on a specified number of subdomains in each direction. As the decomposition method “simple”, this method divides the domain into a grid-like structure along x, y and z directions, creating a specific number of subdomains in each direction.
EXERCISE 3:
Regarding the case, as I am currently using another version of OpenFOAM (v-2306, released this year), I found out that "pitzDailyExpInlet" is the only case contained within incompressible/simpleFoam from the tutorials ($FOAM_TUTORIALS) with the dictionary "decomposeParDict". So I had use this tutorial case: pitzDailyExpInlet.
Attached are the screenshots of the decoposed meshes using the algorithms simple (2 2 1), hierarchical and the scotch. Simple and hierarchical look in face the same, but they are not necessarily the algorithm same. If the number of partitions were bigger, maybe a different partition distribution would be noticeable.
EXERCISE 4:
Regarding the last activity, I renamed the DPMFoam solver, and pushed in git to my github repository:
https://github.com/jcastorena92/-Activitities-in-OpenFOAM-
I used the following commands:
1. I created the repository in git with: git init
2. I added only two files (myDPMFoam.C & Make/files) to the git repository with the command: git add
3. I created a repository in github account
4. I copied a command given automatically by my github repository once I had created the repository and pasted the command where I had added previously the files in my git repository
5. Finally, I pushed the files from my git repository to my github repository