MURE
Public Member Functions | Private Attributes | List of all members
MCNPSource Class Reference

Define a MCNP Source. More...

#include <MCNPSource.hxx>

Inheritance diagram for MCNPSource:
MCSource

Public Member Functions

 MCNPSource (double NPS=10000)
 Normal Constructor. More...
 
 MCNPSource (const MCNPSource &s)
 Copy Constructor. More...
 
MCSourceClone () override
 Clone method. More...
 
 ~MCNPSource () override
 destructor More...
 
void UsePreviousRunSource (string FirstSource="") override
 use a previous kcode source for mcnp. More...
 
void SetEnergy (string E)
 
void SetEXT (string EXT)
 
void SetEXT (double ext)
 
void SetCEL (int cel)
 
void SetVEC (double i=0, double j=0, double k=0)
 Set the reference vector for DIR. More...
 
void SetVEC (string vec)
 set reference vector in a string as "i j k" More...
 
void SetAXS (double i=0, double j=0, double k=0)
 Set the reference vector for EXT and RAD. More...
 
void SetAXS (string axs)
 
void SetX (string x)
 
void SetY (string y)
 
void SetZ (string z)
 
void AddBias (string bias)
 add a bias to the bias vector More...
 
void SetDirection (string dir)
 
void SetRadius (string rad)
 
void SetParticleType (int particle)
 
int GetParticleType ()
 
void SetParticleDistribution (string ParticleDistribution)
 
void SetDistribution (string D)
 
void SetKSRC ()
 
void SetSSR ()
 
bool GetSSR ()
 
void AddPosition (double *pos)
 Add a position to the KSRC position vector (in m) More...
 
void AddPosition (double x, double y, double z)
 Add a position to the KSRC position vector (in m) More...
 
void SetKSRCPosition (int i, double *pos)
 
string Print () override
 Print the MCNP source (into MNCP input file). More...
 
void AddTubeSource (MathTube *tube, string TubeParticleEnergy="1e6")
 
void AddTubeSource (MathTube *tube, Spectrum *spectrum)
 
void UseThisEnergyDistribution (Spectrum *spectrum, int SourceDistributionNum=800)
 
string PrintTubeSource ()
 Print a Tube Source in MCNP. More...
 
void SetSurfaceNumber (int num)
 
void SetEnergy (double E=2.5e6)
 Set the energy for a point source (in eV) More...
 
- Public Member Functions inherited from MCSource
 MCSource (double NPS=10000)
 Normal Constructor. More...
 
 MCSource (const MCSource &s)
 Copy Constructor. More...
 
virtual ~MCSource ()
 destructor More...
 
void SetNPS (double NPS=10000)
 
double GetNPS ()
 
void SetEnergy (double E=2.5e6)
 Set the energy for a point source (in eV) More...
 
void SetPosition (double *pos=nullptr)
 set the position of a point source (in m) More...
 
void SetPosition (double x=0, double y=0, double z=0)
 set the position of a point source (in m) More...
 
double * GetPosition ()
 
virtual void SetSurface (Shape_ptr TheShape)
 set the Surface number for a surface source. More...
 
void SetNormal (double nrm)
 
void SetWeight (double wgt)
 
void SetExtern (bool state=true)
 
void SetKcode (int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.)
 
bool GetKcode ()
 
int GetNActiveCycle ()
 
int GetNInactiveCycle ()
 
virtual bool IsUsePrevSource ()
 
void SetUsePrevSource (bool flag=true)
 
string GetSourceFileName ()
 
void SetSourceFileName (string name)
 
void SetOriginalSourceFileName (string name)
 
string GetOriginalSourceFileName ()
 
bool IsStochasticVolumeSource ()
 True if this is a Stochastic Volume Source run. More...
 
void SetStochasticVolumeSourceShape (Shape_ptr TheShape)
 Set the shape of the outer most sphere for Stochastic Volume run. More...
 
Shape_ptr GetStochasticVolumeSourceShape ()
 get the source sphere for Stochastic Volume Source run More...
 

