Skip to main content

cfdmod

Testing Pipeline Docs Deploy Linting Workflow Release artifacts

Post-processing and geometry-preparation tools for CFD wind-tunnel simulations: pressure (Cp), force (Cf), moment (Cm) and shape (Ce) coefficients; terrain loft and roughness elements; inflow analysis; climate / Weibull / Gumbel statistics; ParaView snapshot automation.

v3 reorganizes post-processing around a single data structure -- the DataSource (elements on one axis, timesteps on the other, named fields plus metadata) -- and composable ops driven by YAML pipeline templates. Every flow (Cp / Cf / Cm / Ce, S1, ...) is now a template run with cfdmod run <template.yaml>; the legacy per-coefficient functions (run_cp / run_cf / ...) and their *CaseConfig models are gone. See docs/source/architecture/v3_migration.md for the mapping and docs/source/architecture/data_sources.md for the paradigm.

Install

Base install (Cp / Cf / Cm / Ce pipeline, IO helpers, CLI):

pip install aerosim-cfdmod

Optional extras:

Extras When you need it
[vtk] ParaView snapshot automation, VTK polydata writers, S1 probe-on-line
[geometry] Altimetry section + loft helpers (trimesh)
[notebook] jupyter / ipykernel for the worked-example notebook
[docs] sphinx + shibuya theme + nbsphinx for make html
[legacy] pandas-HDFStore compat readers (inflow, HFPI static)

Install several at once with pip install "aerosim-cfdmod[vtk,geometry,notebook]".

pymeshlab is intentionally not an extra (its GPL license would force GPL on downstream code). Code paths that genuinely need it expect the user to install it explicitly at their own license risk.

Quickstart

A pipeline is a YAML template: inputs (data sources on disk), a pipeline of ops, and outputs. Run it with the CLI:

cfdmod run path/to/cp.yaml

A minimal Cp template -- subtract a static-pressure probe, divide by the dynamic pressure, reduce to per-triangle statistics:

name: cp
inputs:
  body:                          # surface pressure per triangle per timestep
    kind: surface
    path: bodies.my_case         # -> bodies.my_case.h5 (+ .xdmf)
  p_ref:                         # static reference probe. Must be named points.*
    kind: points
    path: points.static_pressure
pipeline:
  - id: cp_unscaled              # p - p_ref  (column-wise broadcast)
    kind: sub
    source: body
    rhs: p_ref
    field: pressure
    out: cp
  - id: cp_t                     # / dynamic pressure q  (scale = 1/q)
    kind: scale
    source: cp_unscaled
    field: cp
    factor: 800.0
  - id: cp_stats                 # collapse the time axis
    kind: statistics
    source: cp_t
    field: cp
    kinds: [mean, rms, min, max]
outputs:
  cp_timeseries: {source: cp_t, path: out/cp.time_series}
  cp_stats:      {source: cp_stats, path: out/cp.stats}

Or drive it from Python over any storage backend -- the same recipe code runs against an in-memory store (great for notebooks / tests, no files needed) or the on-disk XDMF+H5 store:

from cfdmod import load_template, run_template, XdmfH5Storage

template = load_template("cp.yaml")
bindings = run_template(template, storage=XdmfH5Storage(root="."))
cp_t = bindings["cp_t"]          # a SurfaceDataSource; cp_t.fields.read("cp")

