The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
ElectronMix Class Reference

#include <ElectronMix.hpp>

Inheritance diagram for ElectronMix:
Inheritance graph
[legend]

Public Member Functions

double defaultTemperature () const
 
bool hasPolarizedScattering () const override
 
bool hasScatteringDispersion () const override
 
bool includePolarization () const
 
bool includeThermalDispersion () const
 
double indicativeTemperature (const MaterialState *state, const Array &Jv) const override
 
void initializeSpecificState (MaterialState *state, double metallicity, double temperature, const Array &params) const override
 
double mass () const override
 
MaterialType materialType () const override
 
double opacityAbs (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
 
double opacityExt (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
 
double opacitySca (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
 
void peeloffScattering (double &I, double &Q, double &U, double &V, double &lambda, Direction bfkobs, Direction bfky, const MaterialState *state, const PhotonPacket *pp) const override
 
void performScattering (double lambda, const MaterialState *state, PhotonPacket *pp) const override
 
double sectionAbs (double lambda) const override
 
double sectionExt (double lambda) const override
 
double sectionSca (double lambda) const override
 
vector< StateVariablespecificStateVariableInfo () const override
 
- Public Member Functions inherited from MaterialMix
virtual double asymmpar (double lambda) const
 
virtual Array emissionSpectrum (const MaterialState *state, const Array &Jv) const
 
virtual DisjointWavelengthGridemissionWavelengthGrid () const
 
virtual Array emissivity (const Array &Jv) const
 
virtual bool hasContinuumEmission () const
 
virtual DynamicStateType hasDynamicMediumState () const
 
virtual bool hasExtraSpecificState () const
 
virtual bool hasLineEmission () const
 
virtual bool hasNegativeExtinction () const
 
virtual bool hasPolarizedAbsorption () const
 
virtual bool hasPolarizedEmission () const
 
virtual bool hasPolarizedScattering () const
 
virtual bool hasResonantScattering () const
 
virtual bool hasScatteringDispersion () const
 
virtual bool hasStochasticDustEmission () const
 
virtual double indicativeTemperature (const MaterialState *state, const Array &Jv) const
 
virtual void initializeSpecificState (MaterialState *state, double metallicity, double temperature, const Array &params) const
 
bool isDust () const
 
bool isElectrons () const
 
bool isGas () const
 
virtual bool isSpecificStateConverged (int numCells, int numUpdated, int numNotConverged, MaterialState *currentAggregate, MaterialState *previousAggregate) const
 
virtual Array lineEmissionCenters () const
 
virtual Array lineEmissionMasses () const
 
virtual Array lineEmissionSpectrum (const MaterialState *state, const Array &Jv) const
 
virtual double mass () const =0
 
virtual MaterialType materialType () const =0
 
virtual double opacityAbs (double lambda, const MaterialState *state, const PhotonPacket *pp) const =0
 
virtual double opacityExt (double lambda, const MaterialState *state, const PhotonPacket *pp) const =0
 
virtual double opacitySca (double lambda, const MaterialState *state, const PhotonPacket *pp) const =0
 
virtual vector< SnapshotParameterparameterInfo () const
 
virtual void peeloffScattering (double &I, double &Q, double &U, double &V, double &lambda, Direction bfkobs, Direction bfky, const MaterialState *state, const PhotonPacket *pp) const =0
 
virtual void performScattering (double lambda, const MaterialState *state, PhotonPacket *pp) const =0
 
virtual double sectionAbs (double lambda) const =0
 
virtual double sectionExt (double lambda) const =0
 
virtual const ArraysectionsAbs (double lambda) const
 
virtual const ArraysectionsAbspol (double lambda) const
 
virtual double sectionSca (double lambda) const =0
 
virtual vector< StateVariablespecificStateVariableInfo () const =0
 
virtual const ArraythetaGrid () const
 
virtual UpdateStatus updateSpecificState (MaterialState *state, const Array &Jv) const
 
- Public Member Functions inherited from SimulationItem
template<class T >
T * find (bool setup=true) const
 
template<class T >
T * interface (int levels=-999999, bool setup=true) const
 
virtual string itemName () const
 
void setup ()
 
string typeAndName () const
 
- Public Member Functions inherited from Item
 Item (const Item &)=delete
 
virtual ~Item ()
 
void addChild (Item *child)
 
const vector< Item * > & children () const
 
virtual void clearItemListProperty (const PropertyDef *property)
 
void destroyChild (Item *child)
 
virtual bool getBoolProperty (const PropertyDef *property) const
 
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
 
virtual double getDoubleProperty (const PropertyDef *property) const
 
virtual string getEnumProperty (const PropertyDef *property) const
 
virtual int getIntProperty (const PropertyDef *property) const
 
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
 
virtual ItemgetItemProperty (const PropertyDef *property) const
 
virtual string getStringProperty (const PropertyDef *property) const
 
int getUtilityProperty (string name) const
 
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
 
Itemoperator= (const Item &)=delete
 
Itemparent () const
 
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
 
virtual void setBoolProperty (const PropertyDef *property, bool value)
 
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
 
virtual void setDoubleProperty (const PropertyDef *property, double value)
 
virtual void setEnumProperty (const PropertyDef *property, string value)
 
virtual void setIntProperty (const PropertyDef *property, int value)
 
virtual void setItemProperty (const PropertyDef *property, Item *item)
 
virtual void setStringProperty (const PropertyDef *property, string value)
 
void setUtilityProperty (string name, int value)
 
virtual string type () const
 

Protected Member Functions

 ElectronMix ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from MaterialMix
 MaterialMix ()
 
Configurationconfig () const
 
Randomrandom () const
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from SimulationItem
 SimulationItem ()
 
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
 
virtual void setupSelfAfter ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 

Private Types

using BaseType = MaterialMix
 
using ItemType = ElectronMix
 

Private Attributes

ComptonPhaseFunction _cpf
 
double _defaultTemperature
 
DipolePhaseFunction _dpf
 
bool _hasDispersion
 
bool _includePolarization
 
bool _includeThermalDispersion
 

Friends

class ItemRegistry
 

Additional Inherited Members

- Public Types inherited from MaterialMix
enum class  DynamicStateType { None , Primary , Secondary , PrimaryIfMergedIterations }
 
enum class  MaterialType { Dust , Electrons , Gas }
 

Detailed Description

The ElectronMix class describes the material properties for a population of electrons. Electrons do not absorb photons. They do, however, significantly scatter photons. This process is described by Compton scattering, which converges to Thomson scattering at low photon energies. It is meaningful to implement both processes, because the calculations for Compton scattering are substantially slower than those for Thomson scattering. If requested by the user, polarization by scattering is fully supported in both regimes.

Compton and Thomson scattering

For wavelengths shorter than 10 nm, this class models Compton scattering, which features a wavelength-dependent cross section and phase function, and which causes the photon energy (wavelength) to change during the interaction. This process is implemented through the ComptonPhaseFunction class; see that class for more information.

For wavelengths longer than 10nm, the scattering process can be described by elastic and wavelength-independent Thomson scattering. The scattering cross section is given by the well-known Thomson cross section (a constant) and the phase function is that of a dipole. Consequently, this class calls on the DipolePhaseFunction class to implement Thomson scattering; see that class for more information.

The transition point between Compton and Thomson scattering can be justified as follows. For wavelengths much longer than 10 nm, the expression for the Compton cross section becomes numerically unstable. This could be solved by using a series expansion approximation at longer wavelengths. However, at a wavelength of 10 nm, the Compton cross section has approached the Thomson constant to within less than 0.05 per cent. It thus seems reasonable to transition to the much faster Thomson scattering at that wavelength point.

Thermal dispersion

By default, this class assumes that all electrons are at rest in the local frame (i.e., there is no movement other than the bulk velocity of the spatial cell containing the electrons). If the includeThermalDispersion configuration flag is enabled (and the simulation mode is panchromatic), a random thermal motion corresponding to the local temperature is added when performing a scattering interaction. The dispersion is not taken into account to determine the scattering cross section, because that value does not vary significantly for small wavelength shifts (and it does not vary at all for Thomson scattering).

If the electron mix is associated with an ImportedMedium and the importTemperature flag for the medium is enabled, the local dispersion temperature is obtained from the imported file. Otherwise, the value configured for the defaultTemperature property is used instead, resulting in a constant temperature across space.

Constructor & Destructor Documentation

◆ ElectronMix()

ElectronMix::ElectronMix ( )
inlineprotected

Default constructor for concrete Item subclass ElectronMix : "a population of electrons" .

Member Function Documentation

◆ defaultTemperature()

ElectronMix::defaultTemperature ( ) const
inline

This function returns the value of the discoverable double property defaultTemperature : "the default temperature of the electron population" .

This property represents a physical quantity of type "temperature" .

The minimum value for this property is "[3" .

The maximum value for this property is "1e8]" .

The default value for this property is given by the conditional value expression "1e4" .

This property is relevant only if the Boolean expression "Panchromatic&includeThermalDispersion" evaluates to true after replacing the names by true or false depending on their presence.

This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

◆ hasPolarizedScattering()

bool ElectronMix::hasPolarizedScattering ( ) const
overridevirtual

This function returns the value of the includePolarization flag, indicating whether the material mix supports polarization during scattering events or not.

Reimplemented from MaterialMix.

◆ hasScatteringDispersion()

bool ElectronMix::hasScatteringDispersion ( ) const
overridevirtual

This function returns true when thermal dispersion is enabled and/or support for Compton scattering has been turned on (based on the simulation's wavelength range), indicating that in those cases a scattering interaction for the electron mix may (and usually does) adjust the wavelength of the interacting photon packet. If both thermal dispersion and support for Compton scattering are disabled, the function returns false.

Reimplemented from MaterialMix.

◆ includePolarization()

ElectronMix::includePolarization ( ) const
inline

This function returns the value of the discoverable Boolean property includePolarization : "include support for polarization" .

The default value for this property is given by the conditional value expression "false" .

This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

◆ includeThermalDispersion()

ElectronMix::includeThermalDispersion ( ) const
inline

This function returns the value of the discoverable Boolean property includeThermalDispersion : "include thermal velocity dispersion" .

The default value for this property is given by the conditional value expression "false" .

This property is relevant only if the Boolean expression "Panchromatic" evaluates to true after replacing the names by true or false depending on their presence.

This property is displayed only if the Boolean expression "Level2" evaluates to true after replacing the names by true or false depending on their presence.

◆ indicativeTemperature()

double ElectronMix::indicativeTemperature ( const MaterialState state,
const Array Jv 
) const
overridevirtual

This function returns an indicative temperature of the material mix when it would be embedded in a given radiation field. The implementation in this class ignores the radiation field and returns the temperature driving the thermal velocity dispersion for the medium component in the relevant spatial cell, or zero if thermal velocity dispersion is not enabled for this material mix. Because nothing in the simulation changes the electron temperature, this value corresponds to the temperature defined by the input model at the start of the simulation.

Reimplemented from MaterialMix.

◆ initializeSpecificState()

void ElectronMix::initializeSpecificState ( MaterialState state,
double  metallicity,
double  temperature,
const Array params 
) const
overridevirtual

This function initializes any specific state variables requested by this material mix except for the number density. See the description of the MaterialMix::initializeSpecificState() function for more information.

For this class, in case the electron mix has thermal dispersion, the function initializes the temperature to the specified imported temperature, or if this is not available, to the user-configured default temperature for this electron mix.

Reimplemented from MaterialMix.

◆ mass()

double ElectronMix::mass ( ) const
overridevirtual

This function returns the electron mass.

Implements MaterialMix.

◆ materialType()

MaterialType ElectronMix::materialType ( ) const
overridevirtual

This function returns the fundamental material type represented by this material mix, which is MaterialType::Electrons.

Implements MaterialMix.

◆ opacityAbs()

double ElectronMix::opacityAbs ( double  lambda,
const MaterialState state,
const PhotonPacket pp 
) const
overridevirtual

This function returns the absorption opacity \(k^\text{abs}=n\varsigma^\text{abs}\), which is trivially zero for electrons.

Implements MaterialMix.

◆ opacityExt()

double ElectronMix::opacityExt ( double  lambda,
const MaterialState state,
const PhotonPacket pp 
) const
overridevirtual

This function returns the extinction opacity \(k^\text{ext}=k^\text{abs}+k^\text{sca}\) for the given material state and wavelength. The photon properties are not used because the cross section does not depend on the polarization state of the incoming photon packet.

Implements MaterialMix.

◆ opacitySca()

double ElectronMix::opacitySca ( double  lambda,
const MaterialState state,
const PhotonPacket pp 
) const
overridevirtual

This function returns the scattering opacity \(k^\text{sca}=n\varsigma^\text{sca}\) for the given material state and wavelength. The photon properties are not used because the cross section does not depend on the polarization state of the incoming photon packet.

Implements MaterialMix.

◆ peeloffScattering()

void ElectronMix::peeloffScattering ( double &  I,
double &  Q,
double &  U,
double &  V,
double &  lambda,
Direction  bfkobs,
Direction  bfky,
const MaterialState state,
const PhotonPacket pp 
) const
overridevirtual

This function calculates the contribution of the medium component associated with this electron mix to the peel-off photon luminosity, polarization state, and wavelength shift for the given wavelength, geometry, material state, and photon properties. The contributions to the Stokes vector components are stored in the I, Q, U, V arguments, which are guaranteed to be initialized to zero by the caller. If there is wavelength shift, the new wavelength value replaces the incoming value of the lambda argument.

If includePolarization has been set to true, the function supports polarization; otherwise it does not.

Implements MaterialMix.

◆ performScattering()

void ElectronMix::performScattering ( double  lambda,
const MaterialState state,
PhotonPacket pp 
) const
overridevirtual

This function performs a scattering event on the specified photon packet in the spatial cell and medium component represented by the specified material state and the receiving electron mix. If includePolarization has been set to true, the function supports polarization; otherwise it does not.

Implements MaterialMix.

◆ sectionAbs()

double ElectronMix::sectionAbs ( double  lambda) const
overridevirtual

This function returns the absorption cross section per electron \(\varsigma^{\text{abs}}_{\lambda}\), which is trivially zero for all wavelengths \(\lambda\).

Implements MaterialMix.

◆ sectionExt()

double ElectronMix::sectionExt ( double  lambda) const
overridevirtual

This function returns the total extinction cross section per electron \(\varsigma^{\text{ext}}_{\lambda} = \varsigma^{\text{abs}}_{\lambda} + \varsigma^{\text{sca}}_{\lambda}\). Because the absorption cross section is trivially zero, this equals the scattering cross section.

Implements MaterialMix.

◆ sectionSca()

double ElectronMix::sectionSca ( double  lambda) const
overridevirtual

This function returns the scattering cross section per electron \(\varsigma^{\text{sca}}_{\lambda}\) which varies with the wavelength \(\lambda\) for high energies and converges to the constant Thomson cross section at low energies.

Implements MaterialMix.

◆ setupSelfBefore()

void ElectronMix::setupSelfBefore ( )
overrideprotectedvirtual

This function initializes the DipolePhaseFunction instance held by this class.

Reimplemented from SimulationItem.

◆ specificStateVariableInfo()

vector< StateVariable > ElectronMix::specificStateVariableInfo ( ) const
overridevirtual

This function returns a list of StateVariable objects describing the specific state variables used by the receiving material mix. See the description of the MaterialMix::specificStateVariableInfo() function for more information.

For the electron mix class, the returned list always includes the specific state variable for number density and, in case the electron mix has thermal dispersion, it also includes the specific state variable for temperature.

Implements MaterialMix.


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