SlideShare a Scribd company logo
arXiv:physics/0302010v1[physics.comp-ph]4Feb2003
Incompressible Couette Flow ∗
Maciej Matyka†
email: maq@panoramix.ift.uni.wroc.pl
Exchange Student
at
University of Linkoping
Abstract
This project work report provides a full solution of
simplified Navier Stokes equations for The Incom-
pressible Couette Problem. The well known analyt-
ical solution to the problem of incompressible cou-
ette is compared with a numerical solution. In that
paper, I will provide a full solution with simple C
code instead of MatLab or Fortran codes, which are
known. For discrete problem formulation, implicit
Crank-Nicolson method was used. Finally, the sys-
tem of equation (tridiagonal) is solved with both
Thomas and simple Gauss Method. Results of both
methods are compared.
1 Introduction
Main problem is shown in figure (1). There is
viscous flow between two parallel plates. Upper
plate is moving in x direction with constans velocity
(U = Ue). Lower one is not moving (U = 0). We
are looking for a solution to describe velocity vector
field in the model (between two plates).
∗Thanks for Grzegorz Juraszek (for English languague
checking).
†Student of Computational Physics subsection of Theo-
retical Physics at University of Wroclaw in Poland. Depar-
tament of Physics and Astronomy.
U=Ue
U=0
D Flow
Figure 1: Schematic representation of Couette Flow
Problem
2 Fundamental Equations
Most of incompressible fluid mechanics (dynam-
ics) problems are described by simple Navier-Stokes
equation for incompressible fluid velocity, which can
be written with a form:
∂u
∂t
= (−u∇)u − ∇ϕ + υ∇2
u + g, (1)
where ϕ is defined is defined as the relation of
pressure to density:
ϕ =
p
ρ
(2)
and υ is a kinematics viscosity of the fluid.
We will also use a continuity equation, which can
be written as follows 1
:
1I assume constans density of the fluid.
D = ∇ · v = 0 (3)
Of course, in a case of couette incompressible flow
we will use several simplifications of (1).
3 Mathematical Formulation
of the Couette Problem
Incompressible couette problem is not needed to
solve full Navier-Stokes equations. There is no ex-
ternal force, so first simplification of (1) will be:
∂u
∂t
= (−u∇)u − ∇ϕ + υ∇2
u, (4)
In [1] there can be found easy proof that in cou-
ette problem there are no pressure gradients, which
means that:
∇ϕ = 0, (5)
We will ignore a convection effects so, equation
(4) can be written with a form:
∂u
∂t
= υ∇2
u (6)
Now we have simple differential equation for ve-
locity vector field. That equation is a vector type
and can be simplified even more. Let us write
continuity equation (3) in differential form. Let
u = (u, v), then continuity equation can be ex-
panded as follows2
:
∂u
∂x
+
∂v
∂y
= 0 (7)
We know that there is no u velocity component
gradient along x axis (symmetry of the problem),
so:
∂u
∂x
= 0 (8)
Evaluation of Taylor series3
at points y = 0 and
y = D gives us a proof that only one possible and
physically correct value for y component of velocity
u is:
v = 0 (9)
Because of (9) equation (6) can be written as fol-
lows:
2Only with assumption of non compressible fluid.
3Those simple expressions can be found in [1], chapter
9.2.
∂u
∂t
= υ
∂2
u
∂y2
(10)
Our problem is now simplified to mathematical
problem of solving equations like (10). That is now
a governing problem of incompressible couette flow
analysis.
3.1 Analytical soulution
Analytical solution for velocity profile of steady
flow, without time-changes (steady state) can be
found very easily in an equation:
υ
∂2
u
∂y2
= 0 (11)
And without any changes of viscosity υ it can be
written in form:
∂2
u
∂y2
= 0 (12)
After simple two times integration of equation
(12) we have analytical solution function of (12):
u = c1 · y + c2 (13)
where c1 and c2 are integration constans.
3.2 Boundary Conditions for The
Analytical Solution
Simple boundary conditions are provided in that
problem. We know that:
u =
0 y=0
ue y=D
(14)
Simple applying it to our solution (13) gives a
more specified one, where c1 = ue
D and c2 = 0:
u =
ue
D
· y (15)
It means, that a relationship between u and y is
linear. A Better idea to write that with mathemat-
ical expression is:
u
y
=
ue
D
(16)
Where ue
D is a constans for the problem (initial u
velocity vs size of the model).
2
4 Numerical Solution
4.1 Non-dimensional Form
Let us define some new non-dimensional variables4
:
u =



u
′
= u
ue
y
′
= y
D
t
′
= t
D/ue
(17)
Now let us place these variables into equation
(10) and we have now a non-dimensional equation
written as follows:
ρ
∂u/ue
(t · ue)/D
u2
e
D
= υ
∂2
(u/ue)
∂(y/D)2
ue
D2
(18)
Now we replace all the variables to nondimen-
sional, like defined in (17):
ρ
∂u
′
∂t′
u2
e
D
= υ
∂2
u
′
∂y′2
ue
D2
(19)
Now we will remove all
′
chars from that equa-
tion (only for simplification of notation), and the
equation becomes5
to:
∂u
∂t
=
υ
Dρue
∂2
u
∂y2
(20)
In that equation Reynold’s number Re appears,
and is defined as:
Re =
Dρue
υ
(21)
Where Re is Reynold’s number that depends on
D height of couette model. Finally, the last form of
the equation for the couette problem can be written
as follows:
∂u
∂t
=
1
Re
∂2
u
∂y2
(22)
We will try to formulate numerical solution of the
equation (22).
4.2 Finite - Difference Representa-
tion
In our solution of equation (22) we will use Crank-
Nicolson technique, so discrete representation of
that equation can be written 6
as:
4Exacly the same, like in [1].
5Constans simplification also implemented
6That representation is based on central discrete differen-
tial operators.
un+1
j = un
j +
∆t
2(∆y)2Re
(un+1
j+1 +un
j+1−2un+1
j +un+1
j−1 +un
j−1)
(23)
Simple grouping of all terms which are placed in
time step (n+1) on the left side and rest of them
- on right side, gives us an equation which can be
written as:
Aun+1
j−1 + Bun+1
j + Aun+1
j+1 = Kj (24)
Where Kj is known and depends only on values
u at n time step:
Kj = 1 −
∆t
(∆y)2Re
un
j +
∆t
2(∆y)2Re
(un
j+1 +un
j−1)
(25)
Constans A and B are defined as follows7
:
A = −
∆t
2(∆y)2Re
(26)
B = 1 +
∆t
(∆y)2Re
(27)
4.3 Crank - Nicolson Implicit scheme
For numerical solution we will use one-dimensional
grid points (1, . . . , N + 1) where we will keep cal-
culated u velocities. That means u has values from
the range (u1, u2, . . . , uN+1). We know (from fixed
boundary conditions), that: u1 = 0 and uN+1 = 0.
Simple analysis of the equation (24) gives us a sys-
tem of equations, which can be described by matrix
equation:
A · X = Y (28)
Where A is tridiagonal [N − 1] · [N − 1] matrix
of constant A and B values:
A =








