Previous: "User_Guide"
FAQ on MURE package
There is no general method to obtain the geometry. The main problem
of MURE is to simplify as much as possible Nodes. This is not a simple
job but what we can say is that this is easier if you are using the
``put in'' operator (>>) than if you
are using ``and'' (&&) or ``or'' (||)
operators.
Sometimes, it takes a lot of time to generate MCNP input file because
some cells are complex and the simplification is time consuming. To
be noticed that complex cells also slow down MCNP run. In order to
illustrate this phenomenon, let us take a simple but significant example.
We want to put in a big box of water, 3 boxes of iron, a tube of graphite
and a sphere of iron as shown of figure 1
Figure 1:
Slice in the plane y=0 of the a given geometry.
![\begin{figure}\begin{centering}\includegraphics[width=10cm]{fig/faq_1}\par
\end{centering}\par\end{figure}](Timg1.gif) |
This geometry has been generated by the following code:
-
- #include <iostream>
#include <cmath>
using namespace std;
#include "MureHeaders.hxx"
int main(int argc, char** argv)
{
//
//materials
//
Material *Iron=new Material();
Iron->SetDensity(7.87);
Iron->AddNucleus(26,54,1.);
Material *Graphite=new Material();
Graphite->SetDensity(1.9);
Graphite->AddNucleus(6,12,1.);
Material *H2O=new Material();
H2O->SetDensity(1.);
H2O->AddNucleus(1,1,2.);
H2O->AddNucleus(8,16,1.);
//
//Shapes
//
//A big box containing the whole
Shape_ptr Vessel(new Brick(2,2,2));
//the Exterior
Shape_ptr Exterior(!Vessel);
// 3 small boxes
Shape_ptr Bloc(new Brick(0.3,0.3,0.3));
Shape_ptr Bloc2=Bloc->Clone();
Shape_ptr Bloc3=Bloc->Clone();
Bloc->Translate(-0.9,0,0);
Bloc2->Translate(0.5,0.,0.9);
Bloc3->Translate(0.5,0.,-0.9);
//a tube with a hole inside
Shape_ptr mTube(new Tube(0.4,0.5,0.12));
mTube->Translate(0.5,0,0);
//a sphere that will be in the tube
Shape_ptr mSphere(new Sphere(0.1));
mSphere->Translate(0.5,0,0);
//put the sphere in the vessel
mSphere>>Vessel;
//put Bloc in Vessel
Bloc>>Vessel;
//put Bloc2 in Vessel
Bloc2>>Vessel;
//put Bloc3 in Vessel
Bloc3>>Vessel;
//put the tube in Vessel
mTube>>Vessel;
//
//Cells
//
Cell *exterior=new Cell(Exterior,0,0);
Cell *vessel=new Cell(Vessel,H2O);
Cell *bloc=new Cell(Bloc,Iron);
Cell *bloc2=new Cell(Bloc2,Iron);
Cell *bloc3=new Cell(Bloc3,Iron);
Cell *mtube=new Cell(mTube,Graphite);
Cell *msphere=new Cell(mSphere,Iron);
//define a source in the sphere
MCNPSource *s=new MCNPSource(100000);
s->SetPosition(0.5,0,0);
s->SetEnergy(1e-5);
gMURE->SetSource(s);
gMURE->BuildMCNPFile();
}
The problem in this example is that the vessel cell (green part of
the figure) is quite complex ; in MCNP, each neutron in this cell
has to check all surfaces bounding the cell (i.e., all faces of the
3 cubes, all faces of the graphite tube, the sphere and the faces
of the big water box. To simplify the problem for MCNP (and also for
MURE package), we need to divide the water box in smaller pieces ;
such a simplification can be achieve by: defining an individual part
(box) for each cube, and one for the tube ; then the tube is now
built as a full tube of water inside a full tube of graphite. The
code is the following:
-
- #include <iostream>
#include <cmath>
using namespace std;
#include "MureHeaders.hxx"
int main(int argc, char** argv)
{
//
//materials
//
Material *Iron=new Material();
Iron->SetDensity(7.87);
Iron->AddNucleus(26,54,1.);
Material *Graphite=new Material();
Graphite->SetDensity(1.9);
Graphite->AddNucleus(6,12,1.);
Material *H2O=new Material();
H2O->SetDensity(1.);
H2O->AddNucleus(1,1,2.);
H2O->AddNucleus(8,16,1.);
//
//Shapes
//
//A big box containing the whole
Shape_ptr Vessel(new Brick(2,2,2));
//the Exterior
Shape_ptr Exterior(!Vessel);
// 3 small boxes
Shape_ptr Bloc(new Brick(0.3,0.3,0.3));
Shape_ptr Bloc2=Bloc->Clone();
Shape_ptr Bloc3=Bloc->Clone();
Bloc->Translate(-0.9,0,0);
Bloc2->Translate(0.5,0.,0.9);
Bloc3->Translate(0.5,0.,-0.9);
//a tube with a hole inside
Shape_ptr mTube(new Tube(0.4,0.5));
mTube->Translate(0.5,0,0);
Shape_ptr mTube2(new Tube(0.4,0.12));
mTube2->Translate(0.5,0,0);
//a sphere that will be in the tube
Shape_ptr mSphere(new Sphere(0.1));
mSphere->Translate(0.5,0,0);
//put the sphere in the inner tube ("the hole"), and the inner tube in the tube
mSphere>>mTube2>>mTube;
//define a px plane touching the right plane of "Bloc", including Bloc (last -1)
Shape_ptr PX1(new Plane(1,0,0,-0.6,-1));
//define a pz plane touching the top plane of "mTube", including Bloc2 (last 1)
Shape_ptr PZ1(new Plane(0,0,1,0.4,1));
//define a pz plane touching the bottom plane of "mTube", including Bloc3 (last -1)
Shape_ptr PZ2(new Plane(0,0,1,-0.4,-1));
//put Bloc and PX1 in Vessel (this define the "left part" of the geometry)
Bloc>>PX1>>Vessel;
//put Bloc2 and PZ1 in Vessel (this define the "top right part" of the geometry)
Bloc2>>PZ1>>Vessel;
//put Bloc3 and PZ2 in Vessel (this define the "bottom right part" of the geometry)
Bloc3>>PZ2>>Vessel;
//put the tube in Vessel (this define the "middle right part" of the geometry)
mTube>>Vessel;
//
//Cells
//
Cell *exterior=new Cell(Exterior,0,0);
Cell *vessel=new Cell(Vessel,H2O);
Cell *px1=new Cell(PX1,H2O);
Cell *pz1=new Cell(PZ1,H2O);
Cell *pz2=new Cell(PZ2,H2O);
Cell *bloc=new Cell(Bloc,Iron);
Cell *bloc2=new Cell(Bloc2,Iron);
Cell *bloc3=new Cell(Bloc3,Iron);
Cell *mtube=new Cell(mTube,Graphite);
Cell *mtube2=new Cell(mTube2,H2O);
Cell *msphere=new Cell(mSphere,Iron);
//define a source in the sphere
MCNPSource *s=new MCNPSource(100000);
s->SetPosition(0.5,0,0);
s->SetEnergy(1e-5);
gMURE->SetSource(s);
gMURE->BuildMCNPFile();
}
and the geometry output is shown on figure 2
Figure 2:
Slice in the plane y=0 of the a given geometry.
![\begin{figure}\begin{centering}\includegraphics[width=10cm]{fig/faq_1b}\par
\end{centering}\par\end{figure}](Timg2.gif) |
The gain of running time for MCNP is about 25%. To be noticed that
the method consisting to use universe instead of ``simple'' object
is the worth possibility: it is about 25% of time longer than the
first method proposed.
This is because the DATADIR must be set before any Material definition.
Thus you must used
-
- gMURE-> SetDATADIR();
at the beginning of the program (or use the shell environment variable
DATADIR via a setenv (csh) or export(sh)).
-
First you must say that a Material is an evolving one before any Cell
definition.
-
Be sure to use a correct BaseSummary.dat
and the corresponding AvailableReactionChart.dat
-
if reactions that you allowed (via a gMURE->SetReactionListInitMethod()
or via a gMURE->SetReactionThreshold()) are not take into account,
it is probably because an old run with different parameters has been
stored in ReactionList directory. Remove this directory and
all will be OK.
This is probably because you forget to define the clone() method.
If your EvolutionControl class is EC, this method is then
-
- EvolutionControl* Clone(){return new EC(*this);}
You also certainly have to define the appropriate copy constructor
if the EC class contains pointers.
Previous: "User_Guide"