#include <MultiGrainDustMix.hpp>
Public Member Functions | |
Array | emissivity (const Array &Jv) const override |
bool | hasStochasticDustEmission () const override |
int | numPopulations () const override |
const GrainPopulation * | population (int c) const |
double | populationBulkDensity (int c) const override |
string | populationGrainType (int c) const override |
double | populationMass (int c) const override |
double | populationNormalization (int c) const |
const GrainSizeDistribution * | populationSizeDistribution (int c) const override |
Range | populationSizeRange (int c) const override |
double | totalMass () const override |
![]() | |
double | asymmpar (double lambda) const override |
Array | emissionSpectrum (const MaterialState *state, const Array &Jv) const override |
DisjointWavelengthGrid * | emissionWavelengthGrid () const override |
Array | emissivity (const Array &Jv) const override |
bool | hasContinuumEmission () const override |
double | indicativeTemperature (const MaterialState *state, const Array &Jv) 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 |
virtual ScatteringMode | scatteringMode () const |
double | sectionAbs (double lambda) const override |
double | sectionExt (double lambda) const override |
const Array & | sectionsAbs (double lambda) const override |
const Array & | sectionsAbspol (double lambda) const override |
double | sectionSca (double lambda) const override |
vector< StateVariable > | specificStateVariableInfo () const override |
const Array & | thetaGrid () 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 | ~MultiGrainPopulationInterface () |
virtual int | numPopulations () const =0 |
virtual double | populationBulkDensity (int c) const =0 |
virtual string | populationGrainType (int c) const =0 |
virtual double | populationMass (int c) const =0 |
virtual const GrainSizeDistribution * | populationSizeDistribution (int c) const =0 |
virtual Range | populationSizeRange (int c) const =0 |
virtual double | totalMass () const =0 |
Protected Member Functions | |
MultiGrainDustMix () | |
void | addPopulation (const GrainPopulation *population) |
void | addPopulation (GrainComposition *composition, GrainSizeDistribution *sizeDistribution, int numSizes, GrainPopulation::NormalizationType normType, double normValue) |
double | getOpticalProperties (const Array &lambdav, const Array &thetav, Array &sigmaabsv, Array &sigmascav, Array &asymmparv, Table< 2 > &S11vv, Table< 2 > &S12vv, Table< 2 > &S33vv, Table< 2 > &S34vv, ArrayTable< 2 > &sigmaabsvv, ArrayTable< 2 > &sigmaabspolvv) override |
size_t | initializeExtraProperties (const Array &lambdav) override |
![]() | |
DustMix () | |
virtual double | getOpticalProperties (const Array &lambdav, const Array &thetav, Array &sigmaabsv, Array &sigmascav, Array &asymmparv, Table< 2 > &S11vv, Table< 2 > &S12vv, Table< 2 > &S33vv, Table< 2 > &S34vv, ArrayTable< 2 > &sigmaabsvv, ArrayTable< 2 > &sigmaabspolvv)=0 |
void | informAvailableWavelengthRange (Range available) |
virtual size_t | initializeExtraProperties (const Array &lambdav) |
void | setupSelfAfter () override |
![]() | |
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 () | |
![]() | |
MultiGrainPopulationInterface () | |
Private Types | |
using | BaseType = DustMix |
using | ItemType = MultiGrainDustMix |
Private Attributes | |
EquilibriumDustEmissionCalculator | _calcEq |
StochasticDustEmissionCalculator | _calcSt |
bool | _multigrain |
vector< double > | _mupopv |
vector< double > | _normv |
vector< const GrainPopulation * > | _populations |
bool | _stochastic |
Friends | |
class | ItemRegistry |
Additional Inherited Members | |
![]() | |
enum class | ScatteringMode { HenyeyGreenstein , MaterialPhaseFunction , SphericalPolarization , SpheroidalPolarization } |
![]() | |
enum class | DynamicStateType { None , Primary , Secondary , PrimaryIfMergedIterations } |
enum class | MaterialType { Dust , Electrons , Gas } |
MultiGrainDustMix is an abstract class implementing a dust mix described by one or more grain populations, each with their own grain composition and size distribution, and with or without support for polarization by scattering. The class offers facilities to its subclasses to add dust grain populations to the dust mix during initial setup. Subsequently, the class uses this list of grain populations to calculate the optical properties requested by the DustMix base class, and to implement the additional functionality offered by multi-grain-population dust mixes, such as calculating emission from stochastically heated dust grains.
All grain populations added by the subclass must have a level of Mueller matrix support that matches the value returned by the scatteringMode() function (which may be overridden in the subclass). Specifically, for the HenyeyGreenstein scattering mode, none of the grain populations should offer a Mueller matrix. For the MaterialPhaseFunction and SphericalPolarization scattering modes, all of the grain populations should offer a Mueller matrix. If this is not the case, a fatal error will result.
Calculating representative grain properties
The getOpticalProperties() function calculates the basic representative grain properties expected by the DustMix base class from the following information obtained from the dust grain populations added by the subclass: the absorption efficiencies
The properties are calculated for each wavelength
The absorption and scattering cross sections per hydrogen atom
and
The Mueller matrix coefficients provided by the grain population are assumed to be expressed as a cross section (in arbitrary units). They are thus integrated over the size distribution without again multiplying by the grain cross section, i.e. using
The representative asymmetry parameter
The dust mass per hydrogen atom
Calculating dust emission
The representative grain properties described above and offered by the public MaterialMix interface supported by this class are insufficient to accurately calculate dust emission spectra for the dust mixture. This is so because the emission spectrum is a nonlinear function of (among many other things) the grain size, and thus a single grain cannot accurately represent a population with a (potentialy large) range of grain sizes. Furthermore, smaller dust grains are often not in local thermal equilibrium, and instead are heated stochastically by individual photon absorption events. Modeling emission for these grains involves a temperature probability distribution rather than just an equilibrium temperature. The calculation needs calorimetric properties of the grain material in addition to optical properties.
It is numerically intractable to handle every possible grain size seperately. Instead, the MultiGrainDustMix class discretizes the grain size distribution for each type of grain material into a number of consecutive size bins (on a logarithmic scale), and calculates the optical and calorimetric properties of a representative grain for each of these bins. The number of bins for each type of grain material can be configured by the user. A larger number of bins improves the accuracy of the dust emission spectra. On the other hand, the calculation time scales roughly linearly with the number of bins.
The MultiGrainDustMix class uses one of two methods to calculate the emissivity of the dust mix:
|
inlineprotected |
Default constructor for abstract Item subclass MultiGrainDustMix : "a dust mix with one or more grain populations" .
|
protected |
This function adds the specified grain population to the dust mix. The receiving dust mix object retains a pointer to the specified GrainPopulation instance for later reference, but does not take ownership. The caller must ensure that the GrainPopulation instance lives at least as long as the dust mix, and that it is eventually destroyed (at the same time as or later than the dust mix).
|
protected |
This function adds the a grain population to the dust mix specified by its constituent components. The function creates a new GrainPopulation instance, passing its own function arguments to the GrainPopulation constructor. The receiving dust mix object claims ownership of the new GrainPopulation instance. The caller must guarantee that the lifetime of the specified composition and size distribution objects is as least as long as the lifetime of the receiving dust mix.
Refer to the description of the GrainPopulation constructor for more information on the arguments of this function.
This function returns the emissivity spectrum
Depending on the type of emission calculation configured by the user, this function uses an instance of the EquilibriumDustEmissionCalculator or StochasticDustEmissionCalculator to calculate the emission spectrum. Refer to these classes for more information.
The behavior of this function is undefined if the simulation does not track the radiation field, because in that case setup does not precalculate the information on which this function relies.
Reimplemented from DustMix.
|
overrideprotectedvirtual |
This function is invoked by the DustMix base class to obtain the representative grain optical properties for this dust mix. The first two arguments respectively specify the wavelength grid and (if applicable) the scattering angle grid on which the properties must be tabulated. The output arrays and tables will already have the appropriate size (corresponding to the input wavelength grids) when the function gets called.
For this class, this function integrates the optical properties over the grain size distribution for each of the grain populations added by a subclass as described in the class header, and stores the results into the corresponding output arrays. Also, the function returns the dust mass per hydrogen atom for the dust mix.
For the HenyeyGreenstein scattering mode, the Mueller matric tables remain untouched. For the MaterialPhaseFunction scattering mode, the function fills only the first table and leaves the other tables untouched. For the SphericalPolarization scattering mode, the function fills all four tables.
Implements DustMix.
|
overridevirtual |
This function returns true, indicating that this dust mix supports stochastic heating of dust grains for the calculation of secondary emission.
Reimplemented from MaterialMix.
|
overrideprotectedvirtual |
This function is invoked by the DustMix base class to precalculate additional dust properties required by this class. The argument specifies the wavelength grid on which the properties may be tabulated (i.e. the same grid as passed to the getOpticalProperties() function. The function returns the number of memory bytes allocated to store extra propertries.
The function discretizes the grain size distribution for each grain population added to this dust mix into a number of consecutive size bins (on a logarithmic scale), and obtains the relevant optical and calorimetric properties of a representative grain for each of these bins. The number of bins for each type of grain material can be configured by the user.
Depending on the type of emission calculation configured by the user, this function creates an instance of the EquilibriumDustEmissionCalculator or StochasticDustEmissionCalculator to store the relevant properties (and to actually calculate the emission spectra when requested).
Reimplemented from DustMix.
|
overridevirtual |
This function returns the number of dust grain populations (with indices
Implements MultiGrainPopulationInterface.
const GrainPopulation * MultiGrainDustMix::population | ( | int | c | ) | const |
This function returns a read-only pointer to the grain population with index
|
overridevirtual |
This function returns the bulk mass density
Implements MultiGrainPopulationInterface.
|
overridevirtual |
This function returns a brief human-readable identifier for the type of grain material represented by the population with index
Implements MultiGrainPopulationInterface.
|
overridevirtual |
This function returns the dust mass
Implements MultiGrainPopulationInterface.
double MultiGrainDustMix::populationNormalization | ( | int | c | ) | const |
This function returns the size distribution normalization factor for the population with index
|
overridevirtual |
This function returns the grain size distribution object for the population with index
Implements MultiGrainPopulationInterface.
|
overridevirtual |
This function returns the minimum and maximum grain sizes
Implements MultiGrainPopulationInterface.
|
overridevirtual |
This function returns the total dust mass
Implements MultiGrainPopulationInterface.