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

Define a MCNP Connector. More...

#include <MCNPConnector.hxx>

Inheritance diagram for MCNP::Connector:
ConnectorPlugin

Public Member Functions

Constructor methods
 Connector ()
 
 ~Connector ()
 
 Connector (const Connector &plugin)
 copy constructor
 
ConnectorPluginClone () 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
 
MCNP exec command
string GetMCExecCommandString (string InputFileName, string Arg="", string FileArg="") override
 
void BuildTHMultiGroupDetectors () override
 
void UpdateTHMultiGroupSigmaPhiDetectors () override
 
MCNP specific methods
void SetPRDMP (string prdmp="2J -1 1")
 
void SetRemove_r_files (bool flag=true)
 
bool GetRemove_r_files ()
 
bool IsMCNP4B ()
 
void SetMCNP4B (bool flag=true)
 
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 MT card associated to a Material
 
string Print (Transformation *Transfo) override
 print transformation (translation &rotation) card
 
void WriteMCFileWithoutDetector (string FileName="inp", bool tmpvol=false) override
 
void WriteLine (string line, ostream &Out=cout, int IsComment=0, int IsTruncated=0, char separator='&')
 Write a MCNP line.
 
- 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)
 
virtual string PrintMaterialId (int id)
 
bool IsSerpentConnector ()
 

Internal methods to be used ONLY by developpers

string fPRDMP
 PRDMP argument (default=2J -1 1)
 
bool fRemove_r_files
 Whether to remove "r" files of MCNP.
 
bool fMCNP4B
 If MCNP4B is used (use for PVM argument)
 
TMctal * fMCOutput
 A result tallies from a MCNP m's files.
 
string fDATAPATH
 path to xsdir and cross sections
 
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
 
GroupBinGetNewGroupBin () 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)
 
void CheckXSDIR ()
 Check if a xsdir exist ; if not call MCNP::Connector::BuildXSDIR.
 
void BuildGlobalTallies ()
 build global tallies for global reaction rates (Control Rod, ...) for special evolution controls
 
void UpdateGlobalTallies ()
 update the global tallies
 
void ReadDetectorFile ()
 
void FindTallyInMCNPUserFile ()
 
void TryToFindVolumeFromMCNPTable ()
 no MCNP run is performed, just read of table 50
 
void StochasticVolumeCalculation ()
 a stochastic volume calculation is performed to find missing volumes for tallies
 
void FillTallyBinVolume ()
 fill tally bins volume (SD card)
 
void WriteCell (ostream &Out)
 write MCNP all cells in the cell block (1st bloc) of MCNP's input file
 
void WriteSurface (ostream &Out, bool tmpvol=false)
 write MCNP all surface cards in the surface block (2nd bloc) of MCNP's input file
 
void WriteMaterial (ostream &Out)
 write MCNP materials in the 3rd block of MCNP's input file
 
void WriteMCNPFile (string FileName="inp", bool tmpvol=false)
 write the MCNP input file on disk
 
void CopyMCNPFile (string FileName)
 copy part of the MCNP user defined geometry
 

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 MCNP Connector.

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

Author
PTO
J. Hajnrych
Version
1.0

Constructor & Destructor Documentation

◆ Connector() [1/2]

MCNP::Connector::Connector ( )

◆ ~Connector()

MCNP::Connector::~Connector ( )

◆ Connector() [2/2]

MCNP::Connector::Connector ( const Connector plugin)

copy constructor

Member Function Documentation

◆ BuildDetectors()

void MCNP::Connector::BuildDetectors ( )
overridevirtual

build automatic tallies for standard evolution

Implements ConnectorPlugin.

◆ BuildGlobalTallies()

void MCNP::Connector::BuildGlobalTallies ( )
private

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

◆ BuildMCFile()

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

Build the MC input file from the MURE one.

Implements ConnectorPlugin.

◆ BuildMultiGroupDetectors() [1/2]

void MCNP::Connector::BuildMultiGroupDetectors ( )
overridevirtual

build automatic tallies for in a multigroup evolution

