FAQ on MURE  package

Contents

1 MURE FAQ

1.1 I don’t succeed in building my geometry.

There is no general method to obtain the geometry. The main problem of MURE is to simplify Nodes as much as possible. This is not a simple job but it is easier if you are using the “put in” operator (>>) rather than if “and” (&&) or “or” (||) operators.

1.2 How to optimize a geometry for generation and MCNP run

Sometimes, it takes a lot of time to generate MCNP input files because some cells are complex and the simplification is time consuming. Note that complex cells also slow down MCNP run. In order to illustrate this phenomenon, let’s take a simple but significant example. We want to put in a big water box, 3 boxes of iron, a tube of graphite and a sphere of iron as shown in figure 1

pict

Figure 1: Slice in the plane y=0 of the a given geometry.

This geometry has been generated with the following code:

#include <iostream>
#include <cmath>
using namespace std;
#include "MureHeaders.hxx"
#include <MureMCNPHeaders.hxx>
using namespace MCNP;
int main(int argc, char** argv)
{
    Connector *plugin=new Connector();
    gMURE->SetConnectorPlugin(plugin);
        //
        //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->BuildMCFile();
}

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 limiting 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), 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 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"
#include <MureMCNPHeaders.hxx>
using namespace MCNP;
int main(int argc, char** argv)
{
    Connector *plugin=new Connector();
    gMURE->SetConnectorPlugin(plugin);
        //
        //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->BuildMCFile();
}

and the geometry output is shown in figure 2

pict

Figure 2: Slice in the plane y=0 of a given geometry.

The gain of running time for MCNP is about 25%. Note that the method consisting of using universe instead of “simple” objects is the worse possibility: it takes about 25% longer than the first proposed method.

1.3 MURE says that I must use MURE:SetDATADIR() but I’ve already used it.

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)).

1.4 I want Material evolution but what I have defined is not taken into account correctly.

1.5 I have defined my own EvolutionControl class (as a daughter of the base class EvolutionControl) but it is not taken into account.

This is probably because you did not define the Clone() method. If your EvolutionControl class is EC, this method is then

EvolutionControl* Clone(){return new EC(*this);}

You should probably have to define the appropriate copy constructor if the EC class contains pointers.

1.6 How to migrate from MURE V1.x to MURE V2/3 (alias SMURE)

See the section 2 “How migrate my old MURE V1.x file to the MURE V2.x file” of Chapter 3 “From MURE to SMURE : Choosing the Monte-Carlo Transport Code” of the user guide.

2 MurGui FAQ

2.1 MureGui says that I must use MURE:SetDATADIR()

Use the shell environment variable DATADIR via a setenv (csh) or export (sh)): for example in sh, do export DATADIR=”/path_to_smure_data_dir”

2.2 MureGui crash in radiotaox tab when I try to move legend of curves

This is not a SMURE problem but a ROOT problem for log-log axis ; you can edit the system.rootrc file (normally in $ROOTSYS/etc) and change the line

Canvas.ShowGuidedLines: on 

to

Canvas.ShowGuidedLines: false