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

Class Drift

source code


An interface for the drift velocity as a function of radius and grain size.

Instance Methods [hide private]
 
__init__(self, r, a, func, *args, **kwargs)
Create an instance of the Drift() class.
source code
array/float
avgDrift(self, r=None, norm_type='standard', nd=None, warn=1)
Calculate the average drift velocity as a function of radius, normalising with respect to the average grain size (requires the grain size distribution).
source code

Inherited from cc.modeling.profilers.Profiler.Profiler2D: __call__, eval

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, r, a, func, *args, **kwargs)
(Constructor)

source code 

Create an instance of the Drift() class. Requires a radial grid, a grain size grid and a velocity function.

The function can also be given as an interpolator object.

The optional args and kwargs give the additional arguments for the drift function, which are ignored in case func is an interpolator object

Parameters:
  • r (array) - The radial points (cm)
  • a (array) - The grain size grid (cm)
  • func (function) - The function that describes the drift profile. Can be given as an interpolator object.
  • args (tuple) - Additional parameters passed to the functions when eval or diff are called.

    (default: [])

  • kwargs (dict) - Additional keywords passed to the functions when eval or diff are called.

    (default: {})

Overrides: object.__init__

avgDrift(self, r=None, norm_type='standard', nd=None, warn=1)

source code 

Calculate the average drift velocity as a function of radius, normalising with respect to the average grain size (requires the grain size distribution).

Parameters:
  • r (float/array) - The radial points (cm). If None, the default r grid is used.

    (default: None)

  • norm_type (str) - The weighting of normalisation for the average drift velocity:
    • collisional: Int(w*nd*a^2*da)/Int(nd*a^2*da)
    • dens: Int(w*nd*a^3*da)/Int(nd*a^3*da)
    • nd: Int(w*nd*da)/Int(nd*da)
    • a: Int(w*a*da)/Int(a*da)
    • standard: Int(w*da)/Int(da)

    (default: 'standard')

  • nd (Distribution()) - The grain size distribution. Only needed when norm_type is dens or nd.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

Returns: array/float
The average drift velocity evaluated at r (cm/s). Array is reduced by one dimension since a drops out as variable.