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.

Releasing rays tangential to geometry curve

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Hi everyone,

I would like to be able to use the Release from Edge node in Geometrical Optics to release rays tangentially to an interpolation curve that I've drawn into a 3D geometry.

Does anyone know if it's possible to use geometric variables such as "tcurv1x", "tcurv1z" etc.. to define the ray direction vectors? So far, I'm getting errors that these variables are unkown. Thanks for any help and please let me know if you need additional information.

-------------------
Nick

5 Replies Last Post 2018年2月15日 GMT-5 12:09
Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年2月14日 GMT-5 08:31
Updated: 6 years ago 2018年2月14日 GMT-5 08:31

Hi Nicholas, rays are not always in exact contact with geometric entities in a model, so you can't necessarily use geometric parameters to define ray properties. In cases where you know for sure the rays will be in contact with the geometry (such as for a release), you can use the bndenv operator for the initial direction. So, you can select a Release from Edge feature, and for the Ray direction vector set:

bndenv(t1x) bndenv(t1y) bndenv(t1z)

for example. The bndenv() operator evaluates expressions on the underlying geometry, rather than the rays themselves. See the COMSOL Multiphysics reference manual for more information on this operator and for geometry variables like t1x, t2y etc.

Dan

Hi Nicholas, rays are not always in exact contact with geometric entities in a model, so you can't necessarily use geometric parameters to define ray properties. In cases where you know for sure the rays will be in contact with the geometry (such as for a release), you can use the *bndenv* operator for the initial direction. So, you can select a *Release from Edge* feature, and for the *Ray direction vector* set: bndenv(t1x) bndenv(t1y) bndenv(t1z) for example. The *bndenv()* operator evaluates expressions on the underlying geometry, rather than the rays themselves. See the COMSOL Multiphysics reference manual for more information on this operator and for geometry variables like t1x, t2y etc. Dan

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年2月14日 GMT-5 11:49
Updated: 6 years ago 2018年2月14日 GMT-5 11:57

Hey Dan,

Thank you for the information! If I assign the Ray direction vector set as:

bndenv(t1x) 0 0

An error message says:

Complex number encountered in real expression. - Expression: if(particlestatus==1,comp1.gop.vgx,0) - Geometry: Rays

So it's telling me that the x-component of the group velocity is a complex number? Therefore, bndenv(t1x) is complex? I'm trying to track down the source of the error although I can't figure out why there would be a complex number showing up anywhere.. using abs() or real() operators does not seem to help.

I attached the model, in case it's of any help.

-------------------
Nick
Hey Dan, Thank you for the information! If I assign the *Ray direction vector* set as: bndenv(t1x) 0 0 An error message says: Complex number encountered in real expression. - Expression: if(particlestatus==1,comp1.gop.vgx,0) - Geometry: Rays So it's telling me that the x-component of the group velocity is a complex number? Therefore, bndenv(t1x) is complex? I'm trying to track down the source of the error although I can't figure out why there would be a complex number showing up anywhere.. using abs() or real() operators does not seem to help. I attached the model, in case it's of any help.


Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年2月14日 GMT-5 12:22

It works on a different boundary (within the cylinder) which is strange - I wonder if the problem is with the way I've defined the curve outside of the cylinder.

-------------------
Nick
It works on a different boundary (within the cylinder) which is strange - I wonder if the problem is with the way I've defined the curve outside of the cylinder.

Daniel Smith COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年2月15日 GMT-5 11:51

Ni Nicholas, it seems like the release from edge only works if it is part of a solid object. You'll have to use the interpolation curve in a work plane, extrude it so it becomes a face, then extrude the face so it becomes a solid object. You can then select the original edge to release the rays.

Dan

Ni Nicholas, it seems like the release from edge only works if it is part of a solid object. You'll have to use the interpolation curve in a work plane, extrude it so it becomes a face, then extrude the face so it becomes a solid object. You can then select the original edge to release the rays. Dan

Nicholas Goldring Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 2018年2月15日 GMT-5 12:09

Thank you Dan.

It's true that you can only employ geometric variables in the release node from an edge that has adjacent boundaries although for future reference, it is possible to release from an unattached edge using user defined functions and other built-in variables. Interestingly, I can use geometric variables to define the Density proportional to feature on a release node for an unattached edge.

-------------------
Nick
Thank you Dan. It's true that you can only employ geometric variables in the release node from an edge that has adjacent boundaries although for future reference, it is possible to release from an unattached edge using user defined functions and other built-in variables. Interestingly, I can use geometric variables to define the *Density proportional to* feature on a release node for an unattached edge.

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.