B A
A B A
. . .
. . .
A B A
A B








(29)
X vector is a vector of u values:
X = [u1, u2, . . . , uN+1] (30)
7Directly from equation (23).
3
Y vector is a vector of constans Kj values:
Y = [K1, . . . , KN+1] (31)
5 Solving The System of Lin-
ear Equations
Now the problem comes to solving the matrix - vec-
tor equation (28). There are a lot of numerical
methods for that8
, and we will try to choose two
of them: Thomas and Gauss method. Both are
very similar, and I will start with a description of
my implementation with the simple Gauss method.
5.1 Gauss Method
Choice of the Gauss method for solving system of
linear equations is the easiest way. This simple al-
gorithm is well known, and we can do it very easily
by hand on the paper. However, for big matrices
(big N value) a computer program will provide us
with a fast and precise solution. A very important
thing is that time spent on writing (or implement-
ing, if Gauss procedure was written before) is very
short, because of its simplicity.
I used a Gauss procedure with partial choice of
a/the general element. That is a well known tech-
nique for taking the first element from a column of
a matrix for better numerical accuracy.
The whole Gauss procedure of solving a system of
equations contains three steps. First, we are look-
ing for the general element.
After that, when a general element is in the first
row (we make an exchange of rows9
) we make some
simple calculations (for every value in every row
and column of the matrix) for the simplified matrix
to be diagonal (instead of a tridiagonal one which
we have at the beginning). That is all, because af-
ter diagonalization I implement a simple procedure
(from the end row to the start row of the matrix)
which calculates the whole vector X. There are my
values of ui velocity in all the model10
.
5.2 Thomas Method
Thomas’ method, described in [1] is simplified ver-
sion of Gauss method, created especially for tridiag-
8Especially for tridiagonal matrices like A
9We made it for A matrix, and for X, Y too.
10More detailed description of Gauss method can be found
in a lot of books on numerical methods, like [2].
onal matrices. There is one disadvantage of Gauss
method which disappears when Thomas’ method is
implemented. Gauss method is rather slow, and
lot of computational time is lost, because of special
type of matrix. Tridiagonal matrices contain a lot
of free (zero) values. In the Gauss method these
values joins the calculation, what is useless.
Thomas’ simplification for tridiagonal matrices is
to get only values from non-zero tridiagonal part of
matrix. Simply applying a Thomas’ equations for
our governing matrix equation (28) gives us:
d
′
i = B −
A2
d
′
i−1
(32)
u
′
i = ui −
u
′
iA
d
′
i−1
(33)
We know that exact value of uM is defined as
follows:
uM =
u
′
M
B
(34)
Now solution of the system of equations will be
rather easy. We will use recursion like that:
ui−1 =
u
′
i−1 − A · ui
B
(35)
That easy recursion provides us a solution for the
linear system of equations.
6 Results
Main results are provided as plots of the function:
y
D
= f
u
ue
(36)
In figure (2) there is drawn an analytical solu-
tion to the problem of couette flow. That is linear
function, and we expect that after a several time
steps of numerical procedure we will have the same
configuration of velocity field.
6.1 Different Time Steps
In figure (3) there are results of velocity u calcu-
lation for several different time steps. Analytical
solution is also drawn there.
As we can see in the figure (3) - the solution is
going to be same as analytical one. Beginning state
(known from boundary conditions) is changing and
relaxing.
4
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
y/D
u/u_e
analitycal solution
Figure 2: Analytical exact solution.
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
y/D
u/u_e
step=4
step=8
step=15
step=35
step=69
step=122
analitycal solution
Figure 3: Results for different time steps of numer-
ical calculations.
6.2 Results for Different Reynolds
Numbers
In the figure (4) there is plot of numerical calcula-
tions for different Reynold’s numbers. For example
Reynold’s number depends on i.e. viscosity of the
fluid, size of couette model. As it is shown on the
plot there is strong relationship between the speed
of the velocity field changes and Reynold’s number.
In a couple of words: when Reynolds number in-
creases - frequency of changes also increases.
6.3 Results for Different Grid Den-
sity
In figure (5) there is an example of calculations of
velocity field for different grid density (N number).
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
y/D
u/u_e
Re=500
Re=2000
Re=5000
Re=10000
Figure 4: Calculation for same time (t = 2500) and
different Reynold’s numbers.
We see that there is also strong correlation between
grid density, and speed of changes on the grid. Also,
very interesting case N = 10 shows, that for low
density of the grid changes are very fast, and not
accurate.
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
y/D
u/u_e
N=10
N=15
N=20
N=30
N=50
Figure 5: Calculation for same time (t = 2500),
same Reynold’s numbers (Re=5000) and different
grid density (N number).
6.4 Conclusion
Solving of Incompressible Couette Problem can be
good way to check numerical method, because of
existing analytical solution. In that report there
were presented two methods of solving system of
equations: Gauss and Thomas’ method. System of
equations was taken from Crank-Nicolson Implicit
5
scheme. Well known linear relationships were ob-
served.
6
7 APPENDIX A
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define N (40)
#define NN (N+1)
void Zamien(double *a, double *b) {
double c;
c=*a; *a=*b; *b=c;
}
void WypiszMacierz(double A[NN][NN], int n) {
int i,j;
for(j=1;j<n;j++)
{
for(i=1;i<n;i++) // show matrix
{
printf("%2.4f ",A[i][j]);
}
printf("n");
}
}
void Gauss(double A[NN][NN], double *b, double *x, int n) {
int i,j,k;
double m;
// Gauss Elimination
for(i=0;i<n;i++)
{
// Step #1: Change governing element
m=fabs(A[i][i]);
k=i;
for(j=i+1;j<n;j++)
if(fabs(A[i][j])>m)
{
m=fabs(A[i][j]);
k=j;
}
if(k!=i)
for(j=0;j<n;j++)
{
Zamien(&A[j][i],&A[j][k]);
Zamien(&b[i+1],&b[k+1]);
7
}
// Step #2: make it triangle
for(j=i+1;j<n;j++)
{
m = A[i][j]/A[i][i];
for(k=i;k<n;k++)
A[k][j] = A[k][j] - m*A[k][i];
b[j+1] = b[j+1] - m*b[i+1];
}
}
// Step#3: Solve now
for(i=n-1;i>=1;i--)
{
for(j=i+1;j<n;j++)
b[i+1] = b[i+1]-A[j][i]*x[j+1];
x[i+1] = b[i+1]/A[i][i];
}
}
int main(void)
{
double U[N*2+2]={0},A[N*2+2]={0},B[N*2+2]={0},C[N*2+2]={0},D[N*2+2]={0},Y[N*2+2]={0};
// initialization
double OneOverN = 1.0/(double)N;
double Re=5000; // Reynolds number
double EE=1.0; // dt parameter
double t=0;
double dt=EE*Re*OneOverN*2; // delta time
double AA=-0.5*EE;
double BB=1.0+EE;
int KKEND=1122;
int KKMOD=1;
int KK; // for a loop
int i,j,k; // for loops too
int M; // temporary needed variable
double GMatrix[NN][NN]={0}; // for Gauss Elimination
double test;
Y[1]=0; // init
// apply boundary conditions for Couette Problem
U[1]=0.0;
U[NN]=1.0;
// initial conditions (zero as values of vertical velocity inside of the couette model)
for(j=2;j<=N;j++)
U[j]=0.0;
8
A[1]=B[1]=C[1]=D[1]=1.0;
for(KK=1;KK<=KKEND;KK++)
{
for(j=2;j<=N;j++)
{
Y[j]=Y[j-1]+OneOverN;
A[j]=AA;
if(j==N)
A[j]=0.0;
D[j]=BB;
B[j]=AA;
if(j==2)
B[j]=0.0;
C[j]=(1.0-EE)*U[j]+0.5*EE*(U[j+1]+U[j-1]);
if(j==N)
C[j]=C[j]-AA*U[NN];
}
// Gauss
// C[] - free
// A[]B[]D[] - for matrix calculation
// U[] - X
// calculate matrix for Gauss Elimination
GMatrix[0][0]=D[1];
GMatrix[1][0]=A[1];
for(i=1;i<N-1;i++)
{
GMatrix[i-1][i]=B[i+1]; // GMatrix[1][2]=B[2]
GMatrix[i][i]=D[i+1]; // GMatrix[2][2]=D[2]
GMatrix[i+1][i]=A[i+1]; // GMatrix[3][2]=A[2]
}
GMatrix[N-2][N-1]=B[N];
GMatrix[N-1][N-1]=D[N];
Gauss(GMatrix,C,U,N); // Gauss solving function
Y[1]=0.0;
Y[NN]=Y[N]+OneOverN;
t=t+dt; // time increment
test=KK % KKMOD;
if(test < 0.01) // print the results
{
printf("KK,TIMEn"); // info 1
printf("%d,%fn",KK,t);
9
printf(",J,Y[J],U[j]n"); // info 2
for(j=1;j<=NN;j++)
printf("%d , %f, %fn",j,U[j],Y[j]);
printf("n n n n"); // for nice view of several datas
}
}
return (1);
}
8 APPENDIX B
#include <stdlib.h>
#include <stdio.h>
#define N (50)
#define NN (N+1)
int main(void)
{
double U[N*2+2],A[N*2+2],B[N*2+2],C[N*2+2],D[N*2+2],Y[N*2+2];
// initialization
double OneOverN = 1.0/(double)N;
double Re=7000; // Reynolds number
double EE=1.0; // dt parameter
double t=0;
double dt=EE*Re*OneOverN*2; // delta time
double AA=-0.5*EE;
double BB=1.0+EE;
int KKEND=122;
int KKMOD=1;
int KK; // for a loop
int j,k; // for loops too
int M; // temporary needed variable
double test;
Y[1]=0; // init
// apply boundary conditions for Couette Problem
U[1]=0.0;
U[NN]=1.0;
// initial conditions (zero as values of vertical velocity inside of the couette model)
for(j=2;j<=N;j++)
U[j]=0.0;
A[1]=B[1]=C[1]=D[1]=1.0;
printf("dt=%f, Re=%f, N=%d n",dt,Re, N);
10
for(KK=1;KK<=KKEND;KK++)
{
for(j=2;j<=N;j++)
{
Y[j]=Y[j-1]+OneOverN;
A[j]=AA;
if(j==N)
A[j]=0.0;
D[j]=BB;
B[j]=AA;
if(j==2)
B[j]=0.0;
C[j]=(1.0-EE)*U[j]+0.5*EE*(U[j+1]+U[j-1]);
if(j==N)
C[j]=C[j]-AA*U[NN];
}
// upper bidiagonal form
for(j=3;j<=N;j++)
{
D[j]=D[j]-B[j]*A[j-1]/D[j-1];
C[j]=C[j]-C[j-1]*B[j]/D[j-1];
}
// calculation of U[j]
for(k=2;k<N;k++)
{
M=N-(k-2);
U[M]=(C[M]-A[M]*U[M+1])/D[M]; // Appendix A
}
Y[1]=0.0;
Y[NN]=Y[N]+OneOverN;
t=t+dt; // time increment
test=KK % KKMOD;
if(test < 0.01) // print the results
{
printf("KK,TIMEn"); // info 1
printf("%d,%fn",KK,t);
printf(",J,Y[J],U[j]n"); // info 2
for(j=1;j<=NN;j++)
printf("%d , %f, %fn",j,U[j],Y[j]);
printf("n n n n"); // for nice view of several datas
}
}
return (1);
}
11
References
[1] John D. Andertson, Jr. ’Computational Fluid Dynamics: The Basics with Applications’, McGraw-
Hill Inc, 1995.
[2] David Potter ’Metody obliczeniowe fizyki’, PWN 1982.
[3] Ryszard Grybos, ’Podstawy mechaniki plynow’ (Tom 1 i 2), PWN 1998.
12

