Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Current density problems when modeling a homogeneous magnet

Please login with a confirmed email address before reporting spam

Hi all,

I am modelling superconducting magnet systems with comsol. I had a simple method of getting the right current density in coils using the AC/DC module whereby I calculate the number of turns based on the cross section of the coil and wire area which is the same for all coils. All coils then recieve the same current. This is done using various parameters.

However, when I plot the current density, there are small, but significant variations between coils which is not physically correct. I made my test case have very simple geometry to visualize it properly for area and nturns and I have seen no obvious error. At the moment I can only conclude that the comsol software has some kind of bug that does not get the current density right.



5 Replies Last Post 26 ott 2018, 13:17 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25 ott 2018, 15:07 GMT-4

I simplified it even further. If you have the two coils the same then the current density is the same. If you double one then you get a different current density. I am pretty convinced this means there is a bug unless someone can illuminate me further.

Will

I simplified it even further. If you have the two coils the same then the current density is the same. If you double one then you get a different current density. I am pretty convinced this means there is a bug unless someone can illuminate me further. Will

Durk de Vries COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 26 ott 2018, 07:38 GMT-4

Hi Will,

I had a look at your file "test.mph".

If we consider the feature called Coil 1, we have:

  • Current:
  • Turns:
  • Cross section:
  • Expected current density:

Now, in your model, for Coil 1 this is not the current density you observe. Instead you observe (the volume average of mf.normJ inside the coil is ).

This is a correct assessment and we encourage every user to do these kinds of sanity checks when building their models.

The reason the current is off, is because of the chosen reference edge. When using a circular coil, the reference edge is not only used to determine the coil’s orientation, but also the average turn length. As the manual states: “The coil length used is simply the length of the edges; the best approximation is therefore obtained when the radius of the edges is close to the average radius of the coil”.

The coil cross sectional surface area is then determined by dividing the coil volume by the length derived from the edge selection of Coil Geometry 1. You can see so in the Equation View.

In your initial model "test.mph", the selected edges are located on the inside of the coil. As a result, the determined coil length mf.coil1.length evaluates to: , while it should have been . Consequently, mf.coil1.area evaluates to , rather than the expected .

If you check your geometry sequence and put a point right in the center of the rectangle called coil1Pair (xw: , yw: ), you will get an edge that represents the average turn length of Coil 1. If you select these edges instead of the inner edges, mf.coil1.length will evaluate to , and mf.coil1.area becomes: (that is, with the given mesh it’s accurate up to 6 significant digits). Consequently, the current density becomes , which is off.

This is a good accuracy given the chosen mesh.

In this case, finding an edge that represents the average turn length is not very difficult. If you have a very sophisticated coil cross section however, you may have to evaluate the average radius, that is, evaluate the average of in your cross section and use that for your turn length. You can do so by enabling the checkbox Override length of the edges in Coil Geometry 1 and fill in the numerical value directly, or use the expression , where is a coupling operator on the cross sectional surface defined in Component 1/Definitions. I have attached a model demonstrating this approach for Coil 1 (see "test-df664aa_modified_cleared.mph").

For more sophisticated shapes (as opposed to circles), we advise using the numeric coil. If your geometry and your physics are axisymmetric, you should consider using a 2D-axisymmetric model.

Durk de Vries Electromagnetics Group COMSOL AB Sweden

