Coupling OpenFOAM with Elmer?

General discussion about Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Coupling OpenFOAM with Elmer?

Post by mzenker »

Hi,

in my company, we are thinking about building a simulation model containing fluidics (multiple components and phases), elasticity, electrical currents, and heat flow. For the fluidics part, OpenFOAM seems to be the best tool, whereas the rest can probably better be done in Elmer. So we are asking ourselves:

Can Elmer and OpenFOAM be coupled?

I have searched this forum and the web and found two projects attempting to do that:

ElmerFOAM (http://illinoisrocstar.github.io/ElmerF ... index.html, thanks to Anil for the link in his "using multiple softwares..." thread), which seems to focus on mechanics,
OpenFOAM_Elmer (https://github.com/jvencels/OpenFOAM_Elmer), focused in Magnetohydrodynamics.

Both seem to work under Linux only, and both require patched versions of Elmer and OpenFOAM.
We are working under Windoze here, so Linux-only solutions would require a dedicated (or virtual) machine - our IT department would prefer to avoid that...
So at a first glance, none of those seems ideal to me.

Naively, I would imagine that one could write a solver for Elmer calling OpenFOAM at each iteration step, thereby implementing coupled iterations. But that is perhaps too naive and/or would be terribly inefficient.
Nevertheless, there seems to be a mechanism in OpenFOAM to communicate with an external code using file-based data transfer: http://www.openfoam.com/version-v3.0+/s ... ontrol.php. I didn't look closer into that, however, but it may help.

So my questions are: has someone out there already tried (or thought about) such a coupling between Elmer and OpenFOAM? Does someone know more than I have found out so far? Has someone tried any of the two projects mentioned above?

Thanks for any input...

Matthias
campo
Posts: 13
Joined: 04 Mar 2016, 14:35
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by campo »

OpenFoam runs only over Linux, and you can´t avoid this OS.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Coupling OpenFOAM with Elmer?

Post by mzenker »

campo
Posts: 13
Joined: 04 Mar 2016, 14:35
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by campo »

You mean Bluecfd I guess.Dont know if this mod is isolated from windows.
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

This is an active topic. I have been following the OpenFOAM_Elmer work by vencels (userid in this forum) and must applaud for the developments. This utilizes MPI for the coupling and offers superior scalability possibilities. I would not turn it down simply because the main application field is MHD. At least the Elmer part is completely generic. The OpenFOAM will require some tailoring.

Now the downside of the MPI coupler is that your OpenFOAM and Elmer versions should be fully compatible in their use of MPI library. In Windows you might end up having to compile them for the compatibility and that could be even bigger stretch for the IT department.

There is also a file based hierarchical coupler from Elmer to OpenFOAM that we might release. It is not suited for coupling each timestep but on the other hand avoids some other challenges.

Do you intend to couple fields on boundary or on bulk? Both of the above assume coupling on the bulk only.

What is your Reynolds number? What kind of multiphase flow do you have?

You should be able to try out VMs simply by asking your IT department to add a VirtualBox player. After that you have a sandbox to do anything within the VM.

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

Re: Coupling OpenFOAM with Elmer?

Post by mzenker »

Hi Peter,

thank you for your informative reply.

I was not intending to turn OpenFOAM_Elmer down just because it was aimed for MHD. What made me think it might not be the solution for us was rather the need to patch both Elmer and OpenFOAM and run the whole system under Linux - which I would love to do personally, but it would require struggling with our IT. But maybe it would finally not be that problematic, and we would be able to set that up inside a virtual machine.
The coupler from Elmer to OpenFOAM you mentioned would also be worth a closer look.

That said, we are still in a very early exploratory phase. We have a new colleague with fresh knowledge in OpenFOAM, so we are discussing the possibilities this would imply. We have not started to go into the details, to estimate Reynolds numbers or to evaluate if we really need bulk coupling.
The multiphase case would be a water jet in air impinging on an elastic surface.

I think thanks to your hints I have a rough idea of what is possible.
Now we have to discuss internally what we want to do more exactly, and how to proceed. I will certainly come back with questions if we know better what we need.

Thank you,

Matthias
campo
Posts: 13
Joined: 04 Mar 2016, 14:35
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by campo »

Hi Matthias

I would use an external usb ssd hardrive rather than virtualization for Linux.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Coupling OpenFOAM with Elmer?

Post by mzenker »

Hi campo,

you mean a Linux installed on an external disk, so we would boot the entire PC to Linux without modifying it? That would be another variant indeed.
But we are not yet at that point - first we need to make up our mind on what exactly we want to do, and what we need for it.

Thanks,

Matthias
campo
Posts: 13
Joined: 04 Mar 2016, 14:35
Antispam: Yes

Re: Coupling OpenFOAM with Elmer?

Post by campo »

Yes that is, booting from usb. Believe me, you hardly notice is an external harddisk.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Coupling OpenFOAM with Elmer?

Post by mzenker »

I believe you... :)
But as I said, we are not there yet.
Post Reply