The lack of large reliable data sets in fluid dynamics for deep learning

Fluid flow method using regression forest method by Ladicky et. al (Source)

Deep learning has gained prominence in varied sectors. Fluid dynamics simulations and experiments have also been explored to improve predictions over the past few years.

Ladicky et. al has explored a novel idea combining machine learning with fluid dynamics simulation. Here they made use of physics-based simulation as a regression problem, estimating the acceleration of every particle in every frame. The created a feature vector, directly modeling individual forces and constraints from the Navier-Stokes equations, predicting reliably the positions and velocities of particles in large time step on an unseen test video. A large training set of simulations obtained using traditional solvers were used for training using regression forest to obtain an approximate behavior of particles. Simulations like these reduce the need for computational resources for high-resolution real-time simulation.

“Given the inherent difficulties of long-term predictions, our vision for CFD in 2030 is grounded on a desired set of capabilities that must be present for a radical improvement in CFD predictions of critical flow phenomena associated with the key aerospace product/application categories, including commercial and military aircraft, engine propulsion, rotorcraft, space exploration systems, launch vehicle programs, air-breathing space-access configurations, and spacecraft entry, descent, and landing (EDL). “- NASA’s CFD Vision 2030 Study: A Path to Revolutionary Computational Aerosciences (NASA/CR–2014-218178

Modern day simulations in fluid dynamics have reached its pinnacle with traditional turbulence modelling. In NASA’s CFD Vision 2030 Study: A Path to Revolutionary Computational Aerosciences (NASA/CR–2014-218178) report the most critical area in CFD simulation capability that will remain a pacing item by 2030 will be the ability to adequately predict viscous turbulent flows with possible boundary layer transition and flow separation present.

But modeling knowledge and predictive capabilities can be built only on the basis of good data under varied conditions. The single thing that the fluid dynamics community suffers in the lack of reliable data under different conditions and for different applications. Training, algorithms, modeling techniques and machine learning approaches are secondary to develop data-driven turbulence modeling capabilities. This necessitates a global repository or database of reliable data both experimental and computational, where researchers from around the globe can pool in data and can benefit researchers focused on data-driven fluid dynamic simulations. Such a repository would open up better capabilities of predicting fluid dynamics and understanding flow in varied areas of interest unlike anything seen in history.

Installing Tensorflow(GPU), OpenCV and dlib on Ubuntu 18.04 Bionic Beaver

Image source:

For those who are ready for machine learning and computer vision with the updated versions of OpenCV, dlib, Tensorflow (GPU) on the Bionic Beaver.

Install synaptic and atom from Ubuntu’s package manager

sudo ubuntu-drivers autoinstall
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

search and install nvidia-390 from synaptic

Download CUDA 9.0 (It has to be 9.0 for Tensorflow 1.8):

And Download cuDNN v7.1.3 for CUDA 9.0:

sudo chmod +x
sudo chmod +x
sudo chmod +x
sudo ./ --override
sudo ./
sudo ./

DO NOT INSTALL THE DRIVER AND SAMPLES IN THIS PART! Ignore the fact that they give you a warning for the driver not being installed. This is because the installer cannot detect the installed driver in your system, which we installed earlier through synaptic.

sudo apt-get install cuda-9
sudo apt-get upgrade
tar -zxvf cudnn-9.0-linux-x64-v7.1.tgz
sudo cp -P cuda/lib64/* /usr/local/cuda-9.0/lib64/
sudo cp  cuda/include/* /usr/local/cuda-9.0/include/
sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h
sudo apt-get install libcupti-dev
sudo atom ~/.bashrc

And add these lines:

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

source ~/.bashrc
sudo apt-get update
sudo apt-get install build-essential cmake libopenblas-dev liblapack-dev libx11-dev libgtk-3-dev python python-dev python-pip python3 python3-dev python3-pip

Download and install Anaconda Python 3.6 (I use 3.6 universally and 2.7 for scientific computations)

Create environment using an environment name (envname)

conda create -n envname python=2.7
source activate envname
pip install numpy pillow lxml jupyter matplotlib dlib protobuf
sudo apt -y install python-opencv
conda install -c conda-forge opencv 
sudo snap install protobuf --classic
pip install --upgrade tensorflow-gpu

To KILL process and clear memory of GPU:


and kill the process causing unwanted memory usage

sudo kill -20483 PID.

Ubuntu 18.04 LTS (Bionic Beaver) – A powerful platform for a multitude of applications

Image source:

The heavily revamped Ubuntu comes with GNOME shell instead of unity, Snap apps and a software center where (finally!) we don’t have to search the web for an updated version of any software! The team at Canonical has added many features which have made the platform easy to use and powerful for programming. Canonical’s LivePatch can be used for critical updates without the need for rebooting the computer. The only issue I found was the boot issue with my laptop post-installation. The following fix can be applied to solve the problem.

Fixing boot problems with Ubuntu 18.04 LTS (Bionic Beaver)

Intel Virtualization Technology: Enabled
VT-d: Enabled
Hyper-threading: Enabled
CPU C states: Disabled
Fast Boot: Enabled
Boot mode select: UEFI
Secure Boot: Disabled
Secure Boot Mode: Standard

In: /etc/default/grub, change:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi= acpi_backlight=none acpi=ht pci=nomsi"

Then run: sudo update-grub

The original work of M.J. Boussinesq published in 1913

Annals of Chemistry and of Physics - 1913

In was the search of the original article “The application of the formula for surface viscosity to the surface of a slowly falling droplet in the midst of a large unlimited amount of fluid which is at rest and possesses a smaller specific gravity” published by M.J. Boussinesq which was published in originally in French in the Annales de Chimie et de physique (Annals of Chemistry and of Physics) published in 1913. The paper formed the basis of the legendary Boussinesq-Scriven stress model. I found the volume of the scientific journal in a French library repository and is sharing the same here:

M.J. Boussinesq, “The application of the formula for surface viscosity to the
surface of a slowly falling droplet in the midst of a large unlimited amount
of fluid which is at rest and possesses a smaller specific gravity,” Ann. Chem.
Phys., vol. 29, pp. 357–364, 1913

Interesting publications in fluid dynamics using neural networks

Image source:  Oreilly – A look at deep learning for science

“Turbulence was probably invented by the Devil on the seventh day of Creation when the Good Lord wasn’t looking.” Peter Bradshaw (1994)

Recently, I came across a few interesting publications in fluid dynamics domain focusing on the use of neural networks. The use of neural networks is popular in varied areas including self-driving cars. The use of neural networks has started leaving its footprints in fluid dynamics, especially in turbulence modeling. A recent article in the Journal of Fluid Mechanics by José Nathan Kutz provided an overview of Deep learning in fluid dynamics.

The article mentions the publication by Ling et al. titled: “Reynolds averaged turbulence modelling using deep neural networks with embedded invariance“, as one of first to apply a true DNN architecture, specifically to Reynolds averaged Navier Stokes turbulence models. The paper by Ling et al. focuses on the fact demand for improved Reynolds-averaged Navier–Stokes (RANS) turbulence models that are informed by and can represent a richer set of turbulence physics, and the method they used to learn a model for the Reynolds stress anisotropy tensor from high-fidelity simulation data. The paper showed that the neural network architecture provided improved prediction accuracy  and significant improvement in comparison to baseline RANS linear eddy viscosity and nonlinear eddy viscosity, models.

In May 2017, Gamahara et al. published a paper in Physical Review Fluids titled: Searching for turbulence models by artificial neural network. The work  demonstrated the use of the artificial neural network (ANN) as a tool for finding a new subgrid model of the subgrid-scale (SGS) stress in large-eddy simulation. The paper concludes that the results confirm that the ANN is a promising tool for establishing a new subgrid model with further improvement.

These interesting research papers point to the growing importance of deep neural networks in the area of fluid dynamics and turbulence modeling. It was rightly said that by Peter Bradshaw that  “Turbulence was probably invented by the Devil on the seventh day of Creation when the Good Lord wasn’t looking.”  and maybe the advances in machine learning and neural networks, would provide at least some of the answers humans have been seeking for a long time. 


Machine learning to improve experimental fluid flow analysis

Most analysis in experimental fluid dynamics uses techniques to track flow, by seeding the flow with particles. Humans with eye and the extraordinarily fascinating brain are undoubtedly the best system to identify and track moving objects or particles. The only issue with that is,  human beings are slower for tracking thousands of particles/ objects over time, get tired over time and can sometimes lead to error as a result of tiredness/ fatigue.

Most popular experimental techniques in the fluid flow analysis domain include particle image velocimetry- PIV (used for a high density of particles) and particle tracking velocimetry-PTV. The accuracy of both the methods depends on the algorithm used, the quality of images and the validation to ground truth. Most major companies that produce these PIV and PTV systems such as Dantec Dynamics have a pre-calibrated system and employ robust methods, which yield results that are ready for publication. However, the use of free and open source software, often untested for a given condition and set of particles, produce erroneous results. In the case of PTV systems, there is another complication; this arises due to the existence of particle tracking methods used by surface chemists(e.g., to look at Brownian motion), that produce inaccurate results when used for fluid dynamic analysis.  A classic example of this transpired when I used a particle tracking system used by surface chemists, which produced erroneous results for an oscillatory flow. However, when I used a correction factor calculation called “drift,” used to correct the velocity of particles when the flow field varies as a result of variation in the fluid containment such as in the case of a shaking beaker, there was a much better result, but still not accurate enough. Hence, such algorithms can cause serious errors and wrong interpretation of results, when used to look at fluid dynamics analysis.

The advent of new technologies and advanced machine learning techniques and state-of-the-art tools such as Tensorflow and DLib C++ can resolve such errors, producing highly accurate results and better interpretation of physics. These revolutionary technologies can help us understand fluid dynamics better than yesteryears.

Remote lab and 3D reconstruction of confocal images


The technological advancements of the age have enabled us to do things which were considered almost impossible just over a few years ago.

For the first time, last month, I started setting up remote access to lab experiments for monitoring and control of experiments. This enables monitoring and administration of operations at night without being in the lab physically.

I have experimented with machine learning methods for image classification and tracking, though it is still in its infancy and the technology needs improvement.

The use of 3D reconstruction of amyloid fibril structure obtained from confocal imagery will provide better information about the structure of fibrils.

Confocal image of fibril
Confocal Z-slice image of fibril

3D reconstructed fibril
3D reconstructed fibril 










Deep convolutional neural network for unbiased classification of amyloid fibrils from salt crystals

Image source: “New clues illuminate Alzheimer’s roots”-

I am using machine learning in python along with the use of libraries such as Tensorflow and scikit-learn. Recently I re-trained the Google’s inception model to learn and classify what microscopic images look like for amyloid fibrils and for samples one thinks as fibrils but are salt crystals from a buffer solution of NaCl.  The system was designed to provide an unbiased classification(removing expert bias). The Google’s inception model v3 was re-trained on thousands of images of amyloid fibrils and salt crystals taken from peer reviewed journals.


Results of running sample cases