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

#include <SpinFlipAbsorptionMix.hpp>

Inheritance diagram for SpinFlipAbsorptionMix:
Inheritance graph
[legend]

Public Member Functions

double defaultTemperature () const
 
bool hasExtraSpecificState () const override
 
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

 SpinFlipAbsorptionMix ()
 
- 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 = SpinFlipAbsorptionMix
 

Private Attributes

double _defaultTemperature
 

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 SpinFlipAbsorptionMix class describes the material properties related to the 21 cm spin-flip transition in neutral atomic hydrogen, including only absorption (i.e. omitting emission processes). The 21 cm opacity in a given cell is determined from gas properties defined in the input model (gas temperature).

Configuring the simulation

Simulations of 21 cm the spin-flip transition usually include 21 cm emission (see the SpinFlipSEDFamily class) in addition to a medium component configured with the spin flip material mix (this class). Hence, the simulation mode should be set to "ExtinctionOnly".

As the opacity of the 21 cm line depends on the gas temperature as well as the neutral atomic hydrogen density \(n_\mathrm{HI}\), this information is read from an input file by associating the SpinFlipAbsorptionMix with a subclass of ImportedMedium. For that medium component, the ski file attribute importTemperature must be set to 'true', and importMetallicity and importVariableMixParams must be left at 'false'. For example, if bulk velocities are also imported for this medium component (i.e. importVelocity is 'true'), the column order would be

\[ ..., T, v_\mathrm{x}, v_\mathrm{y}, v_\mathrm{z} \]

For basic testing purposes, the SpinFlipAbsorptionMix can also be associated with a geometric medium component. The geometry then defines the spatial density distribution (i.e. \(n_\mathrm{HI}\)), and this class offers a configuration property to specify a fixed default temperature value that will be used across the spatial domain.

Absorption

Following Draine 2011 Chapter 8, and substituting wavelengths for frequencies, the monochromatic absorption cross section per neutral hydrogen atom \(\varsigma(\lambda)\) at frequency \(\lambda\) can be written as

\[\varsigma^\text{abs}(\lambda) = \frac{3}{32\pi}\,A_\mathrm{SF}\,\frac{hc \,\lambda_\mathrm{SF}} {k_\mathrm{B}T_\mathrm{s}} \times \frac{\lambda_\mathrm{SF}} {\sqrt{2\pi}\,\sigma} \,\exp\left(-\frac{u^2(\lambda)} {2\sigma^2}\right) \]

where \(T_\mathrm{s}\) is the spin temperature of the hydrogen gas (see below), \(\sigma=\sqrt{k_B T/m_\mathrm{p}}\) is the velocity dispersion corresponding to the thermal motion of the atoms, and \(u(\lambda)=c(\lambda-\lambda_\mathrm{SF})/\lambda\) is the frequency deviation from the line center in velocity units.

According to Kim, Ostriker and Kim 2014 (ApJ 786:64), the spin temperature \(T_\mathrm{s}\) is essentially equal to the kinetic gas temperature \(T\) for low gas temperatures \(T<1000~\mathrm{K}\). For higher gas temperatures, it also depends on other gas properties, with an upper bound that never exceeds a fixed maximum value, i.e. \(T_\mathrm{s,upper} \lesssim 5000~\mathrm{K}\) (see their Figure 2).

To avoid the need for defining additional gas properties in the input model, we here use an approximate upper bound for the spin temperature given by

\[ T_\mathrm{s}= 6000~\mathrm{K} \times \left( 1-\mathrm{e}^{-T/5000~\mathrm{K} } \right).\]

Because the absorption cross section is inversely proportional to the spin temperature, this yields an approximate lower bound for the cross section.

Constructor & Destructor Documentation

◆ SpinFlipAbsorptionMix()

SpinFlipAbsorptionMix::SpinFlipAbsorptionMix ( )
inlineprotected

Default constructor for concrete Item subclass SpinFlipAbsorptionMix : "A gas mix supporting the spin-flip 21 cm hydrogen absorption" .

Member Function Documentation

◆ defaultTemperature()

SpinFlipAbsorptionMix::defaultTemperature ( ) const
inline

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

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

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

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

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

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.

◆ hasExtraSpecificState()

bool SpinFlipAbsorptionMix::hasExtraSpecificState ( ) const
overridevirtual

This function returns true, indicating that the cross sections returned by this material mix depend on the values of specific state variables other than the number density.

Reimplemented from MaterialMix.

◆ indicativeTemperature()

double SpinFlipAbsorptionMix::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 stored in the specific state for the relevant spatial cell and medium component. Because the hydrogen temperature is not calculated self-consistently in our treatment, this value corresponds to the temperature defined by the input model at the start of the simulation.

Reimplemented from MaterialMix.

◆ initializeSpecificState()

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

This function initializes the specific state variables requested by this material mix through the specificStateVariableInfo() function except for the number density. For this class, the function initializes the temperature to the specified imported value, or if not available, to the user-configured default value.

Reimplemented from MaterialMix.

◆ mass()

double SpinFlipAbsorptionMix::mass ( ) const
overridevirtual

This function returns the mass of a neutral hydrogen atom.

Implements MaterialMix.

◆ materialType()

MaterialType SpinFlipAbsorptionMix::materialType ( ) const
overridevirtual

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

Implements MaterialMix.

◆ opacityAbs()

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

This function returns the 21 cm absorption opacity \(k^\text{abs}= n_mathrm{HI} \varsigma^\text{abs}\) for the given wavelength and material state. The photon packet properties are not used.

Implements MaterialMix.

◆ opacityExt()

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

This function returns the 21 cm extinction opacity \(k^\text{ext}=k^\text{abs}\) for the given wavelength and material state, which equals the absorption opacity because the scattering opacity is zero. The photon packet properties are not used.

Implements MaterialMix.

◆ opacitySca()

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

This function returns the 21 cm scattering opacity \(k^\text{sca}\) which is trivially zero at all wavelengths.

Implements MaterialMix.

◆ peeloffScattering()

void SpinFlipAbsorptionMix::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 does nothing because the 21 cm line does not scatter.

Implements MaterialMix.

◆ performScattering()

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

This function does nothing because the 21 cm line does not scatter.

Implements MaterialMix.

◆ sectionAbs()

double SpinFlipAbsorptionMix::sectionAbs ( double  lambda) const
overridevirtual

This function returns the 21 cm absorption cross section per neutral hydrogen atom at the given wavelength and using the default gas properties configured for this material mix.

Implements MaterialMix.

◆ sectionExt()

double SpinFlipAbsorptionMix::sectionExt ( double  lambda) const
overridevirtual

This function returns the total 21 cm extinction cross section per neutral hydrogen atom at the given wavelength and using the default gas properties configured for this material mix. The extinction cross section is identical to the absorption cross section because the scattering cross section is zero.

Implements MaterialMix.

◆ sectionSca()

double SpinFlipAbsorptionMix::sectionSca ( double  lambda) const
overridevirtual

This function returns the 21 scattering cross section per neutral hydrogen atom, which is trivially zero for all wavelengths.

Implements MaterialMix.

◆ specificStateVariableInfo()

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

This function returns a list of StateVariable objects describing the specific state variables used by the receiving material mix. For this class, the function returns a list containing descriptors for the properties defined in the input model, namely number density and temperature.

Implements MaterialMix.


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