|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
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< CRPacket > | draw (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 |
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).
| vector< CRPacket > CRSource::draw | ( | const IdxType | n, |
| const Real | t0, | ||
| const Real | t1, | ||
| const Real | qSamp, | ||
| const RngThread & | rng | ||
| ) | const |
Draw CR packets.
| n | Number of packets to draw |
| t0 | Start of time interval over which packets are drawn |
| t1 | End of time interval over which packets are drawn |
| qSamp | Momentum sampling powerlaw index |
| rng | criptic::RngThread random number generator |
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.
|
inline |
Returns total energy corresponding to minimum momentum.
|
inline |
Returns total energy corresponding to maximum momentum.
|
inline |
Returns total 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.
|
inline |
Return mean CR momentum injected.
This returns the mean momentum per CR injected. It is equal to CRSource::pRate() / CRSource::nRate().
|
inline |
Returns total linear momentum injection rate per 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.
|
inline |
Returns rigidity correspondning to minimum momentum.
|
inline |
Returns rigidity correspondning to minimum momentum.
|
inline |
Set the momentum lower limit by specifying the kinetic energy.
| T0 | Kinetic energy of corresponding to the momentum lower limit |
|
inline |
Set the momentum upper limit by specifying the kinetic energy.
| T1 | Kinetic energy of corresponding to the momentum upper limit |
|
inline |
Set the rate coefficient to produce a specified luminosity.
| lum | Luminosity to set source to |
| codeUnits | Is 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).
|
inline |
Returns kinetic energy corresponding to minimum momentum.
|
inline |
Returns kinetic energy corresponding to maximum momentum.
|
inline |
Return mean CR kinetic energy injected.
This returns the mean kineticenergy per CR injected. It is equal to CRSource::TRate() / CRSource::nRate().
|
inline |
Returns total kinetic energy injection rate per 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.
Return the statistical weight of this source.
| qSamp | Sampling spectral index |
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.
| RealVec criptic::CRSource::a |
source acceleration
| Real criptic::CRSource::k |
injection rate coefficient
| Real criptic::CRSource::p0 |
injected CR momentum lower limit
| Real criptic::CRSource::p1 |
injected CR momentum upper limit
| Real criptic::CRSource::q |
powerlaw index on p distribution
| partTypes::pType criptic::CRSource::type |
type of particle
| IdxType criptic::CRSource::uniqueID |
unique ID number
| RealVec criptic::CRSource::v |
source velocity