|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
This page documents how PICurv initializes Eulerian velocity fields and particles at startup. It covers both user-facing YAML inputs and the C implementation path that applies them.
Startup sequence:
picurv_cli/core.py resolves built-in, file, or external-generator YAML.Ucont; existing finalization then applies boundary values and derives the remaining velocity state.The canonical contract has two modes: generated and file. Generated ICs may use a built-in C generator or the repository generators/ic.gen utility. Both produce the same solver-facing result: one initial velocity field.
Built-in zero:
Built-in Cartesian constant:
Built-in streamwise constant:
Built-in Poiseuille:
File-backed Ucat or Ucont:
The input must be one PETSc binary .dat vector readable by ReadFieldData. Ucat inputs are converted by Cart2Contra; Ucont inputs are used directly. The first implementation supports one block only because it intentionally reuses the existing single-field ReadFieldData path.
Repository generator:
The launcher invokes generators/ic.gen by default, or the optional case-relative/absolute params.script override, as:
picurv run --solve materializes the result after grid preparation. picurv precompute --case ... materializes and stages the same artifact without running the solver.
The repository ic.gen accepts an INI [expression] section. Ucat configs define u, v, and w, evaluated at actual cell centers with extrapolated dummy-cell centers. Ucont configs define u_xi, u_eta, and u_zeta, evaluated at their corresponding geometric face centers. Expressions may use x/y/z, normalized logical xi/eta/zeta, storage i/j/k, pi, and the documented numerical functions. The first implementation supports one block. The repository generator requires a staged PICGRID. grid.mode: file and grid.mode: grid_gen provide that grid directly; for single-block grid.mode: programmatic_c, the launcher materializes a nondimensional config/grid.run bridge from scalar programmatic_settings before invoking ic.gen.
The launcher maps the contract to one InitialConditionMode:
| Initial-condition selection | C mode |
|---|---|
generator: zero | IC_MODE_ZERO |
generator: constant | IC_MODE_CONSTANT_CARTESIAN |
generator: streamwise_constant | IC_MODE_CONSTANT_STREAMWISE |
generator: poiseuille | IC_MODE_POISEUILLE |
mode: file or generator: ic_gen | IC_MODE_FILE |
PopulateInitialUcont is the fresh-solve dispatcher. Built-in modes reuse SetInitialInteriorField and UniformCart2Contra. File mode reuses ReadFieldData; when its field selector is Ucat, Cart2Contra converts the loaded vector field to Ucont. After that point, the existing finalization path treats every IC source identically.
eulerian_field_source=solve and StartStep == 0 consumes initial_conditions.eulerian_field_source=solve and StartStep > 0 consumes the restart path.eulerian_field_source=load consumes the existing load path.eulerian_field_source=analytical consumes the analytical initializer.Thus eulerian_field_source supersedes initial_conditions; the launcher does not materialize a configured file or ic_gen artifact when another source has authority.
Operational note:
StartStep identifies the saved restart state being loaded, not the first new step to compute.N, restart with start_step: N; the first newly advanced step will be N+1.Particle initialization is configured in case.yml -> models.physics.particles, but executed by a separate subsystem.
For full particle mode and restart details, use:
After startup, confirm:
Ucat/Ucont fields.Common pitfalls:
Poiseuille in strongly non-rectangular topology and expecting a textbook cylindrical profile,Vmax,flow_direction when the domain is fully periodic (no INLET face),u_physical directly to Ucont without accounting for metric-face scaling.This page describes Initial Condition Modes 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.