-
Notifications
You must be signed in to change notification settings - Fork 21
/
user_input.m
115 lines (94 loc) · 2.8 KB
/
user_input.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%% inputting from user
Uinitial = 0.1; % Uinitial in lattice Units
Vinitial = 0.0 ; % Vinitial in lattice Units
Rhoinitial = 1.0; % Rhoinitial in lattice Units
fprintf('choose your method... (or press enter for defualt: 1)\n');
fprintf('1.bounceback\n');
fprintf('2.flippova\n');
fprintf('3.mei\n');
fprintf('4.bozidi\n');
fprintf('5.yu\n');
fprintf('\n>>>');
replymethode = input('');
if isempty(replymethode)
replymethode = 1 ;
end
methode = replymethode;
Tau = 0.8 ; % Tau - Relaxation time
fprintf('\nTau = ? (default: %d)\n',Tau);
replyTau = input('');
if isempty(replyTau)
replyTau = Tau ;
end
Tau = replyTau;
R = 11;
fprintf('\nR = ? (default: %d)\n',R);
replyR = input('');
if isempty(replyR)
replyR = R ;
end
R = replyR;
if methode==2 || methode==3 || methode==5 %%wall rotation available only in two methods
wall_rotation=0;
fprintf('wall rotation = ? (default: %d)\n', wall_rotation);
replywall_rotation = input('');
if isempty(replywall_rotation)
replywall_rotation = wall_rotation ;
end
wall_rotation = replywall_rotation;
end
nx = 200;
fprintf('nx = ? (default: %d)\n',nx);
replynx = input('');
if isempty(replynx)
replynx = nx ;
end
nx = replynx;
ny = 50;
fprintf('ny = ? (default: %d)\n',ny);
replyny = input('');
if isempty(replyny)
replyny = ny ;
end
ny = replyny;
Nu_physical= 1e-3;
fprintf('Nu_physical = ? (default: %f)\n',Nu_physical);
replyNu_physical = input('');
if isempty(replyNu_physical)
replyNu_physical = Nu_physical ;
end
Nu_physical = replyNu_physical;
channel_height=0.01;
fprintf('channel_height = ? (default: %f)\n',channel_height);
replychannel_height = input('');
if isempty(replychannel_height)
replychannel_height = Uinitial ;
end
channel_height = replychannel_height;
fprintf('U initial = ? (default: %f)\n',Uinitial);
replyu = input('');
if isempty(replyu)
replyu = Uinitial ;
end
Uinitial = replyu;
Nu = (Tau-0.5)/3 ;
Re=Uinitial*2*ny/Nu;
Re_cylinder=Uinitial*2*R*3/(Tau-0.5);
FD=R*Rhoinitial*Uinitial^2/105.6430/Re_cylinder;
t_lattice=channel_height^2/ny^2/3*(Tau-1/2)/Nu_physical;
dt=t_lattice;
dx=channel_height/ny;
fprintf('*****************************************\n')
fprintf(' Re of flow = %f \n',Re)
fprintf(' Re Cylinder = %f \n',Re_cylinder)
fprintf(' FD = %f \n',FD)
fprintf(' Tau = %f \n',Tau)
fprintf(' time lattice= %f \n',t_lattice)
fprintf('*****************************************\n')
reply = input('Please review flow paramters, continue? Y/N [Y]', 's');
if isempty(reply)
reply = 'Y';
end
if reply == 'N' || reply == 'n'
return
end