MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Private Attributes | List of all members
MCNPSource Class Reference

Define a MCNP Source. More...

#include <MCNPSource.hxx>

Public Member Functions

 MCNPSource (double NPS=10000)
 Normal Constructor. More...
 
 MCNPSource (const MCNPSource &s)
 Copy Constructor. More...
 
 ~MCNPSource ()
 destructor More...
 
void SetNPS (double NPS=10000)
 set the number of source particles (default=10 000). More...
 
double GetNPS ()
 returns the number of source particles More...
 
void SetEnergy (double E=2.5e6)
 Set the energy for a point source (in eV) More...
 
void SetEnergy (string E)
 Set the source energy (using bias) More...
 
void SetPosition (double *pos=0)
 set the position of a point source (SDEF) (in m) More...
 
void SetPosition (double x=0, double y=0, double z=0)
 set the position of a point source (SDEF) (in m) More...
 
double * GetPosition ()
 returns the position of a point source More...
 
void SetSurface (int num)
 set the Surface number for a surface source. More...
 
void SetSurface (Shape_ptr TheShape)
 set the Surface number for a surface source. More...
 
void SetWeight (double wgt)
 set the Source particle weight More...
 
void SetNormal (double nrm)
 Set the normal direction of source (inward or outward) More...
 
void SetEXT (string EXT)
 See fEXT description. More...
 
void SetEXT (double ext)
 
void SetVEC (double i=0, double j=0, double k=0)
 Set the reference vector for DIR. More...
 
void SetVEC (string vec)
 
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 AddBias (string bias)
 add a bias to the bias vector More...
 
void SetExtern (bool state=true)
 
void SetDirection (string dir)
 set the direction bias More...
 
void SetRadius (string rad)
 set the Radius bias More...
 
void SetParticleType (int particle)
 set the Particletype (1=n,9=H,...) More...
 
int GetParticleType ()
 get the Particletype (1=n,9=H,...) More...
 
void SetParticleDistribution (string ParticleDistribution)
 set the Particle Distibution if more than one particle type More...
 
void SetDistribution (string D)
 
void SetKcode (int ActiveCycle=100, int InactiveCycle=10, double ExpectedKeff=1.)
 
bool GetKcode ()
 returns true for KCODE calculation mode. More...
 
int GetNActiveCycle ()
 Returns number of active Kcode cycles. More...
 
int GetNInactiveCycle ()
 Returns number of inactive Kcode cycles. More...
 
void SetKSRC ()
 
void SetSSR ()
 
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)
 Allow to modify a KSRC point source position. More...
 
string Print ()
 Print the MCNP source (into MNCP input file). More...
 
void AddTubeSource (Tube *tube, string TubeParticleEnergy="1e6")
 
void AddTubeSource (Tube *tube, Spectrum *spectrum)
 
void UseThisEnergyDistribution (Spectrum *spectrum, int SourceDistributionNum=800)
 
string PrintTubeSource ()
 Print a Tube Source in MCNP. More...
 

Private Attributes

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...
 
int fSurface
 Surface number for surface 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...
 
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...
 
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...
 
bool fExtern
 whether the source is extern or defined in MCNP file More...
 
bool fKcode
 whether or not a KCODE is wanted More...
 
bool fKSRC
 whether or not a KSRC source is wanted More...
 
bool fSSR
 whether or not a surface source read 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...
 
int fParticleType
 particle type for the source (1=neutron) More...
 
string fParticleDistribution
 if not only one particle More...
 
vector< double * > fKSRCposition
 KSRC position vector. More...
 
vector< Tube * > 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...
 

Detailed Description

Define a MCNP Source.

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

See Also
MURE::SetSource
Author
PTO
Version
1.0

Constructor & Destructor Documentation

MCNPSource::MCNPSource ( double  NPS = 10000)

Normal Constructor.

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

Copy Constructor.

MCNPSource::~MCNPSource ( )

destructor

Member Function Documentation

void MCNPSource::AddBias ( string  bias)

add a bias to the bias vector

void MCNPSource::AddPosition ( double *  pos)

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

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

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

