MURE
Loading...
Searching...
No Matches
List of all members
Serpent::Connector Class Reference

Define a Serpent Connector. More...

#include <SerpentConnector.hxx>

Inheritance diagram for Serpent::Connector:
ConnectorPlugin

Public Member Functions

Constructor methods
 Connector ()
 
 ~Connector () override
 
 Connector (const Connector &plugin)
 copy constructor
 
ConnectorClone () 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
 
MCSourceGetMCSource ()
 
string GetMCGlobalOutputFileName (string InputFileName)
 
bool IsSerpentConnector ()
 

Internal methods to be used ONLY by developpers

DetectorOutputReaderfDetectorFileReader
 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
 
NodeGetNewNode (int sign) override
 a way to obrain a new node (here a MCNP::Node) from every where
 
SimpleBinGetNewSimpleBin () override
 a way to obtain a new SimpleBin (here a MureSimpleBin) from every where
 
MureGroupBinGetNewGroupBin () 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
 
MaterialGetTestMaterial ()
 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)
 
MCSourcefSource
 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
 

Detailed Description

Define a Serpent Connector.

This allows to have direct interaction with Serpent (writing files, reading output, setting special cards, ...).

Author
J. Hajnrych
Version
1.0

Constructor & Destructor Documentation

◆ Connector() [1/2]

Serpent::Connector::Connector ( )

◆ ~Connector()

Serpent::Connector::~Connector ( )
override

◆ Connector() [2/2]

Serpent::Connector::Connector ( const Connector plugin)

copy constructor

Member Function Documentation

◆ AddTestMaterialForCell()

void Serpent::Connector::AddTestMaterialForCell ( Cell oldCell)
private

use "test material" to find cell volumes

◆ AddTestMaterialForPinCell()

void Serpent::Connector::AddTestMaterialForPinCell ( PinCell oldCell)
private

use "test material" to find PinCell volumes

◆ BuildDetectors()

void Serpent::Connector::BuildDetectors ( )
overridevirtual

build automatic tallies for standard evolution

Implements ConnectorPlugin.

◆ BuildGlobalTallies()

void Serpent::Connector::BuildGlobalTallies ( )
private

build global tallies for global reaction rates (Control Rod, ...) for special evolution controls

◆ BuildMCFile()

void Serpent::Connector::BuildMCFile ( string  FileString = "")
overridevirtual

Build the MC input file from the MURE one.

Implements ConnectorPlugin.

◆ BuildMultiGroupDetectors() [1/2]

void Serpent::Connector::BuildMultiGroupDetectors ( )
overridevirtual

build automatic tallies for in a multigroup evolution

Implements ConnectorPlugin.

◆ BuildMultiGroupDetectors() [2/2]

void Serpent::Connector::BuildMultiGroupDetectors ( vector< Material * > &  MaterialVector)

build automatic tallies for in a multigroup evolution

◆ BuildPinCells()

void Serpent::Connector::BuildPinCells ( bool  Auto = false)
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.

Parameters
Auto: true when it is called from automatic tallies building

Implements ConnectorPlugin.

◆ BuildTHMultiGroupDetectors()

void Serpent::Connector::BuildTHMultiGroupDetectors ( )
overridevirtual

Implements ConnectorPlugin.

◆ BuildXSDIR()

void Serpent::Connector::BuildXSDIR ( )
overridevirtual

build the xsdir according to the BaseSummary.dat file

Implements ConnectorPlugin.

◆ CheckXSDIR()

void Serpent::Connector::CheckXSDIR ( )
private

Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR.

◆ Clone()

Connector * Serpent::Connector::Clone ( )
overridevirtual

Clone method.

Implements ConnectorPlugin.

◆ CopySerpentFile()

void Serpent::Connector::CopySerpentFile ( string  FileName,
bool  tmpvol = false 
)
private

copy part of the MCNP user defined geometry

◆ EncapsulateGeometry()

void Serpent::Connector::EncapsulateGeometry ( )
private

If the "outside" cell is not a simple shape, put the whole geometry in a Sphere.

◆ FillTallyBinVolume()

void Serpent::Connector::FillTallyBinVolume ( )
private

fill tally bins volume ("dv" card)

◆ FindDetectorMCUserFile()

void Serpent::Connector::FindDetectorMCUserFile ( )
overridevirtual

Find tallies in a MCUser input files.

Implements ConnectorPlugin.

◆ FindMissingVolume()

void Serpent::Connector::FindMissingVolume ( )
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.

◆ GetLatticeType()

unsigned Serpent::Connector::GetLatticeType ( LatticeCell TheLattice)
private

return number corresponding to the serpent "lat" type

◆ GetMCDetectorOutputFileName()

string Serpent::Connector::GetMCDetectorOutputFileName ( string  InputFileName,
bool  OnlyKeff = false 
)
overridevirtual

Reimplemented from ConnectorPlugin.

◆ GetMCExecCommandString()

string Serpent::Connector::GetMCExecCommandString ( string  InputFileName,
string  Arg = "",
string  FileArg = "" 
)
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.

