# [Getdp] given current => calculate the current density

Lars Rindorf Lars.Rindorf at teknologisk.dk
Mon Apr 21 13:27:36 CEST 2008

```Peter

I have taken a look at your example. Your .pro file testB seems right to me. In the mesh file there some errors with duplicate meshes. If you span some points with lines and make surfaces from these lines, then gmesh does not recognize if it meshes the same surface several times. To be more specific, when you use the "extrude" command then gmesh creates both the necessary surfaces and volumes. To see the numbers assigned to these surfaces and volumes then open your file in gmesh, and click "tools" in the menu and "visibility".

I hope this helps

Kind regards
Lars Rindorf

-----Oprindelig meddelelse-----
Fra: getdp-bounces at geuz.org [mailto:getdp-bounces at geuz.org] På vegne af Peter Kaufmann
Sendt: 18. april 2008 17:43
Til: getdp at geuz.org
Emne: [Getdp] given current => calculate the current density

Hello!

My problem sounds simple (and I think it have to be simple), but I did not manage to solve it.

I want to calculate the current density in a 3D Volume. The current on two surfaces are given (incoming and outgoing), the other surfaces are
isolated:
______
/_____/|
incoming |    | | outgoing
=>      |    | | =>
current  |____|/  current

My first attempt (testA.pro) was to set two Dirichlet Constraints (incoming and outgoing current), use the equation of continuity and calculate the current density direct via

Galerkin { [  Dof{j} ,  {d j} ] ;
In v_conductor ; Jacobian JVol ; Integration I1 ; }

... but I only get a current density on the two surfaces.

My second attempt was to calculate first the scalar potential and then via PostProcessing the current density (testB.pro). The problem here is - as far as I understand the problem - the Neumann Constraint on the surfaces. My thoughts about this:

Generally

j[] = - sigma[] * {Grad{ phi }

holds. So on the surfaces I could write the Neumann Constraint using the following Galerkin equation:

Galerkin { [ j[] + sigma[] * {Grad phi} , Dof {phi} ] ;
In s_current_in ; Jacobian JSur ; Integration I1 ; }

... but running getdp I only get the error message "Wrong Initial
Constraints: remaining Dof(s) with non-fixed initial conditions".

Maybe some one can give me a hint or an example?

Is there a way to calculate the size of a surface (for example integrate
1 over the surface) in the "Function" section and use it in the Constraint conditions?

Kind regards,

Peter Kaufmann

```