More Related Content

What's hot

Hypothesis of Riemann's (Comprehensive Analysis)
 Hypothesis of Riemann's (Comprehensive Analysis) Hypothesis of Riemann's (Comprehensive Analysis)
Hypothesis of Riemann's (Comprehensive Analysis)
nikos mantzakouras
 
Constant strain triangular
Constant strain triangular Constant strain triangular
Constant strain triangular
rahul183
 
Solution of System of Linear Equations
Solution of System of Linear EquationsSolution of System of Linear Equations
Solution of System of Linear Equationsmofassair
 
least squares approach in finite element method
least squares approach in finite element methodleast squares approach in finite element method
least squares approach in finite element method
sabiha khathun
 
A Proof of the Riemann Hypothesis
A Proof of the Riemann  HypothesisA Proof of the Riemann  Hypothesis
A Proof of the Riemann Hypothesis
nikos mantzakouras
 
A Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's ConjectureA Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's Conjecture
nikos mantzakouras
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
Matlab Assignment Experts
 
Numerical Differentiation and Integration
 Numerical Differentiation and Integration Numerical Differentiation and Integration
Numerical Differentiation and Integration
Meenakshisundaram N
 
Presentation03 ss
Presentation03 ssPresentation03 ss
Presentation03 ss
nashaat algrara
 
