[mcstas-users] Inconsistent results using MPI and SPLIT
Thierry Bigault
bigault at ill.fr
Thu Jun 18 18:59:23 CEST 2020
Dear All,
I built the attached instrument file to try and simulate a reflectometer.
When I saw that I needed 10 minutes of calculation to get 3 neutrons on
my sample, I thought it was time to try and optimize.
After having a look at the manual, I first put some SPLIT keywords
positioned at 5 different components, which I estimate as strategic. I
gained a lot in statistics on the sample.
Then I decided to use the MPI feature, as my laptop has 8 cores. It
nicely reduces the computing time, at first sight it looks really great !
But the results looked strange, so I made some more systematic tests and
the result is on the attached plots. With all SPLIT commented ("no
SPLIT") it looks fine, the calculated intensity on the sample is
consistent within the error-bars, whatever the number of nodes I use.
When combining all SPLITs active and MPI ("5 SPLIT"), the calculation
time and error-bars can be strongly reduced but the result depends
completely on the number of nodes, with differences much larger than the
error-bar...
Either I did something wrong, or there is a bug somewhere. If someone
has an idea about this issue, I would be interested.
I use version 2.6.1 (May 04, 2020) on Windows 10.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPI and SPLIT tests full H15.tif
Type: image/tiff
Size: 1498450 bytes
Desc: not available
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200618/4669a211/attachment-0001.tif>
-------------- next part --------------
/*******************************************************************************
* Instrument: <MonH15_T3_levieux>
*
* %Identification
*
* author: <Thierry Bigault (bigault at ill.fr)>
* date: 07/05-16/06/2020
* version: 1.0
* origin: ILL
*
* %Instrument_site: ILL
*
* %Description
*
* Attempt to reconstruct H15 up to T3, as of 12/05/2020
* the notations are those of DPT11 Ind C (March 2017)
* There was a change of H1-H2 in 2006 (SNAG)
*
* %Parameters
*
* longmin, longmax [Ang] : min / max wavlengths generated by the source
* gGap [m]: little gaps between elments all along the guide
* gAlpha [-]: slope of reflectivity curves after Qc
* m_AvalVS [-]: m-value of guide coatings after the Safety Valve
* IN6MonoAngle [deg]: average Bragg angle of IN6 triple monochromator
*
* %Links
* <reference/HTML link>
*
* %End
********************************************************************************/
DEFINE INSTRUMENT MonH15_T3_levieux(
double longmin = 0.1, double longmax=15.1,
double gGap = 0.001, double gAlpha = 3, double m_AvalVS = 1,
double IN6MonoAngle = 49.47)
DECLARE
%{
/* global parameters*/
// double longmin=0.1;
// double longmax=15.1;
double longuonde;
double dlonguonde;
/* source parameters*/
double DistSourceGuide = 2.330; /* Distance from the source to the guide entry */
/* gaps and Al windows parameters */
double Al_Thickness = 0.002;
// double gGap = 0.001;
double VS_gap = 0.148; /* thickness of VS (="B") */
double OT1H15_gap = 0.107; /* space between guides for OT1H15 shutter (="D") */
double OT2H15_gap = 0.113; // space between guides for OT2H15 shutter (="G")
/* Guide geometry parameters H15-1, 2, A */
double LH15_1 = 1.997;
double LH15_2= 1.289;
double LH15_A= 0.228;
/* Guide geometry parameters H15-3*/
double LH15_3= 5.500;
double RH15_3= 2850; /* curvature radius realised (design=2700 m) */
double LongSegmentH15_3 = 0.5;
double AngleSegmentH15_3; /*angle between successive segments */
double AngleTotalH15_3; /*angle for the total H15_3 length */
/* Guide geometry parameters H15-4*/
double LH15_4= 17.000;
double RH15_4= 2850; /* curvature radius realised (design=2700 m) */
double LongSegmentH15_4 = 1;
double AngleSegmentH15_4; /*angle between successive segments */
double AngleTotalH15_4; /*angle for the total guide section length */
/* Guide geometry parameters H15-5*/
double LH15_5= 4.750;
double RH15_5= 2850; /* curvature radius realised (design=2700 m) */
double NombreSegmentsH15_5= 5; /* closest possible to 1m-long segments */
double LongSegmentH15_5;
double AngleSegmentH15_5; /*angle between successive segments */
double AngleTotalH15_5; /*angle for the total guide section length */
/* Guide geometry parameters H15-6*/
double LH15_6= 22.335;
double RH15_6= 2700;
double NombreSegmentsH15_6= 22; /* closest possible to 1m-long segments */
double LongSegmentH15_6;
double AngleSegmentH15_6; /*angle between successive segments */
double AngleTotalH15_6; /*angle for the total guide section length */
/* IN6 Monochormator */
// double IN6MonoAngle = 37.66; // Bragg angle, min = 37.66 (4.1 AA), max = 61.55 (5.9 AA)
double IN6Mono_gap = 0.170; /* gap between guides at the IN6 mono position */
double IN6_LA = 2.100; // Distance monok - sample
double IN6_l = 0.030; // distance along z between 2 crystals
double IN6_dtheta = 0; // Bragg angle difference between 2 crystals
/* Guide geometry parameters H15-7*/
double LH15_7= 5.415;
double RH15_7= 2700;
double NombreSegmentsH15_7= 5; /* closest possible to 1m-long segments */
double LongSegmentH15_7;
double AngleSegmentH15_7; /*angle between successive segments */
double AngleTotalH15_7; /*angle for the total guide section length */
/* T3 geometry parameters */
double T3Mono_gap = 0.060; // measure roughly on SLDASM file
double T3MonoAngle = 45;
double T3_MonoD1 = 1.285;
double T3_D1D2 = 0.800;
double T3_D2Sample = 0.270;
double T3_SampleDet = 0.700;
/* Guide geometry parameters H151-14 */
double LH151_14 = 7.000;
/* guide coating parameters */
double gR0 = 1;
double gQc = 0.0217;
// double gAlpha = 3; //4.07; 3 corresponds to today's standard at SwN, R>=93% at m=2
double gW = 0.0001;
double m_AmontVS= 2.1; /* m of coating upstream the VS (="B") */
// double m_AvalVS= 1.; /* m of coating downstream the VS (="B") */
%}
INITIALIZE
%{
longuonde = (longmax+longmin)/2;
dlonguonde = (longmax-longmin)/2;
/* rotation angle between each guide segment in H15_3 */
AngleSegmentH15_3 = (LongSegmentH15_3 / RH15_3) * RAD2DEG;
AngleTotalH15_3 = (LH15_3 / RH15_3) * RAD2DEG;
printf("H15_3: angle par segment = %f deg \n", AngleSegmentH15_3);
printf("H15_3: angle total = %f deg \n", AngleTotalH15_3);
/* rotation angle between each guide segment in H15_4 */
AngleSegmentH15_4 = (LongSegmentH15_4 / RH15_4) * RAD2DEG;
AngleTotalH15_4 = (LH15_4 / RH15_4) * RAD2DEG;
printf("H15_4: angle per segment = %f deg \n", AngleSegmentH15_4);
printf("H15_4: total angle = %f deg \n", AngleTotalH15_4);
/* Segment Length and rotation angle between each guide segment in H15_5 */
LongSegmentH15_5 = LH15_5 / NombreSegmentsH15_5;
AngleSegmentH15_5 = (LongSegmentH15_5 / RH15_5) * RAD2DEG;
AngleTotalH15_5 = (LH15_5 / RH15_5) * RAD2DEG;
printf("H15_5: length per segment = %f m \n", LongSegmentH15_5);
printf("H15_5: angle per segment = %f deg \n", AngleSegmentH15_5);
printf("H15_5: total angle = %f deg \n", AngleTotalH15_5);
/* Segment Length and rotation angle between each guide segment in H15_6 */
LongSegmentH15_6 = LH15_6 / NombreSegmentsH15_6;
AngleSegmentH15_6 = (LongSegmentH15_6 / RH15_6) * RAD2DEG;
AngleTotalH15_6 = (LH15_6 / RH15_6) * RAD2DEG;
printf("H15_6: length per segment = %f m \n", LongSegmentH15_6);
printf("H15_6: angle per segment = %f deg \n", AngleSegmentH15_6);
printf("H15_6: total angle = %f deg \n", AngleTotalH15_6);
/* Calculation of Bragg angle difference between IN6 mono crystals */
double IN6_L = IN6_LA * sin( 2 * IN6MonoAngle * DEG2RAD); // distance neutron axis - sample
double IN6_l0 = IN6_LA * cos( 2 * IN6MonoAngle * DEG2RAD); // 3rd side of triangle IN6_L, IN6_LA
double IN6_LB = sqrt( pow(IN6_L, 2) + pow(IN6_l + IN6_l0, 2 ) ); // distance crystal B - sample
IN6_dtheta = 0.5 * RAD2DEG * tan( 2 * IN6MonoAngle * DEG2RAD ) * (IN6_LB - IN6_LA) / IN6_LB; // Bragg angle difference B -A
// printf("distance neutron axis - sample = %f \n", IN6_L);
// printf("l0 = %f \n", IN6_l0);
// printf("LB = %f \n", IN6_LB);
printf("Bragg angle difference B -A = %f deg \n", IN6_dtheta);
/* Segment Length and rotation angle between each guide segment in H15_7 */
LongSegmentH15_7 = LH15_7 / NombreSegmentsH15_7;
AngleSegmentH15_7 = (LongSegmentH15_7 / RH15_7) * RAD2DEG;
AngleTotalH15_7 = (LH15_7 / RH15_7) * RAD2DEG;
printf("H15_7: length per segment = %f m \n", LongSegmentH15_7);
printf("H15_7: angle per segment = %f deg \n", AngleSegmentH15_7);
printf("H15_7: total angle = %f deg \n", AngleTotalH15_7);
%}
TRACE
COMPONENT origin = Progress_bar()
AT (0, 0, 0) RELATIVE ABSOLUTE
/* Source Froide Verticale (VCS) */
COMPONENT VCS = Source_gen(
yheight = 0.22, xwidth = 0.14,
dist = DistSourceGuide,
focus_xw = 0.038, focus_yh = 0.2,
Lmin = longmin, Lmax = longmax,
T1=216.8, I1=1.24e+13, /* VCS parameters for 58 MW */
T2=33.9, I2=1.02e+13,
T3=16.7 ,I3=3.0423e+12,
verbose = 1)
AT (0, 0, 0) RELATIVE PREVIOUS
/* 5 Al windows 2mm, like Farhi 2004 or Martin 2020 */
COMPONENT Al_window1 = Al_window(thickness=Al_Thickness) AT (0,0,0.21) RELATIVE VCS
COMPONENT COPY(Al_window1) = COPY(PREVIOUS) AT (0,0,0.61) RELATIVE VCS
COMPONENT COPY(Al_window1) = COPY(PREVIOUS) AT (0,0,0.78) RELATIVE VCS
COMPONENT COPY(Al_window1) = COPY(PREVIOUS) AT (0,0,0.92) RELATIVE VCS
COMPONENT COPY(Al_window1) = COPY(PREVIOUS) AT (0,0,2.20) RELATIVE VCS
/* monitor before 1st guide */
COMPONENT MoniteurEntreeGuide = Monitor_nD(
xwidth= 0.051,
yheight= 0.2,
restore_neutron = 1,
// options="x y, auto, all bins=40"
options="auto lambda, bins=50, capture per cm2"
) AT (0, 0, DistSourceGuide - Al_Thickness - 2*gGap) RELATIVE VCS
/* guides H15-1 and H15-2: L=3.29 m in 2 elements. no curvature
* Carters: Doigt de Gant; Carter Pink */
COMPONENT H15F1 = Al_window(thickness = Al_Thickness)
AT (0, 0, DistSourceGuide - Al_Thickness - gGap) RELATIVE VCS
COMPONENT GuideH15_1 = Guide_gravity(
w1 = 0.051, h1 = 0.2, w2 = 0.04735, h2=0.2, l = LH15_1,
m = m_AmontVS, R0 = gR0, Qc = gQc, alpha = gAlpha, W = gW)
AT (0, 0, DistSourceGuide) RELATIVE VCS
COMPONENT GuideLH15_2 = Guide_gravity(
w1= 0.04735, h1 = 0.2, w2 = 0.045, h2 = 0.2, l = LH15_2,
m = m_AmontVS, R0 = gR0, Qc = gQc, alpha = gAlpha, W = gW)
AT (0, 0, LH15_1 + gGap) RELATIVE GuideH15_1
/* guides H15-A, L=0.23 m in 1 element. no curvature
* Carter: obturateur Plomb */
COMPONENT GuideH15_A = Guide_gravity(
w1= 0.045, h1 = 0.2, w2 = 0.045, h2 = 0.2, l = LH15_A,
m = m_AmontVS, R0 = gR0, Qc = gQc, alpha = gAlpha, W = gW)
AT (0, 0, LH15_2 + gGap) RELATIVE GuideLH15_2
/* Reference for positions (z=0) in DPT11-C "Schematique de la ligne H15" */
COMPONENT H15F2 = Al_window(thickness = Al_Thickness)
AT (0, 0, LH15_A + gGap) RELATIVE PREVIOUS
/* guide H15-3, L=5.50 m in 2 elements. Curved left with radius = 2850 m
* This guide gets out of the H1-H2 swimming pool somewhere */
COMPONENT GuideH15_3_1 = Guide_gravity(
w1= 0.045, h1=0.2, w2 = 0.045, h2 = 0.2, l = LongSegmentH15_3,
m = m_AmontVS, R0 = gR0, Qc = gQc, alpha= gAlpha, W= gW)
AT (0, 0, LH15_A + Al_Thickness + 2*gGap) RELATIVE GuideH15_A ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_2 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_3 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_4 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_5 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_6 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_7 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_8 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_9 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_10 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_3_11 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_3, 0) RELATIVE PREVIOUS
/* Reference position 1 for capture flux measurements (no value in DPT11-IndC)*/
COMPONENT PastilleOr1 = Monitor_nD(
xwidth=0.045, yheight=0.2,
options="auto lambda, bins=50, capture per cm2")
AT (0, 0, LongSegmentH15_3 + gGap) RELATIVE PREVIOUS
/* VS (=point "B"), which is just a gap of 0.148 m */
COMPONENT BrasVS = Arm()
AT (0, 0, VS_gap) RELATIVE PREVIOUS
ROTATED (0, AngleTotalH15_3, 0) RELATIVE GuideH15_A
/* guide H15-4, L=17.0 m in 17 elements (10, then capture flux monitor, then 7). Radius = 2850 m */
/*SPLIT*/ COMPONENT GuideH15_4_1 = Guide_gravity(
w1= 0.030, h1 = 0.2, w2 = 0.030, h2 = 0.2, l = LongSegmentH15_4,
m = m_AvalVS, R0 = gR0, Qc = gQc, alpha = gAlpha, W = gW)
AT (0, 0, 0) RELATIVE BrasVS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE BrasVS
COMPONENT GuideH15_4_2 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_3 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_4 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_5 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_6 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_7 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_8 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_9 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_10 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
/* Reference position 2 for capture flux measurements (no value in DPT11-IndC), within 10 cm in z. */
COMPONENT PastilleOr2 = Monitor_nD(
xwidth=0.030, yheight=0.200,
options="auto lambda, bins=50, capture per cm2")
AT (0, 0, LongSegmentH15_4 + gGap/2) RELATIVE PREVIOUS
/* guide H15-4: remaining 7 elements (out of 17) */
COMPONENT GuideH15_4_11 = COPY(GuideH15_4_10)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE GuideH15_4_10 ROTATED (0, AngleSegmentH15_4, 0) RELATIVE GuideH15_4_10
COMPONENT GuideH15_4_12 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_13 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_14 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_15 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_16 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_4_17 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_4 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_4, 0) RELATIVE PREVIOUS
COMPONENT BrasMembraneMince = Arm()
AT (0, 0, LongSegmentH15_4+gGap) RELATIVE PREVIOUS
/* H15F3 Membrane mince (="C"), before crossing the reactor building enclosure */
COMPONENT H15F3 = Al_window( thickness = Al_Thickness)
AT (0, 0, 0) RELATIVE PREVIOUS
/* Reference position 3 for capture flux measurements (no value in DPT11-IndC), within ** cm in z. */
COMPONENT PastilleOr3 = Monitor_nD(
xwidth=0.030,
yheight=0.200,
options="auto lambda, bins=50, capture per cm2, parallel")
AT (0, 0, Al_Thickness + gGap) RELATIVE PREVIOUS
/* A PSD flux monitor */
/*COMPONENT PSD = Monitor_nD(
xwidth=0.030,
yheight=0.200,
options="x y, auto, bins=[3, 5], parallel, unactivate"
) AT (0, 0, 0) RELATIVE PREVIOUS */
/* guide H15-5: 5 elements of adjusted equal lengths (different from real guide) with R = 2850 */
COMPONENT GuideH15_5_1 = COPY(GuideH15_4_17)
(l = LongSegmentH15_5)
AT (0, 0, gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_5, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_5_2 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_5 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_5, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_5_3 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_5 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_5, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_5_4 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_5 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_5, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_5_5 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_5 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_5, 0) RELATIVE PREVIOUS
COMPONENT H15F4 = Al_window( thickness = Al_Thickness)
AT (0, 0, LongSegmentH15_5 + gGap) RELATIVE PREVIOUS
/* OT1 H15 (= point "D"), with a gap of 0.107 m */
COMPONENT BrasOT1H15 = Arm()
AT (0, 0, Al_Thickness + OT1H15_gap) RELATIVE H15F4
ROTATED (0, AngleTotalH15_5, 0) RELATIVE BrasMembraneMince
/* guide H15-6: 22 elements of adjusted equal lengths (different from real guide).
* 14 elements, then capture flux monitor, then 8 elements. Curvature R = 2700 m */
COMPONENT H15F5 = Al_window( thickness = Al_Thickness) AT (0, 0, 0) RELATIVE BrasOT1H15
COMPONENT GuideH15_6_1 = COPY(GuideH15_5_5) (l = LongSegmentH15_6)
AT (0, 0, Al_Thickness + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_2 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_3 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_4 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_5 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_6 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_7 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_8 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_9 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_10 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_11 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_12 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_13 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_14 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
/* Reference position 7 for capture flux measurements (DPT11-IndC), within 2 cm in z. */
COMPONENT PastilleOr7 = Monitor_nD(
xwidth=0.030, yheight=0.200,
options="auto lambda, bins=50, capture per cm2")
AT (0, 0, LongSegmentH15_6 + gGap/2) RELATIVE PREVIOUS
/* guide H15-6: remaining 8 elements (out of 22) */
COMPONENT GuideH15_6_15 = COPY(GuideH15_6_14)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE GuideH15_6_14 ROTATED (0, AngleSegmentH15_6, 0) RELATIVE GuideH15_6_14
COMPONENT GuideH15_6_16 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_17 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_18 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_19 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_20 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_21 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_6_22 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_6, 0) RELATIVE PREVIOUS
COMPONENT H15F6 = Al_window( thickness = Al_Thickness)
AT (0, 0, LongSegmentH15_6 + gGap) RELATIVE PREVIOUS
/* capture flux measurement */
COMPONENT CaptureAvantMonoIN6 = Monitor_nD(
xwidth = 0.030, yheight = 0.200,
options="auto lambda, bins=100, capture per cm2, parallel")
AT (0, 0, Al_Thickness + gGap) RELATIVE PREVIOUS
/* IN6 Monochomator, with gap of 0.170m between guides */
COMPONENT BrasIN6MonoGap = Arm()
AT (0, 0, Al_Thickness + IN6Mono_gap) RELATIVE H15F6
ROTATED (0, AngleTotalH15_6, 0) RELATIVE BrasOT1H15
/* IN6 Triple vertically focusing HOPG Monochomator */
COMPONENT IN6_MonochromatorFront = Monochromator_curved(
RV = 3, NV = 7, NH=1,
zwidth = 0.054, yheight = 0.029, // individual crystals sizes
DM = 3.355, gap = 0.001,
mosaic = 40, r0 = 1, t0 = 1 // mosaic in arcmin
) AT (0, 0, IN6Mono_gap / 2 - IN6_l) RELATIVE H15F6
ROTATED (0, IN6MonoAngle - IN6_dtheta, 0) RELATIVE H15F6
COMPONENT IN6_MonochromatorMiddle = COPY(PREVIOUS)
AT (0, 0, IN6Mono_gap / 2) RELATIVE H15F6
ROTATED (0, IN6MonoAngle , 0) RELATIVE H15F6
COMPONENT IN6_MonochromatorBack = COPY(PREVIOUS)
AT (0, 0, IN6Mono_gap / 2 + IN6_l) RELATIVE H15F6
ROTATED (0, IN6MonoAngle + IN6_dtheta, 0) RELATIVE H15F6
/* capture flux measurement */
COMPONENT CaptureAfterMonoIN6 = Monitor_nD(
xwidth = 0.030, yheight = 0.200,
options="lambda limits=[0.1 10.1], bins=100, capture per cm2, parallel")
AT (0, 0, 0) RELATIVE BrasIN6MonoGap
/* IN6 Monochromatic beam monitor */
/*
COMPONENT BrasIN6MonoBeam = Arm()
AT (0, 0, 0) RELATIVE IN6_MonochromatorMiddle
ROTATED (0, IN6MonoAngle, 0) RELATIVE IN6_MonochromatorMiddle
COMPONENT Beryllium = Filter_gen(
filename = "Be.trm",
xwidth = 0.080, yheight = 0.140, thickness = 0.12 / 0.05 // two Be blocks: 8+4 cm
) AT (0, 0, 1.005) RELATIVE BrasIN6MonoBeam
COMPONENT RealMonochromatic = Monitor_nD(
xwidth = 0.030, yheight = 0.050, //0.200,
options="lambda limits=[0.1 20.1], bins=100, per cm2, parallel")
AT (0, 0, IN6_LA) RELATIVE BrasIN6MonoBeam
ROTATED (0, 0, 0) RELATIVE BrasIN6MonoBeam
*/
/* guide H15-7: 5 elements of adjusted equal lengths (different from real guide). Curvature R = 2700 m */
COMPONENT H15F7 = Al_window( thickness = Al_Thickness) AT (0, 0, 0) RELATIVE BrasIN6MonoGap
COMPONENT GuideH15_7_1 = COPY(GuideH15_6_1) (l = LongSegmentH15_7)
AT (0, 0, Al_Thickness + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_7, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_7_2 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_7 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_7, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_7_3 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_7 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_7, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_7_4 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_7 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_7, 0) RELATIVE PREVIOUS
COMPONENT GuideH15_7_5 = COPY(PREVIOUS)
AT (0, 0, LongSegmentH15_7 + gGap) RELATIVE PREVIOUS ROTATED (0, AngleSegmentH15_7, 0) RELATIVE PREVIOUS
COMPONENT H15F8 = Al_window( thickness = Al_Thickness)
AT (0, 0, LongSegmentH15_7 + gGap) RELATIVE PREVIOUS
/* Gap for OT2 H15, position "G", (D7 Mono z position) */
/*COMPONENT SplitOfGuides = Slit(
xwidth=0.030, yheight=0.050)
AT (0, 0, Al_Thickness+ OT2H15_gap - gGap) RELATIVE H15F8
*/
COMPONENT BrasOT2H15 = Arm()
AT (0, 0.075, Al_Thickness + OT2H15_gap) RELATIVE H15F8
ROTATED (0, AngleTotalH15_7, 0) RELATIVE BrasIN6MonoGap
/* guide H151-14: straight guide, 7m long, smaller in height (only upper part of guide). */
COMPONENT H151F1 = Al_window( thickness = Al_Thickness)
AT (0, 0, 0) RELATIVE BrasOT2H15
/*SPLIT*/ COMPONENT GuideH151_14 = Guide_gravity(
l = LH151_14, w1 = 0.030, h1 = 0.050,
m = m_AvalVS, R0 = gR0, Qc = gQc, alpha = gAlpha, W = gW)
AT (0, 0, Al_Thickness) RELATIVE PREVIOUS
COMPONENT H151F2 = Al_window( thickness = Al_Thickness)
AT (0, 0, LH151_14 + gGap) RELATIVE PREVIOUS
/* flux measurements at T3 monochromator position */
COMPONENT CaptureFluxT3Mono = Monitor_nD(
yheight = 0.050, xwidth = 0.030,
options="lambda limits=[0.1 30.1], bins=300, capture per cm2, parallel"
) AT (0, 0, Al_Thickness + gGap) RELATIVE H151F2
COMPONENT RealFluxT3Mono = Monitor_nD(
yheight = 0.050, xwidth = 0.030,
options="lambda limits=[0.1 30.1], bins=300, per cm2, parallel"
) AT (0, 0, Al_Thickness + 2 * gGap) RELATIVE H151F2
/* T3 Monochomator i-HOPG, at about 0.060m from end of guide PARAMETERS TO BE CHANGED */
/*SPLIT*/ COMPONENT T3_Monochromator = Monochromator_curved(
NH = 1, NV = 1, zwidth = 0.040, yheight = 0.020, // individual crystals sizes
DM = 5.35, // KC8
mosaic = 4.6*60, r0 = 0.23, t0 = 1 // mosaic in arcmin, 4.6deg bad crystals MIRA 2008, r0=0.23
) AT (0, 0, Al_Thickness + T3Mono_gap) RELATIVE H151F2
ROTATED (0, T3MonoAngle, 0) RELATIVE H151F2
COMPONENT BrasT3MonoBeam = Arm()
AT (0, 0, 0) RELATIVE T3_Monochromator
ROTATED (0, T3MonoAngle, 0) RELATIVE T3_Monochromator
/*PSD monitor before diaphragms to check beam size */
COMPONENT PSD_T3_D1x = Monitor_nD(
yheight = 0.400, xwidth = 0.400,
options="x limits=[-0.15 0.15], bins=50 , parallel"
) AT (0, 0, T3_MonoD1 - gGap) RELATIVE BrasT3MonoBeam
COMPONENT PSD_T3_D1y = Monitor_nD(
yheight = 0.400, xwidth = 0.400,
options="y limits=[-0.15 0.15], bins= 50, parallel"
) AT (0, 0, T3_MonoD1 - gGap) RELATIVE BrasT3MonoBeam
/*Two successive T3 Diaphragms */
/*SPLIT*/ COMPONENT Diaphragm_1 = Slit(
xwidth = 1.2 / 1000, yheight = 0.100
) AT (0, 0, T3_MonoD1) RELATIVE BrasT3MonoBeam
/*SPLIT*/ COMPONENT Diaphragm_2 = Slit(
xwidth = 0.3 / 1000, yheight = 0.080
) AT (0, 0, T3_MonoD1 + T3_D1D2) RELATIVE BrasT3MonoBeam
/* Flux measurements at T3 sample position */
COMPONENT RealFluxT3Sample = Monitor_nD(
yheight = 0.100, xwidth = 0.00081,
options="lambda limits=[7.3 7.8], bins=40, parallel"
) AT (0, 0, T3_MonoD1 + T3_D1D2 + T3_D2Sample) RELATIVE BrasT3MonoBeam
/* PSD monitor at detector position */
COMPONENT PSD_T3_DetectorTube = Monitor_nD(
yheight = 0.200, xwidth = 0.025, // Detector tube size 0.158 (v) x 0.025 (w)
options="x limits=[-0.0125 0.0125], bins=40, y limits=[-0.1 0.1], bins= 40, parallel"
) AT (0, 0, T3_MonoD1 + T3_D1D2 + T3_D2Sample + T3_SampleDet) RELATIVE BrasT3MonoBeam
FINALLY
%{
%}
END
More information about the mcstas-users
mailing list