Parameters
InputFileName: input file name
Arg: argument between exec name and input file name (-findvolume, -omp, ...)
FileArg: not used in Serpent

Reimplemented from ConnectorPlugin.

◆ GetNewGroupBin()

MureGroupBin * Serpent::Connector::GetNewGroupBin ( )
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.

◆ GetNewNode()

Serpent::Node * Serpent::Connector::GetNewNode ( int  sign)
overridevirtual

a way to obrain a new node (here a MCNP::Node) from every where

Reimplemented from ConnectorPlugin.

◆ GetNewSimpleBin()

SimpleBin * Serpent::Connector::GetNewSimpleBin ( )
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.

◆ GetNumberOfLatticeDimentions()

unsigned Serpent::Connector::GetNumberOfLatticeDimentions ( unsigned  LatticeType) const
private

return 2 or 3 for 2D or 3D lattice

◆ GetResultFileName()

string Serpent::Connector::GetResultFileName ( const string &  inputFileName) const
private

return the "_res.m" Serpent output file

◆ GetSumResultFileName()

string Serpent::Connector::GetSumResultFileName ( const string &  SumDetectorFileName)
private

◆ GetTestMaterial()

Material * Serpent::Connector::GetTestMaterial ( )
private

return a pure hydrogen material

◆ Print() [1/3]

string Serpent::Connector::Print ( Cell TheCell)
overridevirtual

Print a cell in the cell block (1st bloc) of MCNP's input file.

Implements ConnectorPlugin.

◆ Print() [2/3]

string Serpent::Connector::Print ( Material mat)
overridevirtual

Print a material in the 3rd block of MCNP's input file.

Implements ConnectorPlugin.

◆ Print() [3/3]

string Serpent::Connector::Print ( Transformation Transfo)
overridevirtual

print transformation (translation &rotation) card

Implements ConnectorPlugin.

◆ PrintAllCells()

string Serpent::Connector::PrintAllCells ( )
private

write all cells in the Serpent input file

◆ PrintAllEnergyGrids()

void Serpent::Connector::PrintAllEnergyGrids ( ofstream &  Out)
private

write all tally (time)energy grids in the Serpent input file

◆ PrintAllMaterials()

string Serpent::Connector::PrintAllMaterials ( )
private

write all materials in the Serpent input file

◆ PrintAllPinCells()

string Serpent::Connector::PrintAllPinCells ( )
private

write all pins in the Serpent input file

◆ PrintAllSpecialCards()

string Serpent::Connector::PrintAllSpecialCards ( )
private

write all special cards (i.e. the one not implemented in MURE) in the Serpent input file

◆ PrintAllSurfaceCards()

string Serpent::Connector::PrintAllSurfaceCards ( bool  tmpvol)
private

write all surfaces in the Serpent input file

◆ PrintAllTallies()

string Serpent::Connector::PrintAllTallies ( )
private

write all tallies (detectors) in the Serpent input file

◆ PrintAllTransformationCards()

string Serpent::Connector::PrintAllTransformationCards ( )
private

write all transformation card in the Serpent input file

◆ PrintBasicCell()

string Serpent::Connector::PrintBasicCell ( Cell TheCell)
private

write 1 Cell in the Serpent input file

◆ PrintId() [1/2]

string Serpent::Connector::PrintId ( Cell cell)
overridevirtual

print a "generic" id name to cell number (e.g. "c"=>c1)

Implements ConnectorPlugin.

◆ PrintId() [2/2]

string Serpent::Connector::PrintId ( Material material)
overridevirtual

print a "generic" id name to material number (e.g. "m"=>m1)

Implements ConnectorPlugin.

◆ PrintLattice()

string Serpent::Connector::PrintLattice ( LatticeCell TheLattice)
private

write 1 Lattice in the Serpent input file

◆ PrintLatticeCardHead()

string Serpent::Connector::PrintLatticeCardHead ( LatticeCell TheLattice)
private

print "lat" card with type, origin, nb elements and pitch

◆ PrintLatticeLayout()

string Serpent::Connector::PrintLatticeLayout ( LatticeCell TheLattice)
private

print the array of universe number

◆ PrintMaterialId()

string Serpent::Connector::PrintMaterialId ( int  id)
overridevirtual

convert material number in string

Reimplemented from ConnectorPlugin.

◆ PrintMaterialModeratorOption()

string Serpent::Connector::PrintMaterialModeratorOption ( Material mat)
private

print the "moder" card

◆ PrintMCSource()

string Serpent::Connector::PrintMCSource ( )
private

write tje SerpentSource in the Serpent input file

◆ PrintModeratorMaterial()

string Serpent::Connector::PrintModeratorMaterial ( Material mat)
overridevirtual

print "therm" card associated to a Material

Implements ConnectorPlugin.

◆ PrintModeratorName()

string Serpent::Connector::PrintModeratorName ( Material mat,
unsigned  nucleusIndex 
)
private

print the name on "therm" card ("m_matnum_n_moderatornucleusidx_")

