Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
pdf Engineering - Fluid Dynamics - Shallow Liquid Simulation Using Matlab (2001 Neumann)

pdf Engineering - Fluid Dynamics - Shallow Liquid Simulation Using Matlab (2001 Neumann)

Ratings: (0)|Views: 573|Likes:
Published by elfrich

More info:

Published by: elfrich on Jun 13, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/29/2012

pdf

text

original

 
AMATH 581 Homework 2Shallow Liquid Simulation
Erik Neumann610 N. 65th St., Seattle, WA 98103erikn@MyPhysicsLab.comNovember 19, 2001
Abstract
A model of shallow fluid behavior is evaluated using a variety of nu-merical solving techniques. The model is defined by a pair of partial dif-ferential equations which have two dimensions in space and one dimensionof time. The equations concern the vorticity
ω
and the stream function
ψ
which are related to the velocity field of the fluid. The equations arefirst discretized in time and space. The time behavior is evaluated usinga Runge-Kutta ordinary differential equation solver. The spatial behavioris solved using either Fast Fourier Transform, Gaussian Elimination, LUDecomposition, or iterative solvers. The performance of these techniquesis compared in regards to execution time and accuracy.
Contents
1 Introduction and Overview 22 Theoretical Background 4
2.1 Solving for
ψ
- Matrix Method . . . . . . . . . . . . . . . . . . . 52.2 Solving for
ψ
- FFT Method . . . . . . . . . . . . . . . . . . . . . 62.3 Discretize the Advection-Diffusion Equation . . . . . . . . . . . . 6
3 Algorithm Implementation and Development 7
3.1 Construction of Matrix
A
. . . . . . . . . . . . . . . . . . . . . . 83.2 Construction of Matrix
B
. . . . . . . . . . . . . . . . . . . . . . 93.3 Pinning the Value of 
ψ
(1
,
1) . . . . . . . . . . . . . . . . . . . . . 101
 
3.4 Comparing Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . 113.5 An FFT problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Computational Results 11
4.1 Results for various initial conditions . . . . . . . . . . . . . . . . 114.2 Running times . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3 Accuracy of solvers . . . . . . . . . . . . . . . . . . . . . . . . . . 174.4 Symmetry of Solution . . . . . . . . . . . . . . . . . . . . . . . . 184.5 Time Resolution Needed . . . . . . . . . . . . . . . . . . . . . . . 184.6 Mesh Drift Instability . . . . . . . . . . . . . . . . . . . . . . . . 18
5 Summary and Conclusions 21A MATLAB functions used 22B MATLAB code 23
B.1 evhump.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23B.2 evrhs.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23B.3 wh.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23B.4 fr.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23B.5 ev2.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
C Calculations 34
1 Introduction and Overview
We consider the governing equations associated with shallow fluid modeling.The intended application is the flow of the earth’s atmosphere or ocean circu-lation. The model assumes a 2-dimensional flow, with not much movement upor down. Another assumption is that the fluid is shallow, ie. that the verticaldimension is much smaller than the horizontal dimensions.The velocity field is given by the set of vectors
v
at each point with components
v
=
uvw
(1)2
 
where
u
is the
x
component of the velocity,
v
is the
y
component of the velocityand so on. The height of the fluid is given by
h
(
x,y,t
). From conservation of mass we can derive the following
h
t
+ (
hu
)
x
+ (
hv
)
y
= 0 (2)Conservation of momentum leads to the following two equations(
hu
)
t
+ (
hu
2
+12
gh
2
)
x
+ (
huv
)
y
=
fhv
(3)(
hv
)
t
+ (
hv
2
+12
gh
2
)
y
+ (
huv
)
x
=
fhu
(4)Next, assume that
h
is constant (to leading order). Then equation (2) becomes
u
x
+
v
y
= 0 (5)which expresses that this is an incompressible flow. We can define the streamfunction
ψ
by
u
=
ψ
y
v
=
ψ
x
(6)which automatically satisfies the incompressibility of equation (5). The remain-ing two equations become
u
t
+ 2
uu
x
+ (
uv
)
y
=
fv
(7)
v
t
+ 2
vv
y
+ (
uv
)
x
=
fu
(8)Define the vorticity
ω
by
ω
=
v
x
u
y
.
(9)We can simplify these equations as follows. Subtract the
y
-derivative of (7) fromthe
x
-derivative of (8) and use equations (5) and (9) to simplify (see appendix Cfor details). The result is
ω
t
+
x
+
y
= 0 (10)Adding a diffusion term (representing viscosity) to the right hand side and usingequation (6) leads to
ω
t
ψ
y
ω
x
+
ψ
x
ω
y
=
ν 
2
ω
(11)where
2
ω
=
ω
xx
+
ω
yy
and
ν 
is a small constant factor.Another relationship between vorticity
ω
and the stream function
ψ
is gleanedfrom the following
ω
=
v
x
u
y
= (
ψ
x
)
x
(
ψ
y
)
y
(12)
ω
=
2
ψ
(13)3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->