BasedOnVolumeFlux

generate a sequence of spherical droplets based on volume flux

DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, OPTIONAL: %DropletSource_doNotCreateDropletsOutside%, OPTIONAL: %ind_v(1)%, xVelocityNewDroplet, OPTIONAL: %ind_v(2)%, yVelocityNewDroplet, OPTIONAL: %ind_v(3)%, zVelocityNewDroplet, OPTIONAL: %ind_h%, initialH_NewDroplet )
Entry Description
n Index of the DropletSource sequence (up to 99)
V_dot Volume flux to be generated by the droplet sequence in m^3/s
sizeOfNewDroplets Volume of next droplet in the sequence in m^3
xPosOfNewDroplet x-position of next droplet in the sequence
yPosOfNewDroplet y-position of next droplet in the sequence
zPosOfNewDroplet z-position of next droplet in the sequence
iChamber Chamber index to which each new droplet of the sequence will have to belong
$Material$ Material index to which each new droplet will have to belong
%DropletSource_doNotCreateDropletsOutside% (Optional) with this flag, creation of droplets outside of EVENT-cuts are prevented, such that V_dot is preserved for the reduced creation area
%ind_v(1)%, %ind_v(2)%, %ind_v(3)% Set the index of the x-, y-, z-velocity of the next droplet in the sequence, respectively. This must be done in conjunction with the actual value, see the next entry.
xVelocityNewDroplet, yVelocityNewDroplet, zVelocityNewDroplet Set the x-, y-, z-velocity of the next droplet in the sequence, respectively.
%ind_h% Set the index of the interaction radius (SMOOTH_LENGTH) of the next droplet. This must be done in conjunction with the actual value; see the next entry.
initialH_NewDroplet Set the actual initial interaction radius (SMOOTH_LENGTH) of the next droplet in the sequence.
Note:
  • In order to generate a unique sequence of droplets, the functionalities given in real() can be used, especially the options %DropletSource_provideCounter% (see example below), %DropletSource_provideTargetVolume%, and %DropletSource_provideCurrentVolume%.
  • The optional initialization of %ind_v(1)%, %ind_v(2)%, and %ind_v(3)% overwrites the INITDATA settings. This option is mainly developed for the DROPLETPHASE solver. It is an experimental feature for the LIQUID solver, use with care.
  • Initializing %ind_h% can be useful for simulations with ADDS or ADTV, i.e. KOP(n) = LIQUID ..., or DROPLETPHASE.
  • Radius correction for the LIQUID solver: From the volume \( V\) given by the user, the radius \( r\) of the sphere is classically determined by \( r = \left( \frac{3V}{4 \pi} \right)^{\frac{1}{3}}\). However, taking into account that the volume of the discrete particle sphere will be less (linear approximation of a convex, curved manifold), we correct the radius by \begin{align} \tilde{r} = r \cdot \left( 2 - \sqrt{ 1 - \left( \frac{\alpha}{2} \frac{h}{r} \right)^2 } \right),\end{align} where \( \alpha\) is the value of radius_hole and \( h\) is the current interaction radius (SMOOTH_LENGTH).

Example for Basic Usage

Randomly distributed droplets of identical size can be generated as follows.
DropletSource(1) = ( 5, [&Hmax&^3], [20*rand(1)], [1.5*rand(-1)], [2], 1, $Mat1$ ) # the droplet positions to be created are random: 0 < x < 20 # -1.5 < y < 1.5 # z = 2
To generate droplets with random diameter from a given distribution, check the example for drand().

(Experimental) Parcel Injection

DropletSource provides an additional experimental syntax for injecting parcels:
DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, OPTIONAL: %DropletSource_doNotCreateDropletsOutside%, OPTIONAL: ParcelInjectionOption, OPTIONAL: ParcelInjectionQuantity )
If a ParcelInjectionOption is specified in DropletSource, e.g.
DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, %DropletSource_Multiplicity%, Multiplicity ) DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, %DropletSource_ParcelRate%, ParcelRate ) DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, %DropletSource_ParcelSize%, sizeOfParcel )
points will be injected with a calculated multiplicity \( n_i\) (stored in %ind_mult%) based on an additional ParcelInjectionQuantity (directly following ParcelInjectionOption). The meaning of this quantity and the formula for \( n_i\) differ for different values of ParcelInjectionOption, as shown in the following table.
ParcelInjectionOption ParcelInjectionQuantity Equation
%DropletSource_Multiplicity% Multiplicity \( n_i\) [1] \( n_i = n_i\)
%DropletSource_ParcelRate% ParcelRate \( \omega_i\) [Parcel/s] \( n_i = \dot{V}_i/(V_i^{Droplet}\omega_i)\)
%DropletSource_ParcelSize% sizeOfParcel \( V_i^{Parcel}\) [m^3] \( n_i = V_i^{Parcel}/V_i^{Droplet}\)
The above formulas for \( n_i\) may lead to non-integer multiplicities. In such a case, the nearest integer value is used. Additionally, a minimum multiplicity of one is always enforced. Note: It is still possible to use %DropletSource_doNotCreateDropletsOutside% when using parcel injection. In this case, %DropletSource_doNotCreateDropletsOutside% needs to preceed ParcelInjectionOption, e.g.
DropletSource(n) = ( V_dot, sizeOfNewDroplets, xPosOfNewDroplet, yPosOfNewDroplet, zPosOfNewDroplet, iChamber, $Material$, %DropletSource_doNotCreateDropletsOutside%, %DropletSource_Multiplicity%, Multiplicity )

Example for Parcel Injection

To inject parcels with a random diameter from a given distribution and with specified multiplicity, first store the probabilities (P) together with their associated droplet diameters (D) and multiplicities (Mult) in a begin_table{ environment.
begin_table{$TAB_ParcelData$} # P D Mult 0.05 1.5e-4 5 0.20 2.5e-4 10 0.35 3.5e-4 15 0.25 4.5e-4 20 0.15 5.5e-4 25 end_table
Next, use the drand() function to sample droplets with a random diameter based on the above probabilites. To define the parcel multiplicity, use %DropletSource_Multiplicity% and the same drand() argument, but with the column index of the multiplicity data.
DropletSource(1) = ( [ &PS_vdot& ], [ &piover6& * drand($TAB_ParcelData$,1,2,equn($EQ_iDroplet$))^3 ], 0, 0, 0, 1, $MAT_Droplet$, %DropletSource_Multiplicity%, [ drand($TAB_ParcelData$,1,3,equn($EQ_iDroplet$)) ] ) # this equation returns the unique counter of the next droplet begin_equation{$EQ_iDroplet$} real(%DropletSource_provideCounter%, 1) + 1 end_equation
Note: Using the optional argument iReproducible of drand() together with the unique droplet counter is essential to ensure that the drand() function returns the same row of the table as long as the same droplet is processed. If this would not be done, the association between diameters and multiplicities would be lost.