Simulation of Thermofluids and Fluid Dynamics using Julia
CFD, heat transfer, FEM, machine learning, and PINNs for master-level engineering students

Simulation of Thermofluids and Fluid Dynamics using Julia
A master-level engineering lecture combining classical thermofluid modeling, numerical simulation, finite differences, finite elements, CFD libraries, machine learning, and physics-informed neural networks.
1 Course at a Glance
1.1 5 h Introduction
Core Julia syntax, thermofluid governing equations, heat equation, convection, boundary conditions, numerical stability, and visualization.
1.2 3 Projects × 5 h
Application-oriented simulation projects involving cooling, heating, internal flow, natural convection, and boundary layers.
1.3 Julia Ecosystem
Use plain Julia, DifferentialEquations.jl, Gridap.jl, WaterLily.jl, Lux.jl, and NeuralPDE.jl where appropriate.
1.4 Deliverables
Students submit code, plots, model assumptions, verification checks, parameter studies, and engineering interpretation.
2 Learning Objectives
After this lecture, students should be able to:
- Formulate thermofluid problems using conservation laws.
- Identify suitable models for conduction, convection, advection-diffusion, and incompressible flow.
- Implement finite-difference, finite-volume, and finite-element models in Julia.
- Use selected Julia packages for thermofluid simulation.
- Build simple ML surrogates and PINN models for thermal and flow problems.
- Verify numerical results using analytical solutions, correlations, grid studies, and energy balances.
- Interpret simulation results from an engineering perspective.
3 Projects
3.1 Project 1
3.1.1 Cooling of a Hot Steel Cube
Transient conduction FEM PINN
A steel cube of side length 70 mm is initially at 1000 °C and cooled by air and a water-ice mixture.
3.2 Project 2
3.2.1 Cooling of Coffee in a Mug
Lumped model Parameter fitting ODEs
A mug of hot coffee cools through convection, radiation, evaporation, and conduction through the mug wall.
3.3 Project 3
3.3.1 Heating Water in an L-Shaped Pipe
Internal flow Nusselt correlations Surrogate
Water flows through an L-shaped pipe with external wall temperature of 100 °C.
4 Methods Covered
4.1 Finite Differences
Explicit and implicit discretization of heat and advection-diffusion equations.
4.2 Finite Elements
Weak forms, Robin boundary conditions, transient heat conduction, and FEM implementation.
4.3 CFD Libraries
Overview of helpful Julia libraries such as WaterLily.jl, Gridap.jl, Trixi.jl, and Oceananigans.jl.
4.4 ML and PINNs
Surrogate models, parameter identification, neural ODEs, and physics-informed neural networks.
5 Recommended Prior Knowledge
Students should be familiar with:
- basic thermodynamics,
- heat transfer,
- fluid mechanics,
- partial differential equations,
- elementary numerical methods,
- programming basics, preferably MATLAB, Python, or Julia.
6 Quick Start
Install Julia and the course packages:
using Pkg
Pkg.add([
"Plots",
"CairoMakie",
"DifferentialEquations",
"OrdinaryDiffEq",
"SparseArrays",
"LinearAlgebra",
"Statistics",
"Gridap",
"Lux",
"Optimization",
"OptimizationOptimisers",
"NeuralPDE"
])