Simulation of the electric field generated by 4 electrodes

Numerical methods and mathematical models of Elmer
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Simulation of the electric field generated by 4 electrodes

Post by bertac »

Hello,
I'm trying to simulate the electric field genrated by 4 electrodes into a material. The electrodes are activated as couple and not all at the same time.
I'm using the "Static Current Solver" to calculate the potential and the "Flux and Gradient Solver" to calculate the gradient of the potential (that should be the electric field)

Since I'm new with elmer, I'm asking if it is possible, and what I have to do, to simulate all the couples of electrodes in the same time but avoiding that the software considers the electrodes as active in the same time.
Infact, if I consider all the electrodes at the same potential, the electric field between the electrodes has zones where it is zero.
Instead I need to calculate the sum of the effect of each couple.

Thanks
Claudio
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Simulation of the electric field generated by 4 electrodes

Post by annier »

Hi Claudio,
As initiated by xiszero for cases related to phasechange solver, is not your case somewhat like switch variable defined UDF to activate your electrodes as per your design.
viewtopic.php?f=3&t=3639&hilit=xiszero

Yours Sincerely
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by raback »

Hi

There is a feature that allows you to calculate the Capacitance Matrix that will give you the binary effect of all electrodes. See the "capacitance of two balls" tutorial.

-Peter
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Simulation of the electric field generated by 4 electrodes

Post by annier »

Hi Claudio,
The tutorial mentioned by Peter can be found as Chapter 6 in the Elmer Gui Tutorial Manual.
Thanks Peter that i have learned about the term capacitance matrix from you.

Yours Sincerely,
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by bertac »

Hi,
thanks for the suggestions.
Just one question.
Since all the materials are conductors (stainless steel and human tissue simulated with water having a specific conductivity), and the relative permitttivty of the stainless steel is not foreseen in the material library, what value do you suggest to use?

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

Re: Simulation of the electric field generated by 4 electrodes

Post by raback »

Hi Claudio

Ok, I failed to note that you're using StaticCurrentSolver, not StatElecSolver. Basically these are the same Poisson equations when you swicth electric conductivity to permittivity.

If stainless steel has large conductivity compared to the tissue you might not need to model it at all, just set potential BCs for the steel. Otherwise maybe the analogy will not work for you.

-Peter
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by bertac »

Hi Peter,
I tried to follow your suggestion, but I receive the following error during solver calculation:
WARNING:: ListFind: Requested property: [Equation], not found
This is the .sif file:

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.ep
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body 1"
  Equation = 1
  Material = 2
  Initial condition = 1
End

Body 2
  Target Bodies(1) = 2
  Name = "Body 2"
  Material = 1
  Initial condition = 2
End

Body 3
  Target Bodies(1) = 3
  Name = "Body 3"
  Material = 1
  Initial condition = 2
End

Body 4
  Target Bodies(1) = 4
  Name = "Body 4"
  Material = 1
  Initial condition = 2
End

Body 5
  Target Bodies(1) = 5
  Name = "Body 5"
  Material = 1
  Initial condition = 2
End

Body 6
  Target Bodies(1) = 6
  Name = "Body 6"
  Material = 1
  Initial condition = 2
End

Solver 1
  Equation = Electrostatics
  Capacitance Matrix Filename = CapMatrix
  Capacitance Bodies = 6
  Calculate Capacitance Matrix = True
  Variable = Potential
  Procedure = "StatElecSolve" "StatElecSolver"
  Calculate Electric Flux = True
  Calculate Electric Energy = True
  Calculate Electric Field = True
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Potential"
  Active Solvers(1) = 1
End

Material 1
  Name = "Austenitic stainless steel (AK Steel 201)"
  Electric Conductivity = 14.60e3
  Heat Conductivity = 16.2
  Youngs modulus = 197.0e9
  Electric Conductivity = 14.60e3
  Electric Conductivity = 14.60e3
  Poisson ratio = 0.3
  Youngs modulus = 197.0e9
  Heat Capacity = 500.0
  Youngs modulus = 197.0e9
  Poisson ratio = 0.3
  Heat expansion Coefficient = 15.7e-6
  Poisson ratio = 0.3
  Porosity Model = Always saturated
  Relative Permittivity = 1000.0
  Mesh Poisson ratio = 0.3
  Electric Conductivity = 14.60e3
  Density = 7810.0
End

Material 2
  Name = "Water (room temperature)"
  Relative Permeability = 0.999992
  Heat Conductivity = 0.58
  Electric Conductivity = 0.6
  Heat Capacity = 4183.0
  Relative Permittivity = 80.1
  Relative Permeability = 0.999992
  Viscosity = 1.002e-3
  Viscosity = 1.002e-3
  Sound speed = 1497.0
  Heat expansion Coefficient = 0.207e-3
  Relative Permittivity = 80.1
  Porosity Model = Always saturated
  Relative Permittivity = 80.1
  Density = 998.3
  Relative Permeability = 0.999992
End

Initial Condition 1
  Name = "InitialCondition 1"
  Potential = 0
End

Initial Condition 2
  Name = "InitialCondition 2"
  Potential = 2800
End

Boundary Condition 1
  Target Boundaries(6) = 1 2 3 4 5 6 
  Name = "Far Field"
  Electric Infinity BC = True
  Potential = 0
  Capacitance Body = 6
  Potential = 0
End

Boundary Condition 2
  Target Boundaries(3) = 7 8 9 
  Name = "CapAgo1"
  Potential = 2800
  Capacitance Body = 1
  Potential = 2800
End

