Skip to content

Workspace layout

This page names every folder and file of a workspace, says who writes it, and marks the ones that are yours to edit. A workspace is one folder that holds a whole campaign, and its layout is the same for every solver.

The tree

campaign/
  init.toml                     # cfd-workspace init: the solver of this workspace
  inputs/                       # yours: everything a run reads
    matrices/<name>.fs          # the run matrix, one row per simulation
    setups/s<id>.toml           # physical solver setup, named by the SETUP column
    numerics/n<id>.toml         # numerical setup (CFD solvers), named by the NUMERICS column
    references/r<id>.toml       # reference values, named by the REF column
    pproc/p<id>.toml            # post-processing options, named by the PPROC column
    mesh/                       # meshes and geometry files, named by the MESH column
    hpc/h<id>.toml              # cluster profiles (optional)
    executables.toml            # solver builds a row may name (optional)
    executables.local.toml      # this machine's paths for those builds (optional)
    management/<recipe>.toml    # storage recipes (optional)
    sync-workspaces.toml        # other workspaces to sync from (optional)
  sims/                         # cfd-matrix run: one folder per simulation
    sim_<POL>/datapoints/DP-<point name>/
    batch/<matrix>_b<ID>/       # cfd-matrix run --batch N: one folder per grouped job
  post/                         # cfd-matrix plan, collect and post
    <matrix>/plan.json
    <matrix>/campaign_summary.json
    <matrix>/polars/FAM-<KIND>-P<POL>.csv
    <matrix>/polars/P<POL>-<GROUP>-<KIND>.csv
    <matrix>/polars/P<POL>-<ALIAS>_rotor.csv      # a rotor's table (SU2 rotor run types)
    <matrix>/polars/P<POL>_<matrix>_uns_avg.csv   # time-accurate points, window means
    <matrix>/sections/P<POL>/     # Cp and sectional loads declared in the PPROC file
    <matrix>/fields/P<POL>/       # the volume cut declared in the PPROC file
    <matrix>/probes/P<POL>/       # the probes declared in the PPROC file
    <matrix>/products.json
    <matrix>/post.log
  archive/<stamp>/              # earlier evidence, moved here and never deleted
  .input-digests.cache          # digests of large inputs, reused between commands; safe to delete
  runs.json                     # the record of every point that was run
  marks.json                    # verdicts you recorded with mark-failed and mark-converged
  storage_management.json       # the record of every storage command
  logs/                         # what run, collect and post printed, and every warning

cfd-workspace init creates init.toml, sims/, post/, archive/, the input folders matrices, setups, references, pproc, mesh and hpc (the mock solver creates a few more), the file inputs/INPUTS.md, which says what each input file of the solver holds, and inputs/.gitignore. It also adds /.input-digests.cache to the .gitignore of the workspace root. You create inputs/management/ and the optional files when you need them. Every other file appears when the command beside it first runs.

What you write

You edit only inputs/. Nothing a command writes goes there, and nothing you write belongs anywhere else.

File What it holds Named by
inputs/matrices/<name>.fs The run matrix: one row per simulation, with its flight condition and the files it uses. See matrix columns. the name you give cfd-matrix plan <name>
inputs/setups/s<id>.toml How the solver runs: model, numerics, iteration limit. The keys belong to the solver; see its page. the SETUP cell (001 and s001 name s001.toml)
inputs/numerics/n<id>.toml The numerical keys of an SU2, OpenFOAM or PyFR setup: schemes, limiters, CFL, iteration counts, convergence criteria. Several setups can share one file. It may hold no [solver] table and no mesh. Optional: without it the setup file carries the numerics. cfd-workspace init creates the folder for these three solvers. the NUMERICS cell (001 and n001 name n001.toml)
inputs/references/r<id>.toml Reference area, reference length and moment origin, where the solver takes them from a file. the REF cell
inputs/pproc/p<id>.toml What to keep from each run beyond the coefficients. the PPROC cell
inputs/mesh/<file> The mesh or geometry file, in the format the solver reads. the MESH cell

A matrix row names its mesh by file name, for example wing.su2, and the file is read from inputs/mesh/. A stem that names exactly one file there is enough. The folder names inputs/geometry/, inputs/geometries/ and inputs/meshes/ are still read, after inputs/mesh/, with one warning that names the folder to move the files to. A subfolder inputs/geometry/<name>/ that holds a geometry.json sidecar is generated geometry, not a legacy mesh folder: a path inside it is used as named, with no warning.