Private Attributes

int fParticleType
 particle type for the source (1=neutron) More...
 
int fSurfaceNumber
 particle type for the source (1=neutron) More...
 
string fDirection
 direction bias More...
 
string fRadius
 direction bias More...
 
string fDistribution
 source distribution (use with bias) More...
 
string fEXT
 Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS. More...
 
string X
 
string Y
 
string Z
 
vector< string > fVEC
 Reference vector for DIR. More...
 
vector< string > fAXS
 Reference vector for ext and rad. More...
 
vector< string > fBias
 vector of bias More...
 
int fCEL
 
bool fKSRC
 whether or not a KSRC source is wanted More...
 
bool fSSR
 whether or not a surface source read is wanted More...
 
string fParticleDistribution
 if not only one particle More...
 
vector< double * > fKSRCposition
 KSRC position vector. More...
 
vector< MathTube * > fSourceTube
 vector of Tube for <> sources More...
 
vector< string > fTubeParticleEnergy
 vector of "energies" of each source tube (double or distribution) More...
 
vector< Spectrum * > fTubeParticleSpectrum
 vector of energy spectrum if the source uses Spectrum More...
 
vector< double > fSourceTubeRelIntensities
 
vector< Cell * > fTubeCell
 

Additional Inherited Members

- Protected Attributes inherited from MCSource
double fNPS
 number of source particles More...
 
string fEnergy
 Energy of the Source (either a number or a bias) More...
 
double * fPosition
 Position of the point Source (if it is the case) More...
 
Shape_ptr fSurfaceShape
 Surface Shape for surface source (if it is the case) More...
 
double fNormal
 Normal direction (inward or outward) for particle source. More...
 
double fWeight
 weight of the source More...
 
bool fExtern
 whether the source is extern or defined in MCNP file More...
 
bool fKcode
 whether or not a KCODE is wanted More...
 
int fActiveCycle
 number of active cycles in KCODE More...
 
int fInactiveCycle
 number of inactive cycles in KCODE More...
 
double fKeff
 expected Keff in KCODE More...
 
string fSourceFile
 Name of the next source if using file source. More...
 
string fOriginalSourceFile
 Name of the Original source file. More...
 
bool fUsePrevSource
 Whether MURE must use the preivous run source or not. More...
 
bool fStochasticVolumeSource
 
Shape_ptr fStochasticVolumeSourceShape
 

Detailed Description

Define a MCNP Source.

This source has to be added to the global gMURE pointer.

See also
MURE::SetSource
Author
PTO
Version
2.0

Constructor & Destructor Documentation

◆ MCNPSource() [1/2]

MCNPSource::MCNPSource ( double  NPS = 10000)

Normal Constructor.

Parameters
NPS: number of source particles (default=10 000)

◆ MCNPSource() [2/2]

MCNPSource::MCNPSource ( const MCNPSource s)

Copy Constructor.

◆ ~MCNPSource()

MCNPSource::~MCNPSource ( )
override

destructor

Member Function Documentation

◆ AddBias()

void MCNPSource::AddBias ( string  bias)

add a bias to the bias vector

◆ AddPosition() [1/2]

void MCNPSource::AddPosition ( double *  pos)

Add a position to the KSRC position vector (in m)

◆ AddPosition() [2/2]

void MCNPSource::AddPosition ( double  x,
double  y,
double  z 
)

Add a position to the KSRC position vector (in m)

◆ AddTubeSource() [1/2]

void MCNPSource::AddTubeSource ( MathTube tube,
Spectrum spectrum 
)

Add a isotropic volumetric Tube source. It allows to define an uniform volumic source in Tube(s).Usefull to define sources in an assembly. The first use was to calculated gamma bremmstralung from Beta Decay.

You CANNOT use in the same code AddTubeSource(MathTube*, string) and AddTubeSource(MathTube*, Spectrum*).

Parameters
tube: the Tube used to define the source shape
spectrum: must be either NeutronSpectrum,GammaSpectrum or BetaSpectrum to define the particle and it energy spectrum

