
Apply SALVER index notation to a 4x4 staggered control-volume grid, defining i and j indices for vectors and scalars with wall and ghost-point logic. Prepare boundary conditions and MATLAB initialization.
BASE_CODE.f90 is the base level code all others are derived from.
BASE_CODE_OMP.f90 is a very simple implementation of OpenMP into the pressure solver.
The pressure correction solver loop is changed from SOR to Jacobi to accommodate the parallel operations.
Need fine meshes to see significant speedup.
Apply periodic outlet boundary conditions to impose a fully developed inlet profile for channel flow, iterating with a zero streamwise gradient at the outlet until the flow fully develops.
Modify code to implement periodic inlet-outlet boundary conditions and a mass-conserving outlet velocity. Increase iterations to drive a fully developed flow, cycling through the domain while resolving the transverse direction.
Visualize pressure boundary conditions in channel flow using ParaView, revealing a centerline pressure distribution that forms a nearly linear profile in fully developed flow and a constant centerline velocity.
Apply a symmetry boundary on the top line, halve the channel grid, remove the upper wall, and set the top boundary velocity equal to interior values after extrapolation.
Explore symmetry boundary condition results by analyzing the cemetery plane for channel flow, with velocity reaching about 1.4976 along the center line and a matching pressure drop.
Blend first order upwind with second order central interpolation to improve convection term accuracy and introduce a deferred correction scheme for the x and y momentum equations.
Add unsteady terms to the neighbor Stoke solver for channel flow on a 300 by 60 mesh with 1200 time steps, using small iterations and higher-order terms to preserve vortices.
Analyze the flow behind a square cylinder in a channel, revealing vortex shedding and instabilities. The lecture emphasizes using higher-order upwinding to reduce artificial diffusion and preserve vortices.
Explore mesh clustering toward walls or the domain center, study the updated momentum equations and control volumes, and learn how nonuniform delta y affects indexing and code.
Add the energy equation to the code, discretize with second-order central differences, apply first-order upwind for cell-centered temperatures, and couple to momentum while handling temperature-dependent properties and buoyancy via Boussinesq.
Examine the driven cavity with a heated top wall and zero-temperature side walls, where a clockwise vortex convects heat, shaping temperature contours with no energy and momentum coupling.
Explore the Boussinesq approximation for buoyancy, treating density as constant in unsteady and convection terms and variable only in the buoyancy term, for small temperature differences.
Explore how the Boussinesq approximation drives buoyancy-induced flow in a cavity with a heated bottom plate, forming a central plume and rotating vortices, with flow depending on chosen parameters.
Explore pressure-driven flow in a duct, where inlet boundary conditions create high and low pressures that drive symmetric flow and mass flux governed by pressure gradients.
Explore a pair of parallel jets entering the lower domain, which attract, merge into a single jet that exits the domain, with a runnels number around twenty-three and magnitude contours.
Download the Poisson solver and experiment with speedups as a function of number of threads and number of unknowns (i.e., mesh size).
We will formulate the problem using collocated variables on a Cartesian mesh.
A look into the collocated variable finite volume code set up for the driven cavity problem. The code may be downloaded (next lecture).
Running the code for the driven cavity problem and observing the mass imbalance dropping to machine zero.
Code is included in "downloadable materials." A version for a channel flow is also downloadable.
Using ParaView to plot velocity vectors for driven cavity flow. Data file (.csv) as formatted in the downloadable collocated grid CFD code used to solve the driven cavity problem.
A brief review of the momentum equations and a description of some necessary statistical quantities.
A complete copy of the Section notes may be downloaded from this lecture.
Explore the viscous sublayer and log layer of a turbulent boundary layer, including y+ definitions and the choice between resolving the sublayer with dense grids or using log-law wall functions.
Derives a wall function under near-wall equilibrium by equating production and dissipation of turbulent kinetic energy, using log-layer relations to express wall shear stress and velocity scales.
We briefly go over the code set up for channel flow. This code may be downloaded.
Compare velocity profiles in channel flow normalized by the center line, using y/h, K Epsilon and DC models, noting developing flow and terminal viscosity, and discuss K Epsilon limitations.
This course is a follow-up to my Introduction to Computational Fluid Dynamics course. In this course we extend the capabilities of the two-dimensional, incompressible Navier-Stokes solver developed in the first course to include enhancements such as unsteady flow capabilities, second-order and blended interpolations for the convection terms, pressure, symmetry, and periodic boundary conditions, mesh clustering, the energy equation, and perhaps other topics as deemed appropriate.
All codes are written in Fortran90 and are available for download, as are the course notes. Upon successful completion of the course students should be able to develop their own codes or modify the available codes to solve problems of varying complexity. To get the maximum benefit from this course, I recommend that students complete the first course, or have an equivalent background.
Recently added the description of a finite-difference-based Poisson solver using red/black iteration scheme with OpenMP for parallelization.
Recently added a collocated grid approach to the finite volume formulation of the incompressible Navier-Stokes equations. In the collocated variable approach, the velocity control volumes are not staggered, but are coincident with the scalar control volumes. Although we limit our approach to structured Cartesian meshes, most commercial CFD solvers utilize a collocated variable approach using Cartesian velocity components on unstructured grids.
A new section on two-equation k-epsilon turbulence modelling using wall functions has been added.
The course is such that one can generally pick and choose which sections/lectures to watch.