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

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


The Vertical_Bender McStas Component

14.18  The Vertical_Bender McStas Component

Release: McStas 2.4

Multi-channel bender curving vertically down.

Identification

  • Author: Andrew Jackson, Richard Heenan

  • Origin: ESS

  • Date: August 2016, June 2017

Description

Based on Pol_bender written by Peter Christiansen Models a rectangular curved guide with entrance on Z axis. Entrance is on the X-Y plane. Draws a correct depiction of the guide with multiple channels - i.e. following components need to be displaced. Guide can contain multiple channels using horizontal blades Reflectivity modeled using StdReflecFunc and {R0, Qc, alpha, m, W} can be set for top (outside of curve), bottom (inside of curve) and sides (both sides equal), blades reflectivities match top and bottom (each channel is like a "mini guide"). Neutrons are tracked, with gravity, inside the wall of a cylinder using distance steps of diststep1. Upon crossing the inner or outer wall, the final step is repeated using steps of diststep2, thus checking more closely for the first crossing of either wall. If diststep1 is too large than a "grazing incidence reflection" may be missed altogether. If diststep1 is too small, then the code will run slower! Exact intersection tmes with the flat sides and ends of the bender channel are calculated first in order to limit the time spent tracking curved trajectories. Turning gravity off will not make this run any faster, as the same method is used.

28/06/2017 still need validation against other codes (e.g. for gravity off case)

Example: Vertical_Bender(xwidth = 0.05, yheight = 0.05, length = 3.0, radius = 70.0, nslit = 5, d=0.0005, diststep1=0.020, diststep2=0.002,

rTopPar={0.99, 0.219, 6.07, 3.0, 0.003},
rBottomPar={0.99, 0.219, 6.07, 2.0, 0.003},
rSidesPar={0.99, 0.219, 6.07, 2.0, 0.003},

See example instrument Test_Vert_Bender

%BUGS Original code did not work with rotation about axes and gravity. This tedious tracking method should work (28/6/17 still under test) for a vertical bender, with optional rotation about x axis and gravity (and likely rotation about y axis but needs testing, and even perhaps rotation about z axis as in rotated local frame Gx then is non zero but the edge solver still works). Would also need test the drawing in trace mode).

GRAVITY : Yes, when component is not rotated

Input parameters

Parameters in boldface are required; the others are optional.

Name

Unit

Description

Default

rTopPar

vector

Parameters for reflectivity of bender top surface

{0.99, 0.219, 6.07, 0.0, 0.003}

rBottomPar

vector

Parameters for reflectivity of bender bottom surface

{0.99, 0.219, 6.07, 0.0, 0.003}

rSidesPar

vector

Parameters for reflectivity of bender sides surface

{0.99, 0.219, 6.07, 0.0, 0.003}

xwidth

m

Width at the guide entry

yheight

m

Height at the guide entry

length

m

length of guide along center

radius

m

Radius of curvature of the guide (+:curve up/-:curve down)

G

m/s\(^{2}\)

Gravitational acceleration (currently unused)

9.8

nchan

1

Number of channels

1

d

m

Width of spacers (subdividing absorbing walls)

0.0

debug

1

0 to 10 for zero to maximum print out - reduce number of neutrons to run !

0

endFlat

1

If endflat>0 then entrance and exit planes are parallel.

0

drawOption

1

Drawing detail for mcdisplay, 1: fine, 2: normal, 3: rough

1

alwaystrack

1

default 0, 1 to force tracking even when gravity is off

0

diststep1

m

inital collision search steps for trajectory in cylinder when gravity is non zero

0.020

diststep2

m

final steps for trajectory in cylinder

0.002

Links

  • Component source code found in file Vertical_Bender.comp.


Last Modified: Tuesday, 06-Oct-2026 21:19:10 CEST
Search website mailinglist archive GitHub repos