Skip to content

Commit 96f3399

Browse files
committed
Update of M1 Pipe
1 parent eeb2e0b commit 96f3399

File tree

6 files changed

+126
-20
lines changed

6 files changed

+126
-20
lines changed

Model/MaxIV/commonGenerator/M1DetailGenerator.cxx

+6-3
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,15 @@ M1DetailGenerator::M1DetailGenerator() :
105105
ePlateHeight(5.2),ePipeRadius(0.2),
106106
ePipeThick(0.15),
107107

108-
mainPipeRadius(0.4),
108+
mainPipeRadius(0.4),mainPipeThick(0.2),
109+
mainPipeOuter(0.1),
109110
mainConnectRadius(1.25),mainConnectLength(0.9),
110111
mainCubeWidth(2.80),mainCubeHeight(2.20),
111112
mainCubeDepth(2.80),mainOutRadius(0.9),
112113
mainOutLength(1.7),mainFlangeRadius(1.7),
113114
mainFlangeLength(1.0),mainExitLen(1.0),
114115
mainAngle(-5.0),mainExitRadius(1.25),
115-
mainExitFull(10.0),
116+
mainExitFull(30.0),
116117

117118

118119
fBladeInRad(0.0),fBladeOutRad(2.0),
@@ -276,6 +277,8 @@ M1DetailGenerator::makeMainPipe(FuncDataBase& Control,
276277
ELog::RegMethod RegA("M1DetailGenerator","makeMainPipe");
277278

278279
Control.addVariable(keyName+"PipeRadius",mainPipeRadius);
280+
Control.addVariable(keyName+"PipeThick",mainPipeThick);
281+
Control.addVariable(keyName+"PipeOuter",mainPipeOuter);
279282
Control.addVariable(keyName+"ConnectRadius",mainConnectRadius);
280283
Control.addVariable(keyName+"ConnectLength",mainConnectLength);
281284
Control.addVariable(keyName+"CubeWidth",mainCubeWidth);
@@ -291,8 +294,8 @@ M1DetailGenerator::makeMainPipe(FuncDataBase& Control,
291294
Control.addVariable(keyName+"ExitRadius",mainExitRadius);
292295
Control.addVariable(keyName+"ExitFullLength",mainExitFull);
293296

294-
Control.addVariable(keyName+"PipeMat",pipeMat);
295297
Control.addVariable(keyName+"InnerMat",waterMat);
298+
Control.addVariable(keyName+"PipeMat",pipeMat);
296299
Control.addVariable(keyName+"VoidMat",voidMat);
297300

298301
return;

Model/MaxIV/commonGeneratorInc/M1DetailGenerator.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
* File: commonGeneratorInc/M1DetailGenerator.h
55
*
6-
* Copyright (c) 2004-2023 by Stuart Ansell
6+
* Copyright (c) 2004-2024 by Stuart Ansell
77
*
88
* This program is free software: you can redistribute it and/or modify
99
* it under the terms of the GNU General Public License as published by
@@ -165,6 +165,8 @@ class M1DetailGenerator
165165
// Main Connector Pipe
166166
// -------------
167167
double mainPipeRadius; ///< radius (outer)
168+
double mainPipeThick; ///< radius (outer)
169+
double mainPipeOuter; ///< radius (outer)
168170
double mainConnectRadius; ///< radius (oute)r
169171
double mainConnectLength; ///< distance down
170172

Model/MaxIV/softimax/M1Detail.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ M1Detail::createObjects(Simulation& System)
250250
mainPipe->insertInCell("Join",System,cClamp->getCell("BaseVoid"));
251251
mainPipe->insertInCell("Main",System,cClamp->getCell("BaseVoid"));
252252
mainPipe->insertInCell("Main",System,getCells("MainVoid"));
253-
for(const int cn : getCells("MainVoid"))
254-
ELog::EM<<"Cn == "<<cn<<ELog::endDiag;
253+
mainPipe->insertInCell("Out",System,cClamp->getCell("BaseVoid"));
255254
mainPipe->insertInCell("Out",System,getCells("MainVoid"));
255+
256256

257257
cClamp->insertInCell(System,getCells("MainVoid"));
258258

Model/MaxIV/softimax/M1Pipe.cxx

+44-12
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ M1Pipe::populate(const FuncDataBase& Control)
102102
FixedRotate::populate(Control);
103103

104104
pipeRadius=Control.EvalVar<double>(keyName+"PipeRadius");
105+
pipeThick=Control.EvalVar<double>(keyName+"PipeThick");
106+
pipeOuter=Control.EvalVar<double>(keyName+"PipeOuter");
105107

106108
connectRadius=Control.EvalVar<double>(keyName+"ConnectRadius");
107109
connectLength=Control.EvalVar<double>(keyName+"ConnectLength");
@@ -120,9 +122,9 @@ M1Pipe::populate(const FuncDataBase& Control)
120122
exitAngle=Control.EvalVar<double>(keyName+"ExitAngle");
121123
exitRadius=Control.EvalVar<double>(keyName+"ExitRadius");
122124
exitFullLength=Control.EvalVar<double>(keyName+"ExitFullLength");
123-
124-
pipeMat=ModelSupport::EvalMat<int>(Control,keyName+"PipeMat");
125+
125126
innerMat=ModelSupport::EvalMat<int>(Control,keyName+"InnerMat");
127+
pipeMat=ModelSupport::EvalMat<int>(Control,keyName+"PipeMat");
126128
voidMat=ModelSupport::EvalMat<int>(Control,keyName+"VoidMat");
127129

128130
return;
@@ -138,7 +140,9 @@ M1Pipe::createSurfaces()
138140

139141
// Origin is pipe connection point:
140142

141-
ModelSupport::buildCylinder(SMap,buildIndex+7,Origin,Z,connectRadius);
143+
ModelSupport::buildCylinder(SMap,buildIndex+7,Origin,Z,pipeRadius);
144+
ModelSupport::buildCylinder(SMap,buildIndex+17,Origin,Z,connectRadius);
145+
142146
ModelSupport::buildPlane(SMap,buildIndex+5,Origin-Z*connectLength,Z);
143147

144148
ModelSupport::buildPlane(SMap,buildIndex+101,Origin-Y*(cubeDepth/2.0),Y);
@@ -149,8 +153,13 @@ M1Pipe::createSurfaces()
149153
Origin-Z*(connectLength+cubeHeight),Z);
150154

151155
// pipe exit
152-
const Geometry::Vec3D exitOrg=
153-
Origin+Y*(cubeDepth/2.0)-Z*(connectLength+cubeHeight/2.0);
156+
const Geometry::Vec3D turnOrg=Origin-Z*(connectLength+cubeHeight/2.0);
157+
const Geometry::Vec3D exitOrg=turnOrg+Y*(cubeDepth/2.0);
158+
159+
ELog::EM<<"Turn == "<<turnOrg<<ELog::endDiag;
160+
// 45 deg divider:
161+
ModelSupport::buildPlane(SMap,buildIndex+2005,turnOrg,(Z-Y));
162+
ModelSupport::buildCylinder(SMap,buildIndex+2007,turnOrg,Y,pipeRadius);
154163
ModelSupport::buildCylinder(SMap,buildIndex+2017,exitOrg,Y,outRadius);
155164
ModelSupport::buildCylinder(SMap,buildIndex+2027,exitOrg,Y,flangeRadius);
156165

@@ -166,7 +175,13 @@ M1Pipe::createSurfaces()
166175
const Geometry::Vec3D PY=Qxy.rotate(Y);
167176
ModelSupport::buildPlane(SMap,buildIndex+3001,bendPt,Y);
168177
ModelSupport::buildPlane(SMap,buildIndex+3002,bendPt+Y*exitFullLength,PY);
169-
ModelSupport::buildCylinder(SMap,buildIndex+3007,bendPt,PY,exitRadius);
178+
179+
ModelSupport::buildCylinder(SMap,buildIndex+3007,bendPt,PY,pipeRadius);
180+
ModelSupport::buildCylinder
181+
(SMap,buildIndex+3017,bendPt,PY,pipeRadius+pipeThick);
182+
ModelSupport::buildCylinder
183+
(SMap,buildIndex+3027,bendPt,PY,exitRadius-pipeOuter);
184+
ModelSupport::buildCylinder(SMap,buildIndex+3037,bendPt,PY,exitRadius);
170185

171186
return;
172187
}
@@ -185,20 +200,28 @@ M1Pipe::createObjects(Simulation& System)
185200
const HeadRule baseHR=getRule("MirrorBase");
186201