Boundary Condition 3
  Target Boundaries(3) = 10 11 12 
  Name = "CapAgo2"
  Capacitance Body = 2
  Potential = 2800
End

Boundary Condition 4
  Target Boundaries(3) = 13 14 15 
  Name = "CapAgo3"
  Capacitance Body = 3
  Potential = 2800
End

Boundary Condition 5
  Target Boundaries(3) = 16 17 18 
  Name = "CapAgo4"
  Capacitance Body = 4
  Potential = 2800
End

Boundary Condition 6
  Target Boundaries(3) = 19 20 21 
  Name = "CapAgo5"
  Capacitance Body = 5
  Potential = 2800
End
Why do it says that there is a missing equation? I don't see the error.
Please could you give me a suggestion?
Thanks
Claudio

EDIT: perhaps is it because in the bodies of the electrodes I didn't specify the equation? I did this to say to the solver to calculate only the external material as you suggested. Is it correct?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by raback »

Hi

Bodies 2..6 should include an equation number too, if you have them included. The equation could be empty though if you have nothing to solve.

-Peter
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by bertac »

Hi Peter,
the solver doesn't accept an empty or zero value for the equation.
So how can I say it to solve only the external material?

Thanks
Claudio
bertac
Posts: 10
Joined: 05 Sep 2016, 16:59
Antispam: Yes
Location: Carpi (Modena) - Italy
Contact:

Re: Simulation of the electric field generated by 4 electrodes

Post by bertac »

Hi Peter,
I checked again with more detail the tutorial you suggested me.
Now I found the way to have the solver working: I have to eliminate the body definition of the electrodes leaving only one body, as explained in the tutorial.
The sif file is now:

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = case.sif
  Post File = case.ep
End

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body 1"
  Equation = 1
  Material = 1
End

Solver 1
  Equation = Electrostatics
  Capacitance Matrix Filename = CapMatrix.txt
  Capacitance Bodies = 5
  Calculate Capacitance Matrix = True
  Variable = Potential
  Procedure = "StatElecSolve" "StatElecSolver"
  Calculate Electric Energy = True
  Calculate Electric Field = True
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Equation 1
  Name = "Potential"
  Active Solvers(1) = 1
End

Material 1
  Name = "Water (room temperature)"
  Relative Permeability = 0.999992
  Heat Conductivity = 0.58
  Electric Conductivity = 0.6
  Heat Capacity = 4183.0
  Relative Permittivity = 80.1
  Relative Permeability = 0.999992
  Viscosity = 1.002e-3
  Viscosity = 1.002e-3
  Sound speed = 1497.0
  Heat expansion Coefficient = 0.207e-3
  Relative Permittivity = 80.1
  Porosity Model = Always saturated
  Relative Permittivity = 80.1
  Density = 998.3
  Relative Permeability = 0.999992
End

Boundary Condition 1
  Target Boundaries(6) = 1 2 3 4 5 6 
  Name = "Far Field"
  Electric Infinity BC = True
  Potential = 0
  Potential = 0
End

Boundary Condition 2
  Target Boundaries(3) = 7 8 9 
  Name = "CapAgo1"
  Potential = 2800
  Capacitance Body = 1
  Potential = 2800
End

Boundary Condition 3
  Target Boundaries(3) = 10 11 12 
  Name = "CapAgo2"
  Capacitance Body = 2
  Potential = 2800
End

Boundary Condition 4
  Target Boundaries(3) = 13 14 15 
  Name = "CapAgo3"
  Capacitance Body = 3
  Potential = 2800
End

Boundary Condition 5
  Target Boundaries(3) = 16 17 18 
  Name = "CapAgo4"
  Capacitance Body = 4
  Potential = 2800
End

Boundary Condition 6
  Target Boundaries(3) = 19 20 21 
  Name = "CapAgo5"
  Capacitance Body = 5
  Potential = 2800
End
The problem I'm having now is that the potential is zero everywhere and the solver log says:

Code: Select all

Number of permutation BCs
 Capacitance body:           1 no       12722
 Capacitance body:           2 no       13914
 Capacitance body:           3 no       13702
 Capacitance body:           4 no       13434
 Capacitance body:           5 no       14022
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
SetDirichletBoundaries: Number of dofs set: 6144
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
StatElecSolve:  Assembly (s)          :   47.372000000000000
SolveSystem: Solution trivially zero!
StatElecSolve:  Solve (s)             :   0.0000000000000000
StatElecSolve:  Tot. Electric Energy  :   0.0000000000000000
...
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    2.35765-312
StatElecSolve:   1  2   -4.63156-313
StatElecSolve:   1  3   -4.59470-313
StatElecSolve:   1  4   -4.54810-313
StatElecSolve:   1  5   -4.65034-313
StatElecSolve:   2  2    2.35765-312
StatElecSolve:   2  3   -4.80197-313
StatElecSolve:   2  4   -4.75536-313
StatElecSolve:   2  5   -4.85761-313
StatElecSolve:   3  3    2.35765-312
StatElecSolve:   3  4   -4.71850-313
StatElecSolve:   3  5   -4.82075-313
StatElecSolve:   4  4    2.35765-312
StatElecSolve:   4  5   -4.77414-313
StatElecSolve:   5  5    2.35765-312
StatElecSolve: Capacitance matrix was saved to file capmatrix.txt
ComputeChange: SS (ITER=1) (NRM,RELC): (  0.0000000      0.0000000     ) :: electrostatics
WritePostFile: Saving results in ElmerPost format to file ./case.ep
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
Where is my error. now?

The tutorial says that the potential of the two electrodes was 1V and 0V
Please, could you tell me how these values have been set?

Thanks again
Claudio
Post Reply