c=
subroutine thomas (a,b,c,cwrk,r,n)
c-
c solve tridiagonal system with thomas algorithm. tri(a,b,c)*x = r.
c solution returned in r array.
c input
c a,b,c arrays containing the tridiag matrix (these are not changed)
c r array containing the right hand
%=
function [x] = thomas(a,b,c,cwrk,r,n)
%-
% solve tridiagonal system with thomas algorithm. tri(a,b,c)*x = r.
% solution returned in r array.
% input
% a,b,c arrays containing the tridiag matrix (these are not changed)
% r array containing the right han
Computational Fluid Dynamics
ME 573
INVISCID COMPRESSIBLE FLOW
I. Introduction
Inviscid, compressible, non-reacting flows are described by the Euler equations, which in 2D can be written as:
Q F G
+
+
=0
t x y
where Q is the vector of unknowns, and F and
Computational Fluid Dynamics
ME 573
HOMEWORK #4
Solve the viscous, non-linear Burgers equation:
2
u 1 u2
u
t 2 x
x2
spatial domain:
-L x L
(use a uniform grid, L is given below)
time domain:
0 t tmax (use uniform time steps)
boundary conditions
initial co
c=
subroutine burgers(uex,x,xnu,time,nx)
c-
c Routine calculates the solution to the non-linear burgers equation
c on the domain -1 to 1.
c Assumes the initial conditions are u(x<0) = 1, u(x>0) = 0 with
c compatible boundary conditions.
c Input: x = grid
%=
function [uex] = burgers(x,xnu,time,nx)
%-
% Routine calculates the solution to the non-linear burgers equation
% on the domain -1 to 1.
% Assumes the initial conditions are u(x<0) = 1, u(x>0) = 0 with
% compatible boundary conditions.
% Input: x = gri
Stability Diagrams
Im()
Complex Plane
Stability region lies
within the unit circle.
Diffusion Processes
Re()
Convecting Processes
Mixed
Exact
Solutions
1 = e dt
is real and < 0
is purely imaginary
is complex with
the real part < 0
The lines,
, show how
Computational Fluid Dynamics
HOME WORK #5
ME 573
This homework involves using the effective wave number concept and the homogeneous, representative
equation, Eq. (1) (there is no programming for this homework).
u
=u
t
(1)
1. Consider the following 2 step
Computational Fluid Dynamics
ME 573
PROJECT #2
Write a code to solve the 2D, incompressible (=1), laminar Navier Stokes equations.
Use a staggered grid with velocities at the cell faces and pressure at the cell center.
Use time splitting as presented in
Computational Fluid Dynamics
STAGGERED GRIDS
ME 573
A staggered grid is one in which the velocities and pressure are located at different
positions. A typical staggered grid cell is shown at the right where right pointing
arrows represent the grid locatio
/*-Function solves a block tri-diagonal system: Tri(a,b,c) * x = r
Number of blocks = ndim (set in define statment)
Block size = mdim*mdim
(set in define statment)
Input: arrays a,b,c,r
m_check,n_check
(see arguments for dimensioning)
(problem size to mak
Computational Fluid Dynamics
ME 573
PROJECT #1
Write a code to solve the incompressible (=1) laminar boundary layer equations.
Use the Keller Box Method presented in class.
Parameters:
kinematic viscosity, = 10-5
starting location: Xo = 1.0
ny = 20
Ini
Navier Stokes equations for 2D compressible flow
u v
+
+
=0
t
x
y
u uu uv
p
+
+
= + xx + xy + f x
t
x
y
x x
y
v vu vv
p xy yy
+
+
= +
+
+ fy
t
x
y
y x
y
( u xx + v xy qx ) ( u yx + v yy q y )
eT u ( eT + p ) v ( eT + p )
+
+
=+
+
+ f V
t
x
y
x
y
whe
Computational Fluid Dynamics
ME 573
INITIAL QUESTIONNAIRE
Name _
Department and degree goal _
Advisor
Thesis research project (if any):
If you currently work to help pay for your education, indicate the number of hours per week _
What are your long term c
Computational Fluid Dynamics
ME 573
HOMEWORK #3
1. Solve the 1d heat equation:
2
D
t
x2
Spatial domain size: 0.0 to 2.0 (the number of grid points varies and is specified below).
Use 2nd order central differencing for the spatial derivative.
Use D = 0.0
Computational Fluid Dynamics
ME 573
TRI-DIAGONAL SOLUTIONS
Tri-diagonal matrices are very common in numerical methods. They arise commonly from implicit time
integration schemes using finite difference approximations to 1st and 2nd derivatives. This hando
Computational Fluid Dynamics
ME 573
Homework #2
This homework is about solving the Poisson equation with a number of standard methods. The following
equation is to be solved on a rectangular domain:
2 P R
where:
R A exp
x x
c
xc 0.75 Lx
yc 0.35 Ly
Lx =
Computational Fluid Dynamics
ME 573
LAGRANGE INTERPOLATION
Lagrange interpolation is defined by requiring a polynomial that goes through all of the know data
points. The polynomial is the highest order possible.
For example, if 2 points are available then
Computational Fluid Dynamics
ME 573
HOMEWORK SET 1
1.
Use a Taylor table to derive a third order accurate scheme for a 1st derivative. Use 4 grid points:
two points to the left, one at the point of interest, and one to the right:
ui-2,
ui-1,
ui,
ui+1
Be s