Problems for Assignment 3 - Computer Modeling Fluid Dynamics | MPO 662, Assignments of Geology

Material Type: Assignment; Class: Cmp Mod Fluid Dynm; Subject: Meteorology/Phys Oceanography (MPO) ; University: University of Miami; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-4ya-1
koofers-user-4ya-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MPO 662 { Problem Set 3
1. Consider the Lax Fredrichs approximation to the scalar advection equation:
u
n
+1
j
?
u
n
j
+1
+
u
n
j
?
1
2
t
+
c
u
n
j
+1
?
u
n
j
?
1
2
x
= 0
Determine the truncation error for this scheme
Study the consistency of this FD representation
What condition to you have to impose on
x
so that the time errors and spatial
errors are of the same order of magnitude?
Determine the stability characteristics of this scheme.
2. The 1D heat equation,
u
t
=
u
xx
, is a parabolic equation. It is discretized using an
implicit scheme of the form:
u
n
+1
j
?
u
n
j
t
=
1
2
"
u
n
+1
j
+1
?
2
u
n
+1
j
+
u
n
+1
j
?
1
x
2
+
u
n
j
+1
?
2
u
n
j
+
u
n
j
?
1
x
2
#
(1)
Study the stability and convergence of this method for periodic b oundary conditions.
Hint: expand in Taylor series about (
j
x;
(
n
+
1
2
)
t
), do the space-expansion rst, and
use it in analyzing the time-series.
3. Write a program to solve numerically the equation:
h
t
+ (
hu
)
x
+ (
hv
)
y
= 0 (2)
u
=
?
2
y
?
1
2
; v
= 2
x
?
1
2
;
(3)
h
(
x; y ; t
= 0) = max(0
;
1
?
8
r
)
; r
2
=
x
?
1
4
2
+
y
?
1
2
2
(4)
in the unit square 0
x; y
1. Use a conservative scheme discretized on a C-grid and
the following uxes:
a Donor cell ux
a 2
nd
order centered ux
Choose a time-stepping scheme that is at least as accurate as the space discretization
(you can reuse some of the programs you wrote earlier). Contour the numerical solution
versus the analytical solution at time
t
= 1 for a max. Courant numbers of
0
:
25 and
compute the root mean square error and the maximum error in the solution. Monitor
the minimum and maximum values of the solution throughout the calculation, as well
as the total budget of
h
; check to see if
h
is indeed conserved. Use 4 sets of grids using
16
16, 32
32, 64
64, and 128
128 cells and discuss the numerical results. Draw
pf2

Partial preview of the text

Download Problems for Assignment 3 - Computer Modeling Fluid Dynamics | MPO 662 and more Assignments Geology in PDF only on Docsity!

MPO 662 { Problem Set 3

  1. Consider the Lax Fredrichs approximation to the scalar advection equation:

unj +1

unj +1 +unj 1 2 t

  • c

unj +1 unj 1 2x

 Determine the truncation error for this scheme  Study the consistency of this FD representation  What condition to you have to imp ose on x so that the time errors and spatial errors are of the same order of magnitude?  Determine the stability characteristics of this scheme.

  1. The 1D heat equation, ut =  uxx , is a parab olic equation. It is discretized using an implicit scheme of the form:

unj +1 unj t

unj +1+1 2 unj +1+ unj +1 1 x^2

unj +1 2 unj + unj 1 x^2

Study the stability and convergence of this metho d for p erio dic b oundary conditions. Hint: expand in Taylor series ab out (j x; (n + 12 )t), do the space-expansion rst, and use it in analyzing the time-series.

  1. Write a program to solve numerically the equation:

ht + (hu)x + (hv )y = 0 (2)

u = 2 

y

; v = 2 

x

h(x; y ; t = 0) = max(0; 1 8 r ); r 2 =

x

y

in the unit square 0  x; y  1. Use a conservative scheme discretized on a C-grid and the following uxes:

 a Donor cell ux  a 2nd^ order centered ux

Cho ose a time-stepping scheme that is at least as accurate as the space discretization (you can reuse some of the programs you wrote earlier). Contour the numerical solution versus the analytical solution at time t = 1 for a max. Courant numb ers of  0 : 25 and compute the ro ot mean square error and the maximum error in the solution. Monitor the minimum and maximum values of the solution throughout the calculation, as well as the total budget of h; check to see if h is indeed conserved. Use 4 sets of grids using 16  16, 32  32, 64  64, and 128  128 cells and discuss the numerical results. Draw

also the convergence curves on a log-log plot. Note: the exact solution is simply the initial condition as the cone returns to its starting p osition after a full rotation. The are 8 cases to run, and hence you should think how to structure the program so you can do the numerical exp eriments without to o many changes to your co de (and p ost- pro cessing co de). Designing and planning the di erent steps would save you a lot of work later on. It mayb e helpful while debugging to use a unidirectional constant ow to check your solution. Pay particular attention to your co ding near the edge of the domain. Numb ering of the C-grid can b e cumb ersome. It the tracers are dimensioned as Tr(1:m,1:n) then the velo cities have to b e u(1:m+1,n) and v(1:m,1:n+1). The divergence of the ow eld at p oint tracer p oint (i,j) is given by

do j = 1,n do i = 1,m div(i,j) = (u(i+1,j)-u(i,j))/dx + (v(i,j+1)-v(i,j))/dy enddo enddo