Subject: [Fenics] Fenics for 3D Absorption/Diffusion Problems

From: Lorenzo Isella <[email-masked]>
Date: Mon, 28 Jun 2010 14:54:47 +0200

Dear All,
I am trying to migrate from Comsol to Fenics.
Now, one problem I need to be able to tackle with Fenics (a problem
which is conceptually simple) is the following.
Consider (in 3D) a large box (computational domain). To fix the ideas,
let us say that the box has size L=30 and it stretches from -15 to 15
along x, y and z. Inside the box I have what in aerosol science is
called an aggregate i.e. static configuration of hard spheres, where
every sphere is in touch with at least another sphere.
To fix the ideas, consider, as a minimal example two spheres having both
R=1 (in some units) and whose centres are in positions (-1,0,0) and
(1,0,0).
Now, the problem I would like to solve is a diffusion problem (we can
set D=1 if we want)

D\nabla^2\rho=0 with boundary conditions 
\rho=1 on the sides of the box
and \rho=0 on the aggregate surface.
No computations need to be carried out for the inside of the spheres.

I need to be able to calculate then fairly standard quantities like the
concentration \rho(x,y,z) inside the box and the diffusive flux
orthogonal to the aggregate surface.
I know that this specific example, being in the end of the day a linear
chain, is axisymmetric and hence 2D, but the more general cases I have
in mind (to be tackled when and if I get started with Fenics) are not.
Can anyone point me in the right direction, maybe with a minimal script
I can then study and fine-tune according to my needs?
It should not be tremendously complicated for someone who is experienced
in running much more complicated simulations with Fenics.
Any help is appreciated.
Cheers

Lorenzo

---

From: Anders Logg <[email-masked]>
Date: Mon, 28 Jun 2010 15:15:04 +0200

> in running much more complicated simulations with Fenics.

This sounds like you just want to solve Poisson's equation. Is that
right? Then the steps are:

1. Copy the Poisson demo

2. Create the geometry for your problem (box minus spheres). You should
be able to do that easily either in Netgen (where you can say things
like box - sphere - sphere) or directly in DOLFIN (see the demo in
demo/mesh/smoothing).

--
Anders

---

From: Lorenzo Isella <[email-masked]>
Date: Mon, 28 Jun 2010 15:39:25 +0200

> right? Then the steps are:

Precisely.

> like box - sphere - sphere) or directly in DOLFIN (see the demo in

Right. Some probably very basic questions
(1) I have just downloaded Dolfin, but there is not demo/mesh/smoothing.
The closest I could find is /demo/mesh/refinement/ . Is that right?
(2) I believe that if I use netgen, then I will use it only to generate
the mesh, save it as a proper file format and then load it into fenics.

Is that the right pipeline?
Cheers

Lorenzo

---

From: Anders Logg <[email-masked]>
Date: Mon, 28 Jun 2010 15:57:37 +0200

> The closest I could find is /demo/mesh/refinement/ . Is that right?

It was added after the release of 0.9.7 which I expect is what you are
using. Try the development version or wait until we have release 0.9.8
which should happen on Thursday.

> Is that the right pipeline?

Yes.

--
Anders