Implements ConnectorPlugin.

◆ BuildMultiGroupDetectors() [2/2]

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

build automatic tallies for in a multigroup evolution

◆ BuildPinCells()

void MCNP::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 real MCNP Cells. The Auto flag is used only in the "Serpent" version.

Parameters
Auto:not used in MCNP::Connector

Implements ConnectorPlugin.

◆ BuildTHMultiGroupDetectors()

void MCNP::Connector::BuildTHMultiGroupDetectors ( )
overridevirtual

Implements ConnectorPlugin.

◆ BuildXSDIR()

void MCNP::Connector::BuildXSDIR ( )
overridevirtual

build the xsdir according to the BaseSummary.dat file

Implements ConnectorPlugin.

◆ CheckXSDIR()

void MCNP::Connector::CheckXSDIR ( )
private

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

◆ Clone()

ConnectorPlugin * MCNP::Connector::Clone ( )
inlineoverridevirtual

Clone method.

< Clone method

Implements ConnectorPlugin.

◆ CopyMCNPFile()

void MCNP::Connector::CopyMCNPFile ( string  FileName)
private

copy part of the MCNP user defined geometry

◆ FillTallyBinVolume()

void MCNP::Connector::FillTallyBinVolume ( )
private

fill tally bins volume (SD card)

◆ FindDetectorMCUserFile()

void MCNP::Connector::FindDetectorMCUserFile ( )
overridevirtual

Find tallies in a MCUser input files.

Implements ConnectorPlugin.

◆ FindMissingVolume()

void MCNP::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). The search is performed in 2 passes: the 1st one try to find in the table 50 of MCNP the missing volumes/areas. If after this pass, still some volumes are missing, a stochastic run is done (using a inward sphere surface source correctly weigthed together withe the "VOID" MCNP's card). Precisions on the result ca be increased via MURE::SetVolumeNPS().

Implements ConnectorPlugin.

◆ FindTallyInMCNPUserFile()

void MCNP::Connector::FindTallyInMCNPUserFile ( )
private

◆ GetMCDetectorOutputFileName()

string MCNP::Connector::GetMCDetectorOutputFileName ( string  InputFileName,
bool  OnlyKeff = false 
)
inlineoverridevirtual

Reimplemented from ConnectorPlugin.

◆ GetMCExecCommandString()

string MCNP::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 (e.g. s=inps).

Parameters
InputFileName: input file name
Arg: argument between exec name and input file name (task ...)
FileArg: argument after input file name (s=...)

Reimplemented from ConnectorPlugin.

◆ GetNewGroupBin()

GroupBin * MCNP::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 MCNP::GroupBin) from every where

Implements ConnectorPlugin.

◆ GetNewNode()

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

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

Reimplemented from ConnectorPlugin.

◆ GetNewSimpleBin()

SimpleBin * MCNP::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.

◆ GetRemove_r_files()

bool MCNP::Connector::GetRemove_r_files ( )
inline

< returns flag to remove MCNP "r" file during the evolution

◆ IsMCNP4B()

bool MCNP::Connector::IsMCNP4B ( )
inline

< return true if MCNP version is 4b (change the way of calling TASK in PVM)

◆ Print() [1/3]

string MCNP::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 MCNP::Connector::Print ( Material mat)
overridevirtual

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

Implements ConnectorPlugin.

◆ Print() [3/3]

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

print transformation (translation &rotation) card

Implements ConnectorPlugin.

◆ PrintId() [1/2]

string MCNP::Connector::PrintId ( Cell cell)
inlineoverridevirtual

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

< not used in MCNP::Connector

Implements ConnectorPlugin.

◆ PrintId() [2/2]

string MCNP::Connector::PrintId ( Material material)
inlineoverridevirtual

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

< not used in MCNP::Connector

Implements ConnectorPlugin.

◆ PrintModeratorMaterial()

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

print MT card associated to a Material

Implements ConnectorPlugin.

◆ ReadDetectorFile()

void MCNP::Connector::ReadDetectorFile ( )
private

◆ SetMCNP4B()

