Skip to content

amirgolp/P3D-BRNS

Repository files navigation

About P3D-BRNS

P3D-BRNS is an open-source modelling package designed for simulating Multiphae, Multi-component reactive transport in μ-CT image of any porous strcuture. The "lib" folder contains the code for tracking interface proeprties (Raeini et al 2016), while all others contain the relevant solver and test cases used in the main manuscript.

Instructions for running P3D-BRNS locally:

The source code is developed in a linux-based environemnt (Linux Ubuntu 18.04) using OpenFOAM-4.0 extended version. The reaction network used for each scenario/case can be found in the last line of the file: "corresponding_solver_directory/Make/options". The solver will be looking for the shared object file (i.e. "*.so" in the same directory as the solver) in "FOAM_USER_LIBBIN".

Important Note the BRNS shared objects are compiled using "GNU Fortran (GCC) 6.4.0", "gcc (GCC) 6.4.0" and "g++ (GCC) 6.4.0".

Step 1:

First step is to install a working version of the OpenFOAM-4.0x. For this open a shell and type the followings:

sudo apt-get update
sudo apt-get install git-core build-essential binutils-dev cmake flex zlib1g-dev qt4-dev-tools libqt4-dev libncurses5-dev libxt-dev rpm mercurial graphviz python python-dev gcc-5 g++-5
cd ~
mkdir foam
cd foam
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.0 foam-extend-4.0
cd ~/foam/foam-extend-4.0
echo export WM_THIRD_PARTY_USE_BISON_27=1 >> etc/prefs.sh
echo export QT_SELECT=qt4 >> etc/prefs.sh
echo "export WM_CC='gcc-5'" >> etc/prefs.sh
echo "export WM_CXX='g++-5'" >> etc/prefs.sh
echo "export QT_BIN_DIR=/usr/bin/" >> etc/prefs.sh   
source etc/bashrc
echo "alias fe40='source \$HOME/foam/foam-extend-4.0/etc/bashrc'" >> $HOME/.bashrc
sed -i -e 's=rpmbuild --define=rpmbuild --define "_build_id_links none" --define=' ThirdParty/tools/makeThirdPartyFunctionsForRPM
sed -i -e 's/gcc/\$(WM_CC)/' wmake/rules/linux64Gcc/c
sed -i -e 's/g++/\$(WM_CXX)/' wmake/rules/linux64Gcc/c++ 
./Allwmake.firstInstall

You can test for successfull installation by typing the following in the shell:

  interFoam -help

which should produce no error.

Step 2

Next, the library @ "lib/interfacePropertiesAM" needs to be compiled. For this, navigate to this folder and in the shell, type:

wmake libso

Step 3:

To run each test case, first the corresponding solver needs to be compiled. Navigate to solver folder and in the shell, type:

wmake

Now navigate to the relative test-case fodler and in the shell, type the name of the solver.

Contact

For any inquiries, contact [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published