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

#include <DustDestructionRecipe.hpp>

Inheritance diagram for DustDestructionRecipe:
Inheritance graph
[legend]

Public Member Functions

void beginUpdate (int numCells) override
 
virtual double densityFraction (bool graphite, double a, const Array &Jv, double T) const =0
 
double densityFractionTolerance () const
 
UpdateStatus update (MaterialState *state, const Array &Jv) override
 
- Public Member Functions inherited from DynamicStateRecipe
virtual void beginUpdate (int numCells)=0
 
virtual bool endUpdate (int numCells, int numUpdated, int numNotConverged)
 
int maxNotConvergedCells () const
 
virtual UpdateStatus update (MaterialState *state, const Array &Jv)=0
 
- 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

 DustDestructionRecipe ()
 
- Protected Member Functions inherited from DynamicStateRecipe
 DynamicStateRecipe ()
 
- 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 = DynamicStateRecipe
 
using ItemType = DustDestructionRecipe
 

Private Attributes

double _densityFractionTolerance
 
Array _dlambdav
 
vector< const FragmentDustMixDecorator * > _fdv
 

Friends

class ItemRegistry
 

Detailed Description

DustDestructionRecipe is an abstract class representing recipes for dynamically calculating radiative destruction of dust grains by iterating over the radiation field. The class derives from DynamicStateRecipe so that it fits in the overall dynamic medium state framework. It cooperates with the FragmentDustMixDecorator class to handle each dust mix fragment separately (i.e. different grain materials and/or grain size bins). A subclass can specify a concrete destruction recipe by implementing a single function that takes properties of the radiation field and grain population/size bin under study and returns the corresponding non-destroyed density fraction.

When a DustDestructionRecipe instance is included in the dynamic state configuration of a simulation, it requires there to be one or more medium components with a FragmentDustMixDecorator material mix that has the hasDynamicDensities flag enabled. These media components will be automatically detected and handled.

Constructor & Destructor Documentation

◆ DustDestructionRecipe()

DustDestructionRecipe::DustDestructionRecipe ( )
inlineprotected

Default constructor for abstract Item subclass DustDestructionRecipe : "a dust destruction recipe" .

Member Function Documentation

◆ beginUpdate()

void DustDestructionRecipe::beginUpdate ( int  numCells)
overridevirtual

This function is called before an update cycle begins. It caches the radiation field wavelength grid and information on the dust population fragments in the medium system offered by one or more FragmentDustMixDecorator instances.

Implements DynamicStateRecipe.

◆ densityFraction()

virtual double DustDestructionRecipe::densityFraction ( bool  graphite,
double  a,
const Array Jv,
double  T 
) const
pure virtual

This function returns the non-destroyed density fraction for a grain population with the specified type (graphite or silicate), average grain radius, radiation field, and equilibrium temperature. It must be implemented by a subclass.

Implemented in LinearDustDestructionRecipe.

◆ densityFractionTolerance()

DustDestructionRecipe::densityFractionTolerance ( ) const
inline

This function returns the value of the discoverable double property densityFractionTolerance : "the convergence tolerance on the dynamic density fraction" .

The minimum value for this property is "[1e-6" .

The maximum value for this property is "0.5]" .

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

◆ update()

UpdateStatus DustDestructionRecipe::update ( MaterialState state,
const Array Jv 
)
overridevirtual

This function is called repeatedly as part of the update cycle. If the density of the medium component in the cell under study is nonzero, it calculates the non-destroyed density fraction for each of the dust mix fragments in the medium component under study by calling the densityFraction() function defined in a subclass. If a newly calculated fraction differs by more than some small tolerance from the previously stored value, the corresponding medium state is updated. The function returns NotUpdated if none of the fractions have been updated, UpdatedNotConverged if one or more fractions were updated by more than the configured convergence tolerance, UpdatedConverged if one or more fractions were updated but none of them differed by more than the configured convergence tolerance.

Implements DynamicStateRecipe.


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