TRC-HPC / LFM_Public

libFastMesh - Optimized Finite Volume Computational Aeroacoustics (CAA) Code
GNU General Public License v3.0
7 stars 0 forks source link
aeroacoustics cfd

# libFastMesh - Optimized Finite Volume Computational Aeroacoustics (CAA) Code

Directories & Files

libFastMesh files are divided into the following directories:

The main classes within libFastMesh are:

Installation

Prerequisities

Solver requirements

OpenFOAM environment

The OpenFOAM environment must be initialized prior to LFM building, via:

source ${FOAM_INSTALLDIR}/etc/bashrc

OpenFOAM utilities

The following OpenFOAM utilities are required by libFastMesh:

These utilities are found under runTimeManagerOF, polyMeshReaderOF and dictReaderOF directories, respectively. They can be built using:

cd runTimeManagerOF && wmake && cd ..
cd polyMeshReaderOF && wmake && cd ..
cd dictReaderOF && wmake && cd ..

Hamiltonian Path Renumbering (Optional)

In order to use the hpath renumbering, go to ${FOAM_INSTALLDIR}/src/renumber/renumberMethods. Then, place the hpathRenumber folder inside it, and modify the Make/files file to include hpathRenumber/hpathRenumber.C. Finally, execute wmake inside renumberMethods folder. renumberMesh should now support "hpath" as a renumbering method. Please note that this method works on 2D meshes only.

Building LFM

To build LFM, the following commands need to be executed:

autoreconf -i
./configure --prefix=${INSTALL_DIR} CC=mpicc CXX=mpic++ CXXFLAGS=-O3
make -j 8
make install

for a debug build, replace the configure command with:

autoreconf -i
./configure --prefix=${INSTALL_DIR} CC=mpicc CXX=mpic++ CXXFLAGS="-g -O0 -Wall -DDEBUG"
make -j 8
make install

${INSTALL_DIR} is the location where the user wants to place the solver binaries. For more details on the installation process, please refer to the INSTALL document.

After installation, it is required to copy the following library files (found inside lib directory) to ${INSTALL_DIR}/lib directory:

It is also recommended to add the ${INSTALL_DIR}/bin directory to PATH.

Launching a Simluation

Several example test cases are stored under the 'examples' directory. Consult examples/README.md for a list of test cases.

Input Files

LFM input files consists of a polyMesh, and dictionary files containing the solver parameters

Mesh Partitioning

In order to partition the mesh and prepare it for simulation with LFM, you may use 'decomposePar' from OpenFOAM to partition the polyMesh into to the desired number of subdomains. Information about decomposePar usage may be found in the following link: https://openfoamwiki.net/index.php/DecomposePar

Mesh Renumber

After the mesh partitioning, you may change the cells order to improve performance using the 'renumberMesh' tool from OpenFOAM. Users may set the renumberMethod inside renumberMeshDict, as detailed in the following link: https://openfoamwiki.net/index.php/RenumberMesh. Please note that renumberMesh must be invoked with '-parallel' and '-overwrite' flags to apply the change for each submesh generated during the mesh partitioning step.

Execution

After the preprocessing stage completes, the simulation is ready for running. The command to begin the simulation in parallel:

mpirun -np NP lfm_solve -p

The '-p' argument tells LFM to run in parallel based on the partitioned sub-meshes found inside the directories 'processor#rank' (created during the decomposePar step)

For serial execution of LFM, the -p' argument should be omitted, in which case LFM will read the mesh from constant/polyMesh directory.

Post-processing

The results are saved in the same format as OpenFOAM solvers. Users may reconstruct the solution from all processors using reconstructPar tool of OpenFOAM, and examine it using VisIt or Paraview.

The integral force coefficients that are summed over each wall boundary are written to the 'Output' directory.