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.

help with Magnetic Flux Gradient in mf module

Please login with a confirmed email address before reporting spam

Hi all,

I have a problem with the magnetic flux gradient calculation in a quadrupole solved with the mf module.

If I simulate permanent magnet quadrupole I use the mfnc module and if I want to know the B gradient I define a cutline in the middle of the quadrupole equal to the bore diameter on the x (or y) axis
Then I select a line graph with that line as source and I plot d(mfnc.By,x) (or d(mfnc.Bx,y). The result is the field gradient of the quadrupole

If I do the same with a EM quad I have a gradient equal to zero even if the mf.By plot is not constant (it is correct as it has the tipical quadrupolare shape).

How I should calculate the gradient?

Thanks
Francesco

14 Replies Last Post 2016年7月3日 GMT-4 20:52
Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 07:46
Francesco,

Magnetic field interfaces use so-called curl or vector elements. Calculation of magnetic field gradient requires the second order spatial derivatives. This can be done by using Lagrangian elements, as demonstrated here:

www.comsol.com/blogs/plotting-spatial-derivatives-magnetic-field/

Regards,
Sergei
Francesco, Magnetic field interfaces use so-called curl or vector elements. Calculation of magnetic field gradient requires the second order spatial derivatives. This can be done by using Lagrangian elements, as demonstrated here: http://www.comsol.com/blogs/plotting-spatial-derivatives-magnetic-field/ Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 10:38
Dear Sergei,

Thank you for your answer, I'm going to study the link you sent me.

I have a question anyway. Why the d(By,x) work on mfnc module?
Dear Sergei, Thank you for your answer, I'm going to study the link you sent me. I have a question anyway. Why the d(By,x) work on mfnc module?

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 11:06
Francesco,

This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements.
You can see it under equation view, as shown in the attached image.

Regards,
Sergei
Francesco, This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements. You can see it under equation view, as shown in the attached image. Regards, Sergei


Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 11:15

Francesco,

This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements.
You can see it under equation view, as shown in the attached image.

Regards,
Sergei


Clear now, thank you.
I have applied the procedure in the link you sent to the example of the helmoltz coil.
I think I understand how to do it.

I'll try with my model and let you know.

Cheers
Francesco
[QUOTE] Francesco, This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements. You can see it under equation view, as shown in the attached image. Regards, Sergei [/QUOTE] Clear now, thank you. I have applied the procedure in the link you sent to the example of the helmoltz coil. I think I understand how to do it. I'll try with my model and let you know. Cheers Francesco

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 11:39
Dear Sergei,

I have a doubt. In my model I have numerical coils, so I set two steps in study one:
Step1: coil geometry analysis
Step2: Stationary.

So at the step described in this figure cdn.comsol.com/wordpress/2014/03/Definition-of-the-study-steps.png
I have different options, infact in "Study" field I select "Study 1, Stationary" and then I have other two fields:

1) "Solution" where I can chose between "Current" and "Solution 1"
2) "Use" where I can chose between "Current" and "Solution Store 1"

Which should I choose?
If I select Current for both I have out of memory message performing LU factorization.
I am trying other solutions...
Dear Sergei, I have a doubt. In my model I have numerical coils, so I set two steps in study one: Step1: coil geometry analysis Step2: Stationary. So at the step described in this figure http://cdn.comsol.com/wordpress/2014/03/Definition-of-the-study-steps.png I have different options, infact in "Study" field I select "Study 1, Stationary" and then I have other two fields: 1) "Solution" where I can chose between "Current" and "Solution 1" 2) "Use" where I can chose between "Current" and "Solution Store 1" Which should I choose? If I select Current for both I have out of memory message performing LU factorization. I am trying other solutions...

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月22日 GMT-4 11:53
ok, I just linearized the discretization and I have the solution, but I just realize that I want the derivative of the flux (Bx, By), in this way I have the derivative of the field.
Do I need to specify this in the unit definitions I guess... Waiting for your advice I will try to do it myself.

Ciao and Thank you
Francesco
ok, I just linearized the discretization and I have the solution, but I just realize that I want the derivative of the flux (Bx, By), in this way I have the derivative of the field. Do I need to specify this in the unit definitions I guess... Waiting for your advice I will try to do it myself. Ciao and Thank you Francesco

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年9月23日 GMT-4 07:58
ok, I set mf.Bx, y and z in the place where there is H, after setting Magnetic Flux Density.
I meshed my model more accurately and I had the solution with quadratic interpolation.

