Karman Vortex with OpenFOAM

Motivation

Since the end of last year, I have been studying PINNs, learning models using the PINNs method for 2-dimensional fluids, and using those models to make inferences. It was not easy to show the results of the paper I referred to, and I had some difficulties. As I wrote in the “Summary” section of this post, I was thinking of trying to predict the Karman’s vortex street using the PINNs method.

In the course of my research, I learned from this paper that “data-free PINNs are unable to predict vortex shedding”. If that is the case, I decided to try simulating the Karman’s vortex in OpenFOAM first.

This post is a summary of my simulation of the Karman’s vortex in OpenFOAM.

Sources

  1. Predictive Limitations of Physics-Informed Neural Networks in Vortex Shedding - In this overview, “data-free PINNs are unable to predict vortex shedding”. Then it also said that Data-driven PINN exhibits vortex shedding only while the training data (from a traditional CFD solver) is available. Reading the text seems to be a hurdle for me!
  2. barbagroup/jsc_paper_pinn - The github page of the authors of the above paper. In addition to the manuscript of the paper, the authors have compiled data on the use of a fluid solver called PetIBM and Modulus. The authors seem to have validated using Modulus as PINNs.
  3. Fluid Analysis around a 2D Cylinder in OpenFOAM (Verification of Dynamical Similarity) - The authors verified that the flow pattern is determined by the Reynolds number (Re), using different size models.
  4. [Understanding the von Karman Vortex Street with OpenFOAM 11](https://blog.sam-mousavi.com/2024/06/understanding-the-von-karman-vortex- street-with-openfoam-11/) - A blog post about using OpenFOAM to understand the Karman vortex. The author is a chemical engineering researcher.
  5. von Karman Vortex Street Simulation with OpenFOAM 11 - Github of the above blog post. You can download OpenFOAM data.
  6. Vortex shedding by Joel Guerrero 2D - This page has a tutorial called “2D Circular cylinder - Vortex shedding”. This tutorial is part of a wiki page maintained by OpenFOAM.com. This tutorial is “Fourth simulation - Vortex shedding”, part of the “First glimpse” series. It is also part of the “Day 8” turbulence modeling in the “3 weeks” series.

Running the tutorial

Among the information sources 3. to 6. on OpenFOAM, I decided to follow the tutorial in source 6. which can be tried right away. The procedure for downloading and executing the necessary files is as follows.

Download the necessary files

Download and extract “vortex_shedding.tar.gz” from the link “You can download the case files at the following” on the page of Source 6.

Case used

Once unzipped, open the text “README.CASES”, read the description of each case and decided to run “c14” (Re=10000, turbulent model) Copy the c14 directory to an area accessible by OpenFOAM.

Run c14

Execute the command according to “README.FIRST” and you can see the Karman’s vortex in ParaView.

“pimpleFoam | tee log” takes time. On my environment (Xeon E5-1620 3.6GHz 64GB memory), it took about 30 minutes.

Visualization with ParaView

After creating the “c14.foam” file in the “c14” directory, open it with ParaView.

The following movie shows the animation of the time step results in ParaView and a recording of the screen.

Vortex

Summary

By using the files published by our predecessors, I was able to obtain simulation results of the Karman’s vortex street in my environment very easily. Thanks again to the efforts of our predecessors.

The tutorial case I downloaded this time also included laminar flow, so I would like to compare the OpenFOAM results with the PINNs results. After that, I would like to increase the Reynolds number to see if the twin vortices occur in OpenFOAM and see what happens in PINNs.