Axisymmetric permanent magnet and ferromagnetic shield simulation model and plots

Please login with a confirmed email address before reporting spam

Hello,

Currently I am trying to simulate, in 2D axisymmetry, a set of 7 ring magnets surrounded by 3 layers of iron and one external layer of mumetal shield. The goal is to optimize the shield in order to get a very low field in the outside area. The results look too good: the field outside the shield is so low that I am wondering if I did something wrong when setting up the MFNC sub-componnents for the different parts of my setup (permanent magnets, soft ferrommagnetic layers, air, axisymmetry, ...). For instance am I correctly using the "Magnetic field conservation" sub-components ? Should everything be set under "Axial symmetry" ? ... Unfortunately, I did not found examples for similar cases, this is why I ask for support and join the Comsol .mph file to this request.

In addition to the above mentioned doubts, I have encountered several annoying problems when adding some plots:

1) In 1D plot group 2 I draw the field modulus along some lines parallel to the Z axis and therefore, instead of the arc length starting at 0 and ending at 60 mm on the abscissa axis, I would like to put the Z value going from -30 to +30 mm. In this way, the 0 on the plot will correspond to the 0 in my setup at the center of the central ring magnet. Unfortunately, I did not figured out how to shift these values easily.

2) On the same plot, I have decided to draw the field not only on the axis, but also on several lines parallel to this axis. For that, when defining the Cut line 2D named "Short Z axis", I checked the box "Additional parallel lines" and used the Range button on the right. If I put positive start, step and stop values, which seems logic, it does not work. After some trials, I figured out that I have to put negative values ? This is really weird.

3) When generating and writing the automatic" report, the figures look really ugly and zooms are not conserved for the individual plots. All the figures are rescaled to the entire figure. The legend fonts are not rescaled as well. All this makes the report kind of useless ... In addition to Microsoft Word format, could there be also a LaTeX format ?

4) If I want to plot data in 2D (surface or contour) in a rectangle with custom dimensions and location, should I use 2D Grid or 2D Array ? I do not understand the difference between these 2.

5) In this simulation, I am interested in the shielding factor, i.e. the ratio of the field with and without the shield layers. Is there a way to get that in a single simulation file or do I need to run 2 different Comsol simulations, export the results and perform some post-analysis in a C++ or Python code ?

6) Finally, there should be a way in comsol to obtain the weights of the shielding layers, but I did not found how to do it.

Thanks a lot for any help,

Gilles



8 Replies Last Post Dec 4, 2023, 11:54 a.m. EST
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 4:43 a.m. EST

I tried running Study 1 in FI_shield_test3_nosleeve.mph in 6.2, but this failed with an eror message:

Undefined variable. - Variable: comp1.mfnc.chimrr - Geometry: geom1 - Domain: 2 Failed to evaluate variable. - Variable: comp1.mfnc.Mr - Defined as: (comp1.mfnc.chimrrcomp1.mfnc.Hr)+(comp1.mfnc.chimrzcomp1.mfnc.Hz) Failed to evaluate variable. - Variable: comp1.mfnc.Br - Defined as: mu0_const((comp1.mfnc.I_srrcomp1.mfnc.Hr)+comp1.mfnc.Mr) Failed to evaluate expression. - Expression: dvol(r(pi((2comp1.mfnc.d)(-comp1.mfnc.Br)))) Failed to evaluate Jacobian of expression. - Expression: (2comp1.mfnc.d(-comp1.mfnc.Brtest(comp1.Vmr)-comp1.mfnc.Bztest(comp1.Vmz))pir)(dvol) -

I tried running Study 1 in FI_shield_test3_nosleeve.mph in 6.2, but this failed with an eror message: Undefined variable. - Variable: comp1.mfnc.chimrr - Geometry: geom1 - Domain: 2 Failed to evaluate variable. - Variable: comp1.mfnc.Mr - Defined as: (comp1.mfnc.chimrr*comp1.mfnc.Hr)+(comp1.mfnc.chimrz*comp1.mfnc.Hz) Failed to evaluate variable. - Variable: comp1.mfnc.Br - Defined as: mu0_const*((comp1.mfnc.I_srr*comp1.mfnc.Hr)+comp1.mfnc.Mr) Failed to evaluate expression. - Expression: dvol*(r*(pi*((2*comp1.mfnc.d)*(-comp1.mfnc.Br)))) Failed to evaluate Jacobian of expression. - Expression: (2*comp1.mfnc.d*(-comp1.mfnc.Br*test(comp1.Vmr)-comp1.mfnc.Bz*test(comp1.Vmz))*pi*r)*(dvol) -