◆ AddTubeSource() [2/2]

void MCNPSource::AddTubeSource ( MathTube tube,
string  TubeParticleEnergy = "1e6" 
)

Add a isotropic volumetric Tube source. It allows to define an uniform volumic source in Tube(s).Usefull to define sources in an assembly. The first use was to calculated gamma bremmstralung from Beta Decay.

You CANNOT use in the same code AddTubeSource(MathTube*, string) and AddTubeSource(MathTube*, Spectrum*).

Parameters
tube: the Tube used to define the source shape
TubeParticleEnergy: a string containing either a double for mono-energy neutrons, either a source distribution "Dxxx" where xxx is an int. In that case, the user MUST provide via MCNPSource::AddBias() the description of this distribution.

◆ Clone()

MCSource* MCNPSource::Clone ( )
inlineoverridevirtual

Clone method.

< Clone method

Implements MCSource.

◆ GetParticleType()

int MCNPSource::GetParticleType ( )
inline

< get the Particletype (1=n,9=H,...)

◆ GetSSR()

bool MCNPSource::GetSSR ( )
inline

< Surface Source Reading

◆ Print()

string MCNPSource::Print ( )
overridevirtual

Print the MCNP source (into MNCP input file).

Implements MCSource.

◆ PrintTubeSource()

string MCNPSource::PrintTubeSource ( )

Print a Tube Source in MCNP.

◆ SetAXS() [1/2]

void MCNPSource::SetAXS ( double  i = 0,
double  j = 0,
double  k = 0 
)

Set the reference vector for EXT and RAD.

◆ SetAXS() [2/2]

void MCNPSource::SetAXS ( string  axs)

◆ SetCEL()

void MCNPSource::SetCEL ( int  cel)

◆ SetDirection()

void MCNPSource::SetDirection ( string  dir)
inline

< set the direction bias

◆ SetDistribution()

void MCNPSource::SetDistribution ( string  D)
inline

Set the source distribution. In MCNP, one can define source with distributions ; each distribution is associated with source probability and/or source information. This probabilities and information have to be defined in MCNPSource::AddBias(). For example:

s.SetDistribution("RAD=D1 EXT =D2");
s.AddBias("SI1 1 2"); //radial extension (from r=1cm to r=2cm)
s.AddBias("SI2 -10 10");//axial extension (from z=-10cm to z=10cm)
Define a MCNP Source.
Definition: MCNPSource.hxx:53
void SetDistribution(string D)
Definition: MCNPSource.hxx:141
void AddBias(string bias)
add a bias to the bias vector
Definition: MCNPSource.cxx:136

Rem: one can specify also any cards of a SDEF line (such as AXS x y z, ...).

Parameters
D: the source distribution.

◆ SetEnergy() [1/2]

void MCSource::SetEnergy

Set the energy for a point source (in eV)

◆ SetEnergy() [2/2]

void MCNPSource::SetEnergy ( string  E)
inline

< Set the source energy (using bias)

◆ SetEXT() [1/2]

void MCNPSource::SetEXT ( double  ext)

◆ SetEXT() [2/2]

void MCNPSource::SetEXT ( string  EXT)
inline

< See fEXT description

◆ SetKSRC()

void MCNPSource::SetKSRC ( )
inline

Set KSRC source for MCNP. It allows to suppress SDEF card and specify multipoint source position. See MCNPSource::AddPosition()

◆ SetKSRCPosition()

void MCNPSource::SetKSRCPosition ( int  i,
double *  pos 
)
inline

< Allow to modify a KSRC point source position

◆ SetParticleDistribution()

void MCNPSource::SetParticleDistribution ( string  ParticleDistribution)
inline

< set the Particle Distibution if more than one particle type

◆ SetParticleType()

void MCNPSource::SetParticleType ( int  particle)
inline

< set the Particletype (1=n,9=H,...)

◆ SetRadius()

void MCNPSource::SetRadius ( string  rad)
inline

< set the Radius bias

◆ SetSSR()

