criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
criptic::CRSource Class Reference

A class to describe a source of CR packets. More...

#include <CRSource.H>

Public Member Functions

Real T0 () const
 Returns kinetic energy corresponding to minimum momentum.
 
Real T1 () const
 Returns kinetic energy corresponding to maximum momentum.
 
void set_T0 (const Real T0)
 Set the momentum lower limit by specifying the kinetic energy.
 
void set_T1 (const Real T1)
 Set the momentum upper limit by specifying the kinetic energy.
 
Real E0 () const
 Returns total energy corresponding to minimum momentum.
 
Real E1 () const
 Returns total energy corresponding to maximum momentum.
 
Real R0 () const
 Returns rigidity correspondning to minimum momentum.
 
Real R1 () const
 Returns rigidity correspondning to minimum momentum.
 
Real nRate () const
 Returns total CR injection rate per unit time.
 
Real pRate () const
 Returns total linear momentum injection rate per time.
 
Real TRate () const
 Returns total kinetic energy injection rate per time.
 
Real pBar () const
 Return mean CR momentum injected.
 
Real TBar () const
 Return mean CR kinetic energy injected.
 
Real wgt (const Real qSamp) const
 Return the statistical weight of this source.
 
void setLum (const Real lum, const bool codeUnits=false)
 Set the rate coefficient to produce a specified luminosity.
 
std::vector< CRPacketdraw (const IdxType n, const Real t0, const Real t1, const Real qSamp, const RngThread &rng) const
 Draw CR packets.
 

Public Attributes

partTypes::pType type
 
IdxType uniqueID
 
Real p0
 
Real p1
 
Real q
 
Real k
 
RealVec v
 
RealVec a
 

Detailed Description

A class to describe a source of CR packets.

This is a trivial class that holds data to describe a source of CR packets. Sources produce packets at a rate per unit time per unit momentum d^2 n / dp dt = k * p^q over a momentum range (p0, p1).

Member Function Documentation

◆ draw()

vector< CRPacket > CRSource::draw ( const IdxType  n,
const Real  t0,
const Real  t1,
const Real  qSamp,
const RngThread rng 
) const

Draw CR packets.

Parameters
nNumber of packets to draw
t0Start of time interval over which packets are drawn
t1End of time interval over which packets are drawn
qSampMomentum sampling powerlaw index
rngcriptic::RngThread random number generator
Returns
A std::vector of n CR packets

This method randomly generates n CR packets from the source momentum distribution. The number of packets per unit momentum will be distributed as dn/dp ~ p^qSamp, with the constant of proportionality set to produce the target number n; the packet weights will be set to reflect the true injection rate and momentum distribuiton of the source.

◆ E0()

Real criptic::CRSource::E0 ( ) const
inline

Returns total energy corresponding to minimum momentum.

Returns
Total energy corresponding to minimum momentum

◆ E1()

Real criptic::CRSource::E1 ( ) const
inline

Returns total energy corresponding to maximum momentum.

Returns
Total energy corresponding to maximum momentum

◆ nRate()

Real criptic::CRSource::nRate ( ) const
inline

Returns total CR injection rate per unit time.

Returns
CR injection rate per unit time

This function returns integral_{p0}^{p1} k p^q dp, which is the total number of CR packets produced per unit time.

◆ pBar()

Real criptic::CRSource::pBar ( ) const
inline

Return mean CR momentum injected.

Returns
Mean momentum of CRs this source produces

This returns the mean momentum per CR injected. It is equal to CRSource::pRate() / CRSource::nRate().

◆ pRate()

Real criptic::CRSource::pRate ( ) const
inline

Returns total linear momentum injection rate per time.

Returns
CR momentum injected per unit time

This function returns integral_{p0}^{p1} p * k p^q dp, which is the total linear momentum injected per unit time by the source.

◆ R0()

Real criptic::CRSource::R0 ( ) const
inline

Returns rigidity correspondning to minimum momentum.

Returns
Rigidity corresponding to minimum momentum

◆ R1()

Real criptic::CRSource::R1 ( ) const
inline

Returns rigidity correspondning to minimum momentum.

Returns
Rigidity corresponding to minimum momentum

◆ set_T0()

void criptic::CRSource::set_T0 ( const Real  T0)
inline

Set the momentum lower limit by specifying the kinetic energy.

Parameters
T0Kinetic energy of corresponding to the momentum lower limit

◆ set_T1()

void criptic::CRSource::set_T1 ( const Real  T1)
inline

Set the momentum upper limit by specifying the kinetic energy.

Parameters
T1Kinetic energy of corresponding to the momentum upper limit

◆ setLum()

void criptic::CRSource::setLum ( const Real  lum,
const bool  codeUnits = false 
)
inline

Set the rate coefficient to produce a specified luminosity.

Parameters
lumLuminosity to set source to
codeUnitsIs lum in code units?

This method changes the value of the rate coefficient k to a value such that the kinetic luminosity of the source (the value returned by CRSource::TRate()) is equal to the specified luminosity. The luminosity can be specified either in code units or in metric units (ergs / s or Watts depending on whether the code was compiled with CGS or MKS units).

◆ T0()

Real criptic::CRSource::T0 ( ) const
inline

Returns kinetic energy corresponding to minimum momentum.

Returns
Kinetic energy corresponding to minimum momentum

◆ T1()

Real criptic::CRSource::T1 ( ) const
inline

Returns kinetic energy corresponding to maximum momentum.

Returns
Kinetic energy corresponding to maximum momentum

◆ TBar()

Real criptic::CRSource::TBar ( ) const
inline

Return mean CR kinetic energy injected.

Returns
Mean kinetic energy of CRs this source produces

This returns the mean kineticenergy per CR injected. It is equal to CRSource::TRate() / CRSource::nRate().

◆ TRate()

Real criptic::CRSource::TRate ( ) const
inline

Returns total kinetic energy injection rate per time.

Returns
Kinetic energy injection rate per unit time

This function returns integral_{p0}^{p1} T(p) * k p^q dp, where T(p) is the kinetic energy carried by a CR packet of momentum p. Thus this quantity is the total kinetic energy carried by the injected CRs per unit time.

◆ wgt()

Real criptic::CRSource::wgt ( const Real  qSamp) const
inline

Return the statistical weight of this source.

Parameters
qSampSampling spectral index
Returns
Weight of this source

This function returns the weight that should be assigned to this source in a scheme where CR momentum is sampled such that the number of packets in a particular momentum range p to p + dp is proportional to p^qSamp.

Member Data Documentation

◆ a

RealVec criptic::CRSource::a

source acceleration

◆ k

Real criptic::CRSource::k

injection rate coefficient

◆ p0

Real criptic::CRSource::p0

injected CR momentum lower limit

◆ p1

Real criptic::CRSource::p1

injected CR momentum upper limit

◆ q

Real criptic::CRSource::q

powerlaw index on p distribution

◆ type

partTypes::pType criptic::CRSource::type

type of particle

◆ uniqueID

IdxType criptic::CRSource::uniqueID

unique ID number

◆ v

RealVec criptic::CRSource::v

source velocity


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