velocity selector

Peter Link Peter_Link at physik.tu-muenchen.de
Tue Mar 23 09:24:49 CET 1999


Hi Kristian,
here is another component for the McStas comunity.
Although I'm aware that in principle one can simulate the function of a
mechanical velocity selector with some filter component I tried to
create a selector component that is rather close to reality. I tested it
with a configuration where I have analytic calculation to compare to and
to me it seems O.K.
The principle is quite correctly explained in 
H. Friedrich et al.; Physica B 156&157 (1989) 547
May be some SANS people are interested in this comp too.
Have fun, best regards Peter.
-- 
******************************************
Dr. P. Link
IPC Uni Göttingen
Außenstelle Garching
Neue Forschungs- Neutronenquelle Garching
ZBE- FRM II- Bau
85747 Garching

Tel. 089 2891 4622
Fax. 089 2895 4622
mailto: plink at physik.tu-muenchen.de
******************************************

-------------- next part --------------
/*******************************************************************************
*
*         McStas component for version 1.0, released October 26, 1998
*         Peter Link, IPC University of Göttingen
*
* Component: Selector
*
* Written by: Peter Link  MARCH 1999
*
* velocity selector (helical lamella type)
* 
* 
*
* INPUT PARAMETERS:
*
* xmin:        Lower x bound (m)
* xmax:        Upper x bound (m)
* ymin:        Lower y bound (m)
* ymax:        Upper y bound (m)
* len:         rotor length  (m)
* num:         number of spokes/lamella (1)
* width:       width of spokes at beam-center (m)
* radius:      radius of beam-center (m)
* alfa:        angle of torsion (deg)
* feq:         frequency of rotation(1/s)
* 
*******************************************************************************/


DEFINE COMPONENT Selector
DEFINITION PARAMETERS (xmin, xmax, ymin, ymax, len, num,width,radius,alfa,feq)
SETTING PARAMETERS ()
STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p)
TRACE
%{
    double E;
    double dt;
	double open_angle,closed_angle,n_angle_in,n_angle_out;
	double sel_phase;
    
    PROP_Z0;
    E=VS2E*(vx*vx+vy*vy+vz*vz);
    if (x<xmin || x>xmax || y<ymin || y>ymax)
      ABSORB;                                  /* because outside frame */
    dt = len/vz;
    /* get phase angle of selector rotor as MonteCarlo choice 
	   only the free space between two neighboring spokes is taken
	   p is adjusted to transmission for parallel beam
    */
	n_angle_in = atan2( x,y+radius)*RAD2DEG;
	closed_angle = width/radius*RAD2DEG;
	open_angle = 360/num-closed_angle;
	sel_phase = open_angle*rand01();
	p *= (open_angle/(closed_angle+open_angle));
	
	PROP_DT(dt);

    if (x<xmin || x>xmax || y<ymin || y>ymax)
      ABSORB;                                  /* because outside frame */
    /* now let's look whether the neutron is still
	 between the same two spokes or absorbed meanwhile */
    
	n_angle_out = atan2(x,y+radius)*RAD2DEG;  /* neutron beam might be divergent */
    
	sel_phase = sel_phase + feq*dt*360 - alfa;  /* rotor turned, but spokes are torsaded */ 

	if (n_angle_out<(n_angle_in-sel_phase) || n_angle_out>(n_angle_in-sel_phase+open_angle) )
	    ABSORB;              /* because must have passed absorber */
     
    
%}
END



More information about the mcstas-users mailing list