Anders Westerberg COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 4:57 a.m. EST
Updated: 5 months ago Dec 1, 2023, 4:59 a.m. EST

Hello Gilles,

Regarding 3), you can specify that you want to keep the current axis limits in a report plot using the Zoom extents list in the Plot Group report node's Settings window. With the default setting, Automatic, the plot will be zoomed in if the referenced plot group's axis limits are not fixed. Thus, you can either lock the axis limits or change the setting to Off. This control is described on the COMSOL 6.1 documentation page https://doc.comsol.com/6.1/docserver/#!/com.comsol.help.comsol/comsol_ref_results.36.231.html.

Kind regards, Anders Westerberg COMSOL Development

Hello Gilles, Regarding 3), you can specify that you want to keep the current axis limits in a report plot using the **Zoom extents** list in the **Plot Group** report node's **Settings** window. With the default setting, **Automatic**, the plot will be zoomed in if the referenced plot group's axis limits are not fixed. Thus, you can either lock the axis limits or change the setting to **Off**. This control is described on the COMSOL 6.1 documentation page [https://doc.comsol.com/6.1/docserver/#!/com.comsol.help.comsol/comsol_ref_results.36.231.html](https://doc.comsol.com/6.1/docserver/#!/com.comsol.help.comsol/comsol_ref_results.36.231.html). Kind regards, Anders Westerberg COMSOL Development

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 5:33 a.m. EST

I tried running Study 1 in FI_shield_test3_nosleeve.mph in 6.2, but this failed with an eror message:

Undefined variable. - Variable: comp1.mfnc.chimrr - Geometry: geom1 - Domain: 2 Failed to evaluate variable. - Variable: comp1.mfnc.Mr - Defined as: (comp1.mfnc.chimrrcomp1.mfnc.Hr)+(comp1.mfnc.chimrzcomp1.mfnc.Hz) Failed to evaluate variable. - Variable: comp1.mfnc.Br - Defined as: mu0_const((comp1.mfnc.I_srrcomp1.mfnc.Hr)+comp1.mfnc.Mr) Failed to evaluate expression. - Expression: dvol(r(pi((2comp1.mfnc.d)(-comp1.mfnc.Br)))) Failed to evaluate Jacobian of expression. - Expression: (2comp1.mfnc.d(-comp1.mfnc.Brtest(comp1.Vmr)-comp1.mfnc.Bztest(comp1.Vmz))pir)(dvol) -

Hi Gunnar, Gilles

@Gunnar: Did you run it in version 6.2? It completed without issues here in version 6.1. The setup looks good to me. @Gilles: In order to test the shielding you can consider to set up a second mfnc physics where all shields are defined as air.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
>I tried running Study 1 in FI_shield_test3_nosleeve.mph in 6.2, but this failed with an eror message: > >Undefined variable. > - Variable: comp1.mfnc.chimrr > - Geometry: geom1 > - Domain: 2 >Failed to evaluate variable. > - Variable: comp1.mfnc.Mr > - Defined as: (comp1.mfnc.chimrr*comp1.mfnc.Hr)+(comp1.mfnc.chimrz*comp1.mfnc.Hz) >Failed to evaluate variable. > - Variable: comp1.mfnc.Br > - Defined as: mu0_const*((comp1.mfnc.I_srr*comp1.mfnc.Hr)+comp1.mfnc.Mr) >Failed to evaluate expression. > - Expression: dvol*(r*(pi*((2*comp1.mfnc.d)*(-comp1.mfnc.Br)))) >Failed to evaluate Jacobian of expression. > - Expression: (2*comp1.mfnc.d*(-comp1.mfnc.Br*test(comp1.Vmr)-comp1.mfnc.Bz*test(comp1.Vmz))*pi*r)*(dvol) > - Hi Gunnar, Gilles @Gunnar: Did you run it in version 6.2? It completed without issues here in version 6.1. The setup looks good to me. @Gilles: In order to test the shielding you can consider to set up a second mfnc physics where all shields are defined as air. Cheers Edgar

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 8:17 a.m. EST

Hi,

To explain the reason for the error message in version 6.2: It seems that this model was originally made in an older version of COMSOL Multiphysics. The release notes for version 5.5 contained this information about backward compatibility with version 5.2a:

In version 5.3a, all frames are always defined. If you open models from version 5.2a or earlier, there will be a Permanently Define All Frames button under Frames in the General section of the Component nodes. When you click the button, all frames are defined, and the button disappears.

Doing so for this model makes it run just fine also in version 6.2.

Best regards,

Magnus

Hi, To explain the reason for the error message in version 6.2: It seems that this model was originally made in an older version of COMSOL Multiphysics. The release notes for version 5.5 contained this information about backward compatibility with version 5.2a: In version 5.3a, all frames are always defined. If you open models from version 5.2a or earlier, there will be a **Permanently Define All Frames** button under **Frames** in the **General** section of the **Component** nodes. When you click the button, all frames are defined, and the button disappears. Doing so for this model makes it run just fine also in version 6.2. Best regards, Magnus

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 9:27 a.m. EST

Regarding 1): In the x-Axis Data section, change Parameter to Expression and then change Expression to z.

