|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Eulerian-Lagrangian coupling in PICurv is built from interpolation (grid -> particle) and scatter/normalization (particle -> grid).
For a particle inside a host cell with local coordinates \((a_1,a_2,a_3)\in[0,1]^3\), trilinear interpolation uses 8 source-point weights:
\[ \phi_p = \sum_{m=1}^{8} w_m(a_1,a_2,a_3)\,\phi_m, \qquad \sum_m w_m = 1. \]
PICurv supports two grid-to-particle interpolation methods, selectable at runtime via the interpolation_method YAML key (or -interpolation_method flag).
The recommended method. For each particle, the 8 nearest cell centers are identified via octant detection (based on existing host-cell weights), forming a "dual cell." Trilinear interpolation is performed directly from these cell-centered field values to the particle position.
Key properties:
lUcat, lDiffusivity, etc.) and ghosted cell center coordinates (lCent). No extra ghost exchange is needed beyond what the solver already provides.ApplyPeriodicCorrectionsToCellCentersAndSpacing() and DMGlobalToLocal with DM_BOUNDARY_PERIODIC, so no special handling is needed.Code path: InterpolateEulerFieldToSwarm dispatches to InterpolateEulerFieldFromCenterToSwarm.
The original two-stage method:
sum/count).This is second-order on uniform Cartesian grids but degrades to first-order on curvilinear grids because the unweighted averaging does not account for the asymmetric placement of cell centers around nodes.
Code path: InterpolateEulerFieldToSwarm dispatches to InterpolateEulerFieldFromCornerToSwarm.
Both methods share the same underlying trilinear kernels:
YAML (solver.yml):
C flag: -interpolation_method 0 (Trilinear) or -interpolation_method 1 (CornerAveraged).
Enum: InterpolationMethod in include/variables.h. Stored in SimCtx.interpolationMethod.
Scatter computes per-cell sums, then normalizes by particle count:
\[ \bar{\phi}_{i,j,k} = \begin{cases} \dfrac{\sum_{p\in cell(i,j,k)} \phi_p}{N_{i,j,k}}, & N_{i,j,k}>0, \\ 0, & N_{i,j,k}=0. \end{cases} \]
Code touchpoints:
Current standard scatter path actively maps particle Psi to Eulerian Psi; additional fields are scaffolded and can be enabled with matching vector/DM contracts.
Coupling quality depends on:
Inconsistency in any of these usually appears as noisy particle statistics or nonphysical reconstructed Eulerian fields.
This page describes Trilinear Interpolation and Particle-Grid Projection within the PICurv workflow. For CFD users, the most reliable reading strategy is to map the page content to a concrete run decision: what is configured, what runtime stage it influences, and which diagnostics should confirm expected behavior.
Treat this page as both a conceptual reference and a runbook. If you are debugging, pair the method/procedure described here with monitor output, generated runtime artifacts under runs/<run_id>/config, and the associated solver/post logs so numerical intent and implementation behavior stay aligned.