How to simulate electric field around a livewire?

The graphical user interface of Elmer
sprite
Posts: 7
Joined: 04 Nov 2015, 15:31
Antispam: Yes

How to simulate electric field around a livewire?

Post by sprite »

Hello everyone.
I'm a beginner of elmer. I want to simulate electric field around a livewire. I constructed a box(air) and a cylinder(wire) in it. I set the material of cylinder to copper and the box to air. Add an electrostatics equation to the box and a static current conduction to the cylinder. Then boundary condition: 5V on one side of the cylinder and 0V on the other side. When I click Run-start Solver, I get a sigsegv error...

Code: Select all

ELMER SOLVER (v 8.0) STARTED AT: 2015/11/10 18:20:15
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 8.0 (Rev: Release, Compiled: 2015-05-04)
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif

LoadMesh: Base mesh name: ./.

MAIN: -------------------------------------


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  ffffffffffffffff
Can anyone give me some help?
Thank you.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to simulate electric field around a livewire?

Post by mzenker »

Hi,

the static current conduction solver can also calculate the electric field, so you can use it for air also. AFAIK you can get problems if you couple electrostatic and static current solvers.
You might also need a BC at the external sides of the air cylinder.
If the problems persist, it is always a good idea to post the sif file so that people can have a look at it.
EDIT: I was too quick with my reply: You seem to have a more basic problem here - ElmerSolver does not find the mesh. Do you use the GUI (which is always a good idea especially for beginners), or did you do your setup manually?

HTH,

Matthias
sprite
Posts: 7
Joined: 04 Nov 2015, 15:31
Antispam: Yes

Re: How to simulate electric field around a livewire?

Post by sprite »

mzenker wrote:Hi,

the static current conduction solver can also calculate the electric field, so you can use it for air also. AFAIK you can get problems if you couple electrostatic and static current solvers.
You might also need a BC at the external sides of the air cylinder.
If the problems persist, it is always a good idea to post the sif file so that people can have a look at it.
EDIT: I was too quick with my reply: You seem to have a more basic problem here - ElmerSolver does not find the mesh. Do you use the GUI (which is always a good idea especially for beginners), or did you do your setup manually?

HTH,

