Afzal Hussain
This January, during the starting of the 7th semester I completed Andrew Ng’s Deep Learning Specialization from Coursera. This work was motivated by the potential application of deep learning algorithms in mechanical engineering. The core hypothesis was that deep learning models could predict fluid simulation outcomes, which motivated this research.
This report documents the complete pipeline, from simulation generation to deep learning model development and evaluation.
For this research, I have used OpenFOAM, a C++ open source implementation for pre-processing, solving and post-processing CFD simulation. The reason behind choosing OpenFOAM because of its flexibility and automation. Here supersonic flow over a forward-facing step is investigated. The problem description involves a flow of Mach 3 at an inlet to a rectangular geometry with a step near the inlet region that generates shock waves. The geometry is shown below:
This was the most resource-intensive phase — generating sufficiently varied simulations for training requires substantial computational resources. Deep learning requires large datasets; accordingly, thousands of simulations of varying geometries were generated to enable prediction on unseen configurations. For this purpose, I changed the position of step from near the inlet region to the outlet i.e. 0.1 < x < 2.9, ranging it height 0.1 < y < 0.4. This was accomplished via a Python script. Making the dataset contains the following steps:
- Make 1500 random coordinates within some constraints.
- Remove previous simulation file (if it exists).
- Copy the OpenFOAM forwardStep directory.
- Remove blockMeshDict file from system directory.
- Execute
gen_blockMeshDict.pyto write blockMeshDict and cellInformation file. cellInformation consists cell number of three rectangle (x_cell * y_cell) (2D simulation). - Move blockMeshDict file to system directory
- Move cellInformation file to home directory
- Now execute
sim_cmdfrom terminal. - It uses sonicFoam to run simulation.
- And foamToVTK to convert the simulation result into .vtk file.
This process generated approximately 168 GB of raw simulation data. But all this data is not necessary for training, I extract only velocity at x & y direction, pressure, and temperature of each cell. The dl_data_generation script was used for this extraction.
For long-range dependencies in time-series data, LSTM has been using for a longer period of time, that has proven stable and powerful. But typical LSTM implementation deals with 1-D series data only, as fluid simulations involve spatial data, this work employs a variant of LSTM, proposed by X Shi et al., where state-to-state and input-to-state transitions are replaced by convolution operation. The key equations are shown below, where ‘∗’ denotes the convolution operator and ‘◦’ denotes the Hadamard product:
As fluid simulation is time-dependent I have used three TimeDistributed Conv2D followed by a TimeDistributed MaxPooling2D. After that ConvLSTM2D has been performed. This model initially exhibited slow convergence, so a ResNet-style architecture was incorporated to accelerate convergence. Using ResNet has significantly improved the model performance and accuracy. The whole model is shown below:
The model was evaluated on geometries unseen during training. The obtained results are realistic, competitive in accuracy; it successfully shows discontinuities in shock waves, emanating from ahead of the base of the step, and also captures the time-dependent development of the shock-waves. While this work has been performed on one problem specification, it illustrates the viability of data-driven approaches in computational fluid dynamics. Below a comparison between actual simulation and the predicted one by the model is shown for velocity, pressure and temperature at t = 1, 2 & 3 seconds.
In the past few years, deep learning has exhibited unprecedented competency and efficiency in image classification, speech recognition, weather forecasting, self-driving cars and many other domains, due to the large availability of data. In this work, we propose an end-to-end deep learning model operating on spatiotemporal flow field sequences, where both the input and output are grid-based representations of the domain, having convolutional structures in both the input-to-state and state-to-state transitions. The proposed model is trained and evaluated on supersonic flow over a forward-facing step; the obtained results are realistic, competitive in accuracy while illustrating the viability of data-driven approaches in computational fluid dynamics.
Turbulence Modeling Gateway
Maziar Raissi's Research
Data-driven Fluid Simulations using Regression Forests
Convolutional Neural Networks for Steady Flow Approximation
Application of Convolutional Neural Network to Predict Airfoil Lift Coefficient











