emulsim.actors.coupling.nucleation module
Provides an actor nucleating droplets from a field.
- class DropletNucleationActor(parameters: dict[str, Any] | None = None)[source]
Bases:
ActorBaseActor nucleating droplets from a field.
The nucleation is based on simple nucleation theory, assuming a nucleation barrier that grows linearly with super-saturation \(\Delta c\). The nucleation rate \(k\), defined per unit volume, is assumed to scale exponentially with the nucleation barrier,
\[k = k_0 \exp(\alpha \Delta c)\]Here, \(k_0\) is constant pre-factor (determining the nucleation rate at vanishing supersaturation) and \(\alpha\) controls the strength of the influence of the supersaturation.
- Parameters Dictionary:
initial_radius: Initial radius of the nucleated droplets (default=1.0)
prefactor: Pre-factor \(k_0\) setting the nucleation rate at vanishing super-saturation. (default=1.0)
randomize_position: Determines whether the position of a nucleated droplet will be randomized within each cell (default=False)
saturation_concentration: Saturation concentration above which nucleation can take place (default=0.0)
scale: Pre-factor \(\alpha\) affecting the hight of the nucleation barrier and thus how strongly the super-saturation affects the nucleation rate. (default=1.0)
- Parameters:
parameters (dict) – Parameters defining the behavior of the actor. Call
show_parameters()for details.
Parameters of DropletNucleationActor:
- saturation_concentration
Saturation concentration above which nucleation can take place. The super-saturation is defined as the concentration of the field minus this value. (Default value:
0.0)- initial_radius
Initial radius of the nucleated droplets. Typically, this should be chosen a bit larger than the critical radius. (Default value:
1.0)- prefactor
Pre-factor \(k_0\) setting the nucleation rate at vanishing super-saturation. (Default value:
1.0)- scale
Pre-factor \(\alpha\) affecting the hight of the nucleation barrier and thus how strongly the super-saturation affects the nucleation rate. (Default value:
1.0)- randomize_position
Determines whether the position of a nucleated droplet will be randomized within each cell. Disabling this feature may accelerate the simulation at the expense of more regular droplet positioning. (Default value:
False)
- element_classes: tuple[type[_ElementBase] | tuple[type[_ElementBase], ...], ...] | EllipsisType = (<class 'emulsim.elements.spherical_droplets.SphericalDropletsElement'>, <class 'emulsim.elements.fields.FieldElementBase'>)
defines the elements this actor handles and in what order they need to be supplied. An ellipsis (…) indicates that all elements and lists of elements are accepted. Setting this attribute allows internal consistency checks.
- Type:
- estimate_dt(elements: tuple[SphericalDropletsElement, FieldElementBase]) float[source]
Estimate the maximal time step for simulating this actor.
- estimate_nucleation_count(field: FieldElementBase, t_range: float) float[source]
Rough estimate of the number of nucleated droplets.
- evolve(elements: tuple[SphericalDropletsElement, FieldElementBase], t: float, dt: float) None[source]
Evolve the state from time t to t + dt
- make_evolver_numba(elements: tuple[SphericalDropletsElement, FieldElementBase]) Callable[[tuple[ndarray, ...], float, float], None][source]
Return a function evolve the state from time t to t + dt
- nucleation_rate(field: FieldElementBase | ScalarField) ScalarField[source]
Return nucleation rate \(k\) for a given field.
Note that this nucleation rate is actually a nucleation rate density. The rate with which a droplet is nucleated anywhere in the system thus given by the integral
rate.integral, if rate is the field returned by this function.- Parameters:
field (
FieldElementBaseorScalarField) – Scalar field element from which material is taken- Returns:
Estimated number of droplets that are nucleated
- Return type: