MURE
|
Define a Serpent Connector. More...
#include <SerpentConnector.hxx>
Public Member Functions | |
Constructor methods | |
Connector () | |
~Connector () override | |
Connector (const Connector &plugin) | |
copy constructor | |
Connector * | Clone () override |
Clone method. | |
xsdir methods | |
void | BuildXSDIR () override |
build the xsdir according to the BaseSummary.dat file | |
Detectors related methods | |
void | BuildDetectors () override |
build automatic tallies for standard evolution | |
void | UpdateSigmaPhiDetectors () override |
update (read from MC output) automatic tallies for standard evolution | |
void | BuildMultiGroupDetectors () override |
build automatic tallies for in a multigroup evolution | |
void | BuildMultiGroupDetectors (vector< Material * > &MaterialVector) |
build automatic tallies for in a multigroup evolution | |
void | UpdateMultiGroupSigmaPhiDetectors () override |
update (read from MC output) automatic tallies for multigroup evolution | |
void | UpdateMultiGroupSigmaPhiDetectors (vector< Material * > &MaterialVector) |
update (read from MC output) automatic tallies for multigroup evolution | |
void | UpdateKeff () override |
read from MC output the keff and give it to MURE | |
void | FindDetectorMCUserFile () override |
Find tallies in a MCUser input files. | |
void | SumOutputDetectorFile (string DetectorBaseFileName, int N, string SumDetectorFileName) override |
string | GetMCDetectorOutputFileName (string InputFileName, bool OnlyKeff=false) override |
Serpent exec command | |
string | GetMCExecCommandString (string InputFileName, string Arg="", string FileArg="") override |
Writing file methods | |
void | BuildMCFile (string FileString="") override |
Build the MC input file from the MURE one. | |
void | BuildPinCells (bool Auto=false) override |
void | FindMissingVolume () override |
void | UpdateTallyBinVolume () override |
Reread all bins and assign necessary volume. | |
string | Print (Cell *TheCell) override |
Print a cell in the cell block (1st bloc) of MCNP's input file. | |
string | Print (Material *mat) override |
Print a material in the 3rd block of MCNP's input file. | |
string | PrintModeratorMaterial (Material *mat) override |
print "therm" card associated to a Material | |
string | Print (Transformation *Transfo) override |
print transformation (translation &rotation) card | |
void | WriteMCFileWithoutDetector (string FileName="inp", bool tmpvol=false) override |
build a Serpent file without tally just to obtain keff for void, temperature coefficient, ... | |
void | BuildTHMultiGroupDetectors () override |
void | UpdateTHMultiGroupSigmaPhiDetectors () override |
Public Member Functions inherited from ConnectorPlugin | |
ConnectorPlugin () | |
virtual | ~ConnectorPlugin () |
ConnectorPlugin (const ConnectorPlugin &plugin) | |
copy constructor | |
bool | IsTHMultiGroupTalliesUsed () |
void | SetMCSource (MCSource *source) |
set the MC particle source to the Connector | |
MCSource * | GetMCSource () |
string | GetMCGlobalOutputFileName (string InputFileName) |
bool | IsSerpentConnector () |
Internal methods to be used ONLY by developpers | |
DetectorOutputReader * | fDetectorFileReader |
A detector reader from Serpent "_det0.m" file. | |
static string | MATERIAL_NAME_PREFIX = string("m") |
a prefix string before the materia number: e.g. "m1" for the material 1 | |
static const string | LATTICE_COMMAND = string("lat") |
the "lat" Serpent key word | |
static const string | CELL_NAME_PREFIX = string("c") |
a prefix string before the cell number: e.g. "c1" for the cell 1 | |
static const string | CELL_COMMAND = string("cell") |
the "cell" Serpent key word | |
static const char | COMMENT_SIGN = '%' |
static const unsigned | X_HEX_LATTICE_TYPE = 2 |
static const unsigned | Y_HEX_LATTICE_TYPE = 3 |
static const unsigned | CUBOID_LATTICE_2D_TYPE = 1 |
static const unsigned | CUBOID_LATTICE_3D_TYPE = 11 |
static const unsigned | X_HEX_LATTICE_3D_TYPE = 12 |
static const unsigned | Y_HEX_LATTICE_3D_TYPE = 13 |
Node * | GetNewNode (int sign) override |
a way to obrain a new node (here a MCNP::Node) from every where | |
SimpleBin * | GetNewSimpleBin () override |
a way to obtain a new SimpleBin (here a MureSimpleBin) from every where | |
MureGroupBin * | GetNewGroupBin () override |
a way to obtain a new roupBin (here a MureGroupBin) from every where | |
string | PrintId (Material *material) override |
print a "generic" id name to material number (e.g. "m"=>m1) | |
string | PrintId (Cell *cell) override |
print a "generic" id name to cell number (e.g. "c"=>c1) | |
string | PrintMaterialId (int id) override |
convert material number in string | |
void | CheckXSDIR () |
Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR. | |
void | EncapsulateGeometry () |
If the "outside" cell is not a simple shape, put the whole geometry in a Sphere. | |
void | BuildGlobalTallies () |
build global tallies for global reaction rates (Control Rod, ...) for special evolution controls | |
void | UpdateGlobalTallies () |
update the global tallies | |
void | ReadDetectorFile () |
void | FillTallyBinVolume () |
fill tally bins volume ("dv" card) | |
void | StochasticVolumeCalculation () |
a stochastic volume calculation is performed to find missing volumes for tallies | |
void | AddTestMaterialForCell (Cell *oldCell) |
use "test material" to find cell volumes | |
void | AddTestMaterialForPinCell (PinCell *oldCell) |
use "test material" to find PinCell volumes | |
Material * | GetTestMaterial () |
return a pure hydrogen material | |
string | PrintLattice (LatticeCell *TheLattice) |
write 1 Lattice in the Serpent input file | |
unsigned | GetLatticeType (LatticeCell *TheLattice) |
return number corresponding to the serpent "lat" type | |
unsigned | GetNumberOfLatticeDimentions (unsigned LatticeType) const |
return 2 or 3 for 2D or 3D lattice | |
string | PrintLatticeCardHead (LatticeCell *TheLattice) |
print "lat" card with type, origin, nb elements and pitch | |
string | PrintLatticeLayout (LatticeCell *TheLattice) |
print the array of universe number | |
string | PrintPinCell (PinCell *ThePinCell) |
write 1 PinCell (i.e. a "pin") in the Serpent input file | |
string | PrintBasicCell (Cell *TheCell) |
write 1 Cell in the Serpent input file | |
string | PrintAllMaterials () |
write all materials in the Serpent input file | |
string | PrintAllSurfaceCards (bool tmpvol) |
write all surfaces in the Serpent input file | |
string | PrintAllPinCells () |
write all pins in the Serpent input file | |
string | PrintAllCells () |
write all cells in the Serpent input file | |
string | PrintAllSpecialCards () |
write all special cards (i.e. the one not implemented in MURE) in the Serpent input file | |
string | PrintAllTransformationCards () |
write all transformation card in the Serpent input file | |
string | PrintMCSource () |
write tje SerpentSource in the Serpent input file | |
string | PrintAllTallies () |
write all tallies (detectors) in the Serpent input file | |
void | PrintAllEnergyGrids (ofstream &Out) |
write all tally (time)energy grids in the Serpent input file | |
void | WriteSerpentFile (string FileName, bool tmpvol=false) |
write the Serpent input file on disk | |
void | CopySerpentFile (string FileName, bool tmpvol=false) |
copy part of the MCNP user defined geometry | |
string | PrintMaterialModeratorOption (Material *mat) |
print the "moder" card | |
string | PrintModeratorName (Material *mat, unsigned nucleusIndex) |
print the name on "therm" card ("m_matnum_n_moderatornucleusidx_") | |
string | PrintSerpentDopplerBroadening (Material *mat) |
string | GetResultFileName (const string &inputFileName) const |
return the "_res.m" Serpent output file | |
string | GetSumResultFileName (const string &SumDetectorFileName) |
void | SetBoundaryCondition (Shape_ptr S) |
Add a "set bc" card for boundary mirror condition. | |
Additional Inherited Members | |
Protected Member Functions inherited from ConnectorPlugin | |
bool | IsVolumeCalculationNeeded () |
scan tallies to find if a bin need a volume that is, for now, unknown | |
Protected Attributes inherited from ConnectorPlugin | |
bool | fRebuildDetector |
whether or not rebuild detectors (for thermo-hydraulics) | |
MCSource * | fSource |
The MC particle source. | |
string | fMCGlobalOutputSuffix |
"o" file for MCNP and it should be "_res.m" file for Serpent | |
string | fMCDetectorOutputSuffix |
"m" files for MCNP or "_det0.m" for Serpent | |
bool | fPinCellBuilt |
whether or not PinCell have already been built | |
bool | fTHMultigroupTallies |
True in Thermal hydraulics multigroup calculation. | |
bool | fIsSerpentConnector |
This allows to have direct interaction with Serpent (writing files, reading output, setting special cards, ...).
Serpent::Connector::Connector | ( | ) |
|
override |
Serpent::Connector::Connector | ( | const Connector & | plugin | ) |
copy constructor
|
private |
use "test material" to find cell volumes
|
private |
use "test material" to find PinCell volumes
|
overridevirtual |
build automatic tallies for standard evolution
Implements ConnectorPlugin.
|
private |
build global tallies for global reaction rates (Control Rod, ...) for special evolution controls
|
overridevirtual |
Build the MC input file from the MURE one.
Implements ConnectorPlugin.
|
overridevirtual |
build automatic tallies for in a multigroup evolution
Implements ConnectorPlugin.
void Serpent::Connector::BuildMultiGroupDetectors | ( | vector< Material * > & | MaterialVector | ) |
build automatic tallies for in a multigroup evolution
|
overridevirtual |
Build Pincells. MURE has implemented the Serpent "pin" cell in a PinCell class. This is a very useful and elegant way of defining general pins. This methods transforms these PinCells in virtual Cells (not printed in Serpent). This virtual cells are used by the evolution. The Auto flag is used to build only virtual cells for evolving material defined in a "pin" when tallies (detectors) are automatically built by the EvoltionSolver class. But for user defined detectors, then all virtual cells are built to find volumes if necessary.
Auto | : true when it is called from automatic tallies building |
Implements ConnectorPlugin.
|
overridevirtual |
Implements ConnectorPlugin.
|
overridevirtual |
build the xsdir according to the BaseSummary.dat file
Implements ConnectorPlugin.
|
private |
Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR.
|
overridevirtual |
Clone method.
Implements ConnectorPlugin.
|
private |
copy part of the MCNP user defined geometry
|
private |
If the "outside" cell is not a simple shape, put the whole geometry in a Sphere.
|
private |
fill tally bins volume ("dv" card)
|
overridevirtual |
Find tallies in a MCUser input files.
Implements ConnectorPlugin.
|
overridevirtual |
Find Missing cell volumes for tallies. Tallies are normalized by the volume of the cells. Thus each Tally bin must know its volume (or area). Serpent do not defne cell volumes but material volume. To be coherent with MURE evolution, cells must have a volume. The idea here is to replace for each evolving cell (real or virtual) the material by a "test material" (1 nucleus of hydrogen). The a stochastic Serpent volume calculation is performed and volumes are set to tally bins and cells. Precisions on the result ca be increased via MURE::SetVolumeNPS(). Rem: it seems that, for a given geometry, the VolumeNPS should be at least twice the MCNP'one to obtain the same precision on volumes. But nevertheless, volumes calculation is generally much more faster in Serpent (for a given precision) than in MCNP.
Implements ConnectorPlugin.
|
private |
return number corresponding to the serpent "lat" type
|
overridevirtual |
Reimplemented from ConnectorPlugin.
|
overridevirtual |
MC exec command line. This return the string to exec (via system()) to run a MC. It takes input file name (e.g. inp000), arguments (e.g. "task N n=) and file argument.
InputFileName | : input file name |
Arg | : argument between exec name and input file name (-findvolume, -omp, ...) |
FileArg | : not used in Serpent |
Reimplemented from ConnectorPlugin.
|
inlineoverridevirtual |
a way to obtain a new roupBin (here a MureGroupBin) from every where
< a way to obtain a new GroupBin (here a MureGroupBin) from every where
Implements ConnectorPlugin.
|
overridevirtual |
a way to obrain a new node (here a MCNP::Node) from every where
Reimplemented from ConnectorPlugin.
|
inlineoverridevirtual |
a way to obtain a new SimpleBin (here a MureSimpleBin) from every where
< a way to obtain a new SimpleBin (here a MCNP::SimpleBin) from every where
Implements ConnectorPlugin.
|
private |
return 2 or 3 for 2D or 3D lattice
|
private |
return the "_res.m" Serpent output file
|
private |
|
private |
return a pure hydrogen material
|
overridevirtual |
Print a cell in the cell block (1st bloc) of MCNP's input file.
Implements ConnectorPlugin.
|
overridevirtual |
Print a material in the 3rd block of MCNP's input file.
Implements ConnectorPlugin.
|
overridevirtual |
print transformation (translation &rotation) card
Implements ConnectorPlugin.
|
private |
write all cells in the Serpent input file
|
private |
write all tally (time)energy grids in the Serpent input file
|
private |
write all materials in the Serpent input file
|
private |
write all pins in the Serpent input file
|
private |
|
private |
write all surfaces in the Serpent input file
|
private |
write all tallies (detectors) in the Serpent input file
|
private |
write all transformation card in the Serpent input file
|
private |
|
overridevirtual |
print a "generic" id name to cell number (e.g. "c"=>c1)
Implements ConnectorPlugin.
|
overridevirtual |
print a "generic" id name to material number (e.g. "m"=>m1)
Implements ConnectorPlugin.
|
private |
write 1 Lattice in the Serpent input file
|
private |
print "lat" card with type, origin, nb elements and pitch
|
private |
print the array of universe number
|
overridevirtual |
convert material number in string
Reimplemented from ConnectorPlugin.
|
private |
print the "moder" card
|
private |
write tje SerpentSource in the Serpent input file
|
overridevirtual |
print "therm" card associated to a Material
Implements ConnectorPlugin.
|
private |
print the name on "therm" card ("m_matnum_n_moderatornucleusidx_")
|
private |
|
private |
|
private |
|
private |
Add a "set bc" card for boundary mirror condition.
|
private |
a stochastic volume calculation is performed to find missing volumes for tallies
|
overridevirtual |
Sum MC detector output in multi run mode. The multi run mode (set via MURE::SetRunMultiMC) allow to run, for each MC step, N MC calculations to smooth fluactuations ; Then, this method is used to buid the sum result of each individual MC run, in a unique Detector output file ("m" file of MCNP or "_det0.m" file for Serpent.
DetectorBaseFileName | : base name of individual run (real name are DetectorBaseFileNameX where X=0..N) |
N | : number of multi-run in a MC step |
SumDetectorFileName | : sum of all individual run in this file (it has the same format than each individual one) |
Implements ConnectorPlugin.
|
private |
update the global tallies
|
overridevirtual |
read from MC output the keff and give it to MURE
Implements ConnectorPlugin.
|
overridevirtual |
update (read from MC output) automatic tallies for multigroup evolution
Implements ConnectorPlugin.
void Serpent::Connector::UpdateMultiGroupSigmaPhiDetectors | ( | vector< Material * > & | MaterialVector | ) |
update (read from MC output) automatic tallies for multigroup evolution
|
overridevirtual |
update (read from MC output) automatic tallies for standard evolution
Implements ConnectorPlugin.
|
overridevirtual |
Reread all bins and assign necessary volume.
Implements ConnectorPlugin.
|
overridevirtual |
Implements ConnectorPlugin.
|
overridevirtual |
build a Serpent file without tally just to obtain keff for void, temperature coefficient, ...
Reimplemented from ConnectorPlugin.
|
private |
write the Serpent input file on disk
|
staticprivate |
the "cell" Serpent key word
|
staticprivate |
a prefix string before the cell number: e.g. "c1" for the cell 1
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
protected |
A detector reader from Serpent "_det0.m" file.
|
staticprivate |
the "lat" Serpent key word
|
staticprivate |
a prefix string before the materia number: e.g. "m1" for the material 1
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |