The Python tools a user calls. Each runs from the root of a checkout as
python PATH. This list comes from their argument parsers and exit statements.
Several write files: give each a new --output, and read the source of a script
before running it with other arguments.
Native scripts need the release binary (cargo build --release -p cfd-craft-cli).
The scripts find it at target/release/cfd-craft; --binary overrides that.
OpenFOAM scripts need --foam-root, the Foundation 13 runtime that
integrations/install_openfoam13.py
stages. The map and street converters need Shapely
(integrations/requirements-urban.txt). The mobile study needs the packages
of integrations/requirements-mobile.txt and the example binary
target/release/examples/mobile_response
(cargo build --release --locked -p cfd-craft --example mobile_response).
A script exits 0 when its checks passed and 1 when they did not or its input was
invalid, unless the table says otherwise. Exit 2 means the work completed without
accepted evidence (the convention of the native CLI). Failures carry a code from
diagnostics. No exit code sets physical qualification.
Guide chapters 22,
23 and
24 use these scripts. Each --output
must not exist yet.
Script
Arguments
Result
integrations/urban_map.py
SOURCE --output DIR --crop XMIN YMIN XMAX YMAX --cell-m M --coordinate-system TEXT --license TEXT --attribution TEXT [--template CASE] [--rotation-deg DEG] [--height-attribute height] [--max-ground-range-m 0.5] [--ensemble-clearance] [--binary PATH]
Input: building footprints as GeoJSON polygons or CityJSON solids in projected meters. Output: case.json with polygon prisms, check.json (the report of cfd-craft check) and map-provenance.json (input hash, license, crop, rotation, assumed heights, dropped buildings). --template (default cases/canyon/wh1-wind270.json) supplies flow, numerics and budgets. Exit 1 with CFD-M001
integrations/traffic_sources.py
--case CASE --map-provenance FILE --streets GEOJSON --rates CSV --height-m M --output DIR [--binary PATH] [--street-id-property id] [--street-license TEXT] [--street-attribution TEXT] [--rates-description TEXT]
Input: a converted case with its provenance, street centerlines in the same coordinates and a CSV with street_id, constituent, rate_kg_s_m, units. Output: case.json with added line sources, traffic-provenance.json, check.json, check.stderr. Exit 1 with CFD-M002 and a diagnostic.json (input contract)
validation/urban_campaign.py run
CASE --output DIR [--binary PATH] [--run-budget-s 120] [--campaign-budget-s 1200] [--threads 1] [--workers 2] [--map-provenance FILE] [--runner PATH]
Input: a neutral_rans case. Runs the wind directions 0, 30, …, 330 degrees from cold starts. Output: campaign-plan.json (written first), one folder wind-DDD per direction with the consumed case, the run archive, the independent field check and result.json, then results.json and report.json. Exit 0 when all twelve are accepted within the campaign budget, 2 otherwise. --runner sends the directions through optimization-run
validation/urban_campaign.py worker
JOB [--binary PATH]
Runs the one direction that a job.json of the campaign describes. The campaign and the job launcher integrations/launch_urban_command.py call it
integrations/virtual_ride.py
RUN_DIR --constituent ID --path ID --speed-m-s V --sampling-interval-s S --output FILE [--response-time-s 0] [--initial-kg-m3 C]
Input: an accepted steady run archive with a path receptor. Output: a JSON file (cfd-craft.virtual-ride/0.1) with times, positions, the field along the ride and the reading of a first-order sensor; prints the number of readings. Exit 1 with CFD-M004
tutorials/mobile_measurements.py run
--output DIR [--preset source-response|canyon] [--config PLAN.json] [--binary PATH]
Runs a source-inference study: per wind one flow, one frozen-flow transport run per source group and one reference run; then the ride response matrix, the fit, pass planning and route selection. Output: frozen-study-plan.json (written first), the archives per wind, mobile-response-matrix.json, virtual-observations.csv, report.json. Exit 0 when every check of the plan passes, 2 otherwise, 1 with CFD-M003 for invalid input. --binary is the mobile_response example
Input: a response matrix of run and a CSV with wind,ride,sample_index,concentration_kg_m3. Output: fitted multipliers, rank and ambiguous combinations, held-out error and the hashes of both inputs. Exit 1 with CFD-M003
validation/summarize_urban.py
EVIDENCE_DIR --output FILE
Summarizes the directory layout of the urban evidence record: paired default and multigrid runs, district campaigns, failed rows included
integrations/mobile_inference.py is a module, not a command: identifiability,
infer_sources, required_passes, route_information and select_routes
are the functions behind chapter 24. integrations/urban_job.py stages the
campaign directions as jobs of optimization-run
(chapter 14).