Download User and Programmers Guide to the Neutron Ray-Tracing

Transcript
A.1.6
Ray-geometry intersections
• box intersect(&t1 , &t2 , x, y, z, vx , vy , vz , dx , dy , dz ). Calculates the (0, 1, or
2) intersections between the neutron path and a box of dimensions d x , dy , and dz ,
centered at the origin for a neutron with the parameters (x, y, z, v x , vy , vz ). The
times of intersection are returned in the variables t 1 and t2 , with t1 < t2 . In the
case of less than two intersections, t 1 (and possibly t2 ) are set to zero. The function
returns true if the neutron intersects the box, false otherwise.
• cylinder intersect(&t1 , &t2 , x, y, z, vx , vy , vz , r, h). Similar to box intersect,
but using a cylinder of height h and radius r, centered at the origin.
• sphere intersect(&t1 , &t2 , x, y, z, vx , vy , vz , r). Similar to box intersect, but
using a sphere of radius r.
A.1.7
Random numbers
• rand01(). Returns a random number distributed uniformly between 0 and 1.
• randnorm(). Returns a random number from a normal distribution centered around
0 and with σ = 1. The algorithm used to get the normal distribution is explained
in [13], chapter 7.
• randpm1(). Returns a random number distributed uniformly between -1 and 1.
• randvec target circle(&vx , &vy , &vz , &dΩ, aimx , aimy , aimz , rf ). Generates a
random vector (vx , vy , vz ), of the same length as (aimx , aimy , aimz ), which is targeted
at a disk centered at (aimx , aimy , aimz ) with radius rf (in meters), and perpendicular
to the aim vector.. All directions that intersect the sphere are chosen with equal
probability. The solid angle of the sphere as seen from the position of the neutron is
returned in dΩ. This routine was previously called randvec target sphere (which
still works).
• randvec target rect angular(&vx , &vy , &vz , &dΩ, aimx , aimy , aimz ,height, width, Rot)
does the same as randvec target circle but targetting at a rectangle with angular
dimensions height and width (in radians, not in degrees as other angles). The rotation matrix Rot is the coordinate system orientation in the absolute frame, usually
ROT A CURRENT COMP.
• randvec target rect(&vx , &vy , &vz , &dΩ, aimx , aimy , aimz ,height, width, Rot) is
the same as randvec target rect angular but height and width dimensions are given
in meters. This function is useful to target at a guide entry window.
A.2
Reading a data file into a vector/matrix (Table input)
The read_table-lib provides functionalities for reading text (and binary) data files.
To use this library, add a %include "read_table-lib" in your component definition
DECLARE or SHARE section. Available functions are:
Risø–R–1416(EN)
91