187202
HeadRule HR;
188-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"5 -7");
203+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"2005 -7");
204+
makeCell("Inner",System,cellIndex++,innerMat,0.0,HR*baseHR);
205+
206+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"5 -17 7");
189207
makeCell("Connect",System,cellIndex++,pipeMat,0.0,HR*baseHR);
190208

191-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"101 -102 103 -104 7 5");
209+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"101 -102 103 -104 17 5");
192210
makeCell("Connect",System,cellIndex++,voidMat,0.0,HR*baseHR);
193211

194-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"101 -102 103 -104 -5 105");
212+
// inner for all segments
213+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"-2005 -2007 -3001");
214+
makeCell("Inner",System,cellIndex++,innerMat,0.0,HR);
215+
216+
HR=ModelSupport::getHeadRule
217+
(SMap,buildIndex,"101 -102 103 -104 -5 105 (7:-2005) (2007:2005)");
195218
makeCell("Cube",System,cellIndex++,pipeMat,0.0,HR);
196219

197220
HR=ModelSupport::getHeadRule(SMap,buildIndex,"101 -102 103 -104 105");
198221
addOuterSurf("Join",HR*baseHR);
199222

200223
// exit pipe
201-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"102 -2017 -2012");
224+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"102 -2017 -2012 2007");
202225
makeCell("Outer",System,cellIndex++,pipeMat,0.0,HR);
203226
//flange
204227
HR=ModelSupport::getHeadRule(SMap,buildIndex,"2002 -2012 2017 -2027");
@@ -207,10 +230,19 @@ M1Pipe::createObjects(Simulation& System)
207230
HR=ModelSupport::getHeadRule(SMap,buildIndex,"102 -2002 2017 -2027");
208231
makeCell("OuterVoid",System,cellIndex++,voidMat,0.0,HR);
209232

