LES
&
DES and
Machine Learning
3 day
ONLiNE COURSE
SWEDEN
 
30 June, 2, 4 July 2025


Large-Eddy Simulation &
Detached-Eddy Simulations and
Machine Learning using a Python CFD code

The traditional method for CFD in industry and universities is Reynolds-Averaged Navier-Stokes (RANS). It is a fast method and mostly rather accurate. However, in flows involving large separation regions, wakes and transition it is inaccurate. The reason is that all turbulence is modeled with a turbulence model. For predicting aeroacoustic, RANS is even more unreliable. For these flow, Large-Eddy Simulation (LES) and Detached-Eddy Simulations (DES) is a suitable option although it is much more expensive. Still, in many industries (automotive, aerospace, gas turbines, nuclear reactors, wind power) DES is used as an alternative to RANS. In universities, extensive research has been carried out during the last decade(s) on LES and DES.
 
Unfortunately, most engineers and many researchers have limited knowledge of what a LES/DES CFD code is doing. The object of this on-line course is to close that knowledge gap. During the course, the participants will learn and work with an in-house LES/DES code called arrowpyCALC-LES, written by the lecturer. It is a finite volume CFD code written in Python. The numerical procedure is based on an implicit, fractional step technique with pyamg [17] -- an AMG multigrid pressure Poisson solver -- and a non-staggered grid arrangement. If your computer has a compatible Nvidia graphics card, you can choose so solve the on the graphics card using pyamgx [17]

The second half of the course will be dedicated to Machine Learning. The Machine Learning models that will be used are Neural Network (NN), binary search trees (KDTree) and Physical Informed Neural Network (PINN). They are all available as Python modules. NN will be used for improving wall functions and turbulence models, KDTree will be used for improving wall functions and PINN will be used for improving turbulence models.

The Python CFD code is fully vectorized. It is reasonably fast. The user can choose to run fully on the CPU or the GPU or use the GPU only when solving the equation system (the sparse matrix solver). On an eight million mesh, pyCALC-LES using IDDES runs 70 times faster on the GPU than on the CPU on a 2.3M grid. It is mainly a research code with which only simple geometries can be handled (one-block structured curvi-linear grids in the x-y plane and Cartesian in the z direction)

Below I list some of the flows that have been computed using pyCALC-LES (see some figures below):

  • Diffuser flow using a wall-function based on Neural Network. IDDES is used and the predicted skin-friction is compared with IDDES with y+ 1. Mesh 525x70x48. 10 000 time steps. The computation time is 8 hours (it runs fully on the GPU).
  • Windtunnel flow with a noise reducing fairing, Uin=16m/s (air). LES, WALE model. Domain 1X0.25X0.25 m3. 7500 timesteps (3 750 to reach fully-developed conditions + 3 750 for time-averaging). Mesh 256x200x200 (10M cells). The computation time (pressure equation is solved on the GPU) on an Alienware x17 R1 laptop is 40 hours.





THE ON-LINE COURSE

The course includes lectures (12 hours) and workshops (12 hours) learning and using pyCALC-LES. The course is given 30 June, 2, 4 July 2025.
 
The lectures will be given on-line (Live) using Zoom. During the workshops, the participants will get supervision in a joint Zoom room which will enable participants to learn from each others questions. Part of the supervision may also be given in individual break-out Zoom rooms.
 
arrow Zoom
 
In the lectures we will address:
  • finite volume discretization
  • Smagorinsky model
  • WALE model
  • the k-eps DES model
  • two-equation PANS model (k and epsilon)
  • wall and periodic boundary conditions
  • how to prescribe turbulent inlet boundary conditions
  • how to generate inlet anisotropic synthetic turbulent fluctuations

In the lectures on Machine Learning (ML) we will address:
  • How to use Neural Network (NN) for improving wall functions [23,26]
  • How to use NN for improving turbulence models [23,26]
  • How to use search binary trees (KDTree) for improving wall functions [26]
  • How to use Physical Informed Neural Network (PINN) to Improve a Turbulence Model [27]
  • Import the developed NN, KDTree and PINN models into pyCALC-LES
  • Carry out simulations with pyCALC-LES using the improved models
In the workshops, the participants will use pyCALC-LES and make ML models using Python.

