|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
The pic-flow script is the primary user interface for the PICurv platform. It is a powerful Python-based "conductor" that automates the entire simulation workflow, from building the source code to launching simulations and post-processing results.
This guide serves as the main reference for all of its commands and command-line arguments. All commands are run from the root directory of your PICurv project.
The script is invoked via ./bin/pic-flow and uses a command-based structure, similar to git.
There are three main commands:
init**: Creates a new study directory from a template.build**: Compiles the C solver and other tools.run**: Executes a simulation or post-processing workflow.You can get help at any time by running:
The init command is used to bootstrap a new simulation study by copying a pre-configured template.
Usage:
Arguments:
<template_name>: (Required) The name of a template directory located in examples/. Common choices are flat_channel or bent_channel.Options:
--dest <new_directory_name>: Specifies a name for the new study directory. If omitted, the directory will be named after the template.--copy-binaries: If this flag is present, the C executables (picsolver, postprocessor) will be physically copied into the new study directory. This creates a fully portable, self-contained study. By default, symbolic links are created instead.Example:
The build command is a wrapper around the project's Makefile. It is used to compile all C source code.
Usage:
Any arguments provided after build are passed directly to the make command.
Examples:
The run command is the most powerful command. It orchestrates the execution of the C-solver and post-processor based on the provided YAML configuration files.
Usage:
Workflow Stages: You must specify at least one of the following stages:
--solve: Executes the picsolver executable. This will create a new, timestamped output directory inside the runs/ folder.--post-process: Executes the postprocessor executable. This can be run on the results of a --solve stage in the same command, or on a previously completed run directory using the --run-dir flag.Input Files:
--case <path/to/case.yml>: (Required for --solve) Path to the case definition file, which specifies the physics and geometry.--solver <path/to/solver.yml>: (Required for --solve) Path to the solver profile, which specifies the numerical strategy.--monitor <path/to/monitor.yml>: (Required for --solve) Path to the monitor profile, which controls I/O and logging.--post <path/to/post.yml>: (Required for --post-process) Path to the post-processing recipe file.--run-dir <path/to/run_directory>: (Required for standalone --post-process) Specifies an existing run directory (e.g., runs/flat_channel_...) to post-process. Not needed if running --solve and --post-process together.Execution Options:
-n, --num-procs <integer>: The number of MPI processes to use for the simulation. Defaults to 1 (serial execution).Examples:
bash ./bin/pic-flow run --solve -n 8 \ --case my_studies/case.yml \ --solver my_studies/solver.yml \ --monitor my_studies/monitor.yml bash ./bin/pic-flow run --solve --post-process -n 8 \ --case my_studies/case.yml \ --solver my_studies/solver.yml \ --monitor my_studies/monitor.yml \ --post my_studies/post-recipe.yml bash ./bin/pic-flow run --post-process \ --run-dir runs/flat_channel_20240401-153000 \ --post my_studies/another-post-recipe.yml Now that you understand how to use the pic-flow conductor, the next step is to learn the details of the configuration files it consumes.
Proceed to the Anatomy of a Simulation: Cases, Solvers, and Monitors to learn about the modularity and versatility of the PICurv which helps you get up and running quickly and enables various experiments.