|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
This page documents particle seeding, restart behavior, and early-step migration/settling logic. It is written for both case authors and contributors working in src/ParticleSwarm.c and src/ParticleMotion.c.
Particle controls live in:
Mapping to control flags:
count -> -numParticlesinit_mode -> -pinitrestart_mode -> -particle_restart_modepoint_source -> -psrc_x/-psrc_y/-psrc_z (required when init_mode is PointSource)Note: The interpolation method (Trilinear / CornerAveraged) is configured in solver.yml, not case.yml. See Configuration Reference: Solver YAML and Trilinear Interpolation and Particle-Grid Projection.
picurv accepts these exact canonical strings:
SurfaceVolumePointSourceSurfaceEdgesEnum mapping in C (ParticleInitializationType):
0: PARTICLE_INIT_SURFACE_RANDOM1: PARTICLE_INIT_VOLUME2: PARTICLE_INIT_POINT_SOURCE3: PARTICLE_INIT_SURFACE_EDGESMain setup flow:
AssignInitialPropertiesToSwarm seeds base particle state.PerformInitializedParticleSetup settles/migrates and couples to Eulerian fields.Mode details:
Surface (0):
CMx_c/CMy_c/CMz_c) before migration,ReinitializeParticlesOnInletSurface re-spreads particles on inlet partitions after first settlement.SurfaceEdges (3):
Volume (1):
PointSource (2):
(psrc_x, psrc_y, psrc_z).InitializeParticleSwarm behavior depends on StartStep and restart mode:
StartStep | particle_restart_mode | Behavior |
|---|---|---|
0 | any | initialize new population |
>0 | init | initialize new population in restarted flow |
>0 | load | load particle fields from restart files |
Operational note:
N, use start_step: N.restart_mode: load to continue the existing particle swarm.restart_mode: init to reseed a fresh particle population in the restarted flow field.picurv at the previous run with --restart-from <previous_run_dir> on the CLI (or --continue to resume the most recent run of the same case).For loaded particles, fast migration path:
For initialized particles (StartStep == 0 path):
LocateAllParticlesInGrid performs location/migration.InterpolateAllFieldsToSwarm assigns flow fields at particle positions.For loaded particles:
MigrateRestartParticlesUsingCellID fast migration,LocateAllParticlesInGrid resolves invalid/missing cases,After position/PID/cell placeholders, initialization sets defaults for:
velocity (vector),weight (vector),Diffusivity (scalar),DiffusivityGradient (vector),Psi (scalar).Cell IDs start at -1 until location confirms host cells.
Check banner/log output for:
Typical errors:
point_source.{x,y,z} for point source mode,{init, load}.If adding a new particle initialization mode:
scripts/picurv,ParticleInitializationType and parser wiring in C,InitializeParticleBasicProperties and any inlet reinit path,For the full selector extension checklist, see Modular Selector Extension Guide.
This page describes Particle Initialization and Restart Guide 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.