Code
Largeeddy simulation toolbox ‘lesTools’
lesTools is a toolbox of MATLAB scripts that can aid in the construction and assessment of subgridscale models for largeeddy simulations of turbulent flows.
Currently, lesTools consists of two modules. The first module can be used to study the statistical behavior of physical quantities that are based on the velocity gradient of turbulent flows. The second module can be used to study the nearwall scaling behavior of quantities that are based on the velocity field of incompressible turbulent flows.
Flow statistics
Background
Largeeddy simulation is a powerful methodology for the numerical prediction of the behavior of turbulent flows. In largeeddy simulation, the large scales of motion in flows are explicitly computed, whereas the effects of the smallscale motions are modeled using subgridscale models (see, e.g., the monographs by Sagaut [1] and Pope [2]). Most subgridscale models can, however, only be used in a practical largeeddy simulation, once the value of one or more model constants has been determined.
The model constants of eddy viscosity models can be estimated using a simple dissipation argument. One requires that the average subgrid dissipation due to an eddy viscosity model matches the average dissipation of the Smagorinsky model [3, 4, 5, 6]. The average subgrid dissipation of a subgridscale model can, for example, be computed using the velocity field of a homogeneous isotropic turbulent flow, either coming from an experiment or a numerical simulation [3]. Alternatively, the subgrid dissipation can be estimated using a large number of synthetic velocity gradients, given by random matrices [4, 5] that may be sampled from a uniform distribution [6]. One subsequently equates the average subgrid dissipation from the eddy viscosity model of interest with the average dissipation of the Smagorinsky model to obtain an estimate of the sought model constant in terms of the Smagorinsky constant.
The above dissipation estimate cannot be used to determine the model constant of subgridscale model terms that are nondissipative. Consider, for example, nonlinear terms that are proportional to the commutator of the rateofstrain and rateofrotation tensors [7, 8]. We can, however, determine the desired order of magnitude of the model constant of such a nonlinear term as follows [8]. We first determine the average value of the coefficient that accompanies the nonlinear term. To obtain an estimate of the model constant of the nonlinear term, we then compare this average with the proportionality constant of 1 / 12 of the same nonlinear term in the gradient model, which forms the lowestorder Taylor series approximation of the turbulent stress tensor in terms of the filter length.
Module
The flowStats module of lesTools provides scripts that facilitate the determination of the statistical behavior of physical quantities that are based on the velocity gradient of turbulent flows. In particular, this module can be used to determine the average dissipation and the average model coefficients of subgridscale models. We can, thus, use this module to estimate the model constants of subgridscale models for largeeddy simulation [6, 7, 8].
Usage
Usage of the MATLAB scripts of the flowStats module is explained in detail in the readme in the flowStats folder of this toolbox.
Depending on your purposes, please consider citing the work by Silvis et al. [6] and/or Silvis et al. [8] when making use of the flowStats module.
Acknowledgments
Mirko Signorelli is kindly acknowledged for his assistance in determining the accuracy of the flow statistics.
Nearwall scaling behavior
Background
Using numerical simulations, Chapman and Kuhn [9] revealed the limiting powerlaw behavior of incompressible turbulence near a solid wall. Among other things, they determined the scaling behavior of the Reynolds stresses in terms of the wallnormal distance. To ensure that, for example, the dissipation of kinetic energy near solid walls is properly captured, subgridscale models for the turbulent stresses should exhibit the same asymptotic nearwall behavior as the Reynolds stresses [4, 5, 6, 7].
The nearwall behavior of subgridscale models can be studied by expanding the components of the velocity field in terms of the wallnormal coordinate [5]. Due to the noslip condition, the zerothorder terms in these expansions have to vanish. By incompressibility, the firstorder term in the expansion of the wallnormal velocity component then also has to vanish. The tangential velocity components will, thus, be first order in the wallnormal coordinate, while the wallnormal velocity component exhibits a secondorder nearwall scaling. The expansion of the velocity field can be inserted in subgridscale models (or other physical quantities based on the velocity field) to study their behavior near a solid wall.
Module
The nearWallScaling module of lesTools facilitates the study of the nearwall scaling behavior of physical quantities that are based on the velocity field of incompressible turbulent flows. This module can, for example, be used to analyze the nearwall scaling behavior of subgridscale models [6, 7].
Usage
Usage of the MATLAB scripts of the nearWallScaling module is explained in detail in the readme in the nearWallScaling folder of this toolbox.
Depending on your purposes, please consider citing the work by Silvis et al. [6] and/or Silvis and Verstappen [7] when making use of the nearWallScaling module.
References

Sagaut, P. (2006). Large Eddy Simulation for Incompressible Flows: An Introduction. 3rd edn. SpringerVerlag Berlin Heidelberg. DOI: 10.1007/b137536.

Pope, S. B. (2011). Turbulent Flows. Cambridge University Press.

Nicoud, F., Ducros, F. (1999). “Subgridscale stress modelling based on the square of the velocity gradient tensor”. Flow, Turbulence and Combustion 62, pp. 183–200. DOI: 10.1023/A:1009995426001.

Nicoud, F., Baya Toda, H., Cabrit, O., Bose, S., Lee, J. (2011). “Using singular values to build a subgridscale model for large eddy simulations”. Physics of Fluids 23, 085106. DOI: 10.1063/1.3623274.

Trias, F. X., Folch, D., Gorobets, A., Oliva, A. (2015). “Building proper invariants for eddyviscosity subgridscale models”. Physics of Fluids 27, 065103. DOI: 10.1063/1.4921817.

Silvis, M. H., Remmerswaal, R. A., Verstappen, R. (2017). “Physical consistency of subgridscale models for largeeddy simulation of incompressible turbulent flows”. Physics of Fluids 29, 015105. DOI: 10.1063/1.4974093. PDF Abstract BibTeX BibLaTeX Cited by 34

Silvis, M. H., Verstappen, R. (n.d.). “Creating physicsbased subgridscale models for largeeddy simulation”. (in preparation).

Silvis, M. H., Bae, H. J., Trias, F. X., Abkar, M., Verstappen, R. (2019). “A nonlinear subgridscale model for largeeddy simulations of rotating turbulent flows”. arXiv: 1904.12748 [physics.fludyn]. PDF Abstract BibTeX BibLaTeX Cited by 2

Chapman, D. R., Kuhn, G. D. (1986). “The limiting behaviour of turbulence near a wall”. Journal of Fluid Mechanics 170, pp. 265–292. DOI: 10.1017/S0022112086000885.