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.

Plotting magnetic field lines in 3D

Please login with a confirmed email address before reporting spam

I'm trying to plot magnetic field lines in 3D, but when I select the streamline surface plot, it gives me magnetic flux density by default (mf.Bx, mf.By, mf.Bz) (in units of Teslas, see picture 1).

What I want is what one gets when plotting contour plots in 2D-axisymmetric, which is mf.Aphi x r (in units of Wb, see picture 2).

I checked out this answer, I've tried transforming between coordinate systems (cylindrical in I've tried transforming between coordinate systems (cylindrical in 2D-axisymmetric to cartesian in 3D), but this doesn't work. Specifically, I tried to use mf.Ax, mf.Ay, mf.Az with various expressions of r, such as r = sqrt(x^2 + y^2), but it doesn't plot what I'm looking for. I've also tried plotting contour plots on the cut plane, but it also doesn't look right (picture 3).

Any help is appreciated. Thanks!


3 Replies Last Post 2021年2月4日 GMT-5 11:22
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年2月4日 GMT-5 10:35
Updated: 4 years ago 2021年2月4日 GMT-5 10:42

The magnetic flux density B is often the right choice for plotting field lines. But since you are exploring the options, have you considered plotting the H field?

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
The magnetic flux density B is often the right choice for plotting field lines. But since you are exploring the options, have you considered plotting the H field?

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年2月4日 GMT-5 10:47

Hi Robert, yes I have. It gave basically the same results as the B field.

Hi Robert, yes I have. It gave basically the same results as the B field.

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 2021年2月4日 GMT-5 11:22

I realised the problem - wasn't visualisation-related (had the wrong polarity on the electromagnets). Thanks for your suggestion though!

I realised the problem - wasn't visualisation-related (had the wrong polarity on the electromagnets). Thanks for your suggestion though!

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.