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

#include <TorusGeometry.hpp>

Inheritance diagram for TorusGeometry:
Inheritance graph
[legend]

Public Member Functions

double cutoffRadius () const
 
double density (double R, double z) const override
 
double exponent () const
 
Position generatePosition () const override
 
double index () const
 
double maxRadius () const
 
double minRadius () const
 
double openingAngle () const
 
bool reshapeInnerRadius () const
 
double SigmaR () const override
 
double SigmaZ () const override
 
- Public Member Functions inherited from AxGeometry
virtual double density (double R, double z) const =0
 
double density (Position bfr) const override
 
int dimension () const override
 
virtual double SigmaR () const =0
 
double SigmaX () const override
 
double SigmaY () const override
 
virtual double density (Position bfr) const =0
 
virtual int dimension () const =0
 
virtual Position generatePosition () const =0
 
virtual double SigmaX () const =0
 
virtual double SigmaY () const =0
 
virtual double SigmaZ () const =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

 TorusGeometry ()
 
void setupSelfBefore () override
 
- Protected Member Functions inherited from AxGeometry
 AxGeometry ()
 
- Protected Member Functions inherited from Geometry
 Geometry ()
 
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 = AxGeometry
 
using ItemType = TorusGeometry
 

Private Attributes

double _A
 
double _cutoffRadius
 
const double & _Delta
 
double _exponent
 
double _index
 
double _maxRadius
 
double _minRadius
 
double _openingAngle
 
const double & _p
 
const double & _q
 
const bool & _rani
 
const double & _rcut
 
bool _reshapeInnerRadius
 
const double & _rmax
 
const double & _rmin
 
double _sdiff
 
double _sinDelta
 
double _smin
 
double _tmax
 
double _tmin
 

Friends

class ItemRegistry
 

Detailed Description

The TorusGeometry class is a subclass of the AxGeometry class and describes the geometry of an axisymmetric torus as assumed to be present in the centre of active galactic nuclei (AGN). This geometry is described by a radial power-law density with a finite opening angle; see Stalevski et al. (2012, MNRAS, 420, 2756–2772) and Granato & Danese (1994, MNRAS, 268, 235). In formula, it is most easily expressed in spherical coordinates as

\[ \rho(r,\theta) = A\, r^{-p}\,{\text{e}}^{-q|\cos\theta|} \quad\text{for } r_{\text{min}}<r<r_{\text{max}} \text{ and } \frac{\pi}{2}-\Delta<\theta<\frac{\pi}{2} +\Delta. \]

There are five free parameters describing this dust geometry: the inner and outer radii \(r_{\text{min}}\) and \(r_{\text{max}}\) of the torus, the radial power law index \(p\), the polar index \(q\) and the angle \(\Delta\) describing the opening angle of the torus.

If the dusty system under consideration is in the vicinity of an AGN central engine or another source which is luminous enough to heat the dust up to sublimation temperature, the inner radius should correspond to sublimation radius and scale as \( r_{\text{min}} \propto L(\theta)^{0.5}\) (Barvainis, 1987, ApJ, 320, 537, eq (5)). If the primary source assumes anisotropic emission, the inner radius must follow the same dependence as the distribution of the primary source luminosity. Otherwise, dust temperature on the inner boundary of geometry is very likely to be under- or over-estimated. Thus, if the NetzerAccretionDiskGeometry distribution is chosen to describe primary source emission, it is recommended to turn on the anisotropic inner radius option for the torus geometry. The inner radius will then be set by the following formula:

\[ r_{\text{min}} \propto (\cos\theta\,(2\cos\theta+1))^{0.5}.\]

This should allow dust to approach all the way to the primary central source in the equatorial plane. However, due to the finite resolution of dust cells, it may happen that some of the innermost cells end up with unphysically high temperatures. For this reason, there is an additional input parameter, the cutoff radius \(r_{\text{cut}}\). The value of the cutoff radius is usually found after a few trial-and-error experiments by inspecting temperature distribution maps, until the inner wall of the geometry is at the expected sublimation temperature for a given dust population.

