Coupling OpenFOAM with Elmer?

General discussion about Elmer
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Coupling OpenFOAM with Elmer?

Post by raback »

Hi Matthias

I hastily mixed the bulk vs. boundary operation. So currently only coupling in bulk is supported whereas coupling on boundary would be somewhat more challenging (I just edited my reply to be more accurate). The reason for this is that the boundary may be faceted in a way that for nonconforming meshes may be much harder to project. If you work with volume coupling then you can be sure to find the nodes within some element.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Coupling OpenFOAM with Elmer?

Post by mzenker »

Thank you for the clarification!
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by annier »

Matthias,
1.The following links (follow up from your first post) may be useful for future reference to multisoftwares enthusiasts like you and me. Cheers.
Coupling of Elmer with OpenFOAM for MHD by Juris Vencels (juris.vencels at gmaildotcom)
(a) Presentation on MHD simulations with open source softwares elmer and openfoam coupling (February 2, 2017)
(b) Researchgate profile of Juris Vencels
(c) personal blog of Juris Vencels
(d) Mathematical modellling of environmental and technological processes

2. Although i would like to suggest you to use Ubuntu or Linux for such coupling works, i do understand the situation that you need windows platform at this moment. So, please keep going with that.

Yours Sincerely,
Anil Kunwar
Last edited by annier on 20 Aug 2017, 18:06, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by annier »

Hi All,
For Elmer and OpenFoam enthusiasts, Peter has opened a door for coupling these softwares via files I/O and now it is available in Elmer github repository.
1. Elmer2OpenFoamIO module
2. Test case on joule heating
These tutorials illustrate coupling of Elmer results for use in OpenFoam software via files I/O.

Thank you Peter for your guidance and tutorials.

Cheers.

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by annier »

The work by Juris and Peter is brilliant.
Recently, I am trying to install Juris' software https://github.com/jvencels/OpenFOAM_Elmer, in Ubuntu 16.04.

Steps:
1. I have Elmer installed from launchpad.
2. I installed OpenFOAM as mentioned in the link http://openfoam.org/download/4-1-ubuntu/).
3. Then I downloaded Juris' software from the above mentioned link https://github.com/jvencels/OpenFOAM_Elmer in HOME directory.
4. While following the installation or compilation steps, I encountered the following mpi related issue:

Code: Select all

gcc: error: unrecognized command line option ‘--showme:compile’; did you mean ‘--assume-compiled’?
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam4/src/transportModels -I/opt/openfoam4/src/transportModels/incompressible/lnInclude -I/opt/openfoam4/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/TurbulenceModels/incompressible/lnInclude -I/opt/openfoam4/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -I/opt/openfoam4/src/sampling/lnInclude -I../commSplit/lnInclude -I../coupleElmer/lnInclude -DOMPI_SKIP_MPICXX  -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/mhdInterFoam.o -L/opt/openfoam4/platforms/linux64GccDPInt32Opt/lib \
    -limmiscibleIncompressibleTwoPhaseMixture -lturbulenceModels -lincompressibleTurbulenceModels -lfiniteVolume -lfvOptions -lmeshTools -lsampling -L/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib -lPstream -lElmer -lOpenFOAM -ldl  \
     -lm -o /home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/bin/mhdInterFoam
Make/linux64GccDPInt32Opt/mhdInterFoam.o: In function `main':
mhdInterFoam.C:(.text.startup+0xa751): undefined reference to `MPI_Wtime'
mhdInterFoam.C:(.text.startup+0xa7d3): undefined reference to `MPI_Wtime'
mhdInterFoam.C:(.text.startup+0xa83a): undefined reference to `MPI_Wtime'
mhdInterFoam.C:(.text.startup+0xa886): undefined reference to `MPI_Wtime'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_rank'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Abort'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Init'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_group'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_split'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Allreduce'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Bsend'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Buffer_detach'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Recv'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Wait'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Test'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Alltoall'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_size'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Waitall'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Get_count'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_create'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Group_incl'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Probe'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Send'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Irecv'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Comm_free'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Isend'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Finalize'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Buffer_attach'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libPstream.so: undefined reference to `MPI_Group_free'
/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/lib/libElmer.so: undefined reference to `MPI_Barrier'
collect2: error: ld returned 1 exit status
/opt/openfoam4/wmake/makefiles/general:132: recipe for target '/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/bin/mhdInterFoam' failed
make: *** [/home/username/OpenFOAM/username-4.1/platforms/linux64GccDPInt32Opt/bin/mhdInterFoam] Error 1
5. I have recognized that this is the issue of loading openmpi from /usr/lib/openmpi/include for /opt/openfoam4 libraries as I have MOOSE framework software installed with mpich setting in /opt/moose/mpich.

6. Learning more details about mpich and openmpi as i need to run these two systems of mpi for two softwares in a single computer
https://www.psc.edu/images/xsedetrainin ... to_MPI.PDF

7. I made an alias switch on moose environment.
(a) Commented the following MOOSE Environment in ~/.bashrc file and rewrote it in ~/home/username/moose-projects/etc/bashrc file

Code: Select all

# Source MOOSE Environment
if [ -f /opt/moose/environments/moose_profile ]; then
  . /opt/moose/environments/moose_profile
fi
(b) Created an alias for moose in ~/.bashrc file

Code: Select all

alias mooseswitch1='. /home/username/moose-projects/etc/bashrc'
Now,
(i) As I open a terminal, and type mooseswitch1 and in this context, the mpi working is mpich (related to moose environment)

Code: Select all

username@username-Aspire-1602M:~$ mooseswitch1
username@username-Aspire-1602M:~$ which mpirun
/opt/moose/mpich/mpich-3.2/gcc-opt/bin/mpirun
username@username-Aspire-1602M:~$

(ii) And, when I do not load the moose environment, the default mpi of the system is openmpi,

Code: Select all

username@username-Aspire-1602M:~$ which mpirun
/usr/bin/mpirun

This case has to be utilized to install software OpenFOAM_Elmer developed by Juris as OpenFOAM is based upon mpi interface - OpenMPI

8. The installation process was successfully completed in accordance to https://github.com/jvencels/OpenFOAM_El ... /README.md.




Cheers,
Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by annier »

Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
Post Reply