# libFastMesh - Optimized Finite Volume Computational Aeroacoustics (CAA) Code
libFastMesh files are divided into the following directories:
The main classes within libFastMesh are:
The classes are written in templates format to minimize the memory footprint based on executed case - allowing both single/double precision, 2D/3D problems and geometry aware data structures.
The OpenFOAM environment must be initialized prior to LFM building, via:
source ${FOAM_INSTALLDIR}/etc/bashrc
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 ..
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.
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.
Several example test cases are stored under the 'examples' directory. Consult examples/README.md for a list of test cases.
LFM input files consists of a polyMesh, and dictionary files containing the solver parameters
constant/polyMesh
: This directory must contain the polyMesh in the same format read by OpenFOAM. The boundary file must be with the following restrictions:
0/U, 0/p, 0/T, 0/alpha
: Scalar and vector fields dictionaries with initial values of the velocity, pressure, temperature and alpha
constant/spongeDict
: dictionary file
constant/thermophysicalProperties
: dictionary file
system/fvSchemes
: dictionary file
system/controlDict
: dictionary file
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
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.
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.
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.