The participants will get the pyCALC-LES source CFD code and install it on their lap-top or desk-top.

     
  1. DES of the hump flow [6]. Synthetic inlet fluctuations at the inlet [7-9]. Periodic boundary conditions spanwise direction. On a 624x108x64 mesh the CPU time is 20 seconds per time step on a standard PC [14].
     
    Python and Matlab/Octave files
     

     
 
  • Machine Learning. A k-omega model is improved using PINN. Fully-developed channel flow. CFD simulations. k-omega model improved iwht PINN (bliue solid lines); standard k-omega model (dashed ref lines); DNS: markers [27].

     

     




    OBJECT

    The object is that the participants should learn how a CFD code for LES/DES works as well as Machine Learning. It will give them increased knowledge, confidence and know-how when using Machine Learning and commercial CFD codes.



    PARTiCiPANTS

    The participants are expected to hold a MSC degree or PhD degree related to fluid mechanics. They are expected to have at least a basic knowledge in LES and DES. Programming skills in Pythons is recommended. The course is expected to be valuable also for researchers with extensive knowledge in LES and/or DES. The participants may continue to use pyCALC-LES after the course, in their daily work and/or research. Participant who are reasonable good at programming can rather easy convert the Python CFD code to their favorite language (C, C++, Fortan95).



    LECTURER

    The lecturer at the course (both during lectures and workshops) will be Prof. Lars Davidson, Chalmers University of Technology.
     
    arrow homepage


    COURSE MATERiAL





    COURSE LANGUAGE

    The course material is in English and the lectures will be given in English.



    DATE & LOCATiON

    The course will be held 30 June, 2, 4 July 2025 online at Zoom
    arrow Zoom

     



    REGiSTRATiON

    Registration form should be submitted no later than June 6, 2025. The price is 16,300 SEK (excl. VAT). No refunding after June 9. The number of participants is limited to 16.
     
    registration form


    PROGRAM

    DAY 1, Monday, 7 hours, 13.00-21.00, Swedish time

    • General structure of pyCALC-LES
    • Discretization in pyCALC-LES
    • Compute geometrical quantities
    • Studying Test Case 1 (channel flow)
    • Studying Test Case 2 (atmospheric boundary layer)
    • WORKSHOP
      • Fully-developed channel flow simulations using PANS
      • Channel flow simulations with inlet-outlet using PANS
      • Investigation of different synthetic fluctuating inlet fluctuations. For example, change the prescribed integral length scale, the integral time scale, the anisotropy ...

    Tueday (no teaching). Participants can work on pyCALC-LES

    DAY 2, Wednesday, 7 hours, 13.00-21.00, Swedish time

    • Implicit Rhie-Chow interpolation in pyCALC-LES
    • Implementation of Zero equation models
    • Implementation of the PANS model in pyCALC-LES
    • Studying Test Case 'hump flow'
    • WORKSHOP
      • Implementing a one-equation hybrid LES-RANS model
      • Implementing a DES model (k-eps and/or k-omega)
      • Implementing a DDES model (k-eps and/or k-omega)
      • Implementing a IDDES model (k-eps and/or k-omega)

    Thursday (no teaching). Participants can work on pyCALC-LES

    DAY 3, Friday, 7 hours, 13.00-21.00, Swedish time

    • How to implement a new turbulence model in pyCALC-LES
    • How to generate anisotropic turbulent fluctuations in pyCALC-LES
    • How to write Machine Learning scripts in Python using SVR for improving wall functions [20,21] and arrow turbulence models
    • How to export and import SVR models
    • Pre-cursor RANS (using a 1D solver written in Python) as input to synthetic turbulence generator
    • WORKSHOP, see Section workshop in the report on pyCALC-LES
      • Implement an IDDES model (k-eps and/or k-omega)
      • Implement the SAS model (k-omega)
      • Write Machine Learning scripts in Python using SVR for improving wall functions [20,21] and arrow turbulence models
      • Export SVR model; import them into pyCALC-LES
      • Make CFD simulations with pyCALC-LES using Machine-Learning-improved turbulence models

    Above, we give examples on what turbulence models and Machine Learning rotuines to implement in the workshops. Participants may of course propose to implement other turbulence models and Machine Learning rotuines.


    QUESTiONS & FURTHER iNFORMATiON

    Please contact
     
    • Lars Davidson
    • tel. +46 (0) 730-791 161
    • E-mail: lada@flowsim.se, lada@chalmers.se

     



    REFERENCES

    1. P. Emvin, The Full Multigrid Method Applied to Turbulent Flow in Ventilated Enclosures Using Structured and Unstructured Grids. PhD thesis, Dept. of Thermo and Fluid Dynamics, Chalmers University of Technology, Göteborg, 1997.

    2. L. Davidson, Large eddy simulations: how to evaluate resolution. International Journal of Heat and Fluid Flow, 30(5):1016-1025, 2009.
    3. L. Davidson, The PANS k-ε model in a zonal hybrid RANS-LES formulation. International Journal of Heat and Fluid Flow, 46:112-126, 2014.

    4. L. Davidson, Zonal PANS: evaluation of different treatments of the RANS-LES interface. Journal of Turbulence, 17(3):274-307, 2016.

    5. A. Altintas and L. Davidson, Direct numerical simulation analysis of spanwise oscillating lorentz force in turbulent channel flow at low Reynolds number. Acta Mechanica, pages 1-18, 2016.

    6. J. Ma, S.-H. Peng, L. Davidson, and F. Wang, A low Reynolds number variant of Partially-Averaged Navier-Stokes model for turbulence. International Journal of Heat and Fluid Flow, 32(3):652-669, 2011.10.1016/j.ijheatfluidflow.2011.02.001.

    7. L. Davidson, Using isotropic synthetic fluctuations as inlet boundary conditions for unsteady simulations. Advances and Applications in Fluid Mechanics, 1(1):1-35, 2007.

    8. L. Davidson and S.-H. Peng, Embedded large-eddy simulation using the partially averaged Navier-Stokes model. AIAA Journal, 51(5):1066-1079, 2013.

    9. L. Davidson, Two-equation hybrid RANS-LES models: A novel way to treat k and ω at inlets and at embedded interfaces. Journal of Turbulence, 18(4):291-315, 2017.

    10. B. Nebenfuhr, L. Davidson, Large-Eddy Simulation Study of Thermally Stratified Canopy Flow, Boundary-Layer Meteorology, Vol. 156, number 2 , pp. 253-276, 2015

    11. B. Nebenfuhr, L. Davidson, Prediction of wind-turbine fatigue loads in forest regions based on turbulent LES inflow fields, Volume 20, Issue 6 pp. 1003-1015, Wind Energy, 2017.

    12. L. Davidson and C. Friess, The PANS and PITM model: a new formulation of f_k, Proceedings of 12th International ERCOFTAC Symposium on Engineering Turbulence Modelling and Measurements (ETMM12), Montpelier, France 26-28 September, 2018

    13. L. Davidson, Zonal Detached Eddy Simulation coupled with steady RANS in the wall region, ECCOMAS MSF 2019 Thematic Conference, 18-20 September 2019, Sarajevo, Bosnia-Herzegovina

    14. L. Davidson, inlet boundary conditions.

    15. L. Davidson, "Non-Zonal Detached Eddy Simulation coupled with a steady RANS solver in the wall region", ERCOFTAC Bullentin 120, Special Issue on Current trends in RANS-based scale-resolving simulation methods, pp 43-48, 2019.

    16. L.M. Olson abd J.B. Schroder, PyAMG: Algebraic Multigrid Solvers in Python v4.0, Release 4.0, 2018

    17. L. Davidson and Ch. Friess, "Detached Eddy Simulations: Analysis of a limit on the dissipation term for reducing spectral energy transfer at cut-off", ETMM13: The 13th International ERCOFTAC symposium on engineering, turbulence, modelling Rhodes, Greece, 15-17 September, 2021
      View PDF file

    18. L. Davidson
      "Detached Eddy Simulation coupled with steady RANS in the wall region", ETMM13: The 13th International ERCOFTAC symposium on engineering, turbulence, modelling Rhodes, Greece, 15-17 September, 2021
      View PDF file
       
    19. L. Davidson,
      "Non-Zonal Detached Eddy Simulation coupled with a steady RANS solver in the wall region", International Journal of Heat and Fluid Flow, Vol.92, 108880, 2021
      Get article at publisher

    20. L. Davidson
      "Using Machine Learning for formulating new wall functions for Large Eddy Simulation: A First Attempt", Div. of Fluid Dynamics, Mechanics and Maritime Sciences, Chalmers University of Technology, 2022.
      View PDF file
       
    21. L. Davidson
      "Using Machine Learning for formulating new wall functions for Large Eddy Simulation: A Second Attempt", Div. of Fluid Dynamics, Mechanics and Maritime Sciences, Chalmers University of Technology, 2022.
      View PDF file
       
    22. L. Davidson
      "pyCALC-LES: A Python Code for DNS, LES and Hybrid LES-RANS" Div. of Fluid Dynamics, Mechanics and Maritime Sciences, Chalmers University of Technology, 2022.
      view PDF file
    23. L. Davidson
      "Using Machine Learning for formulating new wall functions for Detached Eddy Simulation", ERCOFTAC symposium on Engineering, Turbulence, Modelling and Measurements (ETMM14), in Mini-Symposium: Machine learning for turbulence, Barcelona, Spain 6th - 8th September 2023; Chalmers University of Technology, 2022.
      View PDF file
       
    24. L. Davidson
      "Using Machine Learning for Improving a Non-Linear k-eps Model: A First Attempt", Div. of Fluid Dynamics, Mechanics and Maritime Sciences, Chalmers University of Technology, 2023.
      View PDF file
       
    25. L. Davidson
      "Using Neural Network for Improving an Explicit Algebraic Stress Model in 2D Flow", CUSF 2024, Proceedings of the Cambridge Unsteady Flow Symposium", Springer, Editors: J. C. Tyacke and N. R. Vadlamani, 2024 (to appear)
      View presentation
      View PDF file
      Proceedings
      Download code

    26. L. Davidson
      "Hybrid LES/RANS for flows including separation: A new wall function using Machine Learning based on binary search trees", Journal of Turbulence, 2025. Get article at publisher
      Download Python script and databases

    27. L. Davidson
      "Using Physical Informed Neural Network (PINN) to Improve a k-omega Turbulence Model" (submitted), ERCOFTAC Symposium on Engineering Turbulence Modelling and Measurements (ETMM-15), Dubrovnik on 22-24 September 2025.