how to evaluate electric field as function of time

Numerical methods and mathematical models of Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: how to evaluate electric field as function of time

Post by mzenker »

Hi,
bryonneufeld wrote: My source term is constant in time but has some spatial variation.
The source term is partial rho/partial t, right? Charge should be adding up at each time step.
I am not sure that I understand your setup. Could you post a sketch of your geometry?
Without knowing your geometry, I would say from your sif file that since there is no variation with time, the result doesn't change with time.
Or maybe the timely variation is so quick that your timesteps (1 s) do not resolve it. What happens if you take smaller time steps?

HTH,

Matthias
bryonneufeld
Posts: 20
Joined: 20 Jun 2014, 02:14
Antispam: Yes

Re: how to evaluate electric field as function of time

Post by bryonneufeld »

Thank you, Matthias. Sorry for sending the duplicate PM earlier.

The geometry is just a slab of dielectric, like a box (1 m X 1 m X 0.1 m). There is a boundary condition on each side (potential = 0).

I have used smaller timesteps (like 1e-06) but the result shows no time dependence as far as I can tell.

Take an analogy with the heat equation: if you have a constant heat source, the material heats up linearly with time (roughly speaking, there may be some diffusion).

Here I have a constant source of electric charge deposition in the material (d rho/dt), but the fields aren't increasing in time. Also, if I turn off the source at some timestep, then the fields immediately go back to zero.

Does the Stat Current Solver conserve charge? Does it allow charge to flow in the material? Perhaps I am missing something.
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: how to evaluate electric field as function of time

Post by raback »

Hi

StatCurrentSolver does not include any time derivative. I guess the equation in post 8 should be the one to solve.

-Peter
bryonneufeld
Posts: 20
Joined: 20 Jun 2014, 02:14
Antispam: Yes

Re: how to evaluate electric field as function of time

Post by bryonneufeld »

Thanks, Peter. I modified the Stat Current solver to have a mass matrix, as seen below. It appears to work qualitatively, but I haven't validated it yet.

However, it appears to be on the right track one way or another. Does this look right to you? Pe is the permittivity matrix (multiplied by vacuum perm.).

Code: Select all

!------------------------------------------------------------------------------
!        The Poisson equation
!------------------------------------------------------------------------------
         DO p=1,N
           DO q=1,N
             A = 0.d0
			 B = 0.d0
             DO i=1,DIM
               DO J=1,DIM
                 A = A + C(i,j) * dBasisdx(p,i) * dBasisdx(q,j)
		 B = B + Pe(i,j) * dBasisdx(p,i) * dBasisdx(q,j)
               END DO
             END DO
             StiffMatrix(p,q) = StiffMatrix(p,q) + S*A
	     MassMatrix(p,q) = MassMatrix(p,q) + S*B
           END DO
           Force(p) = Force(p) + S*L*Basis(p)
         END DO
bryonneufeld
Posts: 20
Joined: 20 Jun 2014, 02:14
Antispam: Yes

Re: how to evaluate electric field as function of time

Post by bryonneufeld »

Just as an update I was able to test my modification to the Stat Current solver against a well-known 1D tool and it matches up well. This comparison is only for a simple geometry, but looks like the approach is basically correct.
Post Reply