Grids and particle-surface interaction models

For non-0D simulations, Merzbild.jl provides a spatial grid, particle sorting onto that grid, boundary conditions describing particle–surface interactions, and convection routines that move particles and apply the boundary conditions.

Grids

Currently a single 1-D grid type is implemented.

StructureDescriptionType/constructor
1-D uniform gridUniform grid on $[0, L]$ with nx cellsGrid1DUniform

A Grid1DUniform discretizes the domain $[0, L]$ into nx equal cells; it subtypes AbstractGrid. The grid can be written to disk with write_grid.

Particle sorting

StructureDescriptionType/constructor
In-place grid sorterSorts particles into their grid cellsGridSortInPlace

Particles are sorted into their cells with sort_particles! using a GridSortInPlace instance, which also restores contiguity of the particle indexing (see Particle buffers and contiguous indexing).

Boundary conditions: 1D

Boundary conditions describe how particles interact with the walls at the ends of the 1-D domain. They are collected into a tuple (left wall, right wall) that is passed to the convection routines. All wall types subtype AbstractBC.

Boundary conditionDescriptionType
Fully specular wallReflects the particle by flipping its normal velocity componentFullySpecularBC1D
Fully diffuse wallRe-emits the particle from a Maxwellian at the wall temperatureFullyDiffuseBC1D
Maxwell wallMixture of specular and diffuse reflection set by an accommodation coefficientMaxwellWallBC1D

Both FullyDiffuseBC1D and MaxwellWallBC1D are species-specific, since the thermal reflection velocity depends on the species mass; MaxwellWallBC1D reduces to specular reflection at an accommodation coefficient of 0 and to fully diffuse reflection at a value of 1. These specular/diffuse gas–surface interaction models are the standard DSMC wall models found in Bird (1994).

Periodic BCs for 1D grids are implemented via convection functions that wrap the particle positions, see below.

Convection

Convection moves particles according to their velocities and applies the boundary conditions when particles reach a wall (periodic versions do not take any lists of boundary conditions as input parameters and simply wrap particle coordinates on 1D uniform grids). Six routines are available, distinguished by whether they accumulate surface properties into a SurfProps instance, and by whether they also compute and store each particle's post-convection cell index (into particles.cell, which avoids required an additional pass over all particles during sorting), plus periodic convection versions:

FunctionComputes surface propertiesComputes post-convection cell index
convect_particles!nono
convect_particles_periodic! (1D uniform grid only)nono
convect_particles! (with SurfProps)yesno
convect_particles_and_compute_cell!noyes
convect_particles_and_compute_cell_periodic! (1D uniform grid only)noyes
convect_particles_and_compute_cell! (with SurfProps)yesyes

The surface-property-computing variants take an additional SurfProps argument, into which per-wall incident and reflected fluxes of mass, momentum, and energy are accumulated as particles strike the walls.