← Back to team overview

yade-users team mailing list archive

Re: Coupling Yade and Comsol


Dear Bruno, (and CC to Janek and Vaclav )

[Could you please kindly confirm safe receipt of this message, so that
I know all the email addresses are correct?]

Fisrt of all, Bruno, thanks for your kind answer. It was a
pleasure talking to you today.

Dear Andrea
I was thinking to the problem of coupling comsol with Yade.

The general idea, in our project (DEM modelling of internal erosion
processes in e.g. earth dams - boss : Felix Darve), is that comsol will
be used for a preliminary study of the flow inside the granular
material, in order to develop a simplified modelling for the fluid
(based on averaged quantities in each void). At the end, the simplified
model will be implemented in Yade itself, so that we don't need to
couple comsol and Yade directly (at least this is our current idea).

I can see what you are trying to do. The upscaling from Stokes
to Darcy was the topic of my D.E.A., and of part of my Ph.D.
thesis. Your problem seems, however, a bit more complicated
than just that, as the internal erosion might create
wormhole-like fluidized-bed regions where Darcy's law is not
necessarily valid anymore. Have you already developed a
conceptual macroscopic model for this kind of flow?

Wormholes are also a point of great concern in other areas in
which our division is involved, i.e., the formation of
wormholes as a consequence of the injection of supercritical
CO2 and levees stability (see hurricane Katrina's damage).

Your problem is a bit more difficult (unless you work on xml files, but
as I told you, it will take a lot of time). The question is : is it
possible to link comsol with external plugins?

I am a longtime Comsol user (since the Femlab 2.1 version). I
have never had the need to interface with external libraries,
but this could be easily implemented by running the
corresponding Matlab script.

or (the reverse scenario)
is it possible to use comsol dll's as external plugins for Yade?

This could be more complicate, yet still doable.

In both cases, the main questions are on the comsol side
(which I don't know yet - only my colleague do).

If one of these two solutions is possible, then you can transfer data
via RAM, and fast updates of the geometry/fluid forces should be possible.

For the kind of preliminary study that I am conducting, I am
not particularly concerned with execution speed, at this stage
at least. I would be satisfied with a very simple "catch the
ball" model that could give some indication on the relevant
physical parameters of the jet erosion model. Later, we could
optimize the implementation by merging the relative libraries.

If not, well, you can still transfer data via the hard drive, but a
simple text file - or even a binary file - containing only the relevant
data will be a lot more efficient than the xml file, and this is easy to

At this stage, I would definitely favor this simple solution,
and this (most likely) will give me a little more grasp on how
Yade actually works.

Janek Koziky and Vaclav Smilauer may have interesting ideas on this
problem. I hope they won't tell you to implement a comsol-like code in
Yade though...

I also hope not :)

Janek, Vaclav: here is a very short summary of what I have
discussed with Bruno earlier. I would appreciate your take on
this and if you could get me started on the yade part.

I am developing a geomechanical model for a borehole breakout
that has been conceptualized as follows:

(1) a packing of (rigid) sand grains (of spherical shape) is
hold together by friction and confining stress;

(2) a jet of water is directed against the internal wall of
this borehole to apply normal and tangential stresses to the
individual grains in the packing;

(3) hydrodynamic forces and torques acting on the individual
grains are then passed to a DEM code to verify the breaking of
the grain bonds, remove the grains with a broken link,
recalculate the equilibrium position for the packing,

(4) pass the new geometric configuration to the fluid flow code
to recalculate stresses -> goto (2)

I have modeled the hydrodynamic stresses by means of COMSOL
Multiphysics (see attached), and I now need to pass this information to a DEM

Any help on how to start the coupling with yade will be highly

Another question is : can you use comsol on a linux platform?
Yade is supposed to be portable on windows platforms. Somebody even
compiled it on windows before if I remember correctly. Most users work
on linux however, and developpers too, so you would have a better
technical support on linux.
Another thing is that, on linux, different applications can open and
modify one file, at the same time. I'm not sure this is possible on windows.

There is absolutely no problem in using Comsol on a Linux
platform: I am actually running both Yade and Comsol on the
same Kubuntu/Linux 64bit platform (haven't tried yet on a 32bit
but it should be even easier)

Anyway, this is a very interesting project!
Best Regards


p.s. I am a geotechnical engineer, so i have little - if any - knowledge
regarding fluid mechanics. I will probably learn a lot in the comming
years (I will have too).

I agree, this is a very interesting project, and I think it
would be great if we could start some kind of a collaboration
to bring together our different expertise. As I said earlier, I
do have experience in fluid flow modeling

Looking forward to hearing your thoughts, advices on this

Bien amicalement,


Andrea Cortis, PhD


Earth Sciences Division, 90-1116
Lawrence Berkeley National Laboratory
1 Cyclotron Road Berkeley,
CA  94720 USA
phone: 1-510-495-2507
fax: 1-510-486-5686
email: acortis@xxxxxxx

Attachment: flow_field.eps
Description: PostScript document

Follow ups