Skip to content

Code-Sample-Collection/cavityflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cavity Flow

Erturk - cavityflow.com

Driven Cavity Flow

The Lid Driven Cavity Flow is most probably one of the most studied fluid problem in computational fluid dynamics field. Due to the simplicity of the cavity geometry, applying a numerical method on this flow problem in terms of coding is quite easy and straight forward. Despite its simple geometry, the driven cavity flow retains a rich fluid flow physics manifested by multiple counter rotating recirculating regions on the corners of the cavity depending on the Reynolds number.

Fortran Codes

Many researchers have contacted me and requested the Fortran codes I have used in my researches. Below you will find the Fortran codes that I wrote. These Fortran codes solve the 2-D steady incompressible driven cavity flow problem using different numerical approaches. I have added many comments into the codes for easy understanding.

Below you will find the fortran code I have used in this study (Study 2). The fortran code uses Successive Over Relaxation (SOR) method which is most probably the simplest and most easy to code numerical method. In this code in order to find a solution for a Reynolds number, a previously obtained smaller Reynolds number solution is used as an initial condition to start the iteration process. The relaxation parameters I have used at different Reynolds numbers are tabulated in this Table. At every 50000 iterations, the solution is written to a data file and also the residuals (error parameters) defined in the manuscript are written to an other data file in order to have an idea about the convergence level of the solution.

The first Fortran code uses Successive Over Relaxation (SOR) method. The second order accuracy code solve the Navier-Stokes (NS) equations. The fourth order accuracy code solve the Fourth Order Navier-Stokes (FONS) equations introduced by Erturk & Gokcol [International Journal for Numerical Methods in Fluids, (2006), 50, pp 421-436]. Visit Study 3 for details on FONS equations.

  • sor_2.f: SOR method, second order accuracy
  • sor_4.f: SOR method, fourth order accuracy

The second Fortran code uses Alternating Direction Implicit (ADI) method. Similarly second order accurcy code solve the NS equations and the fourth order accuracy code solve the FONS equations.

  • adi_2.f: ADI method, second order accuracy
  • adi_4.f (missing): ADI method, fourth order accuracy

The third Fortran code uses the numerical method introduced by Erturk et al. [International Journal for Numerical Methods in Fluids, (2005), 48, pp 747-774]. Many researches have especially requested this code. Visit Study 1 for details on the numerical method. Again similarly second order accurcy code solve the NS equations and the fourth order accuracy code solve the FONS equations.

  • erturk_2.f: Erturk et al. method, second order accuracy
  • erturk_4.f (missing): Erturk et al. method, fourth order accuracy

Fortran code for data files

  • read.f: Fortran code to read binary data files

Triangular Cavity Flow

Flows inside closed geometries have always been the focus of attention of Computational Fluid Dynamics (CFD) studies. The "lid driven triangular cavity flow" is one of these flow problems and in the literature it is possible to find several computational and analytical studies on this flow problem.