Hi Will, I had a look at your file "test.mph". If we consider the feature called **Coil 1**, we have: * Current: IO=100[A] * Turns: Nturns1=20000 * Cross section: coil1DR*coil1DZ=0.1[m]*0.1[m]=0.01[m^2] * Expected current density: \frac{Nturns1*IO}{coil1DR*coil1DZ}=20000*100[A]/0.01[m^2]=2\times10^{8}[A/m^2] Now, in your model, for **Coil 1** this is not the current density you observe. Instead you observe 1.75\times10^{8}[A/m^2] (the volume average of **mf.normJ** inside the coil is 1.749998267524659\times10^{8}). *This is a correct assessment and we encourage every user to do these kinds of sanity checks when building their models.* The reason the current is 14\% off, is because of the chosen reference edge. When using a circular coil, the reference edge is not only used to determine the coil’s orientation, but also the average turn length. As the manual states: *“The coil length used is simply the length of the edges; the best approximation is therefore obtained when the radius of the edges is close to the average radius of the coil”*. The coil cross sectional surface area is then determined by dividing the coil volume by the length derived from the edge selection of **Coil Geometry 1**. You can see so in the **Equation View**. In your initial model "test.mph", the selected edges are located on the inside of the coil. As a result, the determined coil length **mf.coil1.length** evaluates to: 2*pi*primaryRadius=2.1991[m], while it should have been 2*pi*(primaryRadius+coil1DR/2)=2.5133[m]. Consequently, **mf.coil1.area** evaluates to 1.1429\times10^{-2}[m], rather than the expected 0.01[m]. If you check your geometry sequence and put a point right in the center of the rectangle called **coil1Pair** (xw: primaryRadius+coil1DR/2, yw: -coil1Z), you will get an edge that represents the average turn length of **Coil 1**. If you select these edges instead of the inner edges, **mf.coil1.length** will evaluate to 2.5133[m], and **mf.coil1.area** becomes: 1.000001169271455\times10^{-2}[m] (*that is, with the given mesh it’s accurate up to 6 significant digits*). Consequently, the current density becomes 1.999997661459825\times10^{8}[A/m^2], which is 100*\left(\frac{2\times10^{8}[A/m^2]}{mf.normJ}-1\right)=1.17\times10^{-4}\% off. *This is a good accuracy given the chosen mesh.* In this case, finding an edge that represents the average turn length is not very difficult. If you have a very sophisticated coil cross section however, you may have to evaluate the average radius, that is, evaluate the average of \sqrt{x^2+y^2} in your cross section and use that for your turn length. You can do so by enabling the checkbox **Override length of the edges** in **Coil Geometry 1** and fill in the numerical value directly, or use the expression 2*pi*aveop1(sqrt(x^2+y^2)), where aveop1() is a coupling operator on the cross sectional surface defined in **Component 1/Definitions**. I have attached a model demonstrating this approach for **Coil 1** (see "test-df664aa_modified_cleared.mph"). For more sophisticated shapes (as opposed to circles), we advise using the numeric coil. If your geometry and your physics are axisymmetric, you should consider using a **2D-axisymmetric** model. Durk de Vries Electromagnetics Group COMSOL AB Sweden


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 26 ott 2018, 08:19 GMT-4
Updated: 6 years ago 26 ott 2018, 08:22 GMT-4

Thanks Durk, I was calculating current density, but fundamentally I was trying to set it up to have a constant current density, because that is what happens when you build a magnet. I understand your response and it will enable me to develop a useful model now, however, the fact that the circular coil feature in comsol has N windings, wire cross section and current would lead an obviously naive researcher to believe that that would control the current density, which is the physical thing we want to control and model.....

Thanks Durk, I was calculating current density, but fundamentally I was trying to set it up to have a constant current density, because that is what happens when you build a magnet. I understand your response and it will enable me to develop a useful model now, however, the fact that the circular coil feature in comsol has N windings, wire cross section and current would lead an obviously naive researcher to believe that that would control the current density, which is the physical thing we want to control and model.....

Durk de Vries COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 26 ott 2018, 10:25 GMT-4

I see your point.

The N windings, wire cross section and current setting actually does control the current density, it's just that the cross sectional surface area of the coil is off by due to the selection for the edges. I agree this implementation may lead to user error (having to select the appropriate edges could be perceived as inconvenient).

So I had another look at it.

I think we can determine the coil cross sectional surface area directly by integrating over the coil's volume (asuming the coil is circular). The average turn length then follows from . The attached file demonstrates the procedure.

I will do some more benchmarking/validation. If the procedure is robust, we could consider implementing it in the software so that you don't have to worry about the choice of reference edges any longer.

Thank you for your feedback.

Durk de Vries Electromagnetics Group COMSOL AB Sweden

I see your point. The *N windings*, *wire cross section* and *current* setting actually does control the current density, it's just that the cross sectional surface area of the coil is off by 14\% due to the selection for the edges. I agree this implementation may lead to user error (having to select the appropriate edges could be perceived as *inconvenient*). So I had another look at it. I think we can determine the coil cross sectional surface area directly by integrating \frac{1}{2\pi*r} over the coil's volume (asuming the coil is circular). The average turn length then follows from \frac{Volume}{Area}. The attached file demonstrates the procedure. I will do some more benchmarking/validation. If the procedure is robust, we could consider implementing it in the software so that you don't have to worry about the choice of reference edges any longer. Thank you for your feedback. Durk de Vries Electromagnetics Group COMSOL AB Sweden


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 26 ott 2018, 13:17 GMT-4
Updated: 6 years ago 26 ott 2018, 15:32 GMT-4

I came up with something similar, and have my problem properly scaled. I think you are doing the right thing to modify the way the coil works so that it matches the intuitive understanding we gain from the real world. Thanks for your help and for listening!

I came up with something similar, and have my problem properly scaled. I think you are doing the right thing to modify the way the coil works so that it matches the intuitive understanding we gain from the real world. Thanks for your help and for listening!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.