Changeset 2899 for branches/mcstas-1.x

Show
Ignore:
Timestamp:
07/13/10 15:35:20 (23 months ago)
Author:
pkwi
Message:

ESS_moderator_long normalization redefined. Previous normalization was _per_ pulse, is now per second.

Confusing branch_frame removed, replaced by twopulses flag, which equally distributes events on one/two pulses.

ESS_test.instr added, produces average fluxes for the cold and thermal moderators, in agreement with Mezei note dated 31.12.2000

Location:
branches/mcstas-1.x/lib
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • branches/mcstas-1.x/lib/sources/ESS_moderator_long.comp

    r2168 r2899  
    22* 
    33* Mcstas, neutron ray-tracing package 
    4 *         Copyright (C) 1997-2006, All rights reserved 
     4*         Copyright (C) 1997-2010, All rights reserved 
    55*         Risoe National Laboratory, Roskilde, Denmark 
    66*         Institut Laue Langevin, Grenoble, France 
     
    1313* Version: $Revision: 1.23 $ 
    1414* Origin: Risoe 
    15 * Release: McStas 1.9.1 
     15* Release: McStas 1.12b 
    1616* 
    1717* A parametrised pulsed source for modelling ESS long pulses. 
     
    8484* branch_tail: (1)   limit for switching between pulse and tail 
    8585*                (suggested value: tau/d - default defined this way) 
    86 * branchframe: (1) limit for switching between 1st and 2nd pulse 
    87 *                  (if only one pulse wanted: 1) 
     86* twopulses: (1) Flag for selecting one or two pulses. 0 is one pulse.  
    8887* 
    8988* %E 
     
    9594                    T=50, tau=287e-6, tau1=0, tau2=20e-6, d=2e-3, n=20, 
    9695                    n2=5, chi2=0.9, I0=6.9e11, I2=27.6e10, 
    97                     branch1=1, branch2=0.5, branch_tail=0.14350, branchframe=0) 
     96                    branch1=1, branch2=0.5, branch_tail=0.14350, twopulses=0) 
    9897OUTPUT PARAMETERS (M, F, l_range, w_mult) 
    9998STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p) 
     
    101100DECLARE 
    102101%{ 
    103   double l_range, w_mult; 
     102  double l_range, w_mult, branchframe; 
    104103 
    105104  double M(double l, double temp) 
     
    129128  } 
    130129 
     130  if (twopulses) { 
     131    branchframe = 0.5; 
     132    printf("ESS_moderator_long: %s: INFO: Running with TWO pulses\n", NAME_CURRENT_COMP); 
     133  } else { 
     134    branchframe = 0; 
     135    printf("ESS_moderator_long: %s: INFO: Running with ONE pulse\n", NAME_CURRENT_COMP); 
     136  } 
     137 
    131138  l_range = l_high-l_low; 
    132139  w_mult = size*size*1.0e4;     /* source area correction */ 
    133140  w_mult *= l_range;            /* wavelength range correction */ 
    134141  w_mult *= 1/mcget_ncount();   /* Correct for number of rays */ 
    135   w_mult *= freq;               /* Correct for frequency */ 
     142  w_mult *= 50.0/3.0;           /* Correct for baseline frequency setting */ 
    136143%} 
    137144TRACE 
     
    236243  } 
    237244 } 
    238  if (rand01()<branchframe) 
    239    { 
    240      t+=1/freq; 
    241      p/=(branchframe); 
    242    } 
    243  else 
    244    p/=(1-branchframe); 
     245 if (rand01()<branchframe){ 
     246   t+=1/freq; 
     247 } 
    245248%} 
    246249