Proof of Beal's conjecture
Proof of Beal's conjecture Proof of Beal's conjecture
Proof of Beal's conjecture
nikos mantzakouras
 
application of first order ordinary Differential equations
application of first order ordinary Differential equationsapplication of first order ordinary Differential equations
application of first order ordinary Differential equations
Emdadul Haque Milon
 
Engineering Mathematics 2 questions & answers
Engineering Mathematics 2 questions & answersEngineering Mathematics 2 questions & answers
Engineering Mathematics 2 questions & answers
Mzr Zia
 
Lesson 19: The Mean Value Theorem (Section 041 handout)
Lesson 19: The Mean Value Theorem (Section 041 handout)Lesson 19: The Mean Value Theorem (Section 041 handout)
Lesson 19: The Mean Value Theorem (Section 041 handout)
Matthew Leingang
 
Jacobi and gauss-seidel
Jacobi and gauss-seidelJacobi and gauss-seidel
Jacobi and gauss-seidel
arunsmm
 
Solution set 3
Solution set 3Solution set 3
Solution set 3
慧环 赵
 

What's hot (18)

Hypothesis of Riemann's (Comprehensive Analysis)
 Hypothesis of Riemann's (Comprehensive Analysis) Hypothesis of Riemann's (Comprehensive Analysis)
Hypothesis of Riemann's (Comprehensive Analysis)
 
Constant strain triangular
Constant strain triangular Constant strain triangular
Constant strain triangular
 
Solution of System of Linear Equations
Solution of System of Linear EquationsSolution of System of Linear Equations
Solution of System of Linear Equations
 
least squares approach in finite element method
least squares approach in finite element methodleast squares approach in finite element method
least squares approach in finite element method
 
A Proof of the Riemann Hypothesis
A Proof of the Riemann  HypothesisA Proof of the Riemann  Hypothesis
A Proof of the Riemann Hypothesis
 
A Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's ConjectureA Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's Conjecture
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
 
Numerical Differentiation and Integration
 Numerical Differentiation and Integration Numerical Differentiation and Integration
Numerical Differentiation and Integration
 
Presentation03 ss
Presentation03 ssPresentation03 ss
Presentation03 ss
 
Proof of Beal's conjecture
Proof of Beal's conjecture Proof of Beal's conjecture
Proof of Beal's conjecture
 
application of first order ordinary Differential equations
application of first order ordinary Differential equationsapplication of first order ordinary Differential equations
application of first order ordinary Differential equations
 
Ch08 1
Ch08 1Ch08 1
Ch08 1
 
Engineering Mathematics 2 questions & answers
Engineering Mathematics 2 questions & answersEngineering Mathematics 2 questions & answers
Engineering Mathematics 2 questions & answers
 
Lesson 19: The Mean Value Theorem (Section 041 handout)
Lesson 19: The Mean Value Theorem (Section 041 handout)Lesson 19: The Mean Value Theorem (Section 041 handout)
Lesson 19: The Mean Value Theorem (Section 041 handout)
 
Jacobi and gauss-seidel
Jacobi and gauss-seidelJacobi and gauss-seidel
Jacobi and gauss-seidel
 
Solution set 3
Solution set 3Solution set 3
Solution set 3
 
Ch03 2
Ch03 2Ch03 2
Ch03 2
 
Ch03 3
Ch03 3Ch03 3
Ch03 3
 

Similar to Coueete project

Dr. majeed &humam paper
Dr. majeed &humam paperDr. majeed &humam paper
Dr. majeed &humam paper
Alexander Decker
 
The_variational_iteration_method_for_solving_linea.pdf
The_variational_iteration_method_for_solving_linea.pdfThe_variational_iteration_method_for_solving_linea.pdf
The_variational_iteration_method_for_solving_linea.pdf
P Ramana
 
A Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple ContactsA Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple Contacts
Joshua Gorinson
 
Series_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdfSeries_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdf
mohamedtawfik358886
 
An Introduction to Linear Algebra.pdf
An Introduction to Linear Algebra.pdfAn Introduction to Linear Algebra.pdf
An Introduction to Linear Algebra.pdf
Ashley Carter
 
An Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
An Efficient Approach For Solving Stiff Nonlinear Boundary Value ProblemsAn Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
An Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
Sherri Cost
 