◆ PrintPinCell()

string Serpent::Connector::PrintPinCell ( PinCell ThePinCell)
private

write 1 PinCell (i.e. a "pin") in the Serpent input file

◆ PrintSerpentDopplerBroadening()

string Serpent::Connector::PrintSerpentDopplerBroadening ( Material mat)
private

◆ ReadDetectorFile()

void Serpent::Connector::ReadDetectorFile ( )
private

◆ SetBoundaryCondition()

void Serpent::Connector::SetBoundaryCondition ( Shape_ptr  S)
private

Add a "set bc" card for boundary mirror condition.

◆ StochasticVolumeCalculation()

void Serpent::Connector::StochasticVolumeCalculation ( )
private

a stochastic volume calculation is performed to find missing volumes for tallies

◆ SumOutputDetectorFile()

void Serpent::Connector::SumOutputDetectorFile ( string  DetectorBaseFileName,
int  N,
string  SumDetectorFileName 
)
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.

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

◆ UpdateGlobalTallies()

void Serpent::Connector::UpdateGlobalTallies ( )
private

update the global tallies

◆ UpdateKeff()

void Serpent::Connector::UpdateKeff ( )
overridevirtual

read from MC output the keff and give it to MURE

Implements ConnectorPlugin.

◆ UpdateMultiGroupSigmaPhiDetectors() [1/2]

void Serpent::Connector::UpdateMultiGroupSigmaPhiDetectors ( )
overridevirtual

update (read from MC output) automatic tallies for multigroup evolution

Implements ConnectorPlugin.

◆ UpdateMultiGroupSigmaPhiDetectors() [2/2]

void Serpent::Connector::UpdateMultiGroupSigmaPhiDetectors ( vector< Material * > &  MaterialVector)

update (read from MC output) automatic tallies for multigroup evolution

◆ UpdateSigmaPhiDetectors()

void Serpent::Connector::UpdateSigmaPhiDetectors ( )
overridevirtual

update (read from MC output) automatic tallies for standard evolution

Implements ConnectorPlugin.

◆ UpdateTallyBinVolume()

void Serpent::Connector::UpdateTallyBinVolume ( )
overridevirtual

Reread all bins and assign necessary volume.

Implements ConnectorPlugin.

◆ UpdateTHMultiGroupSigmaPhiDetectors()

void Serpent::Connector::UpdateTHMultiGroupSigmaPhiDetectors ( )
overridevirtual

Implements ConnectorPlugin.

◆ WriteMCFileWithoutDetector()

void Serpent::Connector::WriteMCFileWithoutDetector ( string  FileName = "inp",
bool  tmpvol = false 
)
overridevirtual

build a Serpent file without tally just to obtain keff for void, temperature coefficient, ...

Reimplemented from ConnectorPlugin.

◆ WriteSerpentFile()

void Serpent::Connector::WriteSerpentFile ( string  FileName,
bool  tmpvol = false 
)
private

write the Serpent input file on disk

Member Data Documentation

◆ CELL_COMMAND

const string Serpent::Connector::CELL_COMMAND = string("cell")
staticprivate

the "cell" Serpent key word

◆ CELL_NAME_PREFIX

const string Serpent::Connector::CELL_NAME_PREFIX = string("c")
staticprivate

a prefix string before the cell number: e.g. "c1" for the cell 1

◆ COMMENT_SIGN

const char Serpent::Connector::COMMENT_SIGN = '%'
staticprivate

◆ CUBOID_LATTICE_2D_TYPE

const unsigned Serpent::Connector::CUBOID_LATTICE_2D_TYPE = 1
staticprivate

◆ CUBOID_LATTICE_3D_TYPE

const unsigned Serpent::Connector::CUBOID_LATTICE_3D_TYPE = 11
staticprivate

◆ fDetectorFileReader

DetectorOutputReader* Serpent::Connector::fDetectorFileReader
protected

A detector reader from Serpent "_det0.m" file.

◆ LATTICE_COMMAND

const string Serpent::Connector::LATTICE_COMMAND = string("lat")
staticprivate

the "lat" Serpent key word

◆ MATERIAL_NAME_PREFIX

string Serpent::Connector::MATERIAL_NAME_PREFIX = string("m")
staticprivate

a prefix string before the materia number: e.g. "m1" for the material 1

◆ X_HEX_LATTICE_3D_TYPE

const unsigned Serpent::Connector::X_HEX_LATTICE_3D_TYPE = 12
staticprivate

◆ X_HEX_LATTICE_TYPE

const unsigned Serpent::Connector::X_HEX_LATTICE_TYPE = 2
staticprivate

◆ Y_HEX_LATTICE_3D_TYPE

const unsigned Serpent::Connector::Y_HEX_LATTICE_3D_TYPE = 13
staticprivate

◆ Y_HEX_LATTICE_TYPE

const unsigned Serpent::Connector::Y_HEX_LATTICE_TYPE = 3
staticprivate

The documentation for this class was generated from the following files:

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024