Understanding Complex Time-Resolved Flows Using Modal Decomposition

Andre Weiner, Institute of Fluid Mechanics

Overview

Discrete Fourier Transform

01

definition, convergence, averaging

Test case and data

turbulent flow past a 3D cylinder

02

03

Taper-based Spectral POD

definitions, tips & tricks, interpretation

04

Analysis of 3D data

foamToNumpy, Sparse Spatial Sampling

Test Case & Data

O. Lehmkuhl et al. (2013)

Low-frequency unsteadiness in the vortex formation region of a circular cylinder

10.1063/1.4818641

Re = \frac{U_\infty D}{\nu} = 3900

dataset overview (sample plane)

  • ~2200 convective time units (CTU)
  • 10 samples per CTU
  • ~22000 samples in total
  • ~23 GB (binary, single precision)
  • in-plane velocity vector, pressure

Discrete Fourier Transform (DFT)

\hat{x}_{k} = \sum_{j=0}^{N_{\mathrm{fft}}-1} v_j\,x_j\, e^{-\mathrm{i} 2\pi j k / N_{\mathrm{fft}}}

input signal, sample j

sin/cos test signals, sample j, frequency k

window/taper weight

for all samples

complex weight for

f_k
f_\mathrm{max} = f_s/2 = 1/(2\Delta t)
k = 0 \ldots N - 1
f_\mathrm{min} = \Delta f = 1 / (\Delta t N)

*even no. of samples

longer signals improve frequency resolution

faster sampling improves aliasing

usually an issue in CFD

see P. D. Welch (1967)

aptaptive taper selection for each bin

  1. compute amplitudes for an increasing number of tapers
  2. compare the change in amplitude against used-defined tolerance

A. J. Barbour & R. L. Parker (2014), 10.1016/j.cageo.2013.09.015

Taper-based Spectral POD

\mathbf{X} = \mathrm{diag}(\sqrt{\mathbf{w}})\left[\mathbf{x}_1, \mathbf{x}_2,\ldots , \mathbf{x}_N\right]
\mathbf{x}_j = \left[\mathbf{u}_{x,j}/U_\infty, \mathbf{u}_{y,j}/U_\infty, \mathbf{p}_j/U_\infty^2\right]

state vector

\mathbf{x}_j \in \mathbb{R}^{3M\times 1}

masked cells

cell volume/area (repeated)

\mathbf{X} \in \mathbb{R}^{3M\times N}

data matrix

\tilde{\mathbf{X}} = \mathbf{U}^T\mathbf{X}
\mathbf{X} = \mathbf{U\Sigma V}^T

POD basis

\tilde{\mathbf{X}} \in \mathbb{R}^{N\times N}
N \ll M

B. C. Y Yeung & O. T. Schmidt (2024), 10.1007/s00162-024-00695-0

The analysis is exact!

\hat{\mathbf{x}}^{(n)}_{k} = \sum_{j=0}^{N_{\mathrm{fft}}-1} v^{(n)}_{j}\,\tilde{\mathbf{x}}_{j}\, e^{-\mathrm{i} 2\pi j k / N_{\mathrm{fft}}}
\hat{\mathbf{X}}_k = \sqrt{\Delta t} \left[\hat{\mathbf{x}}^{(1)}_k, \hat{\mathbf{x}}^{(2)}_k, \ldots, \hat{\mathbf{x}}^{(N_\mathrm{win})}_k \right]\mathrm{diag}\left(\left[\mu_1, \mu_2, \ldots, \mu_{N_\mathrm{win}}\right]^{1/2}\right)
\hat{\mathbf{X}}_k\hat{\mathbf{X}}_k^\ast \tilde{\mathbf{\Phi}}_k = \tilde{\mathbf{\Phi}}_k \tilde{\mathbf{\Lambda}}_k
\mathbf{\Phi}_k = \mathrm{diag}(1/\sqrt{\mathbf{w}})\mathbf{U}\tilde{\mathbf{\Phi}}_k

vectors

increasing taper penalty

eigenvalue problem

spectral energy

SPOD modes

Analysis of 3D data

foamToNumpy

dataDir       data;

fields
{
    names       (p U);
    dataType    float64;
}

exportData
{
    cellCentre   true;
    cellVolumes  true;
    writeTimes   true;
    dataType     float64;
}

storageOrder   F;         // F or C

time
{
    startTime   0.0;
    endTime     0.5;
    every       1;
}
data/
├── p/
│   ├── p_proc_0.npy
│   └── p_proc_1.npy
└── U/
    ├── U_proc_0.npy
    └── U_proc_1.npy

foamToNumpyDict

processor0/
├── 0.1/
│   ├── p
│   └── U
└── 0.2/
    ├── p
    └── U
processor1/
├── 0.1/
│   ├── p
│   └── U
└── 0.2/
    ├── p
    └── U
...

output

input

numpyToFoam

dataDir    data;

fields     (p U);

time
{
    startTime   0;
    endTime     1;
    deltaT      0.1;
}
data/
├── p/
│   ├── p_proc_0.npy
│   └── p_proc_1.npy
└── U/
    ├── U_proc_0.npy
    └── U_proc_1.npy

numpyToFoamDict

processor0/
├── 0.1/
│   ├── p
│   └── U
└── 0.2/
    ├── p
    └── U
processor1/
├── 0.1/
│   ├── p
│   └── U
└── 0.2/
    ├── p
    └── U
...

input

output

Sparse Spatial Sampling

original mesh/data

(un)refinement metric

new octree mesh

S. Spinner, A. Weiner (2026)

10.1016/j.ast.2026.112661

training GitHub repository

flowTorch library

Thank you!

link to the slides

OFW2026 Training

By Andre Weiner

OFW2026 Training

Slides for the OFW 2026 training

  • 40