Daniel Smith
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
14 feb 2018, 08:31 GMT-5
Updated:
7 years ago
14 feb 2018, 08:31 GMT-5
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:
7 years ago
14 feb 2018, 11:49 GMT-5
Updated:
7 years ago
14 feb 2018, 11:57 GMT-5
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:
7 years ago
14 feb 2018, 12:22 GMT-5
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:
7 years ago
15 feb 2018, 11:51 GMT-5
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:
7 years ago
15 feb 2018, 12:09 GMT-5
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.