LundFMFoamis an OpenFOAM tool package, including chemistry coordinate mapping (CCM) approach, Eulerian stochastic field (ESF) based transport probability density function (PDF) method.
The code is developed by Bai's group in Division of Fluid Mechanics, Lund University. All of the codes and cases in this repository are based on the OpenFOAM-7. The LundFMFoam-7 repository is a collection of many self-developed solvers, libraries, and postProcess tools. Some of the solvers (reactingDNS, multiRegionSprayFoam, reactingCanteraFoam, ZYsprayFoam ...) libraries (boundaryConditions, QSSAchemistrySolver, CanteraChemistryModel, dynamicSmagorinsky, ...) postProcess tools (conditionalAverage, foam2Columns, CEMAX, colorfulParticleTracks, ...) and database (chemicalMechanisms) are open access, while others, such as CCM and ESF, are linked to private repositories and not publicated yet. If you would like to access the private repositories, please write us an email.
Here are the instructions for using LundFMFoam. The instructions are devided into two parts:
- If you are a user, only want to use the existing code, see Guidelines for users.
- If you are a developer, planning to write your own solver or library based on
LundFMFoam, see Instructions for developer.
- Source the build-in OpenFOAM at first, for example
source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc- Download the
LundFMFoam-7repository and sourcebashrcfile
cd $HOME/OpenFOAM
git clone [email protected]:Fluid-Mechanics-Lund-University/LundFMFoam-7.git
cd LundFMFoam-7/etc
source bashrc- Once sourcing the
bashrcfile, you can compile the library or/and solver following the instructions To compile the build-in codes, you can use theAllwmakescript. For example, you can compile the libraries
srcLU
wclean all
./Allwmakeand applications
appLU
wclean all
./AllwmakeTo compile the submodule codes, you need to download the specific submodule. For example, if you would like to compile the CanteraChemistryModel library, you can use the following commands
git submodule update --init src/thermophysicalModels/chemistryModel/CanteraChemistryModel/
srcLU
wmake thermophysicalModels/chemistryModel/CanteraChemistryModel/and if you would also like to compile the reactingCanteraFoam solver
git submodule update --init app/solvers/reactingCanteraFoam/
appLU
wmake solvers/reactingCanteraFoam/The compiled binary files, such as solvers and .so libraries, are written into $FOAM_USER_APPBIN and $FOAM_USER_LIBBIN.
We suggest that you develop your code in your own folder (e.g. $WM_PROJECT_USER_DIR/app and $WM_PROJECT_USER_DIR/src). Do not revise the offical LundFMFoam code when you develop your own code. Therefore, once you finished compiling the LundFMFoam (see Guidelines for users), change the permissions of LundFMFoam to read-only by commanding
chmod -R 444 $LU_PROJECT_DIR- Prepare the configuration files for compiling:
Make/filesandMake/options
- In
Make/files, set the target directory for binary files as$FOAM_USER_APPBINor$FOAM_USER_LIBBIN.
EXE = $(FOAM_USER_APPBIN)/libXXXFoam
LIB = $(FOAM_USER_LIBBIN)/libXXXModel- In
Make/options, use$LU_SRCand$LU_APPto set the include directories to find.Hfiles inLundFMFoam. For example, the include files forESFmethod are in$LU_APP/app/solvers/ESFsprayFoam/lnInclude. The include files forCCMapproach are in$LU_SRC/thermophysicalModels/chemistryModel/lnInclude. Since theLundFMFoamlibraries are written into$FOAM_USER_LIBBIN, you can either use-L$(FOAM_USER_LIBBIN)/libCCMchemistryModel.soor-lCCMchemistryModelto link theLundFMFoamlibraries. Here is a demo forMake/options
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LU_SRC)/thermophysicalModels/chemistryModel/lnInclude
-I$(LU_APP)/app/solvers/ESFsprayFoam/lnInclude \
EXE_LIBS = \
-lCCMChemistryModel \
-lfiniteVolume