Component Manual for the Neutron Ray-Tracing Package McStas, version 3.9

12.18  The Inhomogenous_incoherent_process McStas Component

A sample component to separate geometry and phsysics

Identification

Description

This Union_process is based on the Incoherent_process.comp component originally written by Mads Bertelsen inspired by Kim Lefmann and Kristian Nielsen

Part of the Union components, a set of components that work together and thus sperates geometry and physics within McStas. The use of this component requires other components to be used.

1) One specifies a number of processes using process components like this one 2) These are gathered into material definitions using Union_make_material 3) Geometries are placed using Union_box / Union_cylinder, assigned a material 4) A Union_master component placed after all of the above

Only in step 4 will any simulation happen, and per default all geometries defined before the master, but after the previous will be simulated here.

There is a dedicated manual available for the Union components

Algorithm: The general algorithm for the Union system is described elsewhere.

I here give a brief introduction as to what changes occur when using an inhomogenous process in your Union make material. It is expected that you understand the basic algorithm of the Union system before reading this.

In Union, the neutron moves through a network of objects in a 3 dimensional world. When the neutron hits a material, the probability to scatter is calculated, and a Monte Carlo choice is taken, as to whether that neutron should scatter, or pass through. For a homogenous material (i.e constant attenuation coefficient <span class="latex">$\mu$</span>), this probability is the Beer-Lambert law,

<div class="latex">

$P_s = 1 - e^{-\mu l}$

</div>

Where <span class="latex">$P_s$</span> is the scattering probability, and <span class="latex">$l$</span> is length of the neutron path throughout the object.

For an inhomogenous material, this Beer-Lambert law must be modified, as <span class="latex">$\mu$</span> is a function of the position. Therefore the Beer-Lambert law becomes,

<div class="latex">

$P_s = \int^l_0 1 -  e^{-\mu(l’)l’}dl’$

</div>

Calculating this <span class="latex">$\mu$</span> in the inhomogenous case is often trivial, but not feasible, from a software development point of view (seeing as many different functions of <span class="latex">$\mu$</span> might be wanted). Instead the inhomogenous processes performs an approximate integral, by evaluating <span class="latex">$\mu$</span> at a number of points along the neutron path (This number is in fact number_of_sample_points).

For this incoherent process, the linear attenuation coefficient is,

<div class="latex"> $\mu = pack/V_u * 100 * \sigma$ </div>

Where <span class="latex">$pack$</span> is the packing factor of the material (defaults to 1), <span class="latex">$V_u$</span> is the Unit cell volume, and <span class="latex">$\sigma$</span> is the scattering cross section in barns. <span class="latex">$\mu$</span> therefore has units of <span class="latex">$m^{-1}$</span>.

For this component each factor in the attenuation coefficient can be a "tiny expression". This means that it can be a mathematical equation such as <span class="latex">$\sigma_{expr} = "5.08 + 1000 * z * 2.35"$</span>. When the attenuation coefficient is calculated, then the current value of <span class="latex">$z$</span> is used to get <span class="latex">$\sigma$</span>.

The parameters that the tiny expression can rely upon are currently: The positions, <span class="latex">$x, y, z$</span> The velocities <span class="latex">$vx, vy, vz$</span> and the time <span class="latex">$t$</span>

McStas uses a sligthly modified version of tiny expressions that evaluate exponentials from right to left instead of the standard left to right. Furthermore McStas has added two functions to tiny expressions. These are: A heavy side function hvs(variable, switch_point, large_val,small_val) which returns large val if variable > switch_point and small val otherwise.

A gaussian distribution:

gauss(A,sig,x), which evaluates to A*1/sqrt(2*PI)/sig*exp(-x^2/2/sig^2)

An example using these can be found in the Test instrument for this component, called Test_inhomogenous_process.instr. Example #9 implements a gaussian and a heavyside function. For more information on tiny expressions, see the link below.

Input parameters

Parameters in boldface are required; the others are optional.

Name

Unit

Description

Default

sigma

barns

Incoherent scattering cross section

0

sigma_expr

string

Tiny expression to be calculated as replacement for sigma

""

packing_factor

1

How dense is the material compared to optimal 0-1

1

packing_factor_expr

string

Tiny expression to be calculated as replacement for packing factor

""

unit_cell_volume

Å\(^{3}\)

Unit cell volume

0

unit_cell_volume_expr

string

Tiny expression to be calculated as replacement for the unit cell volume

""

gamma

meV

Lorentzian width of quasielastic broadening (HWHM) [1]

0

gamma_expr

meV

Tiny expression to be calculated as replacement for the gamma value.

""

f_QE

1

Fraction of quasielastic scattering (rest is elastic) [1]

0

number_of_sample_points

1

Number of points that are sampled along the neutron path through a material

20

interact_fraction

1

How large a part of the scattering events should use this process 0-1 (sum of all processes in material = 1)

-1

verbose

1

Flag that prints out the values calculated in the cross section calculation

0

init

string

Deprecated and unused. Accepted so that instruments written for McStas/McXtrace 3.8.7 and earlier, which name the Union_init component here, still compile.

""

Links