McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics NEXMAP


About McStas
 Conditions of use
 Project funding

 Other Downloads (share)

Mailing list

Search web/mailinglist

 Wiki (GitHub)
 McStas manual


Report bugs (GitHub)

Code-repository (GitHub)

McStas: Sample_nxs Component

[ Identification | Description | Input parameters | Output parameters | Links ]

The Sample_nxs Component

General powder/polycrystalline sample with neutron-matter interaction based on neutron cross section calculations of a unit cell


  • Author: Mirko Boin
  • Origin: Helmholtz-Zentrum Berlin fuer Materialien und Energie (Germany)
  • Date: Oct 2014
  • Version:(Unknown)


     - coherent and incoherent scattering, absorption and transmission
     - multiple scattering
     - wavelength-dependent neutron cross section calculation
     - unit cell definition (via input file)
     - focussing option for scattered neutrons (via d_phi)
     - strain gradient simulation for axial symmetric samples ( be extended)

Geometry is a powder filled cylinder or a box defined by radius or xwidth,
yheight, zthick respectively. The component handles coherent and incoherent
scattering (also multiple scattering), absorption and transmission. Hence, it
is suitable for diffraction (scattering) and imaging (transmission) instruments
at the same time. In order to improve the neutron statistics at the detector
these individual features can be enabled/disabled using TransOnly, IncohScat,
For example, if scattering shall not be monitored (e.g. imaging), then TransOnly
can be set to 1 to let the component calculate the neutron transmission through
the sample only. Likewise, incoherent scattering can be switched on and off.

The decision of whether a neuron shall be scattered, absorbed or transmitted is
based on the wavelength-dependent neutron cross sections (nxs), i.e. the neutron
velocity is used here. These cross sections represent the individual scattering
and absorption probabilities for each individual neutron. However, the calculation
of neutron cross sections depends on the material defined for this sample component.
Therefore, several input parameters such as the crystal structure and the atoms
involved (isotope mass, coherent scattering length, ...). This information is
provided by an input file with the following format:

# define the unit cell parameters:
# space_group - the space group number or Hermann or Hall symbol [string]
# lattice_a, ...b, ...c - the lattice spacings a,b,c [angstrom]
# lattice_alpha, ...beta, ...gamma - the lattice angles alpha,beta,gamma [degree]
# debye_temp - the Debye temperature [K]

space_group = -F 4 2 3 # space group number is also allowed (= 225)
lattice_a = 4.049
lattice_b = 4.049
lattice_c = 4.049
lattice_alpha = 90
lattice_beta = 90
lattice_gamma = 90
debye_temp = 429.0

# add atoms to the unit cell:
# notation is "atom_number = name b_coh sigma_inc sigma_abs_2200 molar_mass x y z"
# name - labels the current atom/isotope [string]
# b_coh - the coherent scattering length [fm]
# sigma_inc - the incoherent scattering cross section [barns]
# sigma_abs_2200 - the absorption cross sect. at 2200 m/s [barns]
# molar_mass - the Molar mass [g/mol]
# debye_temp - the Debye temperature [K]
# x y z - the Wyckoff postion of the atom inside the unit cell

add_atom = Al 3.449 0.008 0.23 26.98 0.0 0.0 0.0
The above example defines a pure (fcc) aluminium. Other example files are provided. Alternatively, a fallback mechanism exists to simulate an alpha-Fe (bcc) sample if an input file is missing. But have a look for warning messages during simulation to make sure you are not running the fallback alpha-Fe simulation accidently! CHANGELOG: v1.0 - first official release with McStas 2.0 v1.1 - enabled strain distribution v1.2 - use updated libnxs (global Debye temp -> parameter files changed) - corrected sigma incoherent - updated towards McStas 2.1 conventions For details, please contact the author and visit the nxs website and/or the repository. NXS Website: NXS Repository:
WARNING: This is a contributed Component.

Input parameters

Parameters in boldface are required; the others are optional.
Name Unit Description Default
TransOnly 0
IncohScat 1
MultiScat 1
xwidth 0.05
yheight 0.05
zthick 0.05
radius 0.0
nxsFileName ""
max_hkl 8
d_phi 0
strainFileName ""


[ Identification | Description | Input parameters | Output parameters | Links ]

Generated automatically by McDoc, Peter Willendrup <> / Wed Jan 12 15:13:20 2022

Last Modified: Wednesday, 12-Jan-2022 16:13:20 CET
Search website mailinglist archive GitHub repos