Particles¶
Mallard tracks Lagrangian particles through the flow, on the device, in 2D and 3D, serial and on many ranks. Massless tracers move with the gas velocity at their position, for pathlines, residence times and other Lagrangian analyses; solid particles have inertia: drag, gravity and the forces of the gas accelerate them, convection heats them, and walls rebound or catch them. Each particle can carry quantities along its path (time integrals, extrema, first times, turns about an axis), and probes give statistics of the particles in a region. With two-way coupling solid particles act on the gas, evaporating droplets give it their vapor, and dispersed-phase fields put them on the mesh. Particles enter at points, on a lattice, at random in a region or on inlets, at the start or continuously (Seeding), with size distributions. Sprays and particle output beyond the final positions follow in later releases (#291).
- Which particles?
- Tracers, seeding, restarts and boundaries
- Solid particles: drag, stiff particles, walls
- Per-particle quantities and particle probes
- Accuracy, performance and a checklist
The models are in the theory manual's Lagrangian particles, their discretization and its accuracy in Numerical methods for particles; the measured orders of accuracy in the verification manual.
Which particles?¶
The particles are point particles: each is much smaller than the cells and the smallest eddies around it, sees the gas as undisturbed at its center, and moves on its own, without collisions with other particles and, unless coupled two-way, without acting on the gas (one-way coupling). That describes dilute suspensions, with a volume fraction of particles below about 10⁻⁶ (a mass loading of 0.2% for glass beads in air), and every tracer study.
A solid particle forgets its velocity in its relaxation time \(\tau = \rho_p d^2 / (18 \mu f)\), where \(\rho_p\) is its material density, \(d\) its diameter, \(\mu\) the gas viscosity and \(f \ge 1\) the drag correction (1 for creeping flow). Compared with a time scale of the flow \(\tau_f\) (an eddy's turnover time, a vortex's period, the time to cross a nozzle), it gives the Stokes number \(St = \tau / \tau_f\):
| \(St\) | The particle | Use |
|---|---|---|
| \(\ll 1\) (below 0.05) | follows the gas, plus its settling velocity \(\tau g\) | tracer if settling does not matter; solid for settling smoke, fog, fine dust (stiff particles) |
| about 0.1 to 10 | lags the gas, is flung out of vortices, overshoots turns, hits walls | solid |
| \(\gg 1\) (above 10) | moves almost ballistically; the gas changes its course slowly | solid |
Typical relaxation times in air at 300 K and 1 bar (\(\mu\) = 1.8 × 10⁻⁵ Pa s), with Schiller-Naumann drag at the terminal velocity:
| Particle | \(d\) | \(\tau\) | Terminal velocity | \(Re_p\) at it |
|---|---|---|---|---|
| Water droplet | 1 µm | 3.1 µs | 0.030 mm/s | 2 × 10⁻⁶ |
| Water droplet | 10 µm | 0.31 ms | 3.0 mm/s | 0.002 |
| Water droplet | 100 µm | 26 ms | 0.25 m/s | 1.6 |
| Glass bead (2500 kg/m³) | 10 µm | 0.77 ms | 7.5 mm/s | 0.005 |
| Glass bead (2500 kg/m³) | 100 µm | 57 ms | 0.56 m/s | 3.6 |
\(\tau\) grows as \(d^2\): a factor 10 in diameter is a factor 100 in Stokes number. In a jet of 10 m/s through a 1 cm nozzle (\(\tau_f\) = 1 ms), the 10 µm droplets have \(St\) = 0.3 and the 1 µm ones \(St\) = 0.003.
Particles released at the gas velocity in gas rotating at \(\Omega\) (Mallard
runs of the particle_centrifuge
flow, dots every quarter of a turn, against the exact spirals, lines):
tracers (\(St = 0\)) circle forever; inertial particles lag the rotation and
spiral out, fastest near \(\Omega\tau = 1\).
Tracers: [particles]¶
[particles]
type = "tracer"
file = "tracers.csv"
[particles.lattice]
lo = [0.1, 0.1]
hi = [0.9, 0.9]
n = [9, 9]
Used in:
tracer_vortex,
particle_settling,
particle_bounce,
particle_centrifuge,
particle_cloud
and 3 more.
A tracer is a zero-Stokes particle: massless, its velocity the gas velocity
where it is, with no effect on the flow. Mallard evaluates that velocity from
the reconstruction's own polynomial in the particle's cell, not from cell
averages, and advances the positions as part of the time integrator's state,
so pathlines converge at the order of the scheme in space (fourth order with
TENO of order = 4, second order with MUSCL) and at the integrator's order in
time (first with FE, third with SSPRK3, fourth with RK4). Results are
bitwise the same on any number of ranks.
| Key | Default | Meaning |
|---|---|---|
type |
required | "tracer" |
points |
none | Seed points, [[x, y], ...] ([[x, y, z], ...] in 3D) (Seeding) |
lattice |
none | A table lo, hi, n: a lattice of n[d] points per direction from lo to hi (one point along a direction: its middle) (Seeding) |
injectors |
none | Particles at random in a region, on boundary zones or at a point, at the start or continuously (Injectors) |
file |
none | CSV file of the particles at the end of the run: id, x, y (z), the velocity V_X, V_Y (V_Z) of solid particles, their temperature T_P with heat transfer, then the quantities, by id |
capacity |
the number of particles, and those the injectors emit over the run | Particles a rank can hold |
seed |
0 | Seed of the injectors' random numbers |
Seeding¶
Particles enter the run in these ways, which combine freely:
| How | Keys | When |
|---|---|---|
| At given points | points |
At the start |
| On a regular lattice | [particles.lattice] |
At the start |
| At random in a region, on boundary zones or at a point | [[particles.injectors]] with count, or mass (solid particles) |
All at once, at the start (or at its start) |
| At random in a region, on boundary zones or at a nozzle, continuously | [[particles.injectors]] with rate or mass_flow |
Every step from start to end |
| From a restart file | [initialize] type = "restart" |
The file's particles continue; a file without particles, or a remap start, seeds them as above |
1000 tracers at random in a disk at the start:
[particles]
type = "tracer"
[[particles.injectors]]
name = "cloud"
region = {type = "disk", center = [0.5, 0.5], radius = 0.2}
count = 1000
2 g of 50 µm droplets at random in a disk at the start (mass is the total;
per meter of depth in 2D), as parcels of 1000 droplets, each at the gas
velocity where it lands:
[particles]
type = "solid"
density = 800.0
weight = 1e3
[[particles.injectors]]
name = "cloud"
region = {type = "disk", center = [0.5, 0.5], radius = 0.2}
mass = 2e-3
diameter = 50e-6
20000 tracers per second at random in a rectangle, until t = 0.1:
[[particles.injectors]]
name = "smoke"
region = {type = "rectangle", center = [0.2, 0.5], size = [0.1, 0.4]}
rate = 2e4
end = 0.1
region is any filled region (shapes of
Geometry, "domain", a cell zone) or boundary zones, and
point a single point; solid particles also take a velocity and a diameter
or size distribution (Injectors), and start at the gas velocity
(and temperature, with heat transfer) where they enter unless given one, as
seeds do. Random places are the same on
any number of ranks and after restarts.
Ids follow the seeds: the points first, in order, then the lattice with x
varying fastest, then the injected particles in the order they entered (those
released at the start included). A seed point outside the mesh is an error,
naming the point; a seed on a face between two cells goes to the one with the
lowest global id, so every rank count seeds the same particles in the same
cells. To release particles along a line, put n = 1 along the other
directions of the lattice (n = [1, 50] seeds 50 particles on the vertical
line through the middle of lo and hi).
Restarts¶
Restart files carry the particles, and a restarted run continues their
trajectories exactly, on any number of ranks; the seeds of [particles] are
then not used, and injectors continue where they were: a count injector
that has released its particles does not release them again, and a rate
continues its count. A restart file written without particles (by a run without
[particles]) seeds them, which adds tracers to a developed flow: run the
flow to its statistically steady state, then restart from it with
[particles]. A remap start seeds them too. In both, count injectors
whose start has passed release their particles at the restart's time.
Boundaries¶
- walls and symmetry planes reflect a particle that crossed them within a step;
- inlets, outlets and far-field boundaries remove it;
- periodic boundaries, translational or rotational, carry it to the other side.
Mallard counts the particles that left the domain, that were lost (a
particle that crossed more than a halo layer of a rank in one step, or that
the location walk could not place on a badly distorted mesh) and, for solid
particles, that stuck to walls; restart files carry the three counts. The ids
missing from file, or the count of a probe without a
region, give the particles removed.
Pitfalls.
- In a troubled cell (a shock, a flame front) and with first-order or MUSCL reconstruction, the velocity comes from the cell's linear least-squares fit rather than a high-order polynomial.
- A pathline is no more accurate than the flow it moves in: with first-order fluxes the pathlines converge at first order, although the particles read a second-order fit (accuracy).
- On several ranks, particles move between ranks through the host at every step, so such runs are not captured in CUDA graphs yet (single-rank runs are).
- SIMPLER chemistry coupling is refused for now.
Solid particles¶
[physics]
type = "navier_stokes"
mu = 1.8e-5
[particles]
type = "solid"
diameter = 20e-6 # m
density = 2500.0 # kg/m^3
gravity = [0.0, -9.81] # default: [source] gravity
points = [[0.1, 0.5], [0.2, 0.5]]
[[particles.walls]]
zones = ["floor"]
interaction = "stick"
Used in:
particle_settling,
particle_bounce,
particle_centrifuge,
particle_cloud,
particle_vortex
and 2 more.
A solid particle is a small rigid sphere with a velocity of its own, which drag pulls toward the gas velocity and gravity (less the buoyancy of the gas it displaces) accelerates:
The gas state at the particle (u, rho, mu at its temperature) comes from
the reconstruction polynomial, as for tracers, and position and velocity are
part of the time integrator's state: trajectories converge at the
integrator's order. f is the drag correction of the drag law
(drag), f = 1 for creeping flow. By default the particles do not act on the gas;
coupling = "two-way" makes them (Two-way coupling).
Forces. Drag, gravity and buoyancy are the forces that matter for
particles much denser than the gas (droplets, dust, ash, sand, soot in air).
For bubbles, particles of a density near the gas's, or particles slipping
through shear, forces adds the forces of
Maxey & Riley (1983) and lift
(theory):
forces entry |
Adds | Matters when |
|---|---|---|
"pressure_gradient" |
-grad p / rho_p in place of the buoyancy -g rho / rho_p (equal in a gas at rest) |
the gas accelerates: rho / rho_p is not small and the flow has strong pressure gradients (shocks, nozzles, vortex cores) |
"added_mass" |
half the displaced gas mass, accelerated with the gas: rho_p becomes rho_p + rho / 2 in tau and the inertia, and (rho g - grad p) / 2 is added to the force |
rho / rho_p is not small (bubbles, light particles in dense gas) |
"saffman_lift" |
the shear lift of Saffman (1965), 1.615 (6 / (pi d)) sqrt(rho mu / abs(w)) (u - v) x w per volume, w the vorticity |
particles slip through shear layers and boundary layers |
The gradients come from the cell's least-squares gradient. The Basset history force is not included.
Heat transfer. With specific_heat, each particle carries a temperature
\(T_p\), which convection relaxes toward the gas temperature at the rate of the
Ranz & Marshall (1952) Nusselt number:
with k the gas conductivity. The particle is isothermal (its Biot number is
small) and, unless coupled two-way, does not heat the gas. Particle expressions read it as T_P, the
file has it as a column T_P, and restart files carry it.
| Key | Default | Meaning |
|---|---|---|
type |
required | "solid" |
diameter |
required | Sphere diameter |
density |
required | Material density rho_p |
drag |
"schiller_naumann" |
"stokes", "schiller_naumann" or "singh" |
gravity |
[source] gravity, else none |
Gravity on the particles |
forces |
[] |
Further forces: "pressure_gradient", "added_mass", "saffman_lift" |
specific_heat |
none (no heat transfer) | Particle specific heat c_p: tracks the particle temperature |
velocity |
the gas velocity at each seed | Velocity of every seeded particle |
temperature |
the gas temperature at each seed | Temperature of every seeded particle (with specific_heat) |
The other keys of [particles] (seeds, file,
capacity) are the same. Particle expressions read the particle velocity as
V_X, V_Y, V_Z. Restart files carry the velocities and temperatures;
tracers restarted as solid particles start at the gas velocity, and particles
restarted with heat transfer from a file without temperatures at the gas
temperature.
gravity in [particles] acts on the particles only. [source] gravity
acts on the gas too (a hydrostatic pressure gradient builds up in it) and on
the particles, unless [particles] gravity replaces it; for particles
settling in a small box of gas at rest, gravity on the particles alone is
simpler and the same to within the hydrostatic variation of the gas density.
Drag laws¶
drag in [particles] chooses the drag correlation, f = C_D Re_p / 24
(the drag over Stokes drag):
drag |
f |
Reads |
|---|---|---|
"stokes" |
1 | nothing |
"schiller_naumann" (default) |
1 + 0.15 Re_p^0.687 below Re_p = 1000, then 0.44 Re_p / 24 (C_D = 0.44) |
Re_p |
"singh" |
the correlation of Singh et al. (2022), Appendix C (theory) | Re_p, the slip Mach number M = abs(u - v) / c, the Knudsen number Kn and T_p / T |
The gas's mu (at its temperature), gamma and R come from [physics].
For "singh" the Knudsen number is the gas's mean free path over the
diameter, Kn = mu / (rho c d) sqrt(gamma pi / 2) = sqrt(gamma pi / 2) M / Re_p,
and T_p / T is 1 without specific_heat. Each stage evaluates f from its
own slip velocity, so tau changes as the particle speeds up or slows down.
Where each law is valid. Outside its ranges a law still runs, but its drag is wrong by more than the error given.
drag |
Particle Reynolds number \(Re_p\) | Slip Mach number \(M\) | Knudsen number \(Kn\) | Neglects | Sources |
|---|---|---|---|---|---|
"stokes" |
\(\lesssim 0.1\): 3% low at 0.1, 5% at 0.2, 13% at 1 | \(\ll 1\) | \(\lesssim 0.01\) | the inertia of the gas around the sphere (its wake), compressibility, slip at the surface | Stokes (1851) |
"schiller_naumann" |
\(\lesssim 800\) within 5% of the standard drag curve; C_D = 0.44 from 1000 to the drag crisis near \(2 \times 10^5\) |
\(\lesssim 0.3\) | \(\lesssim 0.01\) | compressibility and shocks, slip at the surface and rarefaction, the drag crisis | Schiller & Naumann (1933), Clift, Grace & Weber (1978) |
"singh" |
creeping flow to \(\approx 10^4\) (laminar boundary layer) | 0 to 10 (fitted from 0.1); above 5 a calorically perfect gas | 0 (continuum) to free-molecular flow | real-gas effects behind strong shocks, boundary-layer turbulence and the drag crisis; least accurate in the transition regime, \(0.1 \lesssim Kn \lesssim 10\) | Singh et al. (2022): 7.6% relative L2 error against experiments and DSMC |
All three are the drag of an isolated, smooth, rigid, non-rotating sphere in steady, uniform flow: none accounts for neighbors, turbulence of the gas at the particle's scale, rotation or non-spherical shapes.
Choosing.
"schiller_naumann", the default, for particles in a gas at ordinary densities whose slip is subsonic: droplets, dust and sand above a few microns in air at 1 bar."stokes"where \(Re_p\) stays well below 1, or to compare with analytic solutions; it is never more accurate than Schiller-Naumann."singh"where the particle is not much larger than the mean free path (\(Kn > 0.01\): below about 7 µm in air at 1 bar, larger in a low-pressure gas) or its slip is compressible (\(M > 0.3\): shocks, nozzles, high-speed dusty flow). In continuum, incompressible flow it is within about 6% of Schiller-Naumann up to \(Re_p = 1000\) and costs more.
Check \(Re_p\), and for "singh" \(M\) and \(Kn\), along the paths with a max
quantity (per-particle quantities).
Terminal velocities in air at 300 K and 1 bar (left) and their ratio to
the Schiller-Naumann value (right): Stokes' law (dashed), the
Schiller-Naumann correlation (solid) and Singh et al.'s (dotted), with the
settling velocities of Mallard runs of the
particle_settling
box (dots: Schiller-Naumann on the left, Singh et al. on the right). Above
50 µm the drag at the terminal velocity exceeds Stokes'; below a few microns
the particles slip through the gas (\(Kn\) = 0.066 at 1 µm) and settle up to
12% faster with Singh et al.'s drag; between, Singh et al.'s continuum drag
is up to 6% above Schiller-Naumann's.
Stiff particles¶
The relaxation time tau can be far below the flow's time step (a 1 µm
droplet in air relaxes in a few microseconds), where an explicit integrator
would be unstable. A particle whose tau is below the step dt relaxes
exponentially within the step: its velocity is integrated exactly for a gas
velocity and force that vary linearly over the step, so tiny particles follow
the gas at their equilibrium velocity u + tau g' instead of making the run
unstable, particles with tau near dt keep their inertia, and the step
never depends on the particles. The same holds for the temperature's tau_T.
- Settling in gas at rest or in uniform flow is exact (the
smoke.tomlinput ofparticle_settling). - Where the gas accelerates, the trajectories still converge in the step, on
both sides of
dt = tau(verification).
Walls¶
Walls and symmetry planes rebound solid particles elastically;
[[particles.walls]] sets other interactions per boundary zone. A rebound
reverses the normal velocity times the restitution coefficient e_n and
scales the tangential velocity by e_t; a sticking wall removes the particle
and counts it as deposited. The bounce is located within the step: the
particle reaches the wall at the time its motion over the step puts it there,
rebounds, and moves on for the rest of the step, so the timing of bounces
does not depend on the step.
[[particles.walls]]
zones = ["bottom"]
restitution = 0.8 # e_n
tangential_restitution = 0.9 # e_t
[[particles.walls]]
zones = ["top"]
interaction = "stick"
| Key | Default | Meaning |
|---|---|---|
zones |
required | Wall or symmetry boundary zones |
interaction |
"rebound" |
"rebound" or "stick" |
restitution |
1 | e_n in [0, 1] (rebound) |
tangential_restitution |
1 | e_t in [0, 1] (rebound) |
e_n is the ratio of the normal speeds after and before the impact: 1 for an
elastic bounce, 0.9 and above for hard beads on a hard wall, less for soft,
rough or small particles, 0 for a particle that slides along the wall; each
bounce keeps \(e_n^2\) of the normal kinetic energy. e_t below 1 models friction at the impact. A
zone that is not a wall or symmetry boundary, and [[particles.walls]] with
tracers, are errors.
The particle_bounce
example: Mallard's particles (dots) against their exact trajectories
(lines).
Pitfalls.
- Solid particles need a viscous single gas (
type = "navier_stokes"in[physics]); mixtures are refused for now. - The bounce of a particle with
taubelow the step happens at the end of the step: such a particle follows the gas within the step. - The located bounce takes the gas velocity and force at the start of the step, so it is exact for drag in a gas that is uniform over the step's travel and for constant acceleration; in a strongly varying gas it is still first order in the step.
temperaturewithoutspecific_heatis an error, as is an expression readingT_Pin a mixture.- Stokes and Schiller-Naumann drag have no slip correction for particles near
the mean free path of the gas: in air at 1 bar, particles of 1 µm settle
12% faster with
"singh"than with them, of 0.1 µm several times as fast. Use"singh"aboveKn = 0.01(drag laws). - Droplets above about 1 mm in air are not spheres (they flatten), and particles of a few cells' size are not point particles: the gas at their center is not the flow around them.
Two-way coupling¶
[particles]
type = "solid"
coupling = "two-way"
weight = 1e4 # particles per parcel
deposition_width = 2e-3 # m
diameter = 50e-6
density = 2500.0
specific_heat = 840.0
Used in:
particle_cloud.
With coupling = "two-way" the gas feels the particles: each stage, every
particle gives the gas the opposite of its own change of momentum and energy,
less what gravity on the particle did, times weight:
summed into the cells and spread over a Gaussian of standard deviation
deposition_width. Drag, the pressure-gradient, added-mass and lift forces and
heat transfer all act back on the gas; gravity on the particles (gravity of
[particles]) does not, since the earth exerts it, not the gas. The sources use
the same stage rates the particles are integrated with, so the gas and the
particles together conserve momentum and energy to round-off (with heat
transfer; without it, the particles' kinetic energy is conserved to the
integrator's order), however stiff the particles are.
A parcel stands for weight identical particles, so that a computational
particle can represent many physical ones; in 2D a parcel stands for weight
particles per meter of depth. The mass loading of a cell, w m_p / (rho V),
decides how strongly the particles act: near 1 and above, they drag the gas
along.
The particle_cloud
example, coupled one way and two ways (Mallard runs). Left: the cloud's mean
fall velocity from its probe. Coupled one way, each particle reaches the
terminal velocity tau g = 0.1 of a single particle; coupled two ways, the
cloud, as heavy as the gas within it, drags that gas along and falls at up
to 0.27. Right: the gas velocity at t = 2 and the parcels, whose wake
sheds a vortex pair and bends the cloud into an arc.
Deposition. With deposition_width = 0 (the default) each particle's
source goes to the cell holding it. On a fine mesh that puts a point source in
one small cell, so the result depends on the mesh. A deposition_width in
meters spreads it over a Gaussian of that width whatever the cells, so coupled
results converge as the mesh is refined: second order in the cell size at a
fixed width (the deposit keeps each particle's position within its cell, not
only its cell, and its spread is the Gaussian's wherever in the cell the
particle sits). Choose a width of the order of the cell size of the coarsest
mesh you would trust, or of the physical size of the region a particle
disturbs. The spreading never moves sources across walls or out of the domain,
and conserves them exactly.
One coupled particle in a periodic unit box, deposited on four meshes
(Mallard runs, PARTICLE_VOLUME_FRACTION along the particle's row of cells).
Left: in its own cell, the deposit is the particle's volume over one cell's,
4 times higher at each refinement (log scale). Right: over a Gaussian of
width 0.08, every mesh samples the same Gaussian (dashed); its error falls at
second order (theory).
| Key | Default | Meaning |
|---|---|---|
coupling |
"one-way" |
"one-way": the particles feel the gas only; "two-way": the gas feels them too |
weight |
1 | Particles per parcel (per meter of depth in 2D) |
deposition_width |
0 | Standard deviation of the Gaussian the sources spread over; 0: each particle's own cell |
The results are bitwise the same on any number of ranks and with or without CUDA graphs.
Pitfalls.
- The point-particle model assumes particles much smaller than the cells and a
dilute suspension.
mallard checkwarns where particles are larger than a tenth of their cell (W-PARTICLE-SIZE) and where the particle volume fraction exceeds 1% (W-PARTICLE-VOLUME-FRACTION): collisions (four-way coupling) and the volume the particles take from the gas are left out. - Two-way coupling needs solid particles; tracers are massless. Axisymmetric runs are refused.
- A wide
deposition_widthcosts spreading passes per stage, about4 width^2 / h^2in 2D and6 width^2 / h^2in 3D for cells of sizeh, each with a halo exchange on several ranks.
Evaporating droplets¶
[physics]
type = "navier_stokes"
gas = "mixture"
mechanism = "mechanisms/h2o2.yaml" # holds the vapor species
transport = "mixture_averaged"
[particles]
type = "droplet"
diameter = 50e-6
temperature = 300.0
evaporation = "abramzon_sirignano" # or "d2_law"
coupling = "two-way"
weight = 1e4
[particles.liquid]
species = "H2O"
density = 958.0
specific_heat = 4216.0
latent_heat = 2.257e6 # J/kg, at the boiling temperature
boiling_temperature = 373.15
critical_temperature = 647.1
critical_pressure = 22.064e6
Droplets are solid particles of a liquid that evaporates into a gas mixture:
sprays, fuel injection, humidification, quenching. Each droplet moves as a
solid particle (drag, gravity, forces, walls), is heated by the gas and
evaporates into the vapor species species of the mechanism, so its diameter
falls until, below minimum_diameter, it is removed. With
coupling = "two-way" the gas receives the vapor, with its momentum and
energy, and gives the heat; the gas and droplets together conserve mass, every
species, momentum and energy to round-off. Droplets need a viscous mixture
(gas = "mixture", type = "navier_stokes").
The model. A droplet is a sphere of uniform temperature (infinite liquid
conductivity) of one component. Its surface is at its temperature T_p, up to
the boiling temperature at the gas pressure, and the vapor there is at its
saturation pressure: the surface's vapor mass fraction Y_s follows from
Raoult's law of a pure liquid. The gas film around the droplet is evaluated by
the 1/3 rule, T_f = T_s + (T - T_s)/3, Y_f = Y_s + (Y - Y_s)/3, with the
mechanism's thermodynamics and transport (its viscosity also sets the drag).
With the Spalding (1953) mass transfer number B_M = (Y_s - Y)/(1 - Y_s):
evaporation = "d2_law":mdot = pi d rho_f D_f Sh0 ln(1 + B_M)and the heat from the gasQ = pi d k_f Nu0 (T - T_s), Ranz & Marshall (1952)'sSh0 = 2 + 0.6 Re^1/2 Sc^1/3,Nu0 = 2 + 0.6 Re^1/2 Pr^1/3. At rest and at its wet-bulb temperature, d² falls linearly:d² = d0² - K t,K = 8 rho_f D_f ln(1 + B_M) / rho_l.evaporation = "abramzon_sirignano"(default): the film model of Abramzon & Sirignano (1989), which thickens the film by the Stefan flow and transfers heat by the numberB_T = (1 + B_M)^phi - 1,phi = (c_p,v / c_p,f) (Sh*/Nu*) / Le_f:mdot = pi d rho_f D_f Sh* ln(1 + B_M),Q = pi d k_f Nu* (T - T_s) ln(1 + B_T)/B_T. The usual choice for sprays in hot gas (Miller et al. 1998).
A 50 µm water droplet at rest in air at 1000 K and 1 atm (Mallard
runs). Released at its wet-bulb temperature (markers), its d² falls on the
straight line d0² - K t of its film, whose properties, wet-bulb temperature
and rate K are computed independently with Cantera from the same mechanism;
released at 300 K (dashed), it first heats to that temperature (right), in a
4 ms, and lives a little longer. At rest the two models differ in
the heat only: Abramzon & Sirignano's blowing factor lowers the heat that
reaches the surface, so the droplet is 4 K cooler and evaporates 22% more
slowly.
The heat into the liquid is Q - mdot L(T_s), so a droplet heats or cools to
its wet-bulb temperature, where the heat from the gas just evaporates it. The
liquid has a constant density and specific heat; its enthalpy is that of the
mechanism's vapor at the boiling point less latent_heat, so the latent heat
at other temperatures follows Kirchhoff's law and the liquid and the gas share
one energy reference. The saturation pressure is Clausius-Clapeyron's through
the boiling point, or Antoine's with antoine. A droplet at or above the
boiling temperature boils: the heat it receives evaporates it and its superheat
relaxes to the boiling temperature at its heating rate. Above the critical
pressure the boiling temperature is the critical temperature, and the
properties of a droplet driven past the critical temperature are those at it.
A droplet that would evaporate entirely within a step evaporates within that
step at its temperature, and droplets below minimum_diameter are removed
after the step: with two-way coupling their remains (mass, momentum, energy)
go to the gas as vapor. Restart files keep the count of evaporated droplets
with those that left the domain, were lost or stuck (PARTICLE_REMOVED).
| Key | Default | Meaning |
|---|---|---|
type |
required | "droplet" |
diameter |
required | Initial diameter of every seeded droplet |
temperature |
required | Initial temperature, below critical_temperature |
velocity |
gas velocity | Initial velocity |
evaporation |
"abramzon_sirignano" |
"abramzon_sirignano" or "d2_law" |
minimum_diameter |
diameter / 100 |
Droplets below it are removed (their remains go to the gas with two-way coupling) |
drag, gravity, forces, coupling, weight, deposition_width |
As for solid particles and two-way coupling |
[particles.liquid] key |
Default | Meaning |
|---|---|---|
species |
required | The vapor species of the mechanism |
fluid |
none | A named liquid, whose properties are tables of the temperature; the keys below then replace its tables |
tolerance |
1e-6 | With fluid: the tables' largest relative error |
density |
required without fluid |
Liquid density (constant) |
specific_heat |
required without fluid |
Liquid specific heat (constant) |
latent_heat |
required without fluid |
Latent heat of vaporization at the boiling point |
boiling_temperature |
required without fluid |
Boiling temperature at boiling_pressure |
boiling_pressure |
101325 Pa | Pressure of the boiling point |
critical_temperature, critical_pressure |
required without fluid |
Critical point; above the boiling point |
antoine |
the table, or Clausius-Clapeyron | [A, B, C] of the saturation pressure log10(p / Pa) = A - B / (T / K + C) |
viscosity, conductivity, surface_tension |
the tables, or none | For particle expressions (MU_P, K_P, SIGMA_P) |
Particle expressions read the droplet's temperature T_P, its diameter D_P,
density RHO_P, the liquid's viscosity MU_P, conductivity K_P and surface
tension SIGMA_P at T_P, and the gas temperature T: a droplet's Weber
number is RHO * ((U_X - V_X)^2 + (U_Y - V_Y)^2) * D_P / SIGMA_P. The CSV
file has the columns T_P, D_P and the droplet's mass M_P. With two-way coupling, PARTICLE_SOURCE_RHOY_<species>
writes the vapor source per volume and time.
Two-way coupled 20 µm water droplets (weight = 3e3,
deposition_width = 2e-4) released at rest into a periodic stream of air at
1000 K, u = 10 + 4 sin(2 pi y / L) m/s, after 1 ms (a Mallard run). The gas
carries the vapor Y_H2O (left) downstream of the droplets, which lag behind
it, and the shear tilts the trails; PARTICLE_SOURCE_RHOY_H2O (right) is
each droplet's evaporation rate spread over the deposition width.
Named liquids¶
[particles.liquid]
species = "H2O"
fluid = "water" # density, specific heat, latent heat, saturation pressure,
# viscosity, conductivity and surface tension from CoolProp
With fluid, every property of the liquid is a function of the droplet's
temperature, from the triple point up to 0.999 of the critical temperature:
density, specific heat, latent heat, saturation pressure, viscosity, thermal
conductivity and surface tension of the saturated liquid. At setup,
CoolProp (Bell et al. 2014)
fills tables of them, as fine as tolerance asks (the largest relative error
of each, 1e-6 by default; a table stops at 8193 knots, where CoolProp's
conductivity, whose slope jumps where its critical enhancement starts, is
within 5e-6), and the setup log lists each table's knots and error; the
droplets read only the tables, on the GPU as on the CPU. Fitting them takes
about 2 s of setup. The range ends
below the critical point where a correlation does (ethanol's surface
tension). The
boiling point is the saturation temperature at boiling_pressure and the
critical point the end of the tables. A key of [particles.liquid] replaces
its table with a constant, for instance density = 1000.0; latent_heat
then is the latent heat at the boiling point, continued by Kirchhoff's law as
for a liquid given property by property.
The latent heat at the surface is the table's, and the enthalpy of the liquid is the integral of its specific heat, from the vapor's enthalpy at the boiling point less the latent heat there: the gas and the liquid share one energy reference, and gas and droplets conserve energy to round-off as before. The diameter follows the density at the droplet's temperature (a heated droplet swells).
Named liquids need a build with -DMallard_ENABLE_COOLPROP=ON
(installation); in a build without it,
fluid is an error that says so. Liquids given property by property need no
CoolProp. The vapor species must be in the mechanism (H2O and O2 are in
mechanisms/h2o2.yaml, NH3, CH3OH and C3H8 in gri30.yaml), with
transport data for a Navier-Stokes gas.
fluid |
CoolProp | Range (K) | Equation of state; viscosity; conductivity; surface tension |
|---|---|---|---|
ammonia |
Ammonia | 195.5 to 405.2 | Gao et al. (2020); Fenghour et al. (1995); Tufeu et al. (1984); Mulero et al. (2012) |
ethanol |
Ethanol | 159.1 to 513.4 | Schroeder et al. (2014); Kiselev et al. (2005); Assael et al. (2013); Mulero et al. (2012) |
methane |
Methane | 90.7 to 190.4 | Setzmann and Wagner (1991); Quinones-Cisneros and Deiters (2006); Friend et al. (1989); Mulero et al. (2012) |
methanol |
Methanol | 175.6 to 512.9 | de Reuck and Craven (1993); Xiang et al. (2006); Sykioti et al. (2013); Mulero et al. (2012) |
n-decane |
n-Decane | 243.5 to 617.1 | Lemmon and Span (2006); Huber et al. (2004); Huber and Perkins (2005); Mulero et al. (2012) |
n-dodecane |
n-Dodecane | 263.6 to 657.4 | Lemmon and Huber (2004); Huber et al. (2004); Huber et al. (2004); Mulero et al. (2012) |
n-heptane |
n-Heptane | 182.6 to 539.6 | Span and Wagner (2003); Michailidou et al. (2014); Assael et al. (2013); Mulero et al. (2012) |
n-hexane |
n-Hexane | 177.8 to 507.3 | Thol et al. (2019); Michailidou et al. (2013); Assael et al. (2013); Mulero et al. (2012) |
n-octane |
n-Octane | 216.4 to 568.2 | Beckmueller et al. (2019); Huber et al. (2004); Huber and Perkins (2005); Mulero et al. (2012) |
n-pentane |
n-Pentane | 143.5 to 469.2 | Thol et al. (2019); Quinones-Cisneros and Deiters (2006); Vassiliou et al. (2015); Mulero et al. (2012) |
nitrogen |
Nitrogen | 63.2 to 126.1 | Span et al. (2000); Lemmon and Jacobsen (2004); Lemmon and Jacobsen (2004); Mulero et al. (2012) |
oxygen |
Oxygen | 54.4 to 154.4 | Schmidt and Wagner (1985); Lemmon and Jacobsen (2004); Lemmon and Jacobsen (2004); Mulero et al. (2012) |
propane |
Propane | 85.5 to 369.5 | Lemmon et al. (2009); Vogel et al. (1998); Marsh et al. (2002); Mulero et al. (2012) |
toluene |
Toluene | 178.0 to 591.2 | Lemmon and Span (2006); Avgeri et al. (2015); Assael et al. (2012); Mulero et al. (2012) |
water |
Water | 273.2 to 646.4 | Wagner and Pruss (2002); Huber et al. (2009); Huber et al. (2012); Mulero et al. (2012) |
Pitfalls.
- Named liquids are saturated liquids: their properties do not depend on the pressure. At 50 bar a compressed liquid is 0.2 to 0.3% denser than the saturated liquid for water, about 2% for n-heptane and n-dodecane at 450 K, and up to 10% near their critical temperature (design).
- The gas composition at a droplet is the average of its cell, not reconstructed to its position as the velocity and pressure are.
- One-component liquids only; the liquid's temperature is uniform (no internal conduction), its density and specific heat constant unless it is a named liquid.
- Supercritical droplets are outside the model: properties stop at the critical temperature, and a gas above the critical pressure boils the droplet at the critical temperature.
- With two-way droplets, the conservation ledger of the run does not check the gas's totals, which the droplets change; the closed-box totals of gas and droplets together are conserved to round-off.
densityandspecific_heatof[particles]are errors for droplets: they belong to[particles.liquid]. Aspecific_heatandlatent_heatwhose Kirchhoff latent heat vanishes below the critical temperature are refused.
Dispersed-phase fields¶
[[write_data]]
prefix = "spray"
fields = ["PARTICLE_VOLUME_FRACTION", "PARTICLE_U_X", "PARTICLE_SOURCE_RHOU_X"]
Runs with solid particles can write the particles as mesh fields, deposited as
the coupling deposits them (over deposition_width):
| Field | Meaning |
|---|---|
PARTICLE_VOLUME_FRACTION |
Particle volume per cell volume |
PARTICLE_NUMBER_DENSITY |
Particles per volume (counting weight) |
PARTICLE_U_X, _Y, _Z |
Mass-weighted mean particle velocity, 0 where there are none |
PARTICLE_SOURCE_<A> |
What the particles give the gas per volume and time at the written state, for <A> each conservative variable (RHO, RHOU_X, ..., RHOE); with coupling = "two-way" |
They are written by [[write_data]] and listed by mallard list fields.
Injectors¶
[particles]
type = "solid"
density = 800.0
weight = 1e3 # droplets per parcel
[[particles.injectors]]
name = "spray"
point = [0.0, 0.05] # the nozzle
rate = 2e5 # parcels per second
speed = 30.0 # m/s
direction = [1.0, 0.0]
cone_angle = 12.0 # half angle, degrees
start = 0.0
end = 5e-3
diameter = {distribution = "rosin_rammler", size = 40e-6, spread = 3.0, basis = "mass", min = 5e-6, max = 150e-6}
[[particles.injectors]]
name = "dust"
region = "inlet" # a boundary zone: along its inward normal
mass_flow = 1e-4 # kg/s
speed = 5.0
diameter = 10e-6
Each [[particles.injectors]] seeds particles at random places
(Seeding lists the other ways in). How many and when:
count: that many parcels at once, atstart. By defaultstartis the run's start, and they are there with the seeds before the first step (and in the initial output); a laterstartreleases them at the end of the first step that reaches it;mass(solid particles): the same, the count beingmass / (weight m)rounded to the nearest parcel,mthe mean mass of a particle of its size distribution, so that the parcels' mass ismassto within half a parcel of mean mass (for one diameter; a distribution's sampled diameters add their statistical spread);rateparcels per second (ormass_flow, from the mean mass of a particle of its size distribution andweight): after every step, for the part of the step betweenstartandend, carrying fractions of a parcel over to the next step so that over the run the count matches the rate.
Where:
point: every particle at a nozzle;regiona boundary zone (or several,{type = "zones", ...}): uniformly over the zone's faces, by area, with the velocity along the inward normal unlessdirectionis given;regiona filled region of shapes (a sphere, a box, their booleans) or of the mesh ("domain", a cell zone), inline or by name: uniformly in its volume.
Solid particles leave with velocity, or speed along direction, spread
uniformly over a cone of half angle cone_angle about it (in angle in 2D, in
solid angle in 3D); with neither, each takes the gas velocity where it enters,
in equilibrium with the flow (velocity = [0.0, 0.0] starts them at rest).
diameter is a diameter or a size distribution, weight defaults to that of
[particles], and temperature to that of [particles], else the gas
temperature where each enters. Tracers take
none of these: they move with the gas.
Settings that vary. Each of rate, mass_flow, velocity (per
component), speed, direction (per component), cone_angle, temperature,
weight and diameter, and each parameter of a size distribution (size,
spread, median, sigma, exponent, min, max), may be an
expression in place of a number. rate and mass_flow
read t only; the others read x, y, z and t, evaluated for each
parcel at the point where it enters and the time it enters (the end of its
step). count and mass stay numbers, and so do diameter and weight
with mass or mass_flow, whose mean mass they set. A pulsed rate:
[[particles.injectors]]
name = "pulses"
point = [0.0, 0.05]
# 2e5 parcels/s for the first 30% of every 1 ms, ramping up over the first 5 ms
rate = "2e5 * min(t / 5e-3, 1) * (frac(t / 1e-3) < 0.3 ? 1 : 0)"
speed = 30.0
direction = [1.0, 0.0]
A nozzle's exit profile, parabolic across an inlet of radius 2 mm about
y = 0.05:
[[particles.injectors]]
name = "nozzle"
region = "inlet"
rate = 1e5
speed = "var r := (y - 0.05) / 2e-3; 40 * (1 - r^2)"
cone_angle = "15 * abs(y - 0.05) / 2e-3" # wider at the edge
A size that varies across the injector, here a Rosin–Rammler distribution whose size grows from the axis to the edge:
[[particles.injectors]]
name = "spray"
region = "inlet"
rate = 1e5
speed = 20.0
diameter = {distribution = "rosin_rammler", basis = "mass", size = "20e-6 + 1e-2 * abs(y - 0.05)", spread = 3.0, min = 2e-6, max = 200e-6}
How the expressions are evaluated:
- A rate of
tis integrated over the part of each step withinstartandendby adaptive Simpson quadrature, to 1e-7 parcels per step (or 1e-10 of the step's parcels), carrying fractions of a parcel over as a constant rate does: the count over the run is the integral of the rate to within one parcel. Each step starts from 9 samples a quarter of a step apart in pairs, so a pulse shorter than about an eighth of a step may be missed: resolve pulses with the time step.mallard checkand the defaultcapacityintegrate it the same way. - A distribution whose parameters are expressions is drawn for each parcel
from its parameters there, by the same inversion of its cumulative
distribution as a distribution of numbers, computed for that parcel (on
1024 cells in ln d), which costs about 2000 evaluations of its density per
parcel.
"table"distributions take numbers only. - A value that is invalid where a particle enters (a negative speed, rate or
diameter, a weight or temperature not above 0, a
cone_angleoutside [0, 90], a zero direction, NaN) keeps that particle out and stops the run at its next check, naming the injector, the key and the point. - Numbers, or strings with units (
"30 m/s"), are constants and give the same particles, bit for bit, as without expressions.
Each panel a Mallard run of solid particles of 100 µm into air at rest.
Left: region = "inner", the inner circle of an annulus, with speed = 5.0
and no direction: particles enter uniformly along the circle and move along
its inward normal (arrows), radially out, after 6 ms. Middle: a filled region,
the union of a disk and a tilted rectangle, with velocity = [0.0, 0.0]:
particles fill it uniformly in area, whatever cells (gray) it cuts. Right: two
point injectors with speed = 10.0 along x, after 5 ms: cone_angle = 15
spreads the directions uniformly within ±15° (dotted), cone_angle = 0
sends every particle along direction.
| Key | Default | Meaning |
|---|---|---|
name |
required | Its name: letters, digits and _ |
point, region |
one of them | Where it injects |
count, mass, rate, mass_flow |
one of them | Parcels released at once at start, their total mass (solid particles; per meter of depth in 2D), parcels per second, or mass per second (solid particles; per meter of depth in 2D); rate and mass_flow may be expressions of t |
start, end |
0, never | When it injects (count and mass: start only) |
velocity, speed |
the gas velocity where each enters | The particles' velocity, or their speed along direction (solid particles; at most one) |
direction |
the inward normal of a zone | Direction of the velocity with speed |
cone_angle |
0 | Half angle of the cone of velocities, degrees |
diameter |
[particles] diameter |
A diameter or a size distribution |
weight |
[particles] weight |
Particles per parcel |
temperature |
[particles] temperature, else the gas temperature where each enters |
With heat transfer |
Every key but name, point, region, count, mass, start and end
may be an expression (Settings that vary).
Two injectors in one Mallard run of fixed dt = 1e-3. Left: rate = 700
is 0.7 parcels per step, so steps inject 0 or 1 parcel (dots), and the
fraction left over (bottom) is carried to the next step: the count is always
rate × time injecting minus that fraction, below one parcel. start = 3.5e-3
and end = 26.5e-3 fall within steps, which inject for the part of the step
inside the window; after end the count stays at 16 of 16.1. Right:
mass_flow with diameters uniform in [20, 40] µm sets a rate of 20 parcels
per step from the mean mass of a particle; the mass injected follows
mass_flow × t to within the randomness of the diameters (98.6% after 30
steps).
Size distributions. diameter = {distribution = ..., basis = ...} with:
distribution |
Parameters | PDF or CDF |
|---|---|---|
"rosin_rammler" |
size X, spread q |
1 - F(d) = exp(-(d/X)^q) |
"log_normal" |
median, sigma |
ln d normal, of standard deviation sigma |
"nukiyama_tanasawa" |
size X, spread q, exponent p |
f(d) ~ d^p exp(-(d/X)^q) |
"uniform" |
min, max |
f(d) constant |
"table" |
diameters, pdf |
f(d) linear between the points |
basis is required: "number" makes it the distribution of the particles' diameters;
"mass" that of their mass (Rosin–Rammler fits of sprays usually are),
whose particles are then mostly the small ones, f by number being f by mass
over d^3. min and max clip it, by default at the 1e-9 and 1 - 1e-9
quantiles in its basis; a distribution by mass whose number of small
particles diverges (Rosin–Rammler with spread below 3) needs a min. The
setup log shows each injector's mean diameter D10 and Sauter mean diameter
D32.
20000 diameters drawn by Mallard from each distribution (histograms)
against its density (lines), by number (blue) and by mass (orange), both
normalized. The solid line is the density the input gives, in its basis; the
dashed one follows from it, f by mass being f by number times d³. The same
parameters by mass put most particles at small diameters (rosin_rammler,
table); by number, most of the mass is in the few large particles
(uniform by number is far from uniform by mass). Parameters: rosin_rammler
size = 40e-6, spread = 3.0, min = 5e-6, max = 100e-6; log_normal
median = 20e-6, sigma = 0.5; nukiyama_tanasawa size = 8e-6,
spread = 1.0, exponent = 2.0; uniform min = 10e-6, max = 50e-6;
table diameters = [10e-6, 30e-6, 60e-6, 90e-6], pdf = [0.0, 1.0, 1.0, 0.0].
A point injector (rate = 1e6, speed = 30.0, cone_angle = 12.0) of
droplets of density 800 kg/m³ into air at rest, after 4 ms (a Mallard run).
Left: the parcels within the cone, the small ones stopped by drag near the
nozzle and the large ones carried farthest. Right: the 4000 diameters drawn
from {distribution = "rosin_rammler", size = 40e-6, spread = 3.0, basis = "mass", min = 5e-6, max = 150e-6}
against its density by mass and by number (f / d³), in ln d: by mass the
distribution peaks near size, by number the particles are mostly the small
ones.
Reproducibility. Each injected particle draws its place, direction and
diameter from random numbers keyed by [particles] seed, its injector and its
count within the injector, not from a sequence: the same particles enter on
any number of ranks, with step graphs or without, and a restarted run
continues the injection exactly (restart files carry each injector's count and
fraction of a parcel, so a count injector releases once). Changing the time step changes when particles enter,
not what they are.
Capacity. By default every rank has slots for every particle the run can
inject: the seeds and what the injectors emit up to [run] t_stop (or
n_steps steps of a fixed dt). Without either, an injector with no end
needs capacity. For long runs whose particles leave the domain, set
capacity to the most that are in it at once: a run that runs out of slots
stops, naming it. mallard check reports each injector (where, along what,
its rate or count, mass flow and parcels over the run) in its JSON
(particle_injectors).
Pitfalls.
- Particles of a rate enter at the end of a step, at the point or face where they are drawn, all together: a step's particles have the same age. At large rates per step, streams come in bunches a step's travel apart.
- A filled region's particles are placed in the cells it covers by their volume fractions, which sample its edge: in cells it cuts, the density is as exact as the fractions. A shape that barely touches a cell (less than about a thousandth of it) may put that cell's few particles at one point of it.
- Particles that take the gas velocity or temperature get it from the gas
where they enter at the end of the step, which costs a pass over the
particles each step: give
velocity(orspeed) andtemperaturewhere the values are known.
Per-particle quantities¶
[[particles.quantities]]
name = "T_CAVITY"
integral = "in(cavity)" # time spent in the region cavity of [regions]
[[particles.quantities]]
name = "T_MAX"
max = "T"
[[particles.quantities]]
name = "T_HOT"
first_time = "T > 1500"
[[particles.quantities]]
name = "TURNS"
winding = {point = [0.052, -0.063, 0.0], axis = [0.0, 0.0, 1.0]}
Used in:
tracer_vortex,
particle_vortex,
particle_step,
particle_wake.
Each [[particles.quantities]] follows one value along every particle's
path, for residence times, exposure (the time integral of a temperature or a
concentration), peak values and when something first happened. A quantity is
one of:
| Key | Meaning |
|---|---|
integral = "<expression>" |
The time integral of the expression along the path, from 0 at the seed |
max = "<expression>", min = ... |
Its largest (smallest) value, -inf (inf) until the first sample |
first_time = "<condition>" |
The first time t at which the condition holds (is not 0), nan until then |
winding = {point = [...], axis = [...]} |
The turns of the particle about the axis through the point, unwrapped and signed (positive counterclockwise about the axis); 2D takes no axis (it is z) |
and each takes:
| Key | Default | Meaning |
|---|---|---|
name |
required | The quantity's name, a field name: uppercase letters, digits and _, starting with a letter (TURNS, T_MAX), and none of the variables below in any case |
while |
none | A condition: the quantity integrates, or samples, only where it holds |
Expressions follow the expression syntax and read, at the particle:
x,y(z) andt;- the gas:
RHO,U_X,U_Y(U_Z),Pand, for a single gas and for droplets,T, evaluated as the particle's velocity is, from the reconstruction polynomial of its cell; - the particle velocity
V_X,V_Y(V_Z), for tracers the gas velocity; - the particle temperature
T_P, for a single gas and for droplets, the gas temperature for particles without heat transfer; - the particle diameter
D_P(solid particles and droplets;nanfor tracers); - the quantities listed before this one;
in(name): 1 inside the regionnameof regions and 0 outside, smooth across the region'sedge.
Some quantities worth knowing:
| Quantity | What it measures |
|---|---|
integral = "1" |
The particle's age |
integral = "in(name)" |
Total residence time in a region |
integral = "hypot(V_X, V_Y)" |
Path length (2D) |
integral = "hypot(V_X - U_X, V_Y - U_Y)" |
Time-integrated slip of a solid particle |
max = "hypot(U_X - V_X, U_Y - V_Y) * RHO * 20e-6 / 1.8e-5" |
Peak particle Reynolds number (here d = 20 µm, mu = 1.8 × 10⁻⁵) |
integral = "T", while = "T > 1200" |
Thermal exposure above a threshold |
first_time = "x > 0.3" |
Arrival time at a plane |
Integrals and windings are part of the time integrator's state, as the
positions are: each stage evaluates them at its own position, so they converge
at the integrator's order (fourth with RK4). An integrand that jumps, such as
in(name) of a region without an edge, is integrated to within a step at
each crossing; give the region an edge of a few steps' travel to keep the
order. Extrema and first times sample the start of every step, where the
state is the accepted solution, so they are exact to the step: a peak between
two steps' starts is missed by the difference.
Quantities are written as columns of file, continue across restarts (a
quantity the restart file does not have starts afresh), move with their
particles between ranks, and are bitwise the same on any number of ranks.
Particle probes¶
[[particles.probes]]
name = "core"
region = {type = "disk", center = [0.25, 0.25], radius = 0.12}
fields = ["TURNS", "hypot(U_X, U_Y)"]
interval = 100
Used in:
tracer_vortex,
particle_cloud,
particle_vortex,
particle_step,
particle_wake.
A particle probe writes, every interval steps, the number of particles in
its region and the mean, standard deviation, minimum and maximum of each field
over them: one row per sample of its CSV file (step, t, COUNT, then
MEAN_<field>, STD_<field>, MIN_<field>, MAX_<field>).
| Key | Default | Meaning |
|---|---|---|
name |
required | The probe's name |
region |
every particle | A filled region of primitives, inline or a name of regions, that does not move |
fields |
none (the count only) | Expressions of the particle variables above, the quantities among them |
interval |
1 | Steps between samples |
file |
particle_probe_<name>.csv |
Its CSV file |
Sums are exact in fixed point, so the statistics are bitwise the same on any number of ranks. A probe samples on the host: steps decided on the device stop at its samples.
A probe without a region and with no fields counts the particles still in
the domain: with [[particles.walls]] that stick, the decrease is the
deposition history.
Pitfalls (quantities and probes).
- An expression reading
TorT_Pin a mixture is an error, except for droplets: particle expressions have temperatures for a single gas and for droplets only. in(name)and probe regions are regions of primitives that do not move (boolean combinations included); at most 4 regions in all particle expressions, 4 probes with regions, and 16 quantities.- Probes count particles by their positions only, at the sampling step; the
residence time of visits (per visit, total, visit counts) is a quantity:
integral = "in(name)"gives the total.
Accuracy¶
The particles read the gas from the reconstruction's polynomial at their positions and move with the flow's time integrator, so their error has the flow's orders:
| Order | Measured (verification manual) | |
|---|---|---|
Gas at the particle, TENO of order k |
k |
2.95 to 5.23 for TENO3 to TENO5 on quadrilaterals, triangles, hexahedra and tetrahedra |
Gas at the particle, FO and MUSCL |
2 | 1.96 to 3.07 (the linear least-squares fit) |
| Pathlines in space | the flow's: 1 (FO), 2 (MUSCL), k (TENO) |
0.92 to 0.94 (FO), 2.28 to 3.19 (MUSCL), 2.94 to 5.09 (TENO3 to TENO5) |
| Trajectories in time | the integrator's: 1 (FE), 3 (SSPRK3, RDPK3Sp35), 4 (RK4, SSPRK54, CK45) |
1.02 to 1.05, 2.97 to 3.14 and 3.96 to 4.22: tracers, drag relaxation, settling and Schiller-Naumann response, also at dt = tau / 2 |
Stiff particles (tau < dt), exponential |
3, exact for a gas velocity and force linear over the step | 2.90 (position) and 2.79 (velocity), RK4 at dt / tau = 12.5 to 3.1 |
| A bounce | exact for drag in uniform gas and constant acceleration; else 1 in dt |
round-off (ABounceIsLocatedWithinTheStep) |
In practice:
- Choose the reconstruction for the flow; the particles inherit its order. In the vortex study, TENO5 on 32² cells is as accurate as MUSCL on 64², and the gap grows with the accuracy asked for.
- The time step of a stable flow (CFL below 1) moves particles less than a
cell per step and resolves their relaxation, exponentially when
tau < dt. Check a trajectory statistic at two values ofcflwhen it matters. - Particle counts at a wall (deposition) and in regions are discrete: converge them in the number of particles as well as the mesh.
Performance¶
- Cost. Each particle costs an evaluation of its cell's polynomial per
stage and a walk of a cell or two per step, independent of the other
particles. Kernels run over every slot, so a
capacityfar above the number of particles costs memory and time. - Linear fits. With
FO,MUSCLor troubled TENO cells, the cells holding particles (only those) compute a least-squares gradient each stage. - Several ranks. Particles that change rank go through the host at every step, which takes distributed runs with particles out of CUDA graphs. On one GPU, steps with particles are graphed.
- Output. The CSV file and the restart files gather every particle on rank 0 (restart files on every rank): fine for thousands to hundreds of thousands of particles, not millions, until parallel particle output (#753).
- Probes sample on the host: a probe every step of a GPU run stops the device at every step; sample every 10 to 100 steps.
Checklist¶
- Estimate \(\tau\) and \(St\) for your particles and flow (table): tracers for \(St \ll 1\) without settling, solid particles otherwise.
- Solid particles:
[physics] type = "navier_stokes"with the rightmu(its temperature dependence included),diameter,density,gravity. - Choose the drag law: check \(Re_p\) (a
maxquantity, above), and the Knudsen and slip Mach numbers:singhabove \(Kn = 0.01\) or \(M = 0.3\); above \(Re_p = 800\) Schiller-Naumann is outside its range. - Walls:
restitutionfrom experiments on your materials, orstickfor deposition. - Converge the statistic you report in
cfl(time), the mesh (space) and the number of particles.
Design notes: particles, liquid library.