I have just one more quastion: Can I use two different mashes, one for study 1 (the magnetic problem) and one for the PDE study?
This second one should be different from the other one, more coarse on some place but very fine in the place where I need the gradient.

I am trying to experiment, but if it is not possible please let me know.

Thank you
Francesco
ok, I set mf.Bx, y and z in the place where there is H, after setting Magnetic Flux Density. I meshed my model more accurately and I had the solution with quadratic interpolation. I have just one more quastion: Can I use two different mashes, one for study 1 (the magnetic problem) and one for the PDE study? This second one should be different from the other one, more coarse on some place but very fine in the place where I need the gradient. I am trying to experiment, but if it is not possible please let me know. Thank you Francesco

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月15日 GMT-4 11:47
Hi again,

I think I am confident now with the method for the field gradient evaluation.
I have a question related with the parametric sweep.

I have performed a 2D simulation with a sweep on the pole shape for my electromagnet, in order to understand which is the best shape. In the sweep I change two parameters.
Now I want to calculate the gradient of all the solutions in the parametric sweep, but I am able to evalute the gradient for a certain solution, not for all.

How I should set the PDE solver?

Thank you in advance.
Hi again, I think I am confident now with the method for the field gradient evaluation. I have a question related with the parametric sweep. I have performed a 2D simulation with a sweep on the pole shape for my electromagnet, in order to understand which is the best shape. In the sweep I change two parameters. Now I want to calculate the gradient of all the solutions in the parametric sweep, but I am able to evalute the gradient for a certain solution, not for all. How I should set the PDE solver? Thank you in advance.

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月16日 GMT-4 08:09
Francesco,

In the section “Values of variables not solved for”, try to set “selections” to “All”, instead of default “Automatic”.

Regards,
Sergei
Francesco, In the section “Values of variables not solved for”, try to set “selections” to “All”, instead of default “Automatic”. Regards, Sergei

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月16日 GMT-4 08:10
Francesco,

In the section “Values of variables not solved for”, try to set “selections” to “All”, instead of default “Automatic”.

Regards,
Sergei
Francesco, In the section “Values of variables not solved for”, try to set “selections” to “All”, instead of default “Automatic”. Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月16日 GMT-4 08:25
Dear Sergei,

I should have write you the solver configuration I use, anyway I am already using this option.
This is what I am using:

Method: Solution
Study: Study 1, Stationary
Solution: Parametric Solution 1
Use: Current
Selection: All

In "use" I can select a specific solution, but not all, so here probably is the problem, I mean, I guess there is something wrong in "use" or othere options.

Thank you

Dear Sergei, I should have write you the solver configuration I use, anyway I am already using this option. This is what I am using: Method: Solution Study: Study 1, Stationary Solution: Parametric Solution 1 Use: Current Selection: All In "use" I can select a specific solution, but not all, so here probably is the problem, I mean, I guess there is something wrong in "use" or othere options. Thank you

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月19日 GMT-4 13:17
Actually magnetic field interfaces use so-called curl or vector elements.
Calculation of magnetic field gradient requires the second order spatial derivatives.
This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements.

www.7pcb.com/
Actually magnetic field interfaces use so-called curl or vector elements. Calculation of magnetic field gradient requires the second order spatial derivatives. This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements. http://www.7pcb.com/

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2015年10月19日 GMT-4 19:56

Actually magnetic field interfaces use so-called curl or vector elements.
Calculation of magnetic field gradient requires the second order spatial derivatives.
This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements.


Yes, I know that, and I am able to perform the calculation for one solution.
What I am not able to do is performing the calculation for all the solutions in a parametric sweep.
I'm probably doing something wrong with the solver configuration.
[QUOTE] Actually magnetic field interfaces use so-called curl or vector elements. Calculation of magnetic field gradient requires the second order spatial derivatives. This is because mfnc interface uses Lagrangian elements for magnetic scalar potential and second order derivatives are available for Lagrangian elements. [/QUOTE] Yes, I know that, and I am able to perform the calculation for one solution. What I am not able to do is performing the calculation for all the solutions in a parametric sweep. I'm probably doing something wrong with the solver configuration.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年7月3日 GMT-4 20:52
I have a question: when I checked u1 and mf.Bx or u2,mf.By..., or mf.norm B and sqrt(u1^2+u2^2+u3^2), it is not the same? Please help me to explain it. Thank you
I have a question: when I checked u1 and mf.Bx or u2,mf.By..., or mf.norm B and sqrt(u1^2+u2^2+u3^2), it is not the same? Please help me to explain it. Thank you

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.