Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
pykitPIV 1.0 documentation
Logo
pykitPIV 1.0 documentation

Installation

  • Installation instruction

Preliminaries

  • Virtual wind tunnel with pykitPIV
  • Indexing convention
  • Randomization of experimental settings
  • Image generation parameters cheatsheet

Quickstart

  • Quickstart your image generation
  • A gallery of examples

User Guide

  • Class: Particle
  • Class: FlowField
  • Class: Motion
  • Class: Image
  • Class: Postprocess
  • Module: ml

Tutorials

  • Generate synthetic PIV images
  • Image statistics
  • Radial flows
  • Potential flows
  • Simplified Langevin model (SLM)
  • Upload an external velocity field
  • Generate temporal sequence of PIV images
  • Postprocess PIV images
  • Feature size estimation tool for PIV images
  • Create a PyTorch data loader
  • Integrate synthetic image generation with training a convolutional neural network (CNN)
  • Create a Gymnasium reinforcement learning environment
  • Single deep Q-learning
  • Upload a trained reinforcement learning model
  • Modeling out-of-plane particles
  • Modeling astigmatic PIV
  • Generate synthetic BOS images
  • Computing sensory cues and rewards for reinforcement learning
  • Double deep Q-learning with memory replay
  • Create a TensorFlow or Keras data loader
  • Train a convolutional variational autoencoder (CVAE)
  • Synthetic PIV of a Taylor-Green vortex
  • Single convolutional deep Q-learning
Back to top
View this page

A gallery of examples¶

Virtual PIV of a Taylor-Green vortex¶

You can find the complete tutorial here: demo-pykitPIV-07-generate-temporal-sequence-of-images.ipynb.

../_images/animate-taylor-green-vortex-PIV.gif

Virtual PIV with a compressible/incompressible flow¶

You can find the complete tutorial here: demo-pykitPIV-07-generate-temporal-sequence-of-images.ipynb.

Below, we show two flow cases:

  • a compressible flow, where \(\nabla \cdot \vec{\mathbf{V}} \neq 0\)

  • an incompressible (potential) flow, where \(\nabla \cdot \vec{\mathbf{V}} = 0\)

Notably, the compressible flow leads to clustering of particles in the regions of strongest divergence, while the incompressible flow, having zero divergence, cannot lead to clustering of particles.

../_images/animate-compressible-PIV.gif ../_images/animate-incompressible-PIV.gif

Virtual PIV environment for reinforcement learning¶

You can find the complete tutorial here: demo-pykitPIV-13-SingleDQN-RL-find-sources-and-sinks.ipynb.

The functionalities from the machine learning module can be used to train a reinforcement learning (RL) agent to navigate the virtual PIV camera towards sources/sinks in a radial flow. The agent can perform one of the five actions:

  • Move up

  • Move down

  • Move right

  • Move left

  • Stay

on the virtual camera, thereby with each step it moves the virtual PIV camera in 2D by \(N\) pixels.

../_images/PIVEnv.svg

Variational-generative approach for creating new training samples¶

You can find the complete tutorial here: demo-pykitPIV-21-convolutional-variational-autoencoder.ipynb.

The functionalities from the machine learning module can be used to train a convolutional variational autoencoder (CVAE). The trained CVAE model generates new velocity fields (\(u\) and \(v\) components) that belong to the distribution of some experimental data. New PIV snapshots can then be generated with the newly generated velocity fields. Hence, this approach can be used to extend the training data for transfer learning and can help adapt a machine learning model to the changing experimental conditions. Potentially, the simplified Langevin model (SLM) can be added atop the generated flow field samples to mitigate the smoothing effect that the variational autoencoder has.

../_images/PIVCVAE.svg
Next
Class: Particle
Previous
Quickstart your image generation
Copyright © 2025, Kamila Zdybał, Claudio Mucignat, Stefan Kunz, Ivan Lunati
Made with Sphinx and @pradyunsg's Furo
On this page
  • A gallery of examples
    • Virtual PIV of a Taylor-Green vortex
    • Virtual PIV with a compressible/incompressible flow
    • Virtual PIV environment for reinforcement learning
    • Variational-generative approach for creating new training samples