Matthias
Thank you for your reply.
As your advice, I tried to apply both air box and copper cylinder the same equation (static current). Still sigsegv.(I'm using elmer GUI in windows.)
the sif file generated by elmer:

Code: Select all

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

Simulation
  Max Output Level = 4
  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
End

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

Solver 1
  Equation = Static Current Conduction
  Variable = Potential
  Procedure = "StatCurrentSolve" "StatCurrentSolver"
  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 = "Equation 1"
  Active Solvers(1) = 1
End

Material 1
  Name = "Air (room temperature)"
  Viscosity = 1.983e-5
  Heat expansion Coefficient = 3.43e-3
  Heat Conductivity = 0.0257
  Relative Permittivity = 1.00059
  Sound speed = 343.0
  Heat Capacity = 1005.0
  Density = 1.205
End

Material 2
  Name = "Copper (generic)"
  Heat expansion Coefficient = 16.5e-6
  Electric Conductivity = 59.59e6
  Electric Conductivity = 59.59e6
  Heat Conductivity = 401.0
  Sound speed = 3810.0
  Heat Capacity = 385.0
  Mesh Poisson ratio = 0.34
  Density = 8960.0
  Poisson ratio = 0.34
  Youngs modulus = 115.0e9
End

Boundary Condition 1
  Target Boundaries(1) = 8 
  Name = "BoundaryCondition 1"
  Potential = 5
End

Boundary Condition 2
  Target Boundaries(1) = 2 
  Name = "BoundaryCondition 2"
  Potential = 0
End
then I add "Electric Conductivity = 0" to air, it seems working well. But I can only get potential of the wire, but not around the wire.

How can I know potential in the air box?
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to simulate electric field around a livewire?

Post by mzenker »

Sorry, I was still too quick and did not look close enough. Elmersolver finds the mesh and crashes after that. I think the crash was due to the missing electric conductivity.

Now what happens if you set the conductivity of air to a very small, but nonzero value?

And - I might have been wrong by advising you not to use both electrostatic and static current solvers. Now that the crash is fixed, you could try to go back to your initial attempt, but take care to specify all needed material properties (see models manual).

HTH,

Matthias
sprite
Posts: 7
Joined: 04 Nov 2015, 15:31
Antispam: Yes

Re: How to simulate electric field around a livewire?

Post by sprite »

Hello Matthias.
About the sigsegv, it seems I forgot to save the generated sif file. Sorry for wasting your time.
But there is still some problems. When I active only the current solver, the simulation result looks good(left). But when add the Electrostatics, the result is strange(right).
p.png
p.png (15.87 KiB) Viewed 9477 times
My 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 = 1
End

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

Solver 2
  Equation = Electrostatics
  Variable = Potential
  Procedure = "StatElecSolve" "StatElecSolver"
  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

Solver 1
  Equation = Static Current Conduction
  Variable = Potential
  Procedure = "StatCurrentSolve" "StatCurrentSolver"
  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 = "Equation 1"
  Active Solvers(1) = 2
End

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

Material 1
  Name = "Air (room temperature)"
  Viscosity = 1.983e-5
  Heat expansion Coefficient = 3.43e-3
  Heat Conductivity = 0.0257
  Relative Permittivity = 1.00059
  Sound speed = 343.0
  Heat Capacity = 1005.0
  Density = 1.205
End

Material 2
  Name = "Copper (generic)"
  Heat expansion Coefficient = 16.5e-6
  Electric Conductivity = 59.59e6
  Electric Conductivity = 59.59e6
  Heat Conductivity = 401.0
  Sound speed = 3810.0
  Heat Capacity = 385.0
  Mesh Poisson ratio = 0.34
  Density = 8960.0
  Poisson ratio = 0.34
  Youngs modulus = 115.0e9
End

Boundary Condition 1
  Target Boundaries(1) = 8 
  Name = "BoundaryCondition 1"
  Potential = 5
End

Boundary Condition 2
  Target Boundaries(1) = 9 
  Name = "BoundaryCondition 2"
  Potential = 0
End
only difference between the 2 simulation:

Equation 1
Name = "Equation 1"
End

and

Equation 1
Name = "Equation 1"
Active Solvers(1) = 2
End
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to simulate electric field around a livewire?

Post by mzenker »

Hmmm...
I have never used the Electrostatics Solver alone or together with the Statcurrent Solver. I would have to test it, and I haven't got the time...
You might want to read the relevant chapters in the Models manual.
Maybe there is a problem when you use the same "Potential" variable for the two, see viewtopic.php?f=7&t=4085. In that case, Peter would have to advise you further.
As far as I see, you don't specify the potential on the outer (lateral) surface of the air volume. I think you should do that, and set it to zero.
You might experiment with the Electrostatic solver by switching the statCurrent Solver off and setting the outer surface of the cylinder and the lateral surfaces of the air volume to different potentials, and see if you get what you expect.

What happens if you use the StatCurrent Solver for everything, with a tiny electric conductivity for air?

HTH,

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

Re: How to simulate electric field around a livewire?

Post by raback »

Yes, Matthias is right. You cannot use "Potential" for both solvers. Use, for example, PotantialA and PotentialB instead. Then solve the equations hierarchically, probably the conductor first (PotentialA) and set the BC for the insulator at the boundary as

Code: Select all

PotentialB = Equals PotentialA
-Peter
sprite
Posts: 7
Joined: 04 Nov 2015, 15:31
Antispam: Yes

Re: How to simulate electric field around a livewire?

Post by sprite »

Hello Matthias and Peter.
Thank you for your help.
But how to modify the variable name ?
And, is "solve the equations hierarchically" means to use "Exec Solver = ..." ?
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: How to simulate electric field around a livewire?

Post by mzenker »

Hi,
sprite wrote: But how to modify the variable name ?
In the GUI, click "Edit Solver Settings", then the variable name is in the tab "Solver specific Options".
sprite wrote: And, is "solve the equations hierarchically" means to use "Exec Solver = ..." ?
You have to use the "priority" field in the Solver's tab. High Priority is executed first.

HTH,

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

Re: How to simulate electric field around a livewire?

Post by raback »

Just edit the sif. The solvers are executed by their number if the "exec solver" flag is at the same level (e.g. Always). -P
Post Reply