Numerical Solutions of Burgers' Equation Project Report
Numerical Solutions of Burgers' Equation Project ReportNumerical Solutions of Burgers' Equation Project Report
Numerical Solutions of Burgers' Equation Project ReportShikhar Agarwal
 
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
ijcsa
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final Project
Stasik Nemirovsky
 
numerical.ppt
numerical.pptnumerical.ppt
numerical.ppt
SuyashPatil72
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidelCesar Mendoza
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidelCesar Mendoza
 
Mit2 092 f09_lec18
Mit2 092 f09_lec18Mit2 092 f09_lec18
Mit2 092 f09_lec18
Rahman Hakim
 
directed-research-report
directed-research-reportdirected-research-report
directed-research-reportRyen Krusinga
 
My paper for Domain Decomposition Conference in Strobl, Austria, 2005
My paper for Domain Decomposition Conference in Strobl, Austria, 2005My paper for Domain Decomposition Conference in Strobl, Austria, 2005
My paper for Domain Decomposition Conference in Strobl, Austria, 2005
Alexander Litvinenko
 
A Stochastic Limit Approach To The SAT Problem
A Stochastic Limit Approach To The SAT ProblemA Stochastic Limit Approach To The SAT Problem
A Stochastic Limit Approach To The SAT Problem
Valerie Felton
 

Similar to Coueete project (20)

Dr. majeed &humam paper
Dr. majeed &humam paperDr. majeed &humam paper
Dr. majeed &humam paper
 
The_variational_iteration_method_for_solving_linea.pdf
The_variational_iteration_method_for_solving_linea.pdfThe_variational_iteration_method_for_solving_linea.pdf
The_variational_iteration_method_for_solving_linea.pdf
 
A Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple ContactsA Numerical Method For Friction Problems With Multiple Contacts
A Numerical Method For Friction Problems With Multiple Contacts
 
Series_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdfSeries_Solution_Methods_and_Special_Func.pdf
Series_Solution_Methods_and_Special_Func.pdf
 
project final
project finalproject final
project final
 
An Introduction to Linear Algebra.pdf
An Introduction to Linear Algebra.pdfAn Introduction to Linear Algebra.pdf
An Introduction to Linear Algebra.pdf
 
An Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
An Efficient Approach For Solving Stiff Nonlinear Boundary Value ProblemsAn Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
An Efficient Approach For Solving Stiff Nonlinear Boundary Value Problems
 
Numerical Solutions of Burgers' Equation Project Report
Numerical Solutions of Burgers' Equation Project ReportNumerical Solutions of Burgers' Equation Project Report
Numerical Solutions of Burgers' Equation Project Report
 
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
SUCCESSIVE LINEARIZATION SOLUTION OF A BOUNDARY LAYER CONVECTIVE HEAT TRANSFE...
 
Numerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final ProjectNumerical Methods in Mechanical Engineering - Final Project
Numerical Methods in Mechanical Engineering - Final Project
 
Sol75
Sol75Sol75
Sol75
 
numerical.ppt
numerical.pptnumerical.ppt
numerical.ppt
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Mit2 092 f09_lec18
Mit2 092 f09_lec18Mit2 092 f09_lec18
Mit2 092 f09_lec18
 
directed-research-report
directed-research-reportdirected-research-report
directed-research-report
 
My paper for Domain Decomposition Conference in Strobl, Austria, 2005
My paper for Domain Decomposition Conference in Strobl, Austria, 2005My paper for Domain Decomposition Conference in Strobl, Austria, 2005
My paper for Domain Decomposition Conference in Strobl, Austria, 2005
 
A Stochastic Limit Approach To The SAT Problem
A Stochastic Limit Approach To The SAT ProblemA Stochastic Limit Approach To The SAT Problem
A Stochastic Limit Approach To The SAT Problem
 
Hbam2011 09
Hbam2011 09Hbam2011 09
Hbam2011 09
 
pRO
pROpRO
pRO
 

Recently uploaded

Reimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a SuccessReimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a Success
Mark Murphy Director
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
Isaac More
 
This Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I MadeThis Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I Made
Aarush Ghate
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdf
Suleman Rana
 
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog EternalMeet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Blog Eternal
 
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to StardomYoung Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
greendigital
 
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdfMaximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
Xtreame HDTV
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
get joys
 
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
Rodney Thomas Jr
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
Isaac More
 
Christina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptxChristina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptx
madeline604788
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy Director
Mark Murphy Director
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
Madhura TBRC
 
Hollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest galleryHollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest gallery
Zsolt Nemeth
 
Tom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive AnalysisTom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive Analysis
greendigital
 
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdfCreate a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Genny Knight
 
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles onlineTreasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Hidden Treasure Hunts
 
I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
Sabrina Ricci
 
A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024
Indira Srivatsa
 

Recently uploaded (19)

Reimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a SuccessReimagining Classics - What Makes a Remake a Success
Reimagining Classics - What Makes a Remake a Success
 
Skeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on ForumSkeem Saam in June 2024 available on Forum
Skeem Saam in June 2024 available on Forum
 
This Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I MadeThis Is The First All Category Quiz That I Made
This Is The First All Category Quiz That I Made
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdf
 
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog EternalMeet Crazyjamjam - A TikTok Sensation | Blog Eternal
Meet Crazyjamjam - A TikTok Sensation | Blog Eternal
 
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to StardomYoung Tom Selleck: A Journey Through His Early Years and Rise to Stardom
Young Tom Selleck: A Journey Through His Early Years and Rise to Stardom
 
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdfMaximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
Maximizing Your Streaming Experience with XCIPTV- Tips for 2024.pdf
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
 
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
From Slave to Scourge: The Existential Choice of Django Unchained. The Philos...
 
Scandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.zaScandal! Teasers June 2024 on etv Forum.co.za
Scandal! Teasers June 2024 on etv Forum.co.za
 
Christina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptxChristina's Baby Shower Game June 2024.pptx
Christina's Baby Shower Game June 2024.pptx
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy Director
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
 
Hollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest galleryHollywood Actress - The 250 hottest gallery
Hollywood Actress - The 250 hottest gallery
 
