Author: Mateo Gutierrez
Turbulence modeling in Computational Fluid Dynamics (CFD) can be extremely time- and resource-intensive when using high-fidelity approaches such as Direct Numerical Simulation (DNS) or Large Eddy Simulation (LES). The objective of this project is to explore the use of Reynolds-Averaged Navier-Stokes (RANS) simulations in conjunction with a Tensor Basis Neural Network (TBNN) to predict the Reynolds stress tensor. This approach aims to enhance the resolution and accuracy of RANS results while maintaining computational efficiency.
The dataset is sourced from Kaggle:
ML Turbulence Dataset – Kaggle
It includes a combination of RANS and DNS/LES data for 29 two-dimensional incompressible flow cases. Each case is stored in .npy format and includes flow variables such as velocity, pressure, turbulence kinetic energy, and Reynolds stresses.
The model used is a Tensor Basis Neural Network (TBNN), based on the formulation by Ling et al. (2016) and Pope (1975). It predicts the anisotropic part of the Reynolds stress tensor using physically invariant input features derived from the mean flow (strain-rate and rotation-rate tensors).
Required Dependencies: torch, numpy, matplotlib, and random.
-
Choose a case:
Set the target dataset and case. Default:- Turbulence model:
komegasst - Case:
CNDV_12600
DNS/LES labels for comparison are found in the
archive/labelsdirectory. - Turbulence model:
-
Set model parameters:
Default TBNN settings:hidden_dim = 256batch_size = 64learning_rate = 1e-5epochs = 200dropout = 0.1
-
Run the model:
Execute the training script. It will train the TBNN on RANS input features and predict the Reynolds stress anisotropy tensor. -
Optional (for tuning):
grid_search.py: Performs randomized hyperparameter tuningoptuna_search.py: Uses Optuna for Bayesian hyperparameter optimization
These scripts are not required for model execution but were used in the tuning phase.
The TBNN model showed strong agreement with DNS/LES results.
-
Quantitative:
- Mean Squared Error (MSE) and Mean Absolute Error (MAE) both converged to values near
$10^{-3}$ after 200 epochs.
- Mean Squared Error (MSE) and Mean Absolute Error (MAE) both converged to values near
-
Qualitative:
- Visualization of the predicted shear stress component
$S_{12}$ closely matched DNS/LES data, capturing key turbulent structures more accurately than traditional RANS models.
- Visualization of the predicted shear stress component
The results validate that TBNNs can effectively bridge the gap between fast, low-fidelity RANS simulations and high-fidelity DNS/LES benchmarks.