A mesh is never copied into a simulation folder. Each point folder holds a link to the file in inputs/mesh/, so a large mesh is stored once.

The solver declaration

init.toml binds the workspace to one solver:

schema_version = 1
solver = "su2"

For QPROP the solver is a table, which also holds the settings of its section polars (see QPROP):

schema_version = 1

[solver]
name = "qprop"
section_timeout_s = 60
on_unconverged_section = "warn"

Every command reads it first. A workspace keeps its solver for life: init refuses a folder that already holds an init.toml, and a collect refuses records made by another solver. The solver names are lower case, and cfd-workspace init --help lists them.

init writes this file. You may add workspace solver settings, warning_refusals, large_input_check (see Large inputs) and a [defaults] table of setup keys. A key other than these, a schema_version other than the integer 1 or a solver name that is not in the list is refused by every command, with the name of the file and the problem.

Default setup keys

Use [defaults] to avoid repeating the same setup values for every row:

[defaults]
iterations = 100
cfl = 5

[defaults.solver]
threads = 2

The setup file overrides these values, including individual keys in nested tables. The row's VAR_NAMES_VALUES overrides apply last. Explicit row flight conditions and MESH also replace the corresponding fallback setup values. Explicit setup values still undergo the adapter's normal agreement checks with the row. The point records defaults_omitted, the default keys the row replaced, so planning and execution use the same effective setup. The adapter validates the composed setup, so an unknown default key is refused just like an unknown setup key. Plan again after changing defaults: init.toml is part of every point's input digest.

Input SHA-256 values describe the raw bytes of each file, including line endings. Equivalent text checked out with LF and CRLF has different digests; a checkout that changes line endings after planning requires a new plan. Keep line endings consistent across machines when the same recorded provenance is needed.

What a run writes

cfd-matrix run writes one folder per point:

sims/sim_<POL>/datapoints/DP-<point name>/

<POL> is the row's POL cell and the point name is built from the row's flight condition, so the same operating point has the same folder name in every workspace. The folder holds the input deck written for the solver, the link to the mesh, the solver's own output files, stdout.log and stderr.log. A run on this machine also leaves execution.json, the record of the process that ran.

runs.json, in the workspace root, records every point: its inputs and their hashes, its status, when it started and finished, and the verdict on its convergence. cfd-matrix status and cfd-workspace show, history and log read this file; you never edit it.

Large inputs

A planned input larger than 8 MiB, usually a mesh, is handled by the workspace setting large_input_check in init.toml:

large_input_check = "digest"    # the default
  • "digest" reads the file once, when it is first seen, and records its SHA-256. Every later command compares the file with that digest (through the digest cache below) and checks what needs its contents: the marker names named in [groups], the Gmsh format line, the problem dimension of an SU2 mesh.
  • "identity" never opens the file. Nothing hashes it, scans it, reads it through the link in a point folder or reads its header. Its recorded value is identity:size=<bytes>;mtime_ns=<nanoseconds> instead of a SHA-256, and every later command compares the size and modification time of the file with those two numbers, refusing with "input changed after planning" when either differs. The checks that need the contents are skipped, each with one warning naming what was not checked. When the digest cache already holds the SHA-256 of the unchanged file, that digest is recorded instead, without a read.

The option --no-read-large-inputs of plan, run and collect, or the environment variable CFDBENDER_NO_READ_LARGE_INPUTS=1, gives one command the "identity" behavior. The option cannot be combined with --rehash-inputs, which reads every input again and overrides the environment variable and workspace setting. An empty variable or 0 leaves the setting in charge; every other value, including false and whitespace, enables identity mode. Files of 8 MiB or less are always read and hashed. The FlightStream engine controls its own reads: these identity controls have no effect on that route, and both --no-read-large-inputs and --rehash-inputs are stripped there with a warning.

With the check off, a mesh changed in place or replaced by a different file with the same size and modification time is not detected. File identity here does not compare the inode or creation time. Its contents are never verified: a planned SHA-256 met by a command that does not read the file is accepted with a warning that it was not verified, and a planned identity met by a command that reads large inputs is checked by size and modification time only, with a warning. Plan again with the check on to record a digest. OpenFOAM still reads a mesh whose [groups] give its wall markers, and XFOIL and QPROP still read an airfoil or blade file, because their runs need those bytes.

