Up to now, we have only considered inviscid, incompressible flows. Without going into the details, this type of problems require the solution of two main subproblems: solving a Poisson equation for the pressure and an advection equation for the momentum and tracers with the corresponding boundary conditions.
Gerris can also solve a third class of subproblems: diffusion equations. Diffusion equations are similar to Poisson equations (they both involve Laplacian operators) and can be solved efficiently using the same multigrid solver we use for the pressure.
In practice adding diffusion to a given tracer is as simple as adding:
... GfsSourceDiffusion {} T 0.01 ...to the parameter file, where 0.01 is the value of the diffusion coefficient.
What if we want to modify the tracer example above so that now the half-cylinder itself is a (diffusive) source of tracer rather than the inlet? We need to be able to impose this boundary condition on the embedded solid surface. On embedded solids, the default boundary conditions for the diffusion equation is Neumann (zero flux) for tracers and Dirichlet (no-slip) for the velocity components. To change that use
... GfsVariableTracer T GfsSourceDiffusion {} T 0.001 GfsSurfaceBc T Dirichlet 1 ...and change the inlet boundary condition back to
... GfsBox { left = GfsBoundary { GfsBcDirichlet U 1 GfsBcDirichlet V 0 } } ...