Electrostatics

Numerical methods and mathematical models of Elmer
Post Reply
cwarner7_11
Posts: 5
Joined: 09 Jul 2010, 22:30

Electrostatics

Post by cwarner7_11 »

I am trying to learn the Electrostatics solver in Elmer, and so far, I get very nice renditions of equipotential surfaces for a 3D arrangement of two electrodes (a very simple model that can be compared to expectations), but I do not get anything even remotely useful when I try to look at the electric field, even when I reduce the model to a 2D plane. I have tried looking at the data in the *.ep file to see if possibly I could export the information into, say, Scilab, and plot the vector fields that way, but the format of the output is not intuitive.
Can anyone give me suggestions in how one can visualize the electric field in the Electrostatics model?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electrostatics

Post by raback »

Hi, You could apply the FluxSolver (see Models Manual) on the electrostatic field to obtain the electric field. This way the field is computed with optimal accuracy using Galerkin within ElmerSolver. Many postprocessors also include the possibity to compute gradients. So does ElmerPost. You can give the command "math gradpot=grad(Potential)". This is not quite as accurate though as the field is computed by simple averaging over elements. - Peter
cwarner7_11
Posts: 5
Joined: 09 Jul 2010, 22:30

Re: Electrostatics

Post by cwarner7_11 »

Hi, You could apply the FluxSolver (see Models Manual) on the electrostatic field to obtain the electric field. This way the field is computed with optimal accuracy using Galerkin within ElmerSolver. Many postprocessors also include the possibity to compute gradients. So does ElmerPost. You can give the command "math gradpot=grad(Potential)". This is not quite as accurate though as the field is computed by simple averaging over elements. - Peter
Peter-
Thanks for the reply.
I have read of the FluxSolver in the Models Manual, but it does not appear to be included in the particular distribution I have installed (Elmer 5-5-0.svn.4214.dfsg-1ubuntu2, installed from Ubuntu repositories)- maybe I am looking in the wrong place (/usr/Share/ElmerGUI/edf and edf-extra, which include the other solvers). I note that the equation editor for Electrostatics offers the option to "Calculate Electric Flux" in the "Solver Specific Options" in "Edit Solver Settings". Is this the same as the FluxSolver? If so, I don't think I am using something right. A key line in my *.ep file is " 24544 133055 8 1 scalar: Potential scalar: Electric.field.1 scalar: Electric.field.2 scalar: Electric.field.3 scalar: Electric.flux.1 scalar: Electric.flux.2 scalar: Electric.flux.3 scalar: Electric.energy.density" which I interpret to mean that I am getting three scalars for each vector field, but no combination of these three different scalars or combinations of the various field scalars with the other two scalers gives me anything even remotely resembling what I would expect to see. When I look at the data in the *.ep file, I get the impression that the pertinent scalars are x, y, z components for the vectors, but there is no clue as to how the sets of readings are ordered; i.e., what are the coordinates of the starting point of each vector?). If I could correlate the sets of data points with specific nodes or body centroids, I could generate a set of coordinates in a spreadsheet or Scilab, and generate the plots I am after.

At this stage, "accuracy" is not so critical to me, although the tip about Galerkin (whatever that is) may be quite useful when I start doing serious work. What I am after right now is an understanding of how to use the software and interpret the output- so I use a pretty simple model for which I can find a "textbook" illustration to compare the results to. I do not understand how to use the command "math gradpot=grad(Potential)". Can you point me to an instruction document?

Charlie
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electrostatics

Post by raback »

Hi

Ok, I had forgotten about the built-in feature to compute fields in the electrostatics solver. The problem is that this is not internally recognized as a vector. In ElmerPost there only as 3 scalar components and not a vector, create the vector by writing the following in the ElmerPost command line

Code: Select all

math efield = tovector(Electric.field.1,Electric.field.2,Electric.field.3)
math elfield_abs = sqrt(vdot(efield,efield))
Thereafter ElmerPost treats this efield as vector variable.

The FluxSolver is still an option but it is not included in ElmerGUI so you have to manually add it to the .sif file.

-Peter

Edit: I added the missing closing parenthesis
cwarner7_11
Posts: 5
Joined: 09 Jul 2010, 22:30

Re: Electrostatics

Post by cwarner7_11 »

Thank you very much (except, you missed a closing parenthesis in your command instructions!). Thi gives me something like what I expect in 2D, but not in 3D, which tells me exactly what I needed to know- there is something wrong with my 3D modeling approach. I may be using too fine a mesh, or maybe my basic geometry is all wrong for 3D...Gives me directions to explore...
By the way, I am exporting *.unv mesh from Salome. When I try to use the "autoclean" function in Elmergrid, it screws up the face groups and boundaries, but when I open the exported mesh directly in ElmerGUI without trying to clean it up, I get what I am after...
Post Reply