A run rebuilds its plan in the current mode, so runs.json records that plan's current values, even when its earlier receipt was made in the other mode. Accepting that receipt checks only the size and modification time when either side is an identity, and warns about that weaker check. Exact nanosecond comparison can also refuse unchanged files when copies or mounts report timestamps at different resolutions; no tolerance is applied.

.input-digests.cache, also in the workspace root, lets a large input (above 8 MiB, such as a mesh) be read and hashed once rather than by every command. It holds each such file's size, modification time, change time, SHA-256 and, for an SU2 mesh, its marker names, or, for a Gmsh mesh, its format line and physical names. It is never a planned input and never enters a record, and deleting it loses nothing. A file whose size, timestamps and inode still match is not read again.

A stored digest is reused while the file's size, timestamps and inode are unchanged. The host name, the workspace path and the device number are not checked, so that a workspace on a shared file system can be used from several nodes, for example plan on one login node and run or collect on another. This rule is tested with simulated file identities, not on a real shared file system; where a file system reports unstable inodes or delayed timestamps, use --rehash-inputs. A copy of the workspace has new inodes and is hashed again once. All checks follow symbolic links to the target. On POSIX, ctime is metadata change time: restoring mtime after a write normally still invalidates the entry. On Windows, the ctime that Python reports is the creation time, so an in-place same-size rewrite with restored mtime can remain undetected. Coarse filesystem timestamps can hide same-tick writes on either platform. Use --rehash-inputs after such changes. Files less than two seconds past their newest timestamp (including future-dated files) are not persisted. Timestamps are epoch values, independent of time zone.

What plan, collect and post write

Everything derived from a matrix is under post/<matrix>/:

File Written by Holds
plan.json cfd-matrix plan The plan receipt: the matrix and every input as planned. A run refuses to start when an input changed after it.
campaign_summary.json collect, post Every recorded point with its result.
polars/FAM-<KIND>-P<POL>.csv collect, post One row per point and family: loads (DIM), airframe coefficients (ACOEF), rotor coefficients (RCOEF); see Results.
polars/P<POL>-<GROUP>-<KIND>.csv collect, post One row per point for each group TOTAL, AIRFRAME and each rotor.
polars/P<POL>-<ALIAS>_rotor.csv collect, post pyflightstream's rotor table: one row per point that turns the rotor <ALIAS>; see SU2.
polars/P<POL>_<matrix>_uns_avg.csv collect, post pyflightstream's unsteady polar: one row per time-accurate point, the means over its averaging window.
sections/P<POL>/<point>_cp_<name>.csv, sections/P<POL>/<point>_sloads_<name>.csv collect, post The Cp and the sectional loads of each [[sections.distributions]] entry of the PPROC file; see SU2.
fields/P<POL>/<point>_vsec.vtk or .dat collect, post The [volume_section] of the PPROC file, one file per exported step of a time-accurate point (_step_<STEP>), each with its .provenance.json.
fields/P<POL>/<point>_vsec_<name>.vtk or .dat collect, post Each cut named in [[volume_sections]] of the PPROC file (provisional name), laid out as the single cut, with its .provenance.json.
probes/P<POL>/<point>_probes.csv collect, post The [[probes]] of the PPROC file; _probes_history.csv beside it on a time-accurate row that mixes the two kinds of entry.
products.json collect, post Every product written, and every one skipped with the reason.
post.log collect, post The same, as text.

These files are rebuilt from runs.json and the simulation folders each time, so deleting them loses nothing.

What is kept

Nothing is deleted without a command that says so. Running a point again moves its folder and its record to archive/<stamp>/ first, where <stamp> is the UTC time of the move, and cfd-workspace history lists what is there. cfd-workspace restore brings a file back.

Logs

run, collect and post keep what they print. The commands that only read write nothing.

File Holds
logs/<command>-<stamp>.log Every line one call of run, collect or post printed.
logs/activity.log One line per call: when it started and how it ended. cfd-workspace log lists these with the run events.
logs/warnings.log Every warning, also those that --warning-off kept out of the console.

Version control

cfd-workspace init also adds /.input-digests.cache to the .gitignore of the workspace root. It writes inputs/.gitignore so that executables.local.toml, which holds paths of one machine, stays out of a repository. inputs/ is small text and is worth committing. sims/ and archive/ hold solver output and are usually left out.