Velocities#

Class Velocity#

class multipy.Velocity(species_velocities=None)#

Supports computing and storing velocities.

Species convective velocities:

  • species velocities, \(\mathbf{u}_i\)

Mixture-averaged convective velocities:

  • mass-averaged velocity, \(\mathbf{v}\)

  • molar-averaged velocity, \(\mathbf{u}\)

  • volume-averaged velocity, \(\mathbf{u}^V\)

  • arbitrarily-averaged velocity, \(\mathbf{u}^a\)

Parameters

species_velocities – (optional) vector numpy.ndarray specifying the species velocities \(\mathbf{u}_i\) in \([m/s]\). It should be of size (n_observations,n_species) where n_species is at least 2.

Getters:

  • get_species_velocities

  • get_molar_averaged (is set to None at class init)

  • get_mass_averaged (is set to None at class init)

  • get_volume_averaged (is set to None at class init)

  • get_arbitrarily_averaged (is set to None at class init)

Setters:

  • set_species_velocities setter for get_species_velocities

  • set_molar_averaged setter for get_molar_averaged

  • set_mass_averaged setter for get_mass_averaged

  • set_volume_averaged setter for get_volume_averaged

  • set_arbitrarily_averaged setter for get_arbitrarily_averaged

Velocity.plot_species_velocities#

multipy.velocity.Velocity.plot_species_velocities(self, species_names=None, colors=None, figsize=(10, 5), filename=None)#

Plots the species velocities.

Example:

../_images/stefan-tube-species-velocities.svg
Parameters
  • species_names – (optional) list of str specifying the species names.

  • colors – (optional) list of str specifying the plotting colors for each species. Example: colors=['#C7254E', '#BBBBBB', '#008CBA'].

  • figsize – (optional) tuple specifying the figure size.

  • filename – (optional) str specifying the filename. If set to None, plot will not be saved to a file.

Velocity.plot_averaged_velocities#

multipy.velocity.Velocity.plot_averaged_velocities(self, colors=None, figsize=(10, 5), filename=None)#

Plots the averaged velocities.

Example:

../_images/stefan-tube-averaged-velocities.svg
Parameters
  • colors – (optional) list of str specifying the plotting colors for each averaged velocity. Example: colors=['#222222', '#858585'].

  • figsize – (optional) tuple specifying the figure size.

  • filename – (optional) str specifying the filename. If set to None, plot will not be saved to a file.

Velocity.species_velocities#

multipy.velocity.Velocity.species_velocities(self, total_flux, species_fractions, basis='molar', mixture_molar_density=None, mixture_mass_density=None)#

Computes the species velocities, \(\mathbf{u}_i\).

If basis is set to 'molar', species velocities are computed using the total molar fluxes, \(\mathbf{N}_i\), species mole fractions, \(X_i\) and the mixture molar density, \(c\):

\[\mathbf{u}_i = \frac{\mathbf{N}_i}{c X_i}\]

If basis is set to 'mass', species velocities are computed using the total mass fluxes, \(\mathbf{n}_i\), species mass fractions, \(Y_i\) and the mixture mass density, \(\rho\):

\[\mathbf{u}_i = \frac{\mathbf{n}_i}{\rho Y_i}\]
Parameters
  • total_flux – vector numpy.ndarray of total molar fluxes \(\mathbf{N}_i\) in \([mole/(m^2s)]\) or total mass fluxes \(\mathbf{n}_i\) in \([kg/(m^2s)]\). It should be of size (n_species, n_observations).

  • species_fractions – scalar numpy.ndarray specifying the species mole fractions \(X_i\) in \([-]\) or species mass fractions \(Y_i\) in \([-]\). It should be of size (n_species, n_observations).

  • basis – (optional) str specifying whether the molar or mass total flux equation should be used. Can be 'molar' or 'mass'.

  • mixture_molar_density – (optional) mixture molar density \(c\) in \([mole/m^3]\). Has to be specified if basis is set to molar.

  • mixture_mass_density – (optional) mixture mass density \(\rho\) in \([kg/m^3]\). Has to be specified if basis is set to mass.

Returns

  • species_velocities - vector numpy.ndarray of species velocities \(\mathbf{u}_i\) in \([m/s]\). It has size (n_species, n_observations).

Velocity.molar_averaged#

multipy.velocity.Velocity.molar_averaged(self, species_mole_fractions)#

Computes the molar-averaged velocity:

\[\mathbf{u} = \sum_{i=1}^{n} X_i \mathbf{u}_i\]

where \(n\) is the number of species.

Parameters

species_mole_fractions – scalar numpy.ndarray specifying all species mole fractions \(X_i\) in \([-]\). It should be of size (n_species,n_observations) where n_species is at least 2.

Returns

  • molar_averaged_velocity - vector numpy.ndarray of molar-averaged velocity \(\mathbf{u}\) in \([m/s]\). It has size (1,n_observations).

Velocity.mass_averaged#

multipy.velocity.Velocity.mass_averaged(self, species_mass_fractions)#

Computes the mass-averaged velocity:

\[\mathbf{v} = \sum_{i=1}^{n} Y_i \mathbf{u}_i\]

where \(n\) is the number of species.

Parameters

species_mass_fractions – scalar numpy.ndarray specifying all species mass fractions \(Y_i\) in \([-]\). It should be of size (n_species,n_observations) where n_species is at least 2.

Returns

  • mass_averaged_velocity - vector numpy.ndarray of mass-averaged velocity in \([m/s]\). It has size (1,n_observations).

Velocity.volume_averaged#

multipy.velocity.Velocity.volume_averaged(self, species_volume_fractions)#

Computes the volume-averaged velocity:

\[\mathbf{u}^V = \sum_{i=1}^{n} V_i \mathbf{u}_i\]

where \(n\) is the number of species.

Parameters

species_volume_fractions – scalar numpy.ndarray specifying all species volume fractions \(V_i\) in \([-]\). It should be of size (n_species,n_observations) where n_species is at least 2.

Returns

  • volume_averaged_velocity - vector numpy.ndarray of volume-averaged velocity \(\mathbf{u}^V\) in \([m/s]\). It has size (1,n_observations).

Velocity.arbitrarily_averaged#

multipy.velocity.Velocity.arbitrarily_averaged(self, arbitrary_weighting_factors)#

Computes the arbitrarily-averaged velocity:

\[\mathbf{u}^a = \sum_{i=1}^{n} a_i \mathbf{u}_i\]

where \(n\) is the number of species and \(a_i\) are the arbitrary weighting factors, such that \(\sum_{i=1}^{n} a_i = 1\).

Parameters

arbitrary_weighting_factors – scalar numpy.ndarray specifying arbitrary weighting factors, \(a_i\) in \([-]\), for all species. It should be of size (n_species,n_observations) where n_species is at least 2.

Returns

  • arbitrarily_averaged_velocity - vector numpy.ndarray of arbitrarily-averaged velocity \(\mathbf{u}^a\) in \([m/s]\). It has size (1,n_observations).