Package ComboCode :: Package cc :: Package modeling :: Package profilers :: Module Velocity
[hide private]
[frames] | no frames]

Module Velocity

source code

Module for calculating the velocity profile as a function of radius.

Author: R. Lombaert

Classes [hide private]
  Velocity
An interface for a velocity profile and its derivative
  Drift
An interface for the drift velocity as a function of radius and grain size.
Functions [hide private]
array/float
driftRPDF(r, a, l, v, mdot, opac, sd, radiance, T=None, P=0, alpha=0.0, mu=2.0, w_thermal='none')
Calculate the drift velocity as a function of radius and grain size by equating the radiation pressure force and drag force.
source code
array/float
vsound(T, gamma, mu)
The sound velocity at T for a given mean molecular weight and gamma.
source code
array
vbeta2D(r, a, *args, **kwargs)
Convenience function for vbeta in 2D.
source code
array
vbeta(r, r0, v0, vinf, beta, vi_mode='constant', rstar=0.0, beta_inner=0.5, *args, **kwargs)
The beta-power law description of the velocity profile.
source code
array
dvbetadr(r, r0, v0, vinf, beta, vi_mode='constant', rstar=0.0, beta_inner=0.5, *args, **kwargs)
The derivative of the vbeta function: analytic.
source code
array
vdust(r, v, w, *args, **kwargs)
Calculate the dust velocity profile from a gas velocity and a drift velocity profile.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.modeling.profilers'
Function Details [hide private]

driftRPDF(r, a, l, v, mdot, opac, sd, radiance, T=None, P=0, alpha=0.0, mu=2.0, w_thermal='none')

source code 

Calculate the drift velocity as a function of radius and grain size by equating the radiation pressure force and drag force.

If the grain size is given as a constant value, the profile is calculated only for an average grain size, and is essentially 1d, in which case the drift does not depend on grain size.

For now in the approximation that the thermal velocities are small compared to the drift. This is only valid in the outer, cool regions of the wind.

The function integrates the luminosity and the opacity over the wavelength grid to estimate the component for the radiation pressure. Note that the opacities are assumed to be independent of grain size for this to work, hence the Rayleigh regime should be applicable.

Inclusion of the thermal velocity requires T profile. Mean molecular weight assumed to be one in that case.

Parameters:
  • r (array/float) - The radial points (cm)
  • a (array/float) - The grain size grid (cm)
  • l (array/float) - The wavelength grid (cm)
  • v (float/Velocity()) - The velocity profile (cm/s)
  • mdot (float/Mdot()) - The mass-loss profile (Msun/yr)
  • opac (Opacity()) - The opacity profile (cm2/g), must include l-dependence. Can be extinction, absorption, or scattering, but note that the calculation assumes this is an absorption opacity.
  • sd (float) - The specific density of the dust species
  • radiance (Radiance()) - The luminosity profile (ergs/s), must include l-dependence
  • T (Temperature()) - The temperature profile. Only relevant if w_thermal is not none.

    (default: None)

  • P (float) - The porosity of the grain (or equivalent, to represent effective grain surface). Default is the spherical case. Is given as the ratio of vacuum per unit volume of a grain.

    (default: 0)

  • alpha (float) - Sticking coefficient (Kwok 1975, Van Marle 2011). Default is current value in MCP/GASTRoNOoM. Should be 0.25 according to Kwok and van Marle. 1-alpha gives the fraction of elastic collisions.

    (default: 0.)

  • mu (float) - The mean molecular weight. Default is a wind with purely H2. To get the GASTRoNOoM value of 1.4, set fH to 1.5.

    (default: 2.0)

  • w_thermal (str) - Type of thermal velocity.
    • sqrt(2kT/m): most probably speed df(v)/dr = 0
    • sqrt(8/pi kT/m): mean speed (f(v) * v dv)/f(v) dv
    • sqrt(3kT/m): rms speed sqrt((f(v) * v2 dv)/f(v) dv)
    • Kwok version: 3/4 sqrt(3kT/m)
    • Epstein: 4/3 sqrt(8kT/mpi)

    Choose from: epstein, kwok, prob, mean, rms, none

    (default: none)

