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 centr
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 (thes
%=
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 (th
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
+
+
#include
#include
#include
#include
<stdio.h>
<stdlib.h>
<string.h>
<math.h>
#define PI
(double)
4*atan(1.0)
/* $PAGE */
/* NAME
:derf
*/
/* FUNCTION
:Program estimates the error function of xarg
*/
/
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
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 w
%=
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
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
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
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
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
/*-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_chec
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 vis
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
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 t
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 differenc
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
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 orde
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 in