final
final
Vx=Uo ;
Vy=0
b a
L1 L2 L3
𝜕𝜔 1
(𝑖) ∭ ⃗ ⋅ ⃗⃗⃗⃗⃗
∙ ⅆ𝑉 + ∬ 𝜔𝑉 ⅆ𝐴 = ∬ ⃗⃗⃗⃗⃗
𝛻𝜔 ⋅ 𝐴
𝜕𝑡 𝑅𝑒
General form:
𝜂+1 𝜂+1 𝜂+1 𝜂+1 𝜂+1 𝜂
𝑎𝑝 𝜔𝑝 + 𝑎𝑤 𝜔𝑤 + 𝑎𝑒 𝜔𝑒 + 𝑎𝑛 𝜔𝑛 + 𝑎𝑠 𝜔𝑠 = 𝑎𝑝𝑜 𝜔𝑝
−𝑉𝑠 1 ∆𝑡 𝑉𝑠 =
𝑉𝑆+𝑉𝑃
;
𝑎𝑠 = ( − )∙ 2
2 𝑅𝑒 ∙ ∆𝑦 ∆𝑦
𝑎𝑝𝑜 = 1
𝜕𝑣𝑥 𝜕𝑣𝑥
𝜔=− ; 𝜑 = 𝑈𝑜. 𝑎 𝜔=− ; 𝜑 = 𝑈𝑜. 𝑎
𝜕𝑦 𝜕𝑦
Vx=Uo ;
𝜕𝑣𝑥
𝜕𝑣𝑦 𝜔=− ;𝜑
Vy=0 𝜕𝑦 𝜕𝑣𝑦
𝜔= ; 𝜑 = 𝑈𝑜. 𝑎 𝜔= ;
𝜕𝑥 = 𝑈𝑜. 𝑎 𝜕𝑥
𝜑 = 𝑈𝑜. 𝑎
𝜔 = 0; 𝜕𝑣𝑥 𝜕𝜔 𝜕𝜑
𝜔=− ; = 0; =0
𝜑 = 𝑈𝑜. 𝑦 𝜕𝑦 𝜕𝑥 𝜕𝑥
𝜕𝑣𝑦 𝜑=0 𝜕𝑣𝑦
𝜔= ; 𝜑=0 𝜔= ; 𝜑=0
𝜕𝑥 𝜕𝑥
𝜕𝑣𝑥 𝜕𝑣𝑥
𝜔=− ; 𝜑=0 𝜔=− ; 𝜑=0
𝜕𝑦 𝜕𝑦
⃗ ⋅ ⃗⃗⃗⃗⃗
(𝑖𝑖) ∭ 𝜔 ⅆ𝑉 = − ∬ 𝛻⃗ 𝜑. ⅆ 𝐴
After discretization:
𝜑𝑝 = 𝜑𝑤 + 𝜑𝑤 + 𝜑𝑤 + 𝜑𝑤 + 𝜔𝑝 ∙ ∆𝑥 2
For obtaining velocity:
𝜕𝜑 −𝜕𝜑
𝑉𝑥 = ; 𝑉𝑦 =
𝜕𝑦 𝜕𝑥
bool isWall(int i, int j, int mx, int my, int lt2, double bigD, double smallD)
{
int c3 = (mx / 2) - (lt2 / 2);
lt = 10.0;
ht = 2.2;
sHt = 0.6;
mx = 50;
my = 11;
entry_velocity = 2.0;
nu = 0.01;
dt = 0.0006;
dy = ht / my; // 0.2
d = dt / (dy * dy);
beta = 1;
length = 4.00;
lt2 = length / dy + 1; // 20
c3 = (mx / 2.0) - (lt2 / 2);
// GENERATING GRID
for (int j = 0; j < my + 2; j++)
{
for (int i = 0; i < mx + 2; i++)
{
if (isWall(i, j, mx, my, lt2, ht, sHt))
{
cout << " | ";
}
else
{
cout << " - ";
}
}
cout << endl;
}
do
{
sum = 0.0;
vy[i][my + 1] = -vy[i][my]; //
bottom
vx[i][my + 1] = -vx[i][my]; //
bottom
omgN[i][my + 1] = 4 * (vx[i][my] / dy) - omgN[i][my]; //
bottom
}
else // Smaller section
{
vy[i][k1] = -vy[i][k1 + 1]; //
top
vx[i][k1] = -vx[i][k1 + 1]; //
top
omgN[i][k1] = -4 * (vx[i][k1 + 1] / dy) - omgN[i][k1 + 1]; //
top
step++;
// writeToFile(vx,vy,psi, omgN, mx, my, step, k1, k2, c3,dy);
// writeToFile(psi, mx, my, "psi", step, k1, k2, c3);
// writeToFile(omgN, mx, my, "vorticity", step, k1, k2, c3);
writer(vx, "vx", mx, my, step, k1, k2, c3, lt2, dy);
writer(omgN, "vorticity", mx, my, step, k1, k2, c3, lt2, dy);
writer(psi, "psi", mx, my, step, k1, k2, c3, lt2, dy);
omgP = omgN;
‘
Series11
Series9
Series7
Series5
Series3
Series1
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51
Velocity contours
8
7
6
5
4
3
2
1
0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
for nu =1
Series15
Series13
Series11
Series9
Series7
Series5
Series3
Series1
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
-3.5--3 -3--2.5 -2.5--2 -2--1.5 -1.5--1 -1--0.5 -0.5-0 0-0.5 0.5-1
1-1.5 1.5-2 2-2.5 2.5-3 3-3.5 3.5-4 4-4.5 4.5-5 5-5.5
5.5-6 6-6.5 6.5-7 7-7.5 7.5-8 8-8.5 8.5-9 9-9.5 9.5-10
10-10.5 10.5-11 11-11.5 11.5-12 12-12.5 12.5-13 13-13.5 13.5-14