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.

divergence, rotational and cylindrical coordinate.

Please login with a confirmed email address before reporting spam

Dear COMSOL's users,

I have read in the Multiphysics Users Guide that:

"In practice, this means that to correctly implement equations containing the gradient, divergence, or curl in an axisymmetric geometry, you need to compensate for the missing terms related to the curvature of the coordinate system."

And a few lines below:

"Note: The axisymmetric versions of physics interfaces take the cylindrical system into
account, and no compensation is therefore needed."

So, my question is: if I use a 2D axisymmetric model, should I compensate or not the missing terms if we use divergence or rotational operator?

Thank-you very much in advance.

Best regards,
Isa

28 Replies Last Post 2017年1月25日 GMT-5 07:58
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月3日 GMT-4 06:32
If you're using a Mathematics interface (like coefficient form, general form or weak form), yes.
If you're using a physics interface (where the equations are already implemented), no.
If you're using a Mathematics interface (like coefficient form, general form or weak form), yes. If you're using a physics interface (where the equations are already implemented), no.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月3日 GMT-4 07:11
Thank-you Jean-François,

you mean that, for example, if I use Magnetic Fields model (mf), I shouldn't compensate the for the missing terms in case using cylindrical coordinates because the model is prepared for it.
Otherwise, if I used a PDE general form interface, divergence and other spacial operators, I would have to introduce some elements such us:
"1/r" or multiply by "r" the first field component before applying "d()/dr". So that I could obtain "1/r*d(rFr)/dr" to obtain the first component of the first gradient, for example.

Thanks!

Best regards,
Isa
Thank-you Jean-François, you mean that, for example, if I use Magnetic Fields model (mf), I shouldn't compensate the for the missing terms in case using cylindrical coordinates because the model is prepared for it. Otherwise, if I used a PDE general form interface, divergence and other spacial operators, I would have to introduce some elements such us: "1/r" or multiply by "r" the first field component before applying "d()/dr". So that I could obtain "1/r*d(rFr)/dr" to obtain the first component of the first gradient, for example. Thanks! Best regards, Isa

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月3日 GMT-4 08:12
Yep, that's right.
Yep, that's right.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月10日 GMT-4 05:14
Hello,
as a new user I am quite disappointed:

