emulsim.elements.multicomponent_droplets module

Provides a simulation element representing multicomponent droplets.

MulticomponentDroplet

Represents a single droplet comprised of many species.

MulticomponentDropletsElement

Element representing many multicomponent droplets.

class MulticomponentDroplet(position: ndarray, radius: float, amounts: ndarray | None = None)[source]

Bases: SphericalDroplet

Represents a single droplet comprised of many species.

Parameters:
  • position (ndarray) – Position of the droplet center

  • radius (float) – Radius of the droplet

  • amounts (ndarray) – The amounts of material of each component. If omitted, a single component with vanishing amounts is assumed.

property amounts: ndarray

the composition.

Type:

ndarray

check_data()[source]

Method that checks the validity and consistency of self.data.

data
property data_bounds: tuple[ndarray, ndarray]

lower and upper bounds on the parameters

Type:

tuple

classmethod from_composition(position: ndarray, radius: float, phis: ndarray) MulticomponentDroplet[source]
Parameters:
  • position (ndarray) – Position of the droplet center

  • radius (float) – Radius of the droplet

  • phis (ndarray) – The composition of the droplet

classmethod get_dtype(**kwargs)[source]

Determine the dtype representing this droplet class.

Parameters:
  • position (ndarray) – The position vector of the droplet. This is used to determine the space dimension.

  • amounts (ndarray) – The amounts of material of each component

Returns:

the (structured) dtype associated with this class

Return type:

numpy.dtype

property num_comps: int

number of components inside the droplet

Type:

int

property phi_solvent: float

solvent fraction

Type:

float

property phis: ndarray

total amounts in the droplet.

Type:

ndarray

class MulticomponentDropletsElement(data: ndarray | None = None, parameters: dict[str, Any] | None = None)[source]

Bases: SphericalDropletsElement

Element representing many multicomponent droplets.

Parameters Dictionary:
  • droplet_concentration: Concentration inside droplets that is used to calculate the total amount of material in droplets (default=1.0)

  • plot_args: Extra arguments for plotting this element (default={})

Parameters:
  • data – The data describing the state

  • parameters – Additional parameters that affect the element

Parameters of MulticomponentDropletsElement:

plot_args

Extra arguments for plotting this element (Default value: {})

droplet_concentration

Concentration inside droplets that is used to calculate the total amount of material in droplets (Default value: 1.0)

property amounts: ndarray

the amounts in all droplets.

Type:

ndarray

droplet_class

alias of MulticomponentDroplet

property num_comps: int

the number of components inside each droplet

Type:

int

property phis: ndarray

fractions of all components in all droplets.

Type:

ndarray

plot(ax=None, *args, **kwargs)[source]

Plot all droplets of this element.

Parameters:
property total_amount: float

total amount of all fields in all droplets

Type:

float