load_template validates the whole template up front (unknown op kinds, dangling source/rhs refs, duplicate ids, typo'd fields) before any file is read.

Filename convention: the XDMF+H5 storage infers a source's kind from its filename -- a probe must be named points.* to load as a points source; everything else loads as a surface. The kind: you declare in the template is checked against the loaded kind.

Cf / Cm / Ce build on a Cp time series by attaching the mesh (mesh_attach), grouping triangles (body_grouping / zoning_grouping), and aggregating (force_contribution / moment_contribution + field_series_for_groups). Complete, runnable templates for all four ship under fixtures/tests/pressure/templates/.

Examples

  • Tutorials (notebooks/tutorials/): 01_data_sources -> 02_recipes -> 03_pipelines -> 04_containers, building from the data structure to full pipelines. All run on synthetic data with no fixtures.
  • Per-coefficient walkthroughs (docs/source/use_cases/pressure/coefficients/): calculate_{cp,Cf,Cm,Ce}.ipynb run the shipped templates against the bundled galpao wind-tunnel fixture.
  • End-to-end (examples/container_pack/process_container_pack.ipynb): a Cp/Cf/Cm/Ce pipeline over a multi-container body.
  • High-rise suite (examples/high_rise/): staged wind-load post-processing (inflow -> Cp -> per-floor Cf/Cm -> dynamic -> facade -> structure).
  • Template reference: fixtures/tests/pressure/templates/{cp,cf,cm,ce}.yaml.

Smoothing as a pipeline step

Signal smoothing is just another op -- insert a moving_average step and downstream ops consume the smoothed field. The window is in the source's time units; no implicit unit conversion.

  - id: cp_smoothed
    kind: moving_average
    source: cp_t
    field: cp
    window: 3.0
    out: cp

CLI

cfdmod run <template.yaml>     # run a v3 pipeline template
cfdmod loft ...                # terrain loft surfaces
cfdmod roughness ...           # roughness elements (linear / radial)
cfdmod regroup ...             # split/reorder mesh triangles via a grouping chain
cfdmod altimetry ...           # altimetry section profiles

python -m cfdmod <command> works identically. cfdmod run prints a one-line error (not a traceback) on a bad template and exits non-zero.

Development

Tests

The suite is grouped by pytest markers:

uv run pytest                          # full default suite (excludes -m perf)
uv run pytest -m unit                  # pure-function tests
uv run pytest -m integration           # end-to-end pipeline tests
uv run pytest -m perf                  # opt-in synthetic big-data benchmarks
uv run pytest tests/core tests/adapters  # the v3 data-source / storage layer

The perf run writes a markdown + JSON report (Python heap peak + RSS per scale) to output/perf/perf_report.{md,json} so regressions across releases are tracked over time.

Tox

uv run tox

Memory profiling

pip install -U memory-profiler
mprof run -C -M python path_to_script.py
mprof plot

Schemas

Generate JSON Schema for every config model:

uv run python -m scripts.generate_schemas

In VSCode, point yaml.schemas at the generated file:

"yaml.schemas": {
    "file:///path/to/cfdmod/output/schema-cfdmod.json": "**/cfdmod/**/*.yaml"
}

Metadata

Release files for aerosim-cfdmod 3.9.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aerosim-cfdmod 3.9.2
File Size Uploaded Provenance Actions
aerosim_cfdmod-3.9.2.tar.gz 279.8 kB Without provenance Details for aerosim_cfdmod-3.9.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aerosim-cfdmod 3.9.2
File Interpreter ABI Platform Actions
aerosim_cfdmod-3.9.2-py3-none-any.whl Python 3 none any Details for aerosim_cfdmod-3.9.2-py3-none-any.whl

Total release size: 657.6 kB

Release files / aerosim_cfdmod-3.9.2.tar.gz

Download URL aerosim_cfdmod-3.9.2.tar.gz
Size 279.8 kB
Tags Source
SHA-256 checksum
How to use checksums
48fc1ff9e0f842fe4910fedd3ba99dd2ae68b2ceca4ac06c14fe170300184b52
BLAKE2b-256 checksum
How to use checksums
4d38719aa754fe7315b92c07f3d2f0cddd5d6bd68295c4f92c66e363e8cb1fb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / aerosim_cfdmod-3.9.2-py3-none-any.whl

Download URL aerosim_cfdmod-3.9.2-py3-none-any.whl
Size 377.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0d6f71f38cb928b1b91d6a19d64163c5e603428b203b045209293d6b6a6edb9
BLAKE2b-256 checksum
How to use checksums
3e77eb7c39420facfddc0477429c6fb60e52a0836ca458d382eac108027788f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for aerosim-cfdmod 3.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page