Tom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive AnalysisTom Selleck Net Worth: A Comprehensive Analysis
Tom Selleck Net Worth: A Comprehensive Analysis
 
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdfCreate a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
Create a Seamless Viewing Experience with Your Own Custom OTT Player.pdf
 
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles onlineTreasure Hunt Puzzles, Treasure Hunt Puzzles online
Treasure Hunt Puzzles, Treasure Hunt Puzzles online
 
I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
 
A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024A TO Z INDIA Monthly Magazine - JUNE 2024
A TO Z INDIA Monthly Magazine - JUNE 2024
 

Coueete project

  • 1. arXiv:physics/0302010v1[physics.comp-ph]4Feb2003 Incompressible Couette Flow ∗ Maciej Matyka† email: maq@panoramix.ift.uni.wroc.pl Exchange Student at University of Linkoping Abstract This project work report provides a full solution of simplified Navier Stokes equations for The Incom- pressible Couette Problem. The well known analyt- ical solution to the problem of incompressible cou- ette is compared with a numerical solution. In that paper, I will provide a full solution with simple C code instead of MatLab or Fortran codes, which are known. For discrete problem formulation, implicit Crank-Nicolson method was used. Finally, the sys- tem of equation (tridiagonal) is solved with both Thomas and simple Gauss Method. Results of both methods are compared. 1 Introduction Main problem is shown in figure (1). There is viscous flow between two parallel plates. Upper plate is moving in x direction with constans velocity (U = Ue). Lower one is not moving (U = 0). We are looking for a solution to describe velocity vector field in the model (between two plates). ∗Thanks for Grzegorz Juraszek (for English languague checking). †Student of Computational Physics subsection of Theo- retical Physics at University of Wroclaw in Poland. Depar- tament of Physics and Astronomy. U=Ue U=0 D Flow Figure 1: Schematic representation of Couette Flow Problem 2 Fundamental Equations Most of incompressible fluid mechanics (dynam- ics) problems are described by simple Navier-Stokes equation for incompressible fluid velocity, which can be written with a form: ∂u ∂t = (−u∇)u − ∇ϕ + υ∇2 u + g, (1) where ϕ is defined is defined as the relation of pressure to density: ϕ = p ρ (2) and υ is a kinematics viscosity of the fluid. We will also use a continuity equation, which can be written as follows 1 : 1I assume constans density of the fluid.
  • 2. D = ∇ · v = 0 (3) Of course, in a case of couette incompressible flow we will use several simplifications of (1). 3 Mathematical Formulation of the Couette Problem Incompressible couette problem is not needed to solve full Navier-Stokes equations. There is no ex- ternal force, so first simplification of (1) will be: ∂u ∂t = (−u∇)u − ∇ϕ + υ∇2 u, (4) In [1] there can be found easy proof that in cou- ette problem there are no pressure gradients, which means that: ∇ϕ = 0, (5) We will ignore a convection effects so, equation (4) can be written with a form: ∂u ∂t = υ∇2 u (6) Now we have simple differential equation for ve- locity vector field. That equation is a vector type and can be simplified even more. Let us write continuity equation (3) in differential form. Let u = (u, v), then continuity equation can be ex- panded as follows2 : ∂u ∂x + ∂v ∂y = 0 (7) We know that there is no u velocity component gradient along x axis (symmetry of the problem), so: ∂u ∂x = 0 (8) Evaluation of Taylor series3 at points y = 0 and y = D gives us a proof that only one possible and physically correct value for y component of velocity u is: v = 0 (9) Because of (9) equation (6) can be written as fol- lows: 2Only with assumption of non compressible fluid. 3Those simple expressions can be found in [1], chapter 9.2. ∂u ∂t = υ ∂2 u ∂y2 (10) Our problem is now simplified to mathematical problem of solving equations like (10). That is now a governing problem of incompressible couette flow analysis. 3.1 Analytical soulution Analytical solution for velocity profile of steady flow, without time-changes (steady state) can be found very easily in an equation: υ ∂2 u ∂y2 = 0 (11) And without any changes of viscosity υ it can be written in form: ∂2 u ∂y2 = 0 (12) After simple two times integration of equation (12) we have analytical solution function of (12): u = c1 · y + c2 (13) where c1 and c2 are integration constans. 3.2 Boundary Conditions for The Analytical Solution Simple boundary conditions are provided in that problem. We know that: u = 0 y=0 ue y=D (14) Simple applying it to our solution (13) gives a more specified one, where c1 = ue D and c2 = 0: u = ue D · y (15) It means, that a relationship between u and y is linear. A Better idea to write that with mathemat- ical expression is: u y = ue D (16) Where ue D is a constans for the problem (initial u velocity vs size of the model). 2
  • 3. 4 Numerical Solution 4.1 Non-dimensional Form Let us define some new non-dimensional variables4 : u =    u ′ = u ue y ′ = y D t ′ = t D/ue (17) Now let us place these variables into equation (10) and we have now a non-dimensional equation written as follows: ρ ∂u/ue (t · ue)/D u2 e D = υ ∂2 (u/ue) ∂(y/D)2 ue D2 (18) Now we replace all the variables to nondimen- sional, like defined in (17): ρ ∂u ′ ∂t′ u2 e D = υ ∂2 u ′ ∂y′2 ue D2 (19) Now we will remove all ′ chars from that equa- tion (only for simplification of notation), and the equation becomes5 to: ∂u ∂t = υ Dρue ∂2 u ∂y2 (20) In that equation Reynold’s number Re appears, and is defined as: Re = Dρue υ (21) Where Re is Reynold’s number that depends on D height of couette model. Finally, the last form of the equation for the couette problem can be written as follows: ∂u ∂t = 1 Re ∂2 u ∂y2 (22) We will try to formulate numerical solution of the equation (22). 4.2 Finite - Difference Representa- tion In our solution of equation (22) we will use Crank- Nicolson technique, so discrete representation of that equation can be written 6 as: 4Exacly the same, like in [1]. 5Constans simplification also implemented 6That representation is based on central discrete differen- tial operators. un+1 j = un j + ∆t 2(∆y)2Re (un+1 j+1 +un j+1−2un+1 j +un+1 j−1 +un j−1) (23) Simple grouping of all terms which are placed in time step (n+1) on the left side and rest of them - on right side, gives us an equation which can be written as: Aun+1 j−1 + Bun+1 j + Aun+1 j+1 = Kj (24) Where Kj is known and depends only on values u at n time step: Kj = 1 − ∆t (∆y)2Re un j + ∆t 2(∆y)2Re (un j+1 +un j−1) (25) Constans A and B are defined as follows7 : A = − ∆t 2(∆y)2Re (26) B = 1 + ∆t (∆y)2Re (27) 4.3 Crank - Nicolson Implicit scheme For numerical solution we will use one-dimensional grid points (1, . . . , N + 1) where we will keep cal- culated u velocities. That means u has values from the range (u1, u2, . . . , uN+1). We know (from fixed boundary conditions), that: u1 = 0 and uN+1 = 0. Simple analysis of the equation (24) gives us a sys- tem of equations, which can be described by matrix equation: A · X = Y (28) Where A is tridiagonal [N − 1] · [N − 1] matrix of constant A and B values: A =         B A A B A . . . . . . A B A A B         (29) X vector is a vector of u values: X = [u1, u2, . . . , uN+1] (30) 7Directly from equation (23). 3
  • 4. Y vector is a vector of constans Kj values: Y = [K1, . . . , KN+1] (31) 5 Solving The System of Lin- ear Equations Now the problem comes to solving the matrix - vec- tor equation (28). There are a lot of numerical methods for that8 , and we will try to choose two of them: Thomas and Gauss method. Both are very similar, and I will start with a description of my implementation with the simple Gauss method. 5.1 Gauss Method Choice of the Gauss method for solving system of linear equations is the easiest way. This simple al- gorithm is well known, and we can do it very easily by hand on the paper. However, for big matrices (big N value) a computer program will provide us with a fast and precise solution. A very important thing is that time spent on writing (or implement- ing, if Gauss procedure was written before) is very short, because of its simplicity. I used a Gauss procedure with partial choice of a/the general element. That is a well known tech- nique for taking the first element from a column of a matrix for better numerical accuracy. The whole Gauss procedure of solving a system of equations contains three steps. First, we are look- ing for the general element. After that, when a general element is in the first row (we make an exchange of rows9 ) we make some simple calculations (for every value in every row and column of the matrix) for the simplified matrix to be diagonal (instead of a tridiagonal one which we have at the beginning). That is all, because af- ter diagonalization I implement a simple procedure (from the end row to the start row of the matrix) which calculates the whole vector X. There are my values of ui velocity in all the model10 . 5.2 Thomas Method Thomas’ method, described in [1] is simplified ver- sion of Gauss method, created especially for tridiag- 8Especially for tridiagonal matrices like A 9We made it for A matrix, and for X, Y too. 10More detailed description of Gauss method can be found in a lot of books on numerical methods, like [2]. onal matrices. There is one disadvantage of Gauss method which disappears when Thomas’ method is implemented. Gauss method is rather slow, and lot of computational time is lost, because of special type of matrix. Tridiagonal matrices contain a lot of free (zero) values. In the Gauss method these values joins the calculation, what is useless. Thomas’ simplification for tridiagonal matrices is to get only values from non-zero tridiagonal part of matrix. Simply applying a Thomas’ equations for our governing matrix equation (28) gives us: d ′ i = B − A2 d ′ i−1 (32) u ′ i = ui − u ′ iA d ′ i−1 (33) We know that exact value of uM is defined as follows: uM = u ′ M B (34) Now solution of the system of equations will be rather easy. We will use recursion like that: ui−1 = u ′ i−1 − A · ui B (35) That easy recursion provides us a solution for the linear system of equations. 6 Results Main results are provided as plots of the function: y D = f u ue (36) In figure (2) there is drawn an analytical solu- tion to the problem of couette flow. That is linear function, and we expect that after a several time steps of numerical procedure we will have the same configuration of velocity field. 6.1 Different Time Steps In figure (3) there are results of velocity u calcu- lation for several different time steps. Analytical solution is also drawn there. As we can see in the figure (3) - the solution is going to be same as analytical one. Beginning state (known from boundary conditions) is changing and relaxing. 4
  • 5. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 y/D u/u_e analitycal solution Figure 2: Analytical exact solution. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 y/D u/u_e step=4 step=8 step=15 step=35 step=69 step=122 analitycal solution Figure 3: Results for different time steps of numer- ical calculations. 6.2 Results for Different Reynolds Numbers In the figure (4) there is plot of numerical calcula- tions for different Reynold’s numbers. For example Reynold’s number depends on i.e. viscosity of the fluid, size of couette model. As it is shown on the plot there is strong relationship between the speed of the velocity field changes and Reynold’s number. In a couple of words: when Reynolds number in- creases - frequency of changes also increases. 6.3 Results for Different Grid Den- sity In figure (5) there is an example of calculations of velocity field for different grid density (N number). 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 y/D u/u_e Re=500 Re=2000 Re=5000 Re=10000 Figure 4: Calculation for same time (t = 2500) and different Reynold’s numbers. We see that there is also strong correlation between grid density, and speed of changes on the grid. Also, very interesting case N = 10 shows, that for low density of the grid changes are very fast, and not accurate. 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 y/D u/u_e N=10 N=15 N=20 N=30 N=50 Figure 5: Calculation for same time (t = 2500), same Reynold’s numbers (Re=5000) and different grid density (N number). 6.4 Conclusion Solving of Incompressible Couette Problem can be good way to check numerical method, because of existing analytical solution. In that report there were presented two methods of solving system of equations: Gauss and Thomas’ method. System of equations was taken from Crank-Nicolson Implicit 5
  • 6. scheme. Well known linear relationships were ob- served. 6
  • 7. 7 APPENDIX A #include <stdlib.h> #include <stdio.h> #include <math.h> #define N (40) #define NN (N+1) void Zamien(double *a, double *b) { double c; c=*a; *a=*b; *b=c; } void WypiszMacierz(double A[NN][NN], int n) { int i,j; for(j=1;j<n;j++) { for(i=1;i<n;i++) // show matrix { printf("%2.4f ",A[i][j]); } printf("n"); } } void Gauss(double A[NN][NN], double *b, double *x, int n) { int i,j,k; double m; // Gauss Elimination for(i=0;i<n;i++) { // Step #1: Change governing element m=fabs(A[i][i]); k=i; for(j=i+1;j<n;j++) if(fabs(A[i][j])>m) { m=fabs(A[i][j]); k=j; } if(k!=i) for(j=0;j<n;j++) { Zamien(&A[j][i],&A[j][k]); Zamien(&b[i+1],&b[k+1]); 7
  • 8. } // Step #2: make it triangle for(j=i+1;j<n;j++) { m = A[i][j]/A[i][i]; for(k=i;k<n;k++) A[k][j] = A[k][j] - m*A[k][i]; b[j+1] = b[j+1] - m*b[i+1]; } } // Step#3: Solve now for(i=n-1;i>=1;i--) { for(j=i+1;j<n;j++) b[i+1] = b[i+1]-A[j][i]*x[j+1]; x[i+1] = b[i+1]/A[i][i]; } } int main(void) { double U[N*2+2]={0},A[N*2+2]={0},B[N*2+2]={0},C[N*2+2]={0},D[N*2+2]={0},Y[N*2+2]={0}; // initialization double OneOverN = 1.0/(double)N; double Re=5000; // Reynolds number double EE=1.0; // dt parameter double t=0; double dt=EE*Re*OneOverN*2; // delta time double AA=-0.5*EE; double BB=1.0+EE; int KKEND=1122; int KKMOD=1; int KK; // for a loop int i,j,k; // for loops too int M; // temporary needed variable double GMatrix[NN][NN]={0}; // for Gauss Elimination double test; Y[1]=0; // init // apply boundary conditions for Couette Problem U[1]=0.0; U[NN]=1.0; // initial conditions (zero as values of vertical velocity inside of the couette model) for(j=2;j<=N;j++) U[j]=0.0; 8
  • 9. A[1]=B[1]=C[1]=D[1]=1.0; for(KK=1;KK<=KKEND;KK++) { for(j=2;j<=N;j++) { Y[j]=Y[j-1]+OneOverN; A[j]=AA; if(j==N) A[j]=0.0; D[j]=BB; B[j]=AA; if(j==2) B[j]=0.0; C[j]=(1.0-EE)*U[j]+0.5*EE*(U[j+1]+U[j-1]); if(j==N) C[j]=C[j]-AA*U[NN]; } // Gauss // C[] - free // A[]B[]D[] - for matrix calculation // U[] - X // calculate matrix for Gauss Elimination GMatrix[0][0]=D[1]; GMatrix[1][0]=A[1]; for(i=1;i<N-1;i++) { GMatrix[i-1][i]=B[i+1]; // GMatrix[1][2]=B[2] GMatrix[i][i]=D[i+1]; // GMatrix[2][2]=D[2] GMatrix[i+1][i]=A[i+1]; // GMatrix[3][2]=A[2] } GMatrix[N-2][N-1]=B[N]; GMatrix[N-1][N-1]=D[N]; Gauss(GMatrix,C,U,N); // Gauss solving function Y[1]=0.0; Y[NN]=Y[N]+OneOverN; t=t+dt; // time increment test=KK % KKMOD; if(test < 0.01) // print the results { printf("KK,TIMEn"); // info 1 printf("%d,%fn",KK,t); 9
  • 10. printf(",J,Y[J],U[j]n"); // info 2 for(j=1;j<=NN;j++) printf("%d , %f, %fn",j,U[j],Y[j]); printf("n n n n"); // for nice view of several datas } } return (1); } 8 APPENDIX B #include <stdlib.h> #include <stdio.h> #define N (50) #define NN (N+1) int main(void) { double U[N*2+2],A[N*2+2],B[N*2+2],C[N*2+2],D[N*2+2],Y[N*2+2]; // initialization double OneOverN = 1.0/(double)N; double Re=7000; // Reynolds number double EE=1.0; // dt parameter double t=0; double dt=EE*Re*OneOverN*2; // delta time double AA=-0.5*EE; double BB=1.0+EE; int KKEND=122; int KKMOD=1; int KK; // for a loop int j,k; // for loops too int M; // temporary needed variable double test; Y[1]=0; // init // apply boundary conditions for Couette Problem U[1]=0.0; U[NN]=1.0; // initial conditions (zero as values of vertical velocity inside of the couette model) for(j=2;j<=N;j++) U[j]=0.0; A[1]=B[1]=C[1]=D[1]=1.0; printf("dt=%f, Re=%f, N=%d n",dt,Re, N); 10
  • 11. for(KK=1;KK<=KKEND;KK++) { for(j=2;j<=N;j++) { Y[j]=Y[j-1]+OneOverN; A[j]=AA; if(j==N) A[j]=0.0; D[j]=BB; B[j]=AA; if(j==2) B[j]=0.0; C[j]=(1.0-EE)*U[j]+0.5*EE*(U[j+1]+U[j-1]); if(j==N) C[j]=C[j]-AA*U[NN]; } // upper bidiagonal form for(j=3;j<=N;j++) { D[j]=D[j]-B[j]*A[j-1]/D[j-1]; C[j]=C[j]-C[j-1]*B[j]/D[j-1]; } // calculation of U[j] for(k=2;k<N;k++) { M=N-(k-2); U[M]=(C[M]-A[M]*U[M+1])/D[M]; // Appendix A } Y[1]=0.0; Y[NN]=Y[N]+OneOverN; t=t+dt; // time increment test=KK % KKMOD; if(test < 0.01) // print the results { printf("KK,TIMEn"); // info 1 printf("%d,%fn",KK,t); printf(",J,Y[J],U[j]n"); // info 2 for(j=1;j<=NN;j++) printf("%d , %f, %fn",j,U[j],Y[j]); printf("n n n n"); // for nice view of several datas } } return (1); } 11
  • 12. References [1] John D. Andertson, Jr. ’Computational Fluid Dynamics: The Basics with Applications’, McGraw- Hill Inc, 1995. [2] David Potter ’Metody obliczeniowe fizyki’, PWN 1982. [3] Ryszard Grybos, ’Podstawy mechaniki plynow’ (Tom 1 i 2), PWN 1998. 12