Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Magnetic field

Please login with a confirmed email address before reporting spam


Does anybody know how to write this expression on comsol ( ∇/B/^2 )? I meant expression that replace "the gradient of the magnetic field norm square".

Thank you

10 Replies Last Post Dec 7, 2012, 2:43 a.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 19, 2012, 3:14 a.m. EST
Hi

you need to write out the full expression the derivatives are defined inside COMSOl see the doc

--
Good luck
Ivar
Hi you need to write out the full expression the derivatives are defined inside COMSOl see the doc -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 19, 2012, 3:18 a.m. EST
Thanks Ivar,
But I have gotten only this expression mf.Br*d(mf.Br, r), which is not the right expression I want.
Thanks Ivar, But I have gotten only this expression mf.Br*d(mf.Br, r), which is not the right expression I want.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 19, 2012, 4:12 a.m. EST
Hi

if you are solving with MF your dependent variable is A the magnetic vector potential, then B is already the derivative of A, so if you want to further derive B, you should use a higher discretization (3rd or 4th order)

Thjen it's easier to express everything directly from A (check the COMSOl equations by turning on the equation view

--
Good luck
Ivar
Hi if you are solving with MF your dependent variable is A the magnetic vector potential, then B is already the derivative of A, so if you want to further derive B, you should use a higher discretization (3rd or 4th order) Thjen it's easier to express everything directly from A (check the COMSOl equations by turning on the equation view -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 19, 2012, 4:51 a.m. EST
Thanks Again,
Here is what I 'm using the expression for: I coupled magnetic field and structural mechanics, the expression is proportional to magnetic force and I'm using this expression as a body load. I used this product mf.Br*d(mf.br, r) as a body load and it works but now I want to replace it with the right expression, which is ∇/B/^2. Actually I 've tried to write it but couldn't manage to do so and every time I tried to run it, it comes up with expression error.
The equation view is already turned on.

Thank you
Thanks Again, Here is what I 'm using the expression for: I coupled magnetic field and structural mechanics, the expression is proportional to magnetic force and I'm using this expression as a body load. I used this product mf.Br*d(mf.br, r) as a body load and it works but now I want to replace it with the right expression, which is ∇/B/^2. Actually I 've tried to write it but couldn't manage to do so and every time I tried to run it, it comes up with expression error. The equation view is already turned on. Thank you

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 20, 2012, 10:06 a.m. EST
Hi again
So is it possible to express ∇/B/^2, in a way that comsol understands...?

Thank you
Hi again So is it possible to express ∇/B/^2, in a way that comsol understands...? Thank you

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 26, 2012, 1:50 a.m. EST
Hi

you can develop the

grad(dot(B,B)) into "2*(dot(B,grad(B))+cross(B,curl(B))

(see i.e Wiki : Vector calculus identities) , knowing the variable names from the equation view, in your particular COMSOL space you have chosen, you can write this out, no ?

--
Good luck
Ivar
Hi you can develop the grad(dot(B,B)) into "2*(dot(B,grad(B))+cross(B,curl(B)) (see i.e Wiki : Vector calculus identities) , knowing the variable names from the equation view, in your particular COMSOL space you have chosen, you can write this out, no ? -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 30, 2012, 6:14 a.m. EST
Thank you Ivar, I really appreciate all the help!
I guess it should be possible to write.
I was just wondering, if these two are the same. ∇/B/^2 = ∇/B^2/ ????
If so, ∇/B/^2 = 2[B×(∇×B) + (B . ∇)B] but then I couldn't be sure of B .∇ = ∇. B? I know that the divergence of the magnetic field is zero( ∇. B = 0)

Thank you very much
Thank you Ivar, I really appreciate all the help! I guess it should be possible to write. I was just wondering, if these two are the same. ∇/B/^2 = ∇/B^2/ ???? If so, ∇/B/^2 = 2[B×(∇×B) + (B . ∇)B] but then I couldn't be sure of B .∇ = ∇. B? I know that the divergence of the magnetic field is zero( ∇. B = 0) Thank you very much

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 30, 2012, 2:40 p.m. EST
Hi

the two are not really the same, there is a sign issue:
If I read you corretly (but perhpas I misinterpreated it) the square of the norm of a vector is for me B*B=B^2 = a scalar representing the dot product of B with itself
but if you take the norm of this scalar, for a complex valued case you will have an sign difference, no?

from the moment you take a suqare root you have to check your signs. So the true question what is the true vector product you are looking for ?

--
Good luck
Ivar
Hi the two are not really the same, there is a sign issue: If I read you corretly (but perhpas I misinterpreated it) the square of the norm of a vector is for me B*B=B^2 = a scalar representing the dot product of B with itself but if you take the norm of this scalar, for a complex valued case you will have an sign difference, no? from the moment you take a suqare root you have to check your signs. So the true question what is the true vector product you are looking for ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 3, 2012, 1:02 p.m. EST
Thank you Ivar,
I'm not sure but may be you right, it could be different for complex valued case.
Actually I'm looking for a force which is proportional to the negative of the gradient of the magnetic field norm square.
i.e F = -∇/B/^2, B= B(z,t)= Bz(z)*sin(wt) in the Z direction or Z-hat
And I want to use this force as a body load.

Thank you for being concerned, I really appreciate all the help.
Thank you Ivar, I'm not sure but may be you right, it could be different for complex valued case. Actually I'm looking for a force which is proportional to the negative of the gradient of the magnetic field norm square. i.e F = -∇/B/^2, B= B(z,t)= Bz(z)*sin(wt) in the Z direction or Z-hat And I want to use this force as a body load. Thank you for being concerned, I really appreciate all the help.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 7, 2012, 2:43 a.m. EST
Hi

one of the reasons I have some issues to give a cear response here is due to the complex nature of E and I do not fully understand in which environment / model you are looking at these equations.

See my comment to:

www.comsol.eu/community/forums/general/message/reply/91752/

--
Good luck
Ivar
Hi one of the reasons I have some issues to give a cear response here is due to the complex nature of E and I do not fully understand in which environment / model you are looking at these equations. See my comment to: http://www.comsol.eu/community/forums/general/message/reply/91752/ -- Good luck Ivar

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.