The total dust mass of the model corresponds to the mass of the original geometry, before the inner wall is reshaped to account for anisotropy; the difference is usually rather small.

Constructor & Destructor Documentation

◆ TorusGeometry()

TorusGeometry::TorusGeometry ( )
inlineprotected

Default constructor for concrete Item subclass TorusGeometry : "a torus geometry" .

Member Function Documentation

◆ cutoffRadius()

TorusGeometry::cutoffRadius ( ) const
inline

This function returns the value of the discoverable double property cutoffRadius : "the inner cutoff radius of the torus" .

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

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

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

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

◆ density()

double TorusGeometry::density ( double  R,
double  z 
) const
overridevirtual

This function returns the density \(\rho(R,z)\) at the cylindrical radius \(R\) and height \(z\). It just implements the analytical formula.

Implements AxGeometry.

◆ exponent()

TorusGeometry::exponent ( ) const
inline

This function returns the value of the discoverable double property exponent : "the radial powerlaw exponent p of the torus" .

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

◆ generatePosition()

Position TorusGeometry::generatePosition ( ) const
overridevirtual

This function generates a random position from the torus geometry, by drawing a random point from the three-dimensional probability density \(p({\bf{r}})\, {\text{d}}{\bf{r}} = \rho({\bf{r}})\, {\text{d}}{\bf{r}}\). For the torus geometry, the density is a separable function of \(r\) and \(\theta\), so that a random position can hence be constructed by combining random spherical coordinates, each chosen from their own probability distributions. A random azimuth \(\phi\) is readily found by chosing a random deviate \({\cal{X}}\) and setting \( \phi = 2\pi {\cal{X}} \).

For the radial coordinate, the appropriate probability distribution is \( p(r)\,{\text{d}}r \propto r^{2-p}\,{\text{d}}r \). A random radius is generated by picking a new uniform deviate \({\cal{X}}\), and solving the equation

