meaning of facet integrals in dg poisson

Asked by Chaffra Affouda

I am trying to implement a finite volume discretization to solve the drift-diffusion equations in semiconductor? I am assuming I have to use something similar to the dg-poisson demo.

What is the physical meaning for the extra terms in (ds, dS) in the dg-poisson demo? I am assuming they represent so type on conservation law. For example in 1D how can I write the fact that the current entering the cell is the same as the current exiting the cell. I define the current as J = grad(u). Do I add - dot(jump(v, n), avg(J))*dS to my form?

---------------from dg poisson demo-----------------------------------------
# Define variational problem
a = dot(grad(v), grad(u))*dx \
   - dot(grad(v), u*n)*ds \
   - dot(v*n, grad(u))*ds \
   + gamma/h*v*u*ds \
   - dot(avg(grad(v)), jump(u, n))*dS \
   - dot(jump(v, n), avg(grad(u)))*dS \
   + alpha/h_avg*dot(jump(v, n), jump(u, n))*dS
L = v*f*dx

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Chaffra Affouda (chaffra) said :
#1

Maybe I should ask a simpler question:

I have an unknown function u. I defined J = grad(u). How can I write the fact that I want J to be continuous at all interior facets?

Q = FunctionSpace(mesh,'CG',2)
n = FacetNormal(mesh)
v = TestFunction(Q)
a = inner(grad(u),grad(v))*dx
a += v*jump(J,n)*dS #continuity condition??
L = -f*v*dx

I get this error when solving:
UFLException: Form argument must be restricted.

Revision history for this message
Anders Logg (logg) said :
#2

On Thu, May 24, 2012 at 02:30:51PM -0000, Chaffra Affouda wrote:
> Question #198108 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/198108
>
> Chaffra Affouda gave more information on the question:
> Maybe I should ask a simpler question:
>
> I have an unknown function u. I defined J = grad(u). How can I write the
> fact that I want J to be continuous at all interior facets?

It won't be continuous since u is only continuous (not C^1).

> Q = FunctionSpace(mesh,'CG',2)
> n = FacetNormal(mesh)
> v = TestFunction(Q)
> a = inner(grad(u),grad(v))*dx
> a += v*jump(J,n)*dS #continuity condition??

???

> L = -f*v*dx
>
> I get this error when solving:
> UFLException: Form argument must be restricted.

You must restrict J on the interior facets since it can (will) be
discontinuous. Apply either ('+'), ('-') or avg. Check the DG
examples.

--
Anders

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) said :
#3

On 25 May 2012 09:25, Anders Logg <email address hidden> wrote:
> Question #198108 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/198108
>
>    Status: Open => Answered
>
> Anders Logg proposed the following answer:
> On Thu, May 24, 2012 at 02:30:51PM -0000, Chaffra Affouda wrote:
>> Question #198108 on DOLFIN changed:
>> https://answers.launchpad.net/dolfin/+question/198108
>>
>> Chaffra Affouda gave more information on the question:
>> Maybe I should ask a simpler question:
>>
>> I have an unknown function u. I defined J = grad(u). How can I write the
>> fact that I want J to be continuous at all interior facets?
>
> It won't be continuous since u is only continuous (not C^1).
>
>> Q = FunctionSpace(mesh,'CG',2)
>> n = FacetNormal(mesh)
>> v = TestFunction(Q)
>> a = inner(grad(u),grad(v))*dx
>> a += v*jump(J,n)*dS #continuity condition??

v should be v('+') or v('-'), to restrict it to one of the cells
adjacent to the facet, at least that will compile,
but see example on the biharmonic equation in

K. B. Ølgaard, A. Logg and G. N. Wells (2008). Automated Code
Generation for Discontinuous Galerkin Methods, SIAM Journal on
Scientific Computing, 31(2), pp. 849-864, [doi:10.1137/070710032],
[arXiv:1104.0628].

and the references therein on how to enforce continuity of gradients
in a weak sense.

> ???
>
>> L = -f*v*dx
>>
>> I get this error when solving:
>> UFLException: Form argument must be restricted.
>
> You must restrict J on the interior facets since it can (will) be
> discontinuous. Apply either ('+'), ('-') or avg. Check the DG
> examples.
>
> --
> Anders
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.

Can you help with this problem?

Provide an answer of your own, or ask Chaffra Affouda for more information if necessary.

To post a message you must log in.