210-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"2012 -2017 -3001");
233+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"2012 -2017 -3001 2007");
211234
makeCell("ExitStr",System,cellIndex++,pipeMat,0.0,HR);
212235

213236
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 -3007 -3002");
237+
makeCell("ExitPipe",System,cellIndex++,innerMat,0.0,HR);
238+
239+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 3007 -3017 -3002");
240+
makeCell("ExitPipe",System,cellIndex++,pipeMat,0.0,HR);
241+
242+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 3017 -3027 -3002");
243+
makeCell("ExitPipe",System,cellIndex++,voidMat,0.0,HR);
244+
245+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 3027 -3037 -3002");
214246
makeCell("ExitPipe",System,cellIndex++,pipeMat,0.0,HR);
215247

216248
HR=ModelSupport::getHeadRule(SMap,buildIndex,"2012 -3001 2017 -2027");
@@ -219,7 +251,7 @@ M1Pipe::createObjects(Simulation& System)
219251
HR=ModelSupport::getHeadRule(SMap,buildIndex,"102 -3001 -2027");
220252
addOuterSurf("Main",HR);
221253

222-
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 -3002 -3007");
254+
HR=ModelSupport::getHeadRule(SMap,buildIndex,"3001 -3002 -3037");
223255
addOuterSurf("Out",HR);
224256

225257
// outbound piper