void MCNPSource::AddTubeSource ( Tube 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(Tube*, string) and AddTubeSource(Tube*, 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.
void MCNPSource::AddTubeSource ( Tube 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(Tube*, string) and AddTubeSource(Tube*, 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
bool MCNPSource::GetKcode ( )
inline

returns true for KCODE calculation mode.

int MCNPSource::GetNActiveCycle ( )
inline

Returns number of active Kcode cycles.

int MCNPSource::GetNInactiveCycle ( )
inline

Returns number of inactive Kcode cycles.

double MCNPSource::GetNPS ( )
inline

returns the number of source particles

int MCNPSource::GetParticleType ( )
inline

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

double* MCNPSource::GetPosition ( )
inline

returns the position of a point source

string MCNPSource::Print ( )

Print the MCNP source (into MNCP input file).

string MCNPSource::PrintTubeSource ( )

Print a Tube Source in MCNP.

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

Set the reference vector for EXT and RAD.

void MCNPSource::SetAXS ( string  axs)
void MCNPSource::SetDirection ( string  dir)
inline

set the direction bias

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)

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

Parameters
D: the source distribution.
void MCNPSource::SetEnergy ( double  E = 2.5e6)

Set the energy for a point source (in eV)

void MCNPSource::SetEnergy ( string  E)
inline

Set the source energy (using bias)

void MCNPSource::SetEXT ( string  EXT)
inline

See fEXT description.

void MCNPSource::SetEXT ( double  ext)
void MCNPSource::SetExtern ( bool  state = true)
inline

Say whether the source is extern or defined in MCNP file. if set to "true", a external file is used (such as inps, source.mcnp, ...) else a SDEF card in used in the MCNP file. This can be used either in standard calculation either in KCODE calculation.

Parameters
state: if true an external source is used.
void MCNPSource::SetKcode ( int  ActiveCycle = 100,
int  InactiveCycle = 10,
double  ExpectedKeff = 1. 
)

Set KCODE mode for MCNP.

Parameters
ActiveCycle: Number of active cycles for keff determination.
InactiveCycle: Number of inactive cycles that are skipped for source stabilization
ExpectedKeff: the expected value of keff.
void MCNPSource::SetKSRC ( )
inline

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

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

Allow to modify a KSRC point source position.

void MCNPSource::SetNormal ( double  nrm)
inline

Set the normal direction of source (inward or outward)

void MCNPSource::SetNPS ( double  NPS = 10000)
inline

set the number of source particles (default=10 000).

void MCNPSource::SetParticleDistribution ( string  ParticleDistribution)
inline

set the Particle Distibution if more than one particle type

void MCNPSource::SetParticleType ( int  particle)
inline

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

void MCNPSource::SetPosition ( double *  pos = 0)

set the position of a point source (SDEF) (in m)

void MCNPSource::SetPosition ( double  x = 0,
double  y = 0,
double  z = 0 
)

set the position of a point source (SDEF) (in m)

void MCNPSource::SetRadius ( string  rad)
inline

set the Radius bias

void MCNPSource::SetSSR ( )
inline
void MCNPSource::SetSurface ( int  num)
inline

set the Surface number for a surface source.

void MCNPSource::SetSurface ( Shape_ptr  TheShape)
inline

set the Surface number for a surface source.

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

Set the reference vector for DIR.

void MCNPSource::SetVEC ( string  vec)
void MCNPSource::SetWeight ( double  wgt)
inline

set the Source particle weight

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

int MCNPSource::fActiveCycle
private

number of active cycles in KCODE

vector<string> MCNPSource::fAXS
private

Reference vector for ext and rad.

vector<string> MCNPSource::fBias
private

vector of bias

string MCNPSource::fDirection
private

direction bias

string MCNPSource::fDistribution
private

source distribution (use with bias)

string MCNPSource::fEnergy
private

Energy of the Source (either a number or a bias)

string MCNPSource::fEXT
private

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

bool MCNPSource::fExtern
private

whether the source is extern or defined in MCNP file

int MCNPSource::fInactiveCycle
private

number of inactive cycles in KCODE

bool MCNPSource::fKcode
private

whether or not a KCODE is wanted

double MCNPSource::fKeff
private

expected Keff in KCODE

bool MCNPSource::fKSRC
private

whether or not a KSRC source is wanted

vector<double*> MCNPSource::fKSRCposition
private

KSRC position vector.

double MCNPSource::fNormal
private

Normal direction (inward or outward) for particle source.

double MCNPSource::fNPS
private

number of source particles

string MCNPSource::fParticleDistribution
private

if not only one particle

int MCNPSource::fParticleType
private

particle type for the source (1=neutron)

double* MCNPSource::fPosition
private

Position of the point Source (if it is the case)

string MCNPSource::fRadius
private

direction bias

vector<Tube*> MCNPSource::fSourceTube
private

vector of Tube for <> sources

bool MCNPSource::fSSR
private

whether or not a surface source read is wanted

int MCNPSource::fSurface
private

Surface number for surface source (if it is the case)

Shape_ptr MCNPSource::fSurfaceShape
private

Surface Shape for surface source (if it is the case)

vector<string> MCNPSource::fTubeParticleEnergy
private

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

vector<Spectrum*> MCNPSource::fTubeParticleSpectrum
private

vector of energy spectrum if the source uses Spectrum

vector<string> MCNPSource::fVEC
private

Reference vector for DIR.

double MCNPSource::fWeight
private

weight of the source


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

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014