#include <SpinFlipHydrogenGasMix.hpp>
Public Member Functions | |
double | defaultMetallicity () const |
double | defaultNeutralSurfaceDensity () const |
double | defaultTemperature () const |
DynamicStateType | hasDynamicMediumState () const override |
bool | hasExtraSpecificState () const override |
bool | hasLineEmission () const override |
double | indicativeTemperature (const MaterialState *state, const Array &Jv) const override |
void | initializeSpecificState (MaterialState *state, double metallicity, double temperature, const Array ¶ms) const override |
Array | lineEmissionCenters () const override |
Array | lineEmissionMasses () const override |
Array | lineEmissionSpectrum (const MaterialState *state, const Array &Jv) const override |
double | mass () 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 |
vector< SnapshotParameter > | parameterInfo () 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< StateVariable > | specificStateVariableInfo () const override |
UpdateStatus | updateSpecificState (MaterialState *state, const Array &Jv) const override |
![]() | |
MaterialType | materialType () const override |
double | sourceWeight () const |
double | wavelengthBias () const |
WavelengthDistribution * | wavelengthBiasDistribution () const |
Range | wavelengthRange () const override |
![]() | |
virtual double | asymmpar (double lambda) const |
virtual Array | emissionSpectrum (const MaterialState *state, const Array &Jv) const |
virtual DisjointWavelengthGrid * | emissionWavelengthGrid () 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 ¶ms) 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< SnapshotParameter > | parameterInfo () 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 Array & | sectionsAbs (double lambda) const |
virtual const Array & | sectionsAbspol (double lambda) const |
virtual double | sectionSca (double lambda) const =0 |
virtual vector< StateVariable > | specificStateVariableInfo () const =0 |
virtual const Array & | thetaGrid () const |
virtual UpdateStatus | updateSpecificState (MaterialState *state, const Array &Jv) const |
![]() | |
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 |
![]() | |
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 Item * | getItemProperty (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) |
Item & | operator= (const Item &)=delete |
Item * | parent () 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 |
![]() | |
virtual | ~WavelengthRangeInterface () |
virtual Range | wavelengthRange () const =0 |
Protected Member Functions | |
SpinFlipHydrogenGasMix () | |
void | setupSelfBefore () override |
![]() | |
EmittingGasMix () | |
![]() | |
MaterialMix () | |
Configuration * | config () const |
Random * | random () const |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
SourceWavelengthRangeInterface () | |
![]() | |
WavelengthRangeInterface () | |
Private Types | |
using | BaseType = EmittingGasMix |
using | ItemType = SpinFlipHydrogenGasMix |
Private Attributes | |
double | _defaultMetallicity |
double | _defaultNeutralSurfaceDensity |
double | _defaultTemperature |
int | _indexUV |
Friends | |
class | ItemRegistry |
Additional Inherited Members | |
![]() | |
enum class | DynamicStateType { None , Primary , Secondary , PrimaryIfMergedIterations } |
enum class | MaterialType { Dust , Electrons , Gas } |
The SpinFlipHydrogenGasMix class describes the material properties related to the 21 cm spin-flip transition in neutral atomic hydrogen, including emission and absorption. The 21 cm emission luminosity and self-absorption opacity in a given cell are determined from gas properties defined in the input model (neutral hydrogen volume density, gas metallity, gas temperature, and neutral hydrogen surface density) and the local UV radiation field calculated by the simulation taking into account dust extinction.
Configuring the simulation
Simulations of the 21 cm the spin-flip transition usually include primary sources and a dust medium in addition to a medium component configured with the spin flip material mix (this class). During primary emission, the dust medium determines the UV radiation field, allowing the spin flip material mix to calculate the 21 cm line luminosity and absorption cross section for use during secondary emission. This calculation happens in the updateSpecificState() function, which is invoked at the end of primary emission (because the material mix advertises that it has a secondary dynamic medium state). This does imply that the 21 cm line absorption remains zero during primary emission, which is not a problem as long as the primary sources don't emit in the radio wavelength range. Thus, unless dust opacities are very high, there is no need for iteration over primary nor secondary emission.
If one is not interested in dust emission (i.e. only in the 21 cm line emission), the simulation mode can be set to "GasEmission" and the radiation field wavelength grid can be limited to a single bin in the UV wavelength range. This bin should be configured to cover the full Lyman-Werner band (912-1110 Å) so that it accurately captures all radiation that dissociates molecular hydrogen. Similarly, instrument wavelength grids can be limited to a relevant range around the 21 cm line center.
To calculate both the dust emission spectrum and the 21 cm line emission in the same simulation, the simulation mode must be set to "DustAndGasEmission" and the radiation field wavelength grid must now include and properly resolve the UV, optical, and infrared wavelength range. Separate instruments can be configured for the relevant wavelength ranges, e.g. using a logarithmic grid for the continuum spectrum and a linear grid for the 21 cm line profile.
The input model must provide values for the spatial distribution of four medium properties that remain constant during the simulation:
Most often, this information will be read from an input file by associating the spin flip material mix with a subclass of ImportedMedium. For that medium component, the ski file attributes importMetallicity and importTemperature must be set to 'true', and importVariableMixParams must be left at 'false'. The additional column required by the spin flip material mix (neutral hydrogen surface mass density) is automatically imported and is expected after all other columns. For example, if bulk velocities are also imported for this medium component (i.e. importVelocity is 'true'), the column order would be
Depending on the specific ImportedMedium subclass being used, the neutral hydrogen density distribution in the first column can be specified as a mass or number density, or as a volume-integrated mass or number for each cell or particle. In all cases, the value is automatically converted to the appropriate volume number density expected by this class. In contrast, the neutral hydrogen surface density must always be specified as a surface mass density, with default units of Msun/pc2.
For basic testing purposes, the spin flip material mix can also be associated with a geometric medium component. The geometry then defines the spatial neutral hydrogen density distribution (i.e.
Partitioning scheme
While the input model defines the neutral (i.e. non-ionized) hydrogen density distribution, the partitioning of the hydrogen gas into its atomic and molecular components must be determined based on the the UV radiation field calculated by the simulation. Since UV radiation in the Lyman-Werner band (912-1110 Å) dissociates molecular hydrogen, a hydrogen partitioning scheme usually has the UV field in that wavelength range as an important parameter. For this purpose, this class samples the radiation field
This class implements the column-density based partioning scheme of Gnedin & Draine 2014 (Apj, 795, 37), which is an update of Gnedin & Kravtsov 2011 (ApJ, 728, 88). The mechanism for estimating the length scale of a gas cell is taken from Diemer et al. 2018 (ApJS, 238, 33).
The scheme has the following input parameters:
With these input parameters, the partitioning scheme can be summarized as follows:
where
Emission
Following Draine 2011 Chapter 8, the integrated luminosity
where
The 21 cm line is extremely narrow so that the emerging line profile is dominated by the Doppler shift caused by the thermal motion of the atoms. The gas temperature defined in the input model is used to randomly shift the wavelength of each emitted photon packet according to a Maxwell-Boltzmann distribution. This happens outside of this class in the secondary source machinery.
Absorption
Again following Draine 2011 Chapter 8, and substituting wavelengths for frequencies, the monochromatic absorption cross section per neutral hydrogen atom
where
According to Kim, Ostriker and Kim 2014 (ApJ 786:64), the spin temperature
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
Because the absorption cross section is inversely proportional to the spin temperature, this yields an approximate lower bound for the cross section.
When an item of this type is used, the names provided by the conditional value expression "CustomMediumState,DynamicState" are inserted into the name sets used for evaluating Boolean expressions.
|
inlineprotected |
Default constructor for concrete Item subclass SpinFlipHydrogenGasMix : "A gas mix supporting the spin-flip 21 cm hydrogen transition" .
|
inline |
This function returns the value of the discoverable double property defaultMetallicity : "the default metallicity of the gas" .
The minimum value for this property is "]0" .
The maximum value for this property is "0.2]" .
The default value for this property is given by the conditional value expression "0.02" .
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.
|
inline |
This function returns the value of the discoverable double property defaultNeutralSurfaceDensity : "the default neutral hydrogen surface density" .
This property represents a physical quantity of type "masssurfacedensity" .
The minimum value for this property is "]0 Msun/pc2" .
The maximum value for this property is "1e9 Msun/pc2]" .
The default value for this property is given by the conditional value expression "10 Msun/pc2" .
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.
|
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.
|
overridevirtual |
This function returns DynamicStateType::Secondary, indicating that this material mix has a dynamic medium state with updates that affect only secondary emission.
Reimplemented from MaterialMix.
|
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.
|
overridevirtual |
This function returns true, indicating that this material supports secondary line emission from gas.
Reimplemented from MaterialMix.
|
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.
|
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, metallicity and neutral hydrogen mass surface density to the specified imported values, or if not available, to the user-configured default values. The atomic hydrogen fraction is set to zero.
Reimplemented from MaterialMix.
|
overridevirtual |
This function returns a list including a single item: the line center of the 21 cm hydrogen spinflip transition.
Reimplemented from MaterialMix.
|
overridevirtual |
This function returns a list including a single item: the mass of the particle emitting the 21 cm line, i.e. the hydrogen atom.
Reimplemented from MaterialMix.
|
overridevirtual |
This function returns a list including a single item: the 21 cm line luminosity in the spatial cell and medium component represented by the specified material state and the receiving material mix when it would be embedded in the specified radiation field.
Reimplemented from MaterialMix.
|
overridevirtual |
This function returns the mass of a neutral hydrogen atom.
Implements MaterialMix.
|
overridevirtual |
This function returns the 21 cm absorption opacity
Implements MaterialMix.
|
overridevirtual |
This function returns the 21 cm extinction opacity
Implements MaterialMix.
|
overridevirtual |
This function returns the 21 cm scattering opacity
Implements MaterialMix.
|
overridevirtual |
This function returns the number and type of import parameters required by this particular material mix as a list of SnapshotParameter objects. For this class, the function returns a descriptor for the neutral hydrogen mass surface density import parameter. Importing metallicity and temperature should be enabled through the corresponding standard configuration flags.
Reimplemented from MaterialMix.
|
overridevirtual |
This function does nothing because the 21 cm line does not scatter.
Implements MaterialMix.
|
overridevirtual |
This function does nothing because the 21 cm line does not scatter.
Implements MaterialMix.
|
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.
|
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.
|
overridevirtual |
This function returns the 21 scattering cross section per neutral hydrogen atom, which is trivially zero for all wavelengths.
Implements MaterialMix.
|
overrideprotectedvirtual |
This function determines the radiation field wavelength bin containing the UV field strength.
Reimplemented from MaterialMix.
|
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 (neutral hydrogen number density, metallicity, temperature, and neutral hydrogen mass surface density) and for a variable to hold the atomic hydrogen fraction derived from the radiation field when the dynamic medium state is updated.
Implements MaterialMix.
|
overridevirtual |
Based on the specified radiation field and the input model properties found in the given material state, this function performs the partitioning scheme described in the class header and stores the resulting atomic hydrogen fraction back in the given material state. The function returns the update status as described for the UpdateStatus class.
Reimplemented from MaterialMix.