The geometry of the model can be defined as 2D axisymmetric, but when I add the PDE for Poissons equation to it (via PDE (poeq), the equation is not adapted to the geometry?

Which coordinate system is used in the equation? On the drawing/Geometry r and z is used, but it is not clear to me whether the equation is based on a cartesian system x,y,z , or on r,phi,z ?

How is the div (divergence) operator in cartesian and axisymmetric coordinates written in Comsol?

Thanks,
junis
Hello, as a new user I am quite disappointed: The geometry of the model can be defined as 2D axisymmetric, but when I add the PDE for Poissons equation to it (via PDE (poeq), the equation is not adapted to the geometry? Which coordinate system is used in the equation? On the drawing/Geometry r and z is used, but it is not clear to me whether the equation is based on a cartesian system x,y,z , or on r,phi,z ? How is the div (divergence) operator in cartesian and axisymmetric coordinates written in Comsol? Thanks, junis

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年6月10日 GMT-4 10:15
For Poisson in a 2D axisymmetric case, you can see the equation in the Equation section of the Settings window: it tells you that the software solves \nabla . ( c \nabla u) = f with \nabla defined as (d/dr ; d/dz ). See attached screenshot.
For Poisson in a 2D axisymmetric case, you can see the equation in the Equation section of the Settings window: it tells you that the software solves \nabla . ( c \nabla u) = f with \nabla defined as (d/dr ; d/dz ). See attached screenshot.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月8日 GMT-4 13:14
hi,

I have 2d-axisymmetric model and I want to define an external force using the divergence of the Maxwell stress tensor. what is the the divergence form in 2d-Axisymmetric ?

I mean where I should put r or divide by (r) in my equation ?

Is d(Tem11,r)+d(Tem12,z) is enough for first element ?

best
hi, I have 2d-axisymmetric model and I want to define an external force using the divergence of the Maxwell stress tensor. what is the the divergence form in 2d-Axisymmetric ? I mean where I should put r or divide by (r) in my equation ? Is d(Tem11,r)+d(Tem12,z) is enough for first element ? best

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月8日 GMT-4 13:17
Dear Isabel,

where is exactly this (r) and (1/r) should be applied ?

Could u plz help me ?

I have a tensor like this:
T11 T12

T21 T22

I want to apply divergence to this tensor in 2d_ axisymmetric model.

best
Dear Isabel, where is exactly this (r) and (1/r) should be applied ? Could u plz help me ? I have a tensor like this: T11 T12 T21 T22 I want to apply divergence to this tensor in 2d_ axisymmetric model. best

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月9日 GMT-4 03:11
Dear Osameh,

what Jean-François tried to explained me, I think so, was that if you use a physics model and you are using 2D axisymmetric geometry, the equations in cilindrical coordinates are already implemented and you don't have to worry about in order to create the correct form in the cilindrical form.

On the other hand, if you are using a mathematical interface where you want to create your own model and using 2D axisymmetric geometry, you will have to take into account that gradient and divergence in cylindrical coordinates are:

grad(f)=df/dr U(r)+1/r (df/dphi) U(phi)+d(f)/dz U(z); where f is a scalar and U(r), U(p)hi and U(z) are unitary vectors.
div F= 1/r d(rFr)/dr+ 1/r d(Fphi)/dphi + d(Fz)/dz; where F is a vector.

I don't know if this explanation has solved your doubt.

Best regards,
Dear Osameh, what Jean-François tried to explained me, I think so, was that if you use a physics model and you are using 2D axisymmetric geometry, the equations in cilindrical coordinates are already implemented and you don't have to worry about in order to create the correct form in the cilindrical form. On the other hand, if you are using a mathematical interface where you want to create your own model and using 2D axisymmetric geometry, you will have to take into account that gradient and divergence in cylindrical coordinates are: grad(f)=df/dr U(r)+1/r (df/dphi) U(phi)+d(f)/dz U(z); where f is a scalar and U(r), U(p)hi and U(z) are unitary vectors. div F= 1/r d(rFr)/dr+ 1/r d(Fphi)/dphi + d(Fz)/dz; where F is a vector. I don't know if this explanation has solved your doubt. Best regards,

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月12日 GMT-4 15:09
Dear Isabel,

Thanks for your response, Actullay I am looking for a divergence of a second order tensor field . you gave me the divergence of a vector.

best
Dear Isabel, Thanks for your response, Actullay I am looking for a divergence of a second order tensor field . you gave me the divergence of a vector. best

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月22日 GMT-4 13:52

hi,

I have 2d-axisymmetric model and I want to define an external force using the divergence of the Maxwell stress tensor. what is the the divergence form in 2d-Axisymmetric ?

I mean where I should put r or divide by (r) in my equation ?

Is d(Tem11,r)+d(Tem12,z) is enough for first element ?

best


Hi Osameh,
did you get any solution to your Maxwell stress tensor problem?I m having the same issue!
Thanks in advance,

David.
[QUOTE] hi, I have 2d-axisymmetric model and I want to define an external force using the divergence of the Maxwell stress tensor. what is the the divergence form in 2d-Axisymmetric ? I mean where I should put r or divide by (r) in my equation ? Is d(Tem11,r)+d(Tem12,z) is enough for first element ? best [/QUOTE] Hi Osameh, did you get any solution to your Maxwell stress tensor problem?I m having the same issue! Thanks in advance, David.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月22日 GMT-4 15:15
David,

see this:

en.wikipedia.org/wiki/Curvilinear_coordinates#Divergence_of_a_second-order_tensor_field_2

David, see this: http://en.wikipedia.org/wiki/Curvilinear_coordinates#Divergence_of_a_second-order_tensor_field_2

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月23日 GMT-4 16:55

Thanks for your rapid reply Osemeh,

But my other concern is that, for the moment I have just the expression of the Maxwell stress tensor in cartesian coordinates.
How do you transform the Maxwell stress tensor from cartesian coordinates to cylindrical coordinates?

Thanks again for your past answer,

David.
Thanks for your rapid reply Osemeh, But my other concern is that, for the moment I have just the expression of the Maxwell stress tensor in cartesian coordinates. How do you transform the Maxwell stress tensor from cartesian coordinates to cylindrical coordinates? Thanks again for your past answer, David.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月23日 GMT-4 18:00

In 2D axisymmetric comsol model, can we say

Txx Txy Trr Trz
Tyy Tyy tensor equivalents to Tzr Tzz tensor?

Then, I can use immediately the wikipedia page that you enclosed to me.

So I think in 2D axisymmetric, we do not use theta from the cylindrical coordinates in 2D axisymmetric, right?

Can you enlighten me on this issue Osameh?


Thanks,

david.
In 2D axisymmetric comsol model, can we say Txx Txy Trr Trz Tyy Tyy tensor equivalents to Tzr Tzz tensor? Then, I can use immediately the wikipedia page that you enclosed to me. So I think in 2D axisymmetric, we do not use theta from the cylindrical coordinates in 2D axisymmetric, right? Can you enlighten me on this issue Osameh? Thanks, david.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月23日 GMT-4 18:03
sorry it didnt go well. I meant,

Can we say

Txx Txy
Tyx Tyy

is equivalent to

Trr Trz
Tzr Tzz
?
Thanks
sorry it didnt go well. I meant, Can we say Txx Txy Tyx Tyy is equivalent to Trr Trz Tzr Tzz ? Thanks

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月23日 GMT-4 20:39
Axisymmetric means that you have symmetry around one axis, yes you are right , 2d axisymmetric means that you have symmetry for " Phi".

about the Maxwell stress tensor , I think the nature of this tensor is Second Rank Tensor and it is not coordinate dependent.

best
Axisymmetric means that you have symmetry around one axis, yes you are right , 2d axisymmetric means that you have symmetry for " Phi". about the Maxwell stress tensor , I think the nature of this tensor is Second Rank Tensor and it is not coordinate dependent. best

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月24日 GMT-4 10:33

Hi Osameh,
You must be right, the maxwells stress tensor doesn't seem to be coordinate-system dependent for any other orthogonal system.

Thanks again for your rapid responses!

Have a great day and best wishes in your researches!

david
Hi Osameh, You must be right, the maxwells stress tensor doesn't seem to be coordinate-system dependent for any other orthogonal system. Thanks again for your rapid responses! Have a great day and best wishes in your researches! david

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月24日 GMT-4 12:37
Actually it may be not that, I tried in my program comsol to do the change in the divergence with the wikipedia page that you gave me, and without changing the cartesian tensor, but the error is an error with the jacobian.
So, the tensor should be different.

I enclose my comsol program if it can be of any help. the equations that I use are in model->definition->variable.
What I did there is basically to say that F=div(T) where T is the maxwell stress tensor
and T=epsilonrEE(transpose)-1/2*EE(transpose)I,
where I is the identity matrix.


Actually it may be not that, I tried in my program comsol to do the change in the divergence with the wikipedia page that you gave me, and without changing the cartesian tensor, but the error is an error with the jacobian. So, the tensor should be different. I enclose my comsol program if it can be of any help. the equations that I use are in model->definition->variable. What I did there is basically to say that F=div(T) where T is the maxwell stress tensor and T=epsilonrEE(transpose)-1/2*EE(transpose)I, where I is the identity matrix.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月24日 GMT-4 16:42
According to comsol, the wikipedia equation of the tensor divergence is unconsistant.
According to comsol, the wikipedia equation of the tensor divergence is unconsistant.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月7日 GMT-4 06:15
Hi there,

also as new user, who wasted several weeks now with on false 2D axisymmetric models, I must add that this is far more than dissapointing.
In my opinion it is by far not obvious for the common user that the program uses a different coordinate system internally than defined by the geometry. BTW: at least in the case of the Helmholtz equation the front end does not even show its internal definition of the nabla operator.

I must say, that I thought of comsol multiphysics as a really great piece of software. I mean, the front end, the live links to other programs and its huge spectrum of functionality are really convincing.

Now I must regretfully and painfully learn, that over quite some time all my calculations were complete nonsense.

It is totaly incomprehensible, why the mathematics models are not correctly implemented.

I strongly suggest to correct this flaw in future releases, because it is a completely unnecessary drawback of your otherwise fine software.

cheers,
jan

P.S: It is also not straight forward (at least for me) to manually correct for the missing terms.
Hi there, also as new user, who wasted several weeks now with on false 2D axisymmetric models, I must add that this is far more than dissapointing. In my opinion it is by far not obvious for the common user that the program uses a different coordinate system internally than defined by the geometry. BTW: at least in the case of the Helmholtz equation the front end does not even show its internal definition of the nabla operator. I must say, that I thought of comsol multiphysics as a really great piece of software. I mean, the front end, the live links to other programs and its huge spectrum of functionality are really convincing. Now I must regretfully and painfully learn, that over quite some time all my calculations were complete nonsense. It is totaly incomprehensible, why the mathematics models are not correctly implemented. I strongly suggest to correct this flaw in future releases, because it is a completely unnecessary drawback of your otherwise fine software. cheers, jan P.S: It is also not straight forward (at least for me) to manually correct for the missing terms.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月7日 GMT-4 09:25
Hello Jan-Henrik,
I suspect you are running an outdated version of the software. In the current version, the definition of \nabla is displayed when solving the Helmholtz equation using the Mathematics interface; see attached screenshot.
Jeff
Hello Jan-Henrik, I suspect you are running an outdated version of the software. In the current version, the definition of \nabla is displayed when solving the Helmholtz equation using the Mathematics interface; see attached screenshot. Jeff


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月7日 GMT-4 13:08
Hi,

thanks. I was running 4.1, which indeed does not come about with this helpful hint.

In the meantime I figured out how to compensate for the missing stuff. Just in case anybody else faces a similar problem...

If your diffusion coefficient c is isotropic, you just muliply *all* coefficients (c,f and a) by r. Thats it.
And voila, it produces the same result as a true 3D calculation.
I don't know what happens if the diffusivity is not isotropic.

greetings,
jan
Hi, thanks. I was running 4.1, which indeed does not come about with this helpful hint. In the meantime I figured out how to compensate for the missing stuff. Just in case anybody else faces a similar problem... If your diffusion coefficient c is isotropic, you just muliply *all* coefficients (c,f and a) by r. Thats it. And voila, it produces the same result as a true 3D calculation. I don't know what happens if the diffusivity is not isotropic. greetings, jan

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 2011年9月7日 GMT-4 18:05
Hi

r or 2*pi*r ? ;)

--
Good luck
Ivar
Hi r or 2*pi*r ? ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年9月9日 GMT-4 09:55
Hm, I compared normalized results...
Maybe you're right with the 2*pi...

But why should there be a factor 2*pi?
I mean, comsol uses nabla =[dr, dz] so the first term operator of the Helmholtz equation looks like
[dr, dz]*(c*[dr,dz])
where c =[c11,0;0,c22] is a diagonal matrix in the isotropic case (dr and dz denote the derivation with respect to r and z).
This is the equal to
dr*(c11*dr) + dz*(c22*dz)
But I really want is
1/r*dr*(r*c11*dr) + dz*(c22*dz)
So in the first step I multiply the whole eqation by r and the above becomes
dr*(r*c11*dr) + dz*(r*c22*dz)
Hence, c has to become r*c.

Did I miss anything?

jan
Hm, I compared normalized results... Maybe you're right with the 2*pi... But why should there be a factor 2*pi? I mean, comsol uses nabla =[dr, dz] so the first term operator of the Helmholtz equation looks like [dr, dz]*(c*[dr,dz]) where c =[c11,0;0,c22] is a diagonal matrix in the isotropic case (dr and dz denote the derivation with respect to r and z). This is the equal to dr*(c11*dr) + dz*(c22*dz) But I really want is 1/r*dr*(r*c11*dr) + dz*(c22*dz) So in the first step I multiply the whole eqation by r and the above becomes dr*(r*c11*dr) + dz*(r*c22*dz) Hence, c has to become r*c. Did I miss anything? jan

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 2011年9月10日 GMT-4 05:22
Hi

You have probably not missed anything
,
my 2*pi*r was mainly ment as a reminder, as it's the most common error when integrating in 2D-axi, when one integrate over an edge and desire the area which menas one should not forget hte "2*pi*r*dr" instead of the cartesian "dx*dy"

The same for the development of the 2D-axi variables, to avoid the singularity at r=0, but then it's mostly "r" as the 2*pi* appear twice and simplifies

--
Good luck
Ivar
Hi You have probably not missed anything , my 2*pi*r was mainly ment as a reminder, as it's the most common error when integrating in 2D-axi, when one integrate over an edge and desire the area which menas one should not forget hte "2*pi*r*dr" instead of the cartesian "dx*dy" The same for the development of the 2D-axi variables, to avoid the singularity at r=0, but then it's mostly "r" as the 2*pi* appear twice and simplifies -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年12月15日 GMT-5 07:18

If you're using a Mathematics interface (like coefficient form, general form or weak form), yes.
If you're using a physics interface (where the equations are already implemented), no.


Why is this NOT implemented for general form PDE's, nor explained clearly in the manual?

Are there any models in the model library that give an example how it can be implemented? I just want to see that I have correctly understood what has been said in this thread.
[QUOTE] If you're using a Mathematics interface (like coefficient form, general form or weak form), yes. If you're using a physics interface (where the equations are already implemented), no. [/QUOTE] Why is this NOT implemented for general form PDE's, nor explained clearly in the manual? Are there any models in the model library that give an example how it can be implemented? I just want to see that I have correctly understood what has been said in this thread.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年12月15日 GMT-5 09:20
hi,

I think in 2D-axisymmetric, we should not have any derivative with respect to Phi in our equations , is it right ?

best
hi, I think in 2D-axisymmetric, we should not have any derivative with respect to Phi in our equations , is it right ? best

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2017年1月25日 GMT-5 04:03
This is not complete information. In cylindrical coordinate system
d/dtheta (er) = etheta
so etheta*d/detheta (er) = 1

If \nabla defined as (d/dr ; d/dz ) then we will miss a term in an axisymmetric system when calculating \nabla . ( c \nabla u) = f
for c=1 it should be: d^2/dr^2 (u)+ (1/r)d/dr (u)+ d^2/dz^2 (u)
and not this: d^2/dr^2 (u) + d^2/dz^2 (u)

Can you please clarify on this...

Note: er, etheta and ez are unit vectors in the respective direction.
This is not complete information. In cylindrical coordinate system d/dtheta (er) = etheta so etheta*d/detheta (er) = 1 If \nabla defined as (d/dr ; d/dz ) then we will miss a term in an axisymmetric system when calculating \nabla . ( c \nabla u) = f for c=1 it should be: d^2/dr^2 (u)+ (1/r)d/dr (u)+ d^2/dz^2 (u) and not this: d^2/dr^2 (u) + d^2/dz^2 (u) Can you please clarify on this... Note: er, etheta and ez are unit vectors in the respective direction.

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2017年1月25日 GMT-5 07:58
Hi,

Maybe this blog post is helpful?

www.comsol.se/blogs/guidelines-for-equation-based-modeling-in-axisymmetric-components/

As a side note, it is possible to use LateX to write easy-to-read equations like



Just precede the LateX code by '[math]'.

At the end of the equation, place '[/m ath]'. (I had to insert a space to convince the system not to believe it was an equation.)

Regards,
Henrik
Hi, Maybe this blog post is helpful? https://www.comsol.se/blogs/guidelines-for-equation-based-modeling-in-axisymmetric-components/ As a side note, it is possible to use LateX to write easy-to-read equations like [math] \frac{\partial}{\partial \theta} \mathbf e_r = \mathbf e_{\theta} [/math] Just precede the LateX code by '[math]'. At the end of the equation, place '[/m ath]'. (I had to insert a space to convince the system not to believe it was an equation.) Regards, Henrik

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.