cylinder_intersect
Kristian Nielsen
kristian.nielsen at risoe.dk
Thu Mar 11 08:35:32 CET 1999
> As 'promised', I've got some trouble with mcstas, trying to put in the
> powder1 sample. In fact, all incoming neutrons are absorbed by the
> condition:
> ...
> if (cylinder_intersect(&t0, &t1, x, y, z, vx, vy, vz, radius, h))
> {
> printf("t0 %lf t1 %lf \n",t0, t1);
> if (t0 < 0)
> {
> ABSORB;
> }
> ...
> I checked the neutron parameters, and a typical neutron comes in with:
> vx= 15 vy= -29 vz= 2903 m/s
> x=-0.003 y=-0.014 z= 0.000 m
> The sample is defined as
> radius 0.020000 height 0.050000 m
> And the routine cylinder_intersect gives finally
> t0 -0.000007 t1 0.000007
As you mention yourself, the problem is that the neutron is already in
the middle of the sample (z=0) when the sample scattering is computed,
so a negative flight time to the sample surface is computed. Since
neutrons cannot pass backwards in time, McStas absorbs in this case (of
course, it should really provide some warning about this condition; that
will be in a later version).
This kind of problem is usually caused by overlapping components. My
guess is that you have some kind of monitor/detector at the same
physical position as the sample, but before the sample in the logical
ordering. Move the monitor 0.021 cm closer to the monochromator so that
it does not overlap the sample, and I think the problem will be solved.
Good luck with your simulations!
- Kristian.
More information about the mcstas-users
mailing list