void MCNP::Connector::SetMCNP4B ( bool  flag = true)
inline

< return true if MCNP version is 4b (change the way of calling TASK)

◆ SetPRDMP()

void MCNP::Connector::SetPRDMP ( string  prdmp = "2J -1 1")
inline

< Set the PRDMP MC card

◆ SetRemove_r_files()

void MCNP::Connector::SetRemove_r_files ( bool  flag = true)
inline

< remove MC "r" file during the evolution

◆ StochasticVolumeCalculation()

void MCNP::Connector::StochasticVolumeCalculation ( )
private

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

◆ SumOutputDetectorFile()

void MCNP::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.

◆ TryToFindVolumeFromMCNPTable()

void MCNP::Connector::TryToFindVolumeFromMCNPTable ( )
private

no MCNP run is performed, just read of table 50

◆ UpdateGlobalTallies()

void MCNP::Connector::UpdateGlobalTallies ( )
private

update the global tallies

◆ UpdateKeff()

void MCNP::Connector::UpdateKeff ( )
overridevirtual

read from MC output the keff and give it to MURE

Implements ConnectorPlugin.

◆ UpdateMultiGroupSigmaPhiDetectors() [1/2]

void MCNP::Connector::UpdateMultiGroupSigmaPhiDetectors ( )
overridevirtual

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

Implements ConnectorPlugin.

◆ UpdateMultiGroupSigmaPhiDetectors() [2/2]

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

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

◆ UpdateSigmaPhiDetectors()

void MCNP::Connector::UpdateSigmaPhiDetectors ( )
overridevirtual

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

Implements ConnectorPlugin.

◆ UpdateTallyBinVolume()

void MCNP::Connector::UpdateTallyBinVolume ( )
overridevirtual

Reread all bins and assign necessary volume.

Implements ConnectorPlugin.

◆ UpdateTHMultiGroupSigmaPhiDetectors()

void MCNP::Connector::UpdateTHMultiGroupSigmaPhiDetectors ( )
overridevirtual

Implements ConnectorPlugin.

◆ WriteCell()

void MCNP::Connector::WriteCell ( ostream &  Out)
private

write MCNP all cells in the cell block (1st bloc) of MCNP's input file

◆ WriteLine()

void MCNP::Connector::WriteLine ( string  line,
ostream &  Out = cout,
int  IsComment = 0,
int  IsTruncated = 0,
char  separator = '&' 
)

Write a MCNP line.

Write a MCNP line (i.e of length <80 chars).

Parameters
line: the line to write
Out: where to write
IsComment: whether (1) or not (0) it is a comment (i.e., need a "C " at beginning or an " &" at the end)
IsTruncated: whether (1) or not (0) the line has less than 80 chars
separator: character to be put at the end of line

◆ WriteMaterial()

void MCNP::Connector::WriteMaterial ( ostream &  Out)
private

write MCNP materials in the 3rd block of MCNP's input file

◆ WriteMCFileWithoutDetector()

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

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

Reimplemented from ConnectorPlugin.

◆ WriteMCNPFile()

void MCNP::Connector::WriteMCNPFile ( string  FileName = "inp",
bool  tmpvol = false 
)
private

write the MCNP input file on disk

◆ WriteSurface()

void MCNP::Connector::WriteSurface ( ostream &  Out,
bool  tmpvol = false 
)
private

write MCNP all surface cards in the surface block (2nd bloc) of MCNP's input file

Member Data Documentation

◆ fDATAPATH

string MCNP::Connector::fDATAPATH
private

path to xsdir and cross sections

◆ fMCNP4B

bool MCNP::Connector::fMCNP4B
private

If MCNP4B is used (use for PVM argument)

◆ fMCOutput

TMctal* MCNP::Connector::fMCOutput
private

A result tallies from a MCNP m's files.

◆ fPRDMP

string MCNP::Connector::fPRDMP
private

PRDMP argument (default=2J -1 1)

◆ fRemove_r_files

bool MCNP::Connector::fRemove_r_files
private

Whether to remove "r" files of MCNP.


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

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