Pressure Coefficient

The Pressure Coefficient, \(c_p\), is a dimensionless quantity that provides a generalized representation of the pressure distribution on a surface, or body, exposed to a fluid flow. It allows us to assess how the local pressure at a specific point differs from the surrounding free-stream pressure, accounting for the dynamic pressure of the fluid flow.

Definition

The pressure coefficient is a dimensionless form of the pressure signal. It is obtained by the following expression:

\[c_{p}(t) = \frac{p(t) - p_{\infty}(t)}{q}\]

By definition, the pressure coefficient is a local property for each triangle of the mesh.

Use Case

It is used primarily for analysis and interpretation of the measured data.

It should always be generated, since it is the first analysis step. It is a fundamental property of the pressure normalization, and it is used to calculate the other coefficients. However, it is not the final result to be delivered to clients.

Artifacts

The user provides:

  1. Body pressure XDMF+H5: per-timestep pressure on every mesh triangle.

  2. Reference probe XDMF+H5 (optional): atmospheric reference pressure probe signal. If omitted, the reference pressure is taken as 0.

  3. Parameters (CpCaseConfig): adimensionalisation values, statistic list, time-step range. The config can be a YAML file or built in code.

  4. Mesh (optional): .lnas / .stl / .h5 / .xdmf. When omitted, the geometry is read from the body H5’s embedded /Triangles + /Geometry.

Outputs (under the output directory; layout is flat, no subfolders):

  1. cp.{label}.time_series.{h5,xdmf} – per-timestep Cp on the full mesh, ParaView-readable.

  2. stats.{h5,xdmf} – combined statistics for every coefficient in the run, with one <Grid> per leaf group on the matching mesh. Cp lands under /cp/{label}/.

Each output H5 carries the post-processing config under /processing_metadata/ for downstream debugging; read it back with cfdmod.read_processing_metadata().

Usage

A reference parameters file:

pressure_coefficient:
  default:
    # Select the time interval to filter the signal and calculate statistics
    timestep_range: [10000, 20000]
    # Velocity at the building interest height
    simul_U_H: 0.05
    # Simulation characteristic length scale for time scale conversion
    simul_characteristic_length: 0.8445
    # Define which statistics will be calculated
    statistics:
      - stats: "mean"
      - stats: "rms"
      - stats: "skewness"
      - stats: "kurtosis"
      - stats: "mean_eq"
        params:
          scale_factor: 0.61
      - stats: "min"
        params:
          method_type: "Absolute"
      - stats: "max"
        params:
          method_type: "Gumbel"
          peak_duration: 3 # in seconds
          event_duration: 600 # in seconds. Period of extreme event
          n_subdivisions: 10 # Number of subdivisions
          non_exceedance_probability: 0.78 # Confidence parameter in %
          full_scale_U_H: 40
          full_scale_characteristic_length: 22.4
      - stats: "max"
        params:
          method_type: "Peak"
          peak_factor: 3 # xtr = avg +- factor * rms
# Moving-average smoothing is no longer a stats method. To get stats over a
# smoothed signal, run apply_filters([MovingAverageFilter(window=...)]) on
# the cp.*.time_series.h5 first and then run statistics over the filtered
# file. See cfdmod.pressure.filters.

Driving the pipeline from Python:

from cfdmod import run_cp, CpCaseConfig
run_cp(
    body_h5="body.h5",
    probe_h5="probe.h5",                    # or None for zero reference
    cfg_path=CpCaseConfig.from_file("cp.yaml"),
    output="output",
    # mesh_path optional; omitting it reads from body.h5
)

Or via the CLI:

python -m cfdmod pressure cp \
   --body   {BODY_H5} \
   --probe  {PROBE_H5} \
   --config {CONFIG_PATH} \
   --output {OUTPUT_PATH}

The same flow is also exercised in the calculate_cp.ipynb notebook, with a fuller end-to-end version (including container partition, Cf, and Cm) available at notebooks/process_container_pack.ipynb in the repository root.

Data format

Note

For more information about the normalized time scale (\(t^*\)), check the Normalization section

\(c_p(t)\)

time_idx/point_idx

Normalized time (\(t^*\))

0

1

2

0

0.0

1.25

1.15

1.32

0

1.0

1.1

1.5

1.13

\(c_p (stats)\)

scalar

0

1

2

3

min

-1.25

-0.9

-1.1

-0.2

max

1.15

0.95

1.13

0.19

mean

0.83

0.9

0.5

0.13

rms

0.26

0.25

0.13

0.19

skewness

1.15

-0.95

1.13

0.19