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.

Map vector field from 2D axisymmetric component (r-z coordinate) to 3D component (x-y-z coordinate)

Please login with a confirmed email address before reporting spam

Hi COMSOL community,

I am encountering an obstacle that the results from 2D axisymmetric component are mapped to 3D component as the initial values. The General Extrusion coupling is used in the 2D axisymmetric component (e.g. r=sqrt(x^2+y^2), z=z), and in the 3D component, this operator is utilized to generate initial values for, like, Solid Mechanics interface with this kind of form, e.g. comp1.genext1(withsol('sol1',u)). I found the scalar value can be directly mapped from 2D (r-z coordinate) to 3D (x-y-z coordinate), but for the vector fields, it is not straightforward since the revolving angle (phi) is unknown. Unlike the Revolution 2D data set in the postprocessing stage where we know the revolution ange (rev1phi) helping transform from 2D r-z coordinate to 3D Cartesian coordinate, the General Extrusion operator will not offer the information of revolving angle in the model set-up stage.

I also attached a simple testing model with two components in 2D axisymmetric and 3D Cartesian coordinate, respectively. The general extrusion coupling is set in the 2D component, and the initial values are expressed with this general extrusion operator in 3D component. However, the initial values are not correctly calulcated in the 3D Cartesian cooordinate.

Please any thoughts or solutions to this problem.

Thanks.



3 Replies Last Post Mar 29, 2018, 2:42 p.m. EDT
Chien Liu COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Mar 26, 2018, 4:21 p.m. EDT

Dear Dragon, You can either express the vector components with expressions, such as

comp1.genext1(withsol('sol1',u))*X/sqrt(X^2+Y^2)

for the X component, or, perhaps more conveniently, take advantage of COMSOL's built-in coordinate system capabilities - in this case use the Cylindrical System for the Initial Values node, as shown in the attached example.

Please feel free to contact support if you need further assistance.

Sincerely, Chien

Dear Dragon, You can either express the vector components with expressions, such as comp1.genext1(withsol('sol1',u))*X/sqrt(X^2+Y^2) for the X component, or, perhaps more conveniently, take advantage of COMSOL's built-in coordinate system capabilities - in this case use the Cylindrical System for the Initial Values node, as shown in the attached example. Please feel free to contact support if you need further assistance. Sincerely, Chien


Please login with a confirmed email address before reporting spam

Posted: 6 years ago Mar 26, 2018, 10:23 p.m. EDT

Dear Chien,

Thank you for your suggestions very much.

Actually, I tried the approach by setting, comp1.genext1(withsol('sol1',u))X/sqrt(X^2+Y^2), as the initial value. However, the error will occur when the coordinates of X and Y are both zeros, namely at the origin, since zero can not be as the denominator. I got the error message in COMSOL.

I also tried the second way to build an Cylindrical System like you metioned which was used in the initial value settings. The thing confusing me is that, when the different element sizes are used, some element sizes will result in correct answer, but some will not. An error message jumps out, like: Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: comp2.sys3.r@VDN$x - Defined as: (x2)((((x^2)+(y^2))^(-0.5))0.5) Failed to evaluate variable. - Variable: comp2.sys3.T11 - Defined as: d(comp2.sys3.r,x)/sqrt(((d(comp2.sys3.r,x)^2)+((d(comp2.sys3.phi,x)comp2.sys3.r)^2))+(d(comp2.sys3.a,x)^2)) Failed to evaluate expression.

Even for your attached model, if the element sizes are changed to fine or extremely fine, the same error message will occur. I am wondering the resaon casuing the error message is that the coordinate transform between Cylindrical and Cartersian is related to the meshing desinty. But even using the extremely fine mesh density, we still get the error message. Could you inspect this problem a little deeper?

Thank you so much. I look forward to hearing from you.

Best Regards, Dragon

Dear Chien, Thank you for your suggestions very much. Actually, I tried the approach by setting, comp1.genext1(withsol('sol1',u))X/sqrt(X^2+Y^2), as the initial value. However, the error will occur when the coordinates of X and Y are both zeros, namely at the origin, since zero can not be as the denominator. I got the error message in COMSOL. I also tried the second way to build an Cylindrical System like you metioned which was used in the initial value settings. The thing confusing me is that, when the different element sizes are used, some element sizes will result in correct answer, but some will not. An error message jumps out, like: Attempt to evaluate negative power of zero. - Function: ^ Failed to evaluate temporary symbolic derivative variable. - Variable: comp2.sys3.r@VDN$x - Defined as: (x*2)*((((x^2)+(y^2))^(-0.5))*0.5) Failed to evaluate variable. - Variable: comp2.sys3.T11 - Defined as: d(comp2.sys3.r,x)/sqrt(((d(comp2.sys3.r,x)^2)+((d(comp2.sys3.phi,x)*comp2.sys3.r)^2))+(d(comp2.sys3.a,x)^2)) Failed to evaluate expression. Even for your attached model, if the element sizes are changed to fine or extremely fine, the same error message will occur. I am wondering the resaon casuing the error message is that the coordinate transform between Cylindrical and Cartersian is related to the meshing desinty. But even using the extremely fine mesh density, we still get the error message. Could you inspect this problem a little deeper? Thank you so much. I look forward to hearing from you. Best Regards, Dragon

Chien Liu COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Mar 29, 2018, 2:42 p.m. EDT

Dear Dragon, If a mesh point happens to land on the Z axis (X=Y=0), then the error that you described may occur. You can shift the 3D geometry away from the Z axis to avoid this issue.

Please feel free to contact support if you need further assistance.

Sincerely, Chien

Dear Dragon, If a mesh point happens to land on the Z axis (X=Y=0), then the error that you described may occur. You can shift the 3D geometry away from the Z axis to avoid this issue. Please feel free to contact support if you need further assistance. Sincerely, Chien

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.