Regarding 2): The range distances increase in a direction that is orthogonal to the cut line's direction: If the cut line points along the x-axis, then positive distances correspond to positive coordinates along the y-axis. In your example, it would be better if the direction (sign) was chosen dynamically, but in many cases both positive and negative values for the distances fall inside the geometry.

Regarding 4): Do you want to control the minimum and maximum values along the r- and z-axes? You can do that by changing the View settings. An example: Go to the Magnetic Flux Density Norm plot group, the click on Go to Source button to the right of the View list. This takes you to the View node. In the View's Axis subnode you can change the r- and z-axes. The values in the model look good to me, though.

Regarding 1): In the **x-Axis Data** section, change **Parameter** to **Expression** and then change **Expression** to **z**. Regarding 2): The range distances increase in a direction that is orthogonal to the cut line's direction: If the cut line points along the x-axis, then positive distances correspond to positive coordinates along the y-axis. In your example, it would be better if the direction (sign) was chosen dynamically, but in many cases both positive and negative values for the distances fall inside the geometry. Regarding 4): Do you want to control the minimum and maximum values along the r- and z-axes? You can do that by changing the View settings. An example: Go to the Magnetic Flux Density Norm plot group, the click on **Go to Source** button to the right of the **View** list. This takes you to the View node. In the View's Axis subnode you can change the r- and z-axes. The values in the model look good to me, though.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 11:34 a.m. EST
Updated: 5 months ago Dec 4, 2023, 8:41 a.m. EST

Hi Gilles,

Regarding 6), using Derived Quantities you can integrate the density to obtain the mass of parts. Since you're in 2D axi, check that the integration includes the needed (There's a checkbox for that). Then you get the weight by multiplying by g.

Best,

Jeff

-------------------
Jeff Hiller
Hi Gilles, Regarding 6), using Derived Quantities you can integrate the density to obtain the mass of parts. Since you're in 2D axi, check that the integration includes the needed 2*\pi*r (There's a checkbox for that). Then you get the weight by multiplying by g. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 1, 2023, 4:29 p.m. EST

Good evening,

Many thanks to all of you for your answers, these helped me a lot.

Gilles

Good evening, Many thanks to all of you for your answers, these helped me a lot. Gilles

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 months ago Dec 4, 2023, 11:54 a.m. EST
Updated: 5 months ago Dec 4, 2023, 11:53 a.m. EST

Gilles,

For completeness sake:

There is another way of getting to the mass; it involves creating a "Mass Properties" node and a Global Evaluation, see the attached file for an example and page 345 in the Reference Manual for COMSOL Multiphysics version 6.2 for more details if needed.

Best,

Jeff

-------------------
Jeff Hiller
Gilles, For completeness sake: There is another way of getting to the mass; it involves creating a "Mass Properties" node and a Global Evaluation, see the attached file for an example and page 345 in the Reference Manual for COMSOL Multiphysics version 6.2 for more details if needed. Best, Jeff

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.