void MCNPSource::SetSSR ( )
inline

< Surface Source Reading

◆ SetSurfaceNumber()

void MCNPSource::SetSurfaceNumber ( int  num)
inline

< Set the surface number

◆ SetVEC() [1/2]

void MCNPSource::SetVEC ( double  i = 0,
double  j = 0,
double  k = 0 
)

Set the reference vector for DIR.

◆ SetVEC() [2/2]

void MCNPSource::SetVEC ( string  vec)

set reference vector in a string as "i j k"

◆ SetX()

void MCNPSource::SetX ( string  x)
inline

◆ SetY()

void MCNPSource::SetY ( string  y)
inline

◆ SetZ()

void MCNPSource::SetZ ( string  z)
inline

◆ UsePreviousRunSource()

void MCNPSource::UsePreviousRunSource ( string  FirstSource = "")
overridevirtual

use a previous kcode source for mcnp.

Tells MCSource to use for the next MC run the fission source obtained from a previous critical run. In an evolution, each MC step is done using the source from the previous MC step (or the input "s" file provide by the user). This can be used to reduce inactive cycle in critical calculation, starting from an already converge fission source.

Parameters
FirstSource: name of the first source to use. If not specified, creates a default source.

Implements MCSource.

◆ UseThisEnergyDistribution()

void MCNPSource::UseThisEnergyDistribution ( Spectrum spectrum,
int  SourceDistributionNum = 800 
)

Use a spectrum as an energy distribution. It allows to use your spectrum object (BetaSpectrum,GammaSpectrum,or NeutronSpectrum) as a MCNP energy distribution

Parameters
spectrum: must be either NeutronSpectrum,GammaSpectrum or BetaSpectrum
SourceDistributionNum: the MCNP source distribution number used in D, SI,SP, ... cards

Member Data Documentation

◆ fAXS

vector<string> MCNPSource::fAXS
private

Reference vector for ext and rad.

◆ fBias

vector<string> MCNPSource::fBias
private

vector of bias

◆ fCEL

int MCNPSource::fCEL
private

◆ fDirection

string MCNPSource::fDirection
private

direction bias

◆ fDistribution

string MCNPSource::fDistribution
private

source distribution (use with bias)

◆ fEXT

string MCNPSource::fEXT
private

Cell case:distance from POS along AXS Surface Case:cosine of angle from AXS.

◆ fKSRC

bool MCNPSource::fKSRC
private

whether or not a KSRC source is wanted

◆ fKSRCposition

vector<double *> MCNPSource::fKSRCposition
private

KSRC position vector.

◆ fParticleDistribution

string MCNPSource::fParticleDistribution
private

if not only one particle

◆ fParticleType

int MCNPSource::fParticleType
private

particle type for the source (1=neutron)

◆ fRadius

string MCNPSource::fRadius
private

direction bias

◆ fSourceTube

vector<MathTube *> MCNPSource::fSourceTube
private

vector of Tube for <> sources

◆ fSourceTubeRelIntensities

vector<double> MCNPSource::fSourceTubeRelIntensities
private

◆ fSSR

bool MCNPSource::fSSR
private

whether or not a surface source read is wanted

◆ fSurfaceNumber

int MCNPSource::fSurfaceNumber
private

particle type for the source (1=neutron)

◆ fTubeCell

vector<Cell *> MCNPSource::fTubeCell
private

◆ fTubeParticleEnergy

vector<string> MCNPSource::fTubeParticleEnergy
private

vector of "energies" of each source tube (double or distribution)

◆ fTubeParticleSpectrum

vector<Spectrum *> MCNPSource::fTubeParticleSpectrum
private

vector of energy spectrum if the source uses Spectrum

◆ fVEC

vector<string> MCNPSource::fVEC
private

Reference vector for DIR.

◆ X

string MCNPSource::X
private

◆ Y

string MCNPSource::Y
private

◆ Z

string MCNPSource::Z
private

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

MURE Project, documentation generated by Doxygen 1.9.1 - Mon Jan 3 2022