Returns: array/float
The drift velocity (cm/s) as a function of r and a

vsound(T, gamma, mu)

source code 

The sound velocity at T for a given mean molecular weight and gamma.

Parameters:
  • T (array/float) - The temperature (K)
  • gamma (float) - The adiabatic constant
  • mu (float) - the mean molecular weight in units of hydrogen mass (g)
Returns: array/float
The sound velocity

vbeta2D(r, a, *args, **kwargs)

source code 

Convenience function for vbeta in 2D. Used by Drift() to calculate a beta law for a single grain size.

Ignores the grain size array, and passes arguments on to vbeta.

Additional args and kwargs are passed on to vbeta.

Parameters:
  • r (array) - The radial points (cm)
  • a (array) - Grain size (cm), dummy variable that is ignored.
Returns: array
The beta law velocity profile (cm/s)

vbeta(r, r0, v0, vinf, beta, vi_mode='constant', rstar=0.0, beta_inner=0.5, *args, **kwargs)

source code 

The beta-power law description of the velocity profile.

Below the cut-off r0, the velocity is taken constant and equal to v0. This behaviour can be changed with the vi_mode keyword.

Parameters:
  • r (array) - The radial points (cm)
  • r0 (float) - The inner radius (typically at dust condensation radius, cm)
  • v0 (float) - The initial velocity at r0 (cm/s). Can be 'vs' for the sound velocity, in which case additional args and kwargs must be passed to the function call (see method vsound()).
  • vinf (float) - The terminal wind velocity (cm/s)
  • beta (float) - The exponent of the beta law
  • vi_mode (str) - The type of velocity law used in the inner wind at r<r0. Options:
    • constant: A constant value at v0
    • beta: an increasing velocity up to v0 according to a beta law with beta=beta_inner, r0~rstar.

    Lower case letters required.

    (default: 'constant')

  • rstar (float) - The stellar radius (cm), only relevant when vi_mode==beta

    (default: 0)

  • beta_inner (float) - Only relevant for vi_mode==beta, the beta exponent for the inner wind at r<r0. Default is value for GASTRonOoM

    (default: 0.5)

Returns: array
The beta law velocity profile (cm/s)

dvbetadr(r, r0, v0, vinf, beta, vi_mode='constant', rstar=0.0, beta_inner=0.5, *args, **kwargs)

source code 

The derivative of the vbeta function: analytic.

Below the cut-off r0, the velocity is taken constant and equal to v0. This behaviour can be changed with the vi_mode keyword. (NYI)

Parameters:
  • r (array) - The radial points (cm)
  • r0 (float) - The inner radius (typically at dust condensation radius, cm)
  • v0 (float) - The initial velocity at r0 (cm/s). Can be 'vs' for the sound velocity, in which case additional args and kwargs must be passed to the function call (see method vsound()).
  • vinf (float) - The terminal wind velocity (cm/s)
  • beta (float) - The exponent of the beta law
  • vi_mode (str) - The type of velocity law used in the inner wind at r<r0. Options:
    • constant: A constant value at v0
    • beta: an increasing velocity up to v0 according to a beta law with beta=beta_inner, r0~rstar.

    Lower case letters required.

    (default: 'constant')

  • rstar (float) - The stellar radius (cm), only relevant when vi_mode==beta

    (default: 0)

  • beta_inner (float) - Only relevant for vi_mode==beta, the beta exponent for the inner wind at r<r0. Default is value for GASTRonOoM

    (default: 0.5)

Returns: array
The analytic derivative of the beta law velocity profile (cm^2/s)

vdust(r, v, w, *args, **kwargs)

source code 

Calculate the dust velocity profile from a gas velocity and a drift velocity profile.

Requires averaging the drift velocity over grain size. Several normalisation possibilities available. See Drift().avgDrift.

Parameters:
  • r (array) - The radial points (cm)
  • v (float/Velocity()) - The velocity profile (cm/s)
  • w (float/Drift()) - The drift velocity profile (cm/s) as a function of r and a.
  • args (tuple) - Additional parameters passed to the avgDrift method

    (default: [])

  • kwargs (dict) - Additional keywords passed to the avgDrift method

    (default: {})

Returns: array
The dust velocity profile (cm/s)