Libraries for coupling Elmer FEM and OpenFOAM + test cases. For detailed information how this software works check our article.
If you use EOF-Library, please cite: Juris Vencels, Peter Råback, Vadims Geža, EOF-Library: Open-source Elmer FEM and OpenFOAM coupler for electromagnetics and fluid dynamics, SoftwareX, Volume 9, 2019, Pages 68-72, ISSN 2352-7110, https://doi.org/10.1016/j.softx.2019.01.007.
This software is maintained by Juris Vencels from EOF Consulting LLC in cooperation with CSC - IT Center for Science Ltd. (Finland).
EOF-Library couples internal fields between Elmer FEM and OpenFOAM. Applications are
There are two options to install and use this software:
Performance-wise these two options are comparable. Docker installation comes with OpenFOAM and Elmer installed, and environment is set. This is preferred option for most users and for running simulations on multiple computers or cloud.
On the other hand complete installation gives users more flexibility, it is preferred option for developers who want to work on their own solvers or have full control over software and its source code.
First, you will need to install docker on your OS:
Then, follow commands below to install the software & run demo simulation.
mkdir runs
cd runs
docker run --rm -it -e HOST_USER_ID=$(id -u) -e HOST_USER_GID=$(id -g) -v ${PWD}:/home/openfoam/EOF-Library/runs eoflibrary/eof_elmer84_of6:latest
eofUpdate
cd EOF-Library
wmake solvers/mhdInterFoam6
cp -r tests/levitation2D runs
cd runs/levitation2D
setFields
decomposePar
ElmerGrid 2 2 meshElmer -metis 2
mpirun -n 2 mhdInterFoam -parallel : -n 2 ElmerSolver_mpi case.sif
Get git
, cmake
, gfortran
, blas
and lapack
.
sudo apt-get install git cmake gfortran libblas-dev liblapack-dev
Download OpenFOAM source code, configure and compile it
Download Elmer from developers repo (https://github.com/ElmerCSC/elmerfem).
Configure and compile Elmer with -DWITH_MPI=TRUE
by following these steps (https://www.csc.fi/web/elmer/sources-and-compilation). In short .., we create build folder and call CMake from this folder:
cmake -DWITH_MPI=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../mpi-install ../elmerfem
make -j install
Download EOF-Library:
git clone https://github.com/jvencels/EOF-Library
. EOF-Library/etc/bashrc
which mpirun
mpirun --version
eofCompile
Colmpile OpenFOAM solver
cd EOF-Library/solvers/mhdInterFoam6
wmake
Copy test
cd ../..
mkdir runs
cd runs
cp -r ../tests/levitation2D .
cd levitation2D
setFields
decomposePar
ElmerGrid 2 2 meshElmer -metis 2
mpirun -np 2 mhdInterFoam -parallel : -np 2 ElmerSolver_mpi