Skip to content

Commit 87a3cca

Browse files
authored
Merge pull request #2343 from mccode-dev/phonon_focusing_fix
Phonon focusing fix
2 parents cf6a2db + 5bf8971 commit 87a3cca

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

mcstas-comps/examples/Tests_samples/Samples_Phonon/Samples_Phonon.instr

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* Simple test instrument for the Phonon_simple component.
1818
* Refer to the component documentation for further instructions.
1919
*
20-
* %Example: E=10 -n 1e5 Detector: mon1_I=2.86265e-25
20+
* %Example: E=10 -n 1e5 focus_r=0.001 Detector: mon1_I=2.86265e-25
21+
* %Example: E=10 -n 1e5 focus_a=0.1 Detector: mon1_I=2.86265e-25
2122
*
2223
* %Parameters
2324
* E: [meV] Mean energy at source
@@ -30,7 +31,21 @@
3031
*
3132
* %End
3233
******************************************************************************/
33-
DEFINE INSTRUMENT Samples_Phonon(E=10, DE=0, HDIV=1e-4, VDIV=1e-4, TT=72.69, OM=-43.3, C=8)
34+
DEFINE INSTRUMENT Samples_Phonon(E=10,
35+
DE=0,
36+
HDIV=1e-4,
37+
VDIV=1e-4,
38+
TT=72.69,
39+
OM=-43.3,
40+
C=8,
41+
focus_r = 0,
42+
focus_a = 0
43+
)
44+
45+
46+
INITIALIZE %{
47+
%}
48+
3449

3550
TRACE
3651

@@ -45,7 +60,8 @@ COMPONENT source = Source_div(
4560
AT (0,0,0) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1
4661

4762
COMPONENT sample = Phonon_simple(
48-
radius=0.01, yheight=0.02, focus_r=0.001,
63+
radius=0.01, yheight=0.02, focus_r=focus_r,
64+
focus_aw = focus_a, focus_ah = focus_a,
4965
target_index=+2,
5066
sigma_abs=0.17, sigma_inc=0.003, b=0.90, M=208,
5167
c=C, a=4.95, DW=1.00, T=300)

mcstas-comps/samples/Phonon_simple.comp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ INITIALIZE
348348
V_my_s = (V_rho * 100 * sigma_inc);
349349
V_my_a_v = (V_rho * 100 * sigma_abs * 2200);
350350
DV = 0.001; /* Velocity change used for numerical derivative */
351+
if (focus_aw)
352+
focus_aw *= DEG2RAD;
353+
if (focus_ah)
354+
focus_ah *= DEG2RAD;
351355

352356
// Set constant parameters for parms object
353357
phonon.a_ = a;

0 commit comments

Comments
 (0)