Model/MaxIV/softimaxInc/M1Pipe.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ class M1Pipe :
4444
{
4545
private:
4646

47-
double pipeRadius; ///< Pipe radius (outer)
47+
double pipeRadius; ///< Pipe radius (inner)
48+
double pipeThick; ///< Pipe radius (outer)
49+
double pipeOuter; ///< Pipe radius (outer)
4850

4951
double connectRadius; ///< radius (outer)
5052
double connectLength; ///< distance down
@@ -64,8 +66,8 @@ class M1Pipe :
6466
double exitRadius; ///< new radius at bend
6567
double exitFullLength; ///< length after bend
6668

67-
int pipeMat; ///< Electron shield material
6869
int innerMat; ///< void material
70+
int pipeMat; ///< Electron shield material
6971
int voidMat; ///< void material
7072

7173
// Functions:

model.sh

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
for item in beamline global instrument scatMat transport src
2+
do
3+
echo $item
4+
./CMakeIndividual.pl $item > $item/CMakeLists.txt
5+
done
6+
7+
for item in attachComp compWeights construct constructVar crystal \
8+
endf flukaPhysics flukaProcess flukaTally funcBase \
9+
generalProcess geometry input insertUnit log magnetic mcnpProcess \
10+
md5 modelSupport monte objectMod phitsPhysics \
11+
phitsProcess phitsSupport phitsTally physics \
12+
poly simMC source support tally visit weights \
13+
work world xml
14+
do
15+
echo $item;
16+
./CMakeIndividual.pl System/$item > System/$item/CMakeLists.txt
17+
done;
18+
19+
20+
for item in balder commonBeam commonGenerator cosaxs \
21+
danmax flexpes formax Linac maxpeem micromax R1Common \
22+
R3Common softimax species;
23+
do
24+
echo $item;
25+
./CMakeIndividual.pl Model/MaxIV/$item maxiv > Model/MaxIV/$item/CMakeLists.txt
26+
done;
27+
28+
29+
for item in cuBlock d4cModel delft essConstruct \
30+
essLinac exampleBuild photon \
31+
pipeBuild ralBuild saxs \
32+
xrayHutch
33+
do
34+
echo $item;
35+
./CMakeIndividual.pl Model/$item base > Model/$item/CMakeLists.txt
36+
done;
37+
38+
./CMakeIndividual.pl Model/essBuild base ess > Model/essBuild/CMakeLists.txt
39+
./CMakeIndividual.pl Model/t1Build base ral > Model/t1Build/CMakeLists.txt
40+
./CMakeIndividual.pl Model/t2Build base ral > Model/t2Build/CMakeLists.txt
41+
./CMakeIndividual.pl Model/maxivBuild base maxiv > Model/maxivBuild/CMakeLists.txt
42+
./CMakeIndividual.pl Model/singleItemBuild ess base maxiv ral > Model/singleItemBuild/CMakeLists.txt
43+
./CMakeIndividual.pl test base > test/CMakeLists.txt
44+
45+
./CMakeIndividual.pl Model/filter photon base > Model/filter/CMakeLists.txt
46+
./CMakeIndividual.pl Model/snsBuild ral base > Model/snsBuild/CMakeLists.txt
47+
48+
49+
for item in beer bifrost common commonVar cspec dream \
50+
estia freia heimdal loki magic miracles nmx nnbar \
51+
odin simpleItem skadi testBeam trex vespa vor
52+
do
53+
echo $item;
54+
./CMakeIndividual.pl Model/ESSBeam/$item ess > Model/ESSBeam/$item/CMakeLists.txt
55+
done;
56+
57+
58+
exit
59+
for item in ralVar
60+
do
61+
echo $item;
62+
./CMakeIndividual.pl Model/ralBuild/$item > Model/ralBuild/$item/CMakeLists.txt
63+
done;
64+
65+
66+
67+
#./CMakeIndividual.pl System/constructVar > System/constructVar/CMakeLists.txt

0 commit comments

Comments
 (0)