Voltage Step Response 2D Magnetic Circuit

Numerical methods and mathematical models of Elmer
Post Reply
zmladen
Posts: 43
Joined: 28 Apr 2013, 17:15
Antispam: Yes

Voltage Step Response 2D Magnetic Circuit

Post by zmladen »

Hello,

In order to learn how to couple the circuits equations with elmerFEM magnetic solver I wanted to simulate a volage step responce of the simple 2D magnetic circuit with a coil.
Example-image.jpg
Example-image.jpg (107.59 KiB) Viewed 1301 times
The model files with scaled mesh (to meters) are attached. I have a problem understanding how many components should I use to couple a 2D coil with the circuit equations. In 2d coil has two terminals A+ and A-. Should each terminal be assigned to a new component? How to connect then the terminals and assign a resistance so that the current can flow? In the IM examples from Palvel there is only one terminal per phase.

The resuls should loke something like this:
Youtube_Example_Pavel.jpg
(125.36 KiB) Not downloaded yet
Youtube Channel from Pavel:
https://www.youtube.com/watch?v=nd-FLO9sviI
Attachments
Voltage-Step-Response.zip
(399.85 KiB) Downloaded 106 times
zmladen
Posts: 43
Joined: 28 Apr 2013, 17:15
Antispam: Yes

Re: Voltage Step Response 2D Magnetic Circuit

Post by zmladen »

Hello,

I managed to set up the circuit equations. As expected it turned out that 2 components have to be used, one for A+ and one for A- terminal. The anti-serial connection of the coils is provided within the circuits definitions.
circuit_tions.jpg
(125.49 KiB) Not downloaded yet
The results seem to be valid. Here the current response of the coil for a voltage supply of 10V. The resistance of coil is assumed to be 20Ohm's (just a dummy value)
voltage_step_response.jpg
voltage_step_response.jpg (19.21 KiB) Viewed 1284 times
The working model in ElmerFEM version 9.0 can be find here (voltage_step_response.zip). The video animation can be found here:
https://youtu.be/TH7rl0aVfWM

Maybe someone finds it usefull.


I still have couple of questions:

1. In some models the "Electrode Area = Real XXX" is used in the component definition. When it is required to use this value. I have made some tests and the current response doesnt change if Electrode Area is used or not.
2. I didnt use Solver 4 and Solver 5 even though it is advised in some documentation. When should we use them. The results also do not change if I use solvers or not.

Code: Select all

Solver 4
  Exec Solver = Always
  Equation = CircOutput
  Procedure = "CircuitsAndDynamics" "CircuitsOutput"
End

Solver 5
  Exec Solver = After Timestep
  Equation = scalars
  Procedure = "SaveData" "SaveScalars"
  Filename = transient_results.dat
  Output Directory = results
End
3. How the ground node is modeled. It didn't explicitly set the ground node in the circuit.

Thanks,
Mladen
Attachments
step_response.zip
(397.81 KiB) Downloaded 106 times
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Voltage Step Response 2D Magnetic Circuit

Post by fjimenez »

Hi Mladen,

I have been recently working a little bit with Circuits and coils in Elmer so I'll try to answer your questions. I have only been using Elmer since last year so I am in no way an expert.

Q1. I haven't checked the code so I might as well be very wrong. Assume that you have a constant current source and a coil. If you work in 2D, you don't need the CoilSolver to get the current density so you can just use a constant value. The circuit+MagnetoDynamics loop calculates this value form the .definitions file. The way that this is done is by using the simple formula I*N/A where I is the current of the source, N is the number of turns of the coil, and A is the electrode area. Very easy to check, just change the area and look in paraview the value of the current density in the coil.

Q2. Although you did not have these solvers in the list, they are run at the end of each time step.

Q3. I think that ground will be the reference node you are using in the .definitions file.

About the resistance, this is the actual serial resistance of the coil. You can estimate this if you know the material of the wire and its cross section area. This value is pretty important in harmonic problems because it determines the total impedance of the coil and the phase lag. This way you can also estimate the inductance value that Elmer is using. You can also fit an exponential to the plot above and extract the inductance value that Elmer uses. What I am still not sure is how Elmer calculates the coil's inductance. I asked about this in another post (viewtopic.php?t=7673) but so far no one has replied yet.

By the way, I have written a few .definition files by hand but now I prefer to use CircuitBuilder. It is much easier. There are still some problems with it but you can just open the .definitions files and fix it.

Cheers,

Francisco
zmladen
Posts: 43
Joined: 28 Apr 2013, 17:15
Antispam: Yes

Re: Voltage Step Response 2D Magnetic Circuit

Post by zmladen »

I've checked the results again, with and without specifying the electrode area and the results, including the current density, are the same.

I have also found this explanation in Emler Models Manual:
Electrode Area Real area
If the coil type is stranded and resistance is not explicitly given, then this keyword may be given
to specify the area of the coil terminal. This is then used to compute the Resistance of the coil.
Note that if neither the Resistance nor the Electrode Area are given then the area of the terminal
is automatically computed. However, at the moment in 3D this feature is not yet working.
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Voltage Step Response 2D Magnetic Circuit

Post by fjimenez »

Hi Mladen,

Elmer seems to calculate the electrode area correctly, I guess that it is done in the component section, that is why you get the same results with the Electrode Area line in it. However, if you use a different value, say 350 e-4, you will get a different current density. Just beware that you will need to change the simulation time accordingly if you want to capture the initial rise of the current trace because you are changing the impedance of the circuit.

As mentioned before, I have been doing some work with the harmonic solver and I was able to replicate a basic circuit response to frequency using Elmer. Here is an example. The test consists of a current source and a coil in an 2d axi symmetric model. I guess I need to dig in the code to see how the inductance is calculated.
elmer_theory_current_source.png
elmer_theory_current_source.png (41.48 KiB) Viewed 1193 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Voltage Step Response 2D Magnetic Circuit

Post by raback »

Hi fjimenez,

Great work! It is really nice that people take a serious look at the circuit simulation part. It is hard thing for us developers since it is by no means easy and it is quite different ballgame than the standard solution of partial differential equations.

-Peter
gforti
Posts: 70
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: Voltage Step Response 2D Magnetic Circuit

Post by gforti »

Hello. I tried to simulate the files within step_response.zip and had the following response:

ERROR:: ComputeChange: Numerical Error: Norm of solution appears to be NaN
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DIVIDE_BY_ZERO
STOP 1

After a few tests, this problem was solved by changing the boundary condition from Infinity BC to Potential = 0:

Boundary Condition 1
Name = "outerBoundary"
Target Boundaries(1) = 1
! Infinity BC = True
Potential = 0
End

PS.: I am running Elmer 9.0 on an Ubuntu 20.04 based distro (ElementaryOS):

Elmer version: 9.0
Elmer revision: f39d43661
Elmer compilation date: 2022-10-15
Post Reply