\[ {\cal{X}} = \int_{r_\text{min}}^r p(r')\, {\text{d}}r' \]

for \(r\). For \(p\ne3\) we find

\[ {\cal{X}} = \frac{r^{3-p}-r_{\text{min}}^{3-p}} {r_{\text{max}}^{3-p}-r_{\text{min}}^{3-p}}. \]

Inverting this results in

\[ r = \left[ (1-{\cal{X}})\,r_{\text{min}}^{3-p} + {\cal{X}}\,r_{\text{max}}^{3-p} \right]^{\frac{1}{3-p}}. \]

For \(p=3\) this expression does not hold, and for \(p\approx3\) it breaks down numerically. So for \(p\approx3\) we can write the general expression

\[ r = {\text{gexp}}_{p-2} \Big[ {\text{gln}}_{p-2}\, r_{\text{min}} + {\cal{X}}\,( {\text{gln}}_{p-2}\, r_{\text{max}} - {\text{gln}}_{p-2}\, r_{\text{min}} ) \Bigr]. \]

In this expression, \({\text{gln}}_p\,x\) and \({\text{gexp}}_p\,x\) are the generalized logarithm and exponential functions defined in SpecialFunctions::gln and SpecialFunctions::gexp respectively.

Finally, for the polar angle, the appropriate distribution function is

\[ p(\theta)\, {\text{d}}\theta \propto e^{-q|\cos\theta|}\sin\theta\, {\text{d}}\theta. \]

A random polar angle is generated by picking a new uniform deviate \({\cal{X}}\), and solving the equation

\[ {\cal{X}} = \int_0^\theta p(\theta')\, {\text{d}}\theta' \]

for \(\theta\). We obtain after some calculation

\[ {\cal{X}} = \begin{cases} \; \dfrac12 \left( 1 - \dfrac{1-{\text{e}}^{-q\cos\theta}}{1-{\text{e}}^{-q\sin\Delta}} \right) & \quad\text{for } \frac{\pi}{2}-\Delta < \theta < \frac{\pi}{2} \\[1.2em] \;\dfrac12 \left( 1 + \dfrac{1-{\text{e}}^{q\cos\theta}}{1-{\text{e}}^{-q\sin\Delta}} \right) & \quad\text{for } \frac{\pi}{2} < \theta < \frac{\pi}{2}+\Delta \end{cases} \]

Inverting this gives

\[ \cos\theta = \begin{cases}\; -\dfrac{1}{q} \ln\left[ 1-\left(1- {\text{e}}^{-q\sin\Delta}\right) (1-2{\cal{X}}) \right] & \quad\text{if $0<{\cal{X}}<\tfrac12$} \\[1.2em] \; \dfrac{1}{q} \ln\left[ 1-\left(1 -{\text{e}}^{-q\sin\Delta}\right) (2{\cal{X}}-1) \right] & \quad\text{if $\tfrac12<{\cal{X}}<1$} \end{cases}. \]

Implements Geometry.

◆ index()

TorusGeometry::index ( ) const
inline

This function returns the value of the discoverable double property index : "the polar index q of the torus" .

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

◆ maxRadius()

TorusGeometry::maxRadius ( ) const
inline

This function returns the value of the discoverable double property maxRadius : "the maximum radius of the torus" .

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

The minimum value for this property is "]0" .

◆ minRadius()

TorusGeometry::minRadius ( ) const
inline

This function returns the value of the discoverable double property minRadius : "the minimum radius of the torus" .

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

The minimum value for this property is "]0" .

◆ openingAngle()

TorusGeometry::openingAngle ( ) const
inline

This function returns the value of the discoverable double property openingAngle : "the half opening angle of the torus" .

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

The minimum value for this property is "[0 deg" .

The maximum value for this property is "90 deg]" .

◆ reshapeInnerRadius()

TorusGeometry::reshapeInnerRadius ( ) const
inline

This function returns the value of the discoverable Boolean property reshapeInnerRadius : "reshape the inner radius according to the Netzer luminosity profile" .

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.

◆ setupSelfBefore()

void TorusGeometry::setupSelfBefore ( )
overrideprotectedvirtual

This function calculates some frequently used values. The normalization parameter \(A\) is set by the normalization condition that total mass equals one, i.e.

\[ 1 = 2\pi\, A\, \int_{\pi/2-\Delta}^{\pi/2+\Delta} e^{-q|\cos\theta|}\sin\theta\, {\text{d}}\theta \int_{r_{\text{min}}}^{r_{\text{max}}} r^{2-p}\, {\text{d}}r. \]

This results in

\[ A = \frac{q}{4\pi\, (1-{\text{e}}^{-q\sin\Delta})}\, \frac{1}{ {\text{gln}}_{p-2}\, r_{\text{max}} - {\text{gln}}_{p-2}\, r_{\text{min}} }, \]

with \({\text{gln}}_p\, x\) the generalized logarithm defined in SpecialFunctions::gln. If \(q=0\), this expression reduces to

\[ A = \frac{1}{4\pi\,\sin\Delta\, ({\text{gln}}_{p-2}\, r_{\text{max}} - {\text{gln}}_{p-2}\, r_{\text{min}} )}. \]

Reimplemented from Geometry.

◆ SigmaR()

double TorusGeometry::SigmaR ( ) const
overridevirtual

This function returns the radial surface density, i.e. the integration of the density along a line in the equatorial plane starting at the centre of the coordinate system,

\[ \Sigma_R = \int_0^\infty \rho(R,0)\,{\text{d}}R. \]

For the torus geometry,

\[ \Sigma_R = A\, ( {\text{gln}}_p\, r_{\text{max}} - {\text{gln}}_p\, r_{\text{min}} ) \]

with \({\text{gln}}_p\,x\) the generalized logarithm defined in SpecialFunctions::gln.

Implements AxGeometry.

◆ SigmaZ()

double TorusGeometry::SigmaZ ( ) const
overridevirtual

This function returns the Z-axis surface density, i.e. the integration of the density along the entire Z-axis,

\[ \Sigma_Z = \int_{-\infty}^\infty \rho(0,0,z)\, {\text{d}}z. \]

For the torus geometry this integral is simply zero (we exclude the special limiting case where \(\Delta=\tfrac{\pi}{2}\)).

Implements Geometry.


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