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)


McStas: Elliptic_guide_gravity

[ Identification | Description | Input parameters | Links ]

The Elliptic_guide_gravity Component

Perfect elliptic guide which allows for simulations with gravity. The guide mirrors can be divided into segments with individual m-values. Parabolic guide components can also be simulated.

Identification

  • Author: Henrik Bo Hoffmann Carlsen and Mads Bertelsen
  • Origin: NBI
  • Date: 27 Aug 2012

Description

The Elliptic_guide_gravity component models a true elliptic guide, with separate
ellipses in the vertical (top/bottom) and horizontal (left/right) directions,
allowing gravity to be simulated.

The guide is centered along the z-axis, with entry and exit planes parallel to the
xy-plane. The guide entry is at z=0 (in line with other guide components).
By default, the ellipses are defined by specifying their focal points as
distances from the guide entry (linxw, loutxw, linyh, loutyh). In addition,
it is possible to directly define the ellipse through the parameter set:
majorAxisxw, minorAxisxw, majorAxisyh, minorAxisyh, together with
majorAxisoffsetxw and majorAxisoffsetyh, where the offset parameters place the
ellipse centers respectively.
Further, it is possible to approximate the ellipses through parabolas, or as
half ellipses.

m-values for the guides may be specified independently for each of the four walls,
as a scalar value for the entire wall, or as a vector distributing the m-values
evenly (seglength left unset) or according to the vector seglength.

Example 1, Elliptical definition using focal points:

Elliptic_guide_gravity(
l=50,
linxw=5,linyh=5,loutxw=10,loutyh=10,
xwidth=0.05,yheight=0.05,
R0=0.99,Qc=0.0219,alpha=6.07,m=1.0,W=0.003
)

Example 2: Half elliptical definition:

Elliptic_guide_gravity(
l=50,
linxw=5,linyh=5,loutxw=10,loutyh=10,
xwidth=0.1,yheight=0.1,
R0=0.99,Qc=0.0219,alpha=6.07,m=1.0,W=0.003,
option = "halfEllipse",
dimensionsAt = "entrance"
)

Example 3: Parabolic approximation:

Elliptic_guide_gravity(
l=50,
linxw=5,linyh=5,loutxw=1e6,loutyh=1e6, // values larger than 1e8 may cause erroneous results
xwidth=0.1,yheight=0.1,
R0 = 0.99,Qc=0.0219,alpha=6.07,m=1.0,W=0.003,
dimensionsAt = "exit"
)

Example 4: Elliptical definition with varying m-values:

Elliptic_guide_gravity(
l=50,
linxw=5,linyh=5,loutxw=10,loutyh=10,
xwidth=0.1,yheight=0.1,
R0 = 0.99,Qc=0.0219,alpha=6.07,m=1.0,W=0.003,
mvaluesright=marray,mvaluesleft=marray,mvaluestop=marray,mvaluesbottom=marray
)

where marray is initialized as
for(iter=0; iter < 50; iter++){ marray[iter] = 2; }
And Declared as
double mValues[50];
If you are using the array-based coating-specification, you **must** give nSegments a compatible value.

Input parameters

Parameters in boldface are required; the others are optional.
NameUnitDescriptionDefault
xwidthmwidth at the guide entry, mid or exit (see dimensionsAt)0
yheightmheight at the guide entry, mid or exit (see dimensionsAt)0
lmlength of the guide
linxwmdistance from 1st focal point to guide entrance - left and right horizontal mirrors0
loutxwmdistance from 2nd focal point to guide exit - left and right horizontal mirrors0
linyhmdistance from 1st focal point to guide entrance - top and bottom vertical mirrors0
loutyhmdistance from 2nd focal point to guide exit - top and bottom vertical mirrors0
majorAxisxwmDirect definition of the guide geometry, will ignore linxw, loutxw, linyh, and loutyh if this is nonzero. Length of the axis parallel to z for the horizontal ellipse.0
minorAxisxwmDirect definition of the guide geometry, will ignore linxw, loutxw, linyh, and loutyh if this is nonzero. Length of the axis perpendicular to z for the horizontal ellipse.0
majorAxisyhmDirect definition of the guide geometry, will ignore linxw, loutxw, linyh, and loutyh if this is nonzero. Length of the axis parallel to z for the vertical ellipse.0
minorAxisyhmDirect definition of the guide geometry, will ignore linxw, loutxw, linyh, and loutyh if this is nonzero. Length of the axis perpendicular to z for the vertical ellipse.0
majorAxisoffsetxwmDirect definition of the guide geometry, distance between the center of the horizontal ellipse and the guide entrance.0
majorAxisoffsetyhmDirect definition of the guide geometry, distance between the center of the vertical ellipse and the guide entrance.0
dimensionsAtstringDefine whether xwidth and yheight sets the size of the opening, minor axis or the end of the guide."entrance"
optionstringOptions are 'ellipse' and 'halfEllipse'. Ellipse is defined by both the focal points, while halfEllipse locked the center of the ellipse either the entrance or exit of the guide, and use the focal point of the other end to define the ellipse"ellipse"
R01Low-angle reflectivity0.99
QcAA^-1Critical scattering vector0.0218
alphaAASlope of reflectivity6.07
m1m-value of material for all mirrors, zero means complete absorption.2
WAA^-1Width of supermirror cut-off0.003
alpharightAASlope of reflectivity for right vertical mirror-1
mright1m-value of material for right vertical mirror-1
alphaleftAASlope of reflectivity for left vertical mirror-1
mleft1m-value of material for left vertical mirror-1
alphatopAASlope of reflectivity for top horizontal mirror, overwrites alpha-1
mtop1m-value of material for top horizontal mirror, overwrites m-1
alphabottomAASlope of reflectivity for bottom horizontal mirror-1
mbottom1m-value of material for bottom horizontal mirror-1
verboseboolGive extra information about calculations"on"
enableGravitymFlag to select propagation with gravity.1.0
curvaturemSimulate horizontal radius of curvature by centripetal force added to the gravity. Note: Does not curve the guide in mcdisplay but "curves the neutron". Has opposite sign definition of Guide_curved.0
nSegmentsmMust be used to specify number of guide segments, i.e. when giving inputs mvaluesright ... etc.-1
mvaluesrightpointerPointer to array of m-values, right mirrorNULL
mvaluesleftpointer- same, left mirrorNULL
mvaluestoppointer- same, top mirrorNULL
mvaluesbottompointer- same, bottom mirrorNULL
seglengthpointerPointer to array of segment lengths for discrete mirror descriptionNULL
AT ( , , ) RELATIVE
ROTATED ( , , ) RELATIVE

Links


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

Generated on mcstas 3.9.2


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