ME469A WINTER 2009

COMPUTATIONAL METHODS 
IN FLUID MECHANICS  

Home

Announcements

Handouts

Homeworks

Download Area

Download

2.2 Two-dimensional codes with Cartesian grids

grid.f : Program for interactive generation of rectilinear orthogonal grids for the 2d multigrid flow prediction code.
grid.inp : Example input file for the program grid.f .
pcol.f : Solves the 2D Navier-Stokes equations on a Cartesian grid using the colocated variable arrangement. It is set for lid- and buoyancy-driven flows in closed cavities (steady or unsteady; includes UDS and CDS schemes for convective fluxes, Euler implicit or three time levels time stepping).
pcol.inp : Example input file for the program pcol.f .
plot.f : Produces plots of grid, velocity vectors, and profiles, contours lines and color fills for any quantity. The output are postscript files for each page. The code can easily be adapted for interactive use and screen window output, but as this is to some extent hardware-dependent, only postscript output is provided here. The same code is used for both Cartesian and non-orthogonal grids, and for both single-grid and multi-grid solutions. Array dimensions NX and NY should be equal to or greater than the maximum number of nodes in respective directions on the finest grid. Up to 128 contours can be plotted. The plots are saved on files which carry the name+grid number, eg. VECT1.PS for the plot of velocity vectors from grid 1.
plot.inp : Example input file for the program plot.f .
psc.f : Finite volume method for solving conservation equation for scalar transport using Cartesian grids and known velocity field (set up for stagnation point flow, u=x and v=-y; at x=0, scalar varies from 0.0 at y=y_max to 1.0 at y=0; at x=x_max, outflow - zero gradient extrapolation from inside; at y=y_max, inflow, scalar = 0.0; at y=0, Neumann boundary condition, zero gradient in y-direction).
psc.inp : Example input file for the program psc.f .
pscus.f : Finite volume method for solving conservation equation for scalar transport using Cartesian grids and known velocity field (set up for stagnation point flow, u=x and v=-y; at x=0, scalar varies from 0.0 at y=y_max to 1.0 at y=0; at x=x_max, outflow - zero gradient extrapolation from inside; at y=y_max, inflow, scalar = 0.0; at y=0, Neumann boundary condition, zero gradient in y-direction). unsteady version, solving for the transition from initial solution (zero field) to steady solution. four schemes for time integration are implemented (implicit Euler, explicit Euler, Crank- Nicolson and three time level implicit).
pscus.inp : Example input file for the program pscus.f .

2.3 Two-dimensional codes with non-orthogonal grids

grid.f : Code for generating 2D non-orthogonal multigrid grids. Input data is described in the file.
grid.inp : Example input file for the program grid.f .
prog.f : Flow solver.
prog.inp : Example input file for the program prog.f .
plot.f : The post-processor. It provides plots of grid, velocity vectors, profiles at given X or Y coordinate, contours of pressure, temperature and streamfunction, and color-filled area between contours. It is the same code that is used for Cartesian grids.
plot.inp : Example input file for the program plot.f .

2.4 Three-dimensional codes with Cartesian grids

grid.f : This file contains a code for generating 3D Cartesian multigrid grids. Its main part is the 2D grid generation code described in more detail in directory 2DC. In addition, it is also used to set boundary conditions, since the type of boundary for CV-faces along boundaries can be prescribed by assigning a particular value to an integer array identifying each boundary cell face. More details will be given for the updated version.
grid.inp : Example input file for the program grid.f .
prog.f : This file contains the code for solving the steady three-dimensional Navier-Stokes equations using Cartesian grids and colocated arrangement of variables. Multigrid FAS scheme is used to accelerate outer iterations.
prog.inp : Example input file for the program prog.f .

2.5 Parallel codes

parp.f : The CFD code described herein is based on the Finite Volume Method (FVM) and uses Cartesian grids (or axisymmetric rectangular grids). It has been adapted to the calculation of cavity flows (lid-driven or buoyancy-driven), without in- or outflow. It uses a single, equidistant grid
tpp.f :

2.6 Solvers for Laplace's equation

lapl2d.f : Sets up the matrix equation [A] f = Q which results from finite difference discretization of the Laplace equation in 2D using Cartesian grid and central difference approximation of the second derivative. Boundary conditions are of Dirichlet type: f(0,x) = f(x,0) = 0, f(1,y) = y, f(x,1) = x. The exact solution is: f(x,y) = x y. The equation can then be solved by a variety of iterative solvers. The CDS produces exact solution on any grid. The convergence error can thus be easily determined.
lapl2d.inp : Example input file for the program lapl2d.f .
lapl3d.f : Similar to above but in three dimensions.
lapl3d.inp : Example input file for the program lapl3d.f .
sipvec.f : Sets up the matrix equation [A] f = Q which results from finite difference discretization of the Laplace equation using uniform grid in each direction and central difference approximation of the second derivatives. boundary conditions are of Dirichlet type: t(0,x,z) = t(x,0,z) = t(x,y,0)=0., t(1,y,z)=y*z, t(x,1,z)=x*z, t(x,y,1)=x*y. the exact solution is: t(x,y,z) = x*y*z. the equation can then be solved by a variety of iterative solvers.

2.7 Staggered Solvers

grid.f : Grid generation code for Cartesian grids. It is identical to the code GRID.F in directory 2DC for colocated grids. Here no multigrid version of the flow solver is available (colocated arrangement is nice especially because the implementation of multigrid is easy, as only one set of CVs is present), so one should generate only a single grid.
grid.inp : Example input file for the program grid.f .
pstag.f : Incorporates the FV method using a staggered arrangement of variables. Variables are stored as 2D arrays. SIMPLE is used for the pressure calculation. UDS and CDS are implemented for the convective terms, CDS is used for the diffusive terms. The boundary conditions are set for the lid-driven cavity flow. Only steady flows are considered.
pstag.inp : Example input file for the program pstag.f .
plot.f : Code which produces vector, profile, contour, and color fill plots of results. It is the same code that is used for colocated Cartesian (directory 2DC) and non-orthogonal (directory 2DG) grids.
plot.inp : Example input file for the program plot.f .