1 |
edhill |
1.1 |
clear |
2 |
|
|
clear path |
3 |
|
|
whos |
4 |
|
|
global Nx Ny Nz |
5 |
|
|
global lat long dz dm mdep |
6 |
|
|
global delt_su su_its t_su delt |
7 |
|
|
global descriptor this_path |
8 |
|
|
global f deltaf Q beta r_expt r_heat H |
9 |
|
|
global time rots it |
10 |
|
|
global g Cp rho_bar alpha |
11 |
|
|
global w3d |
12 |
|
|
global iterations |
13 |
|
|
|
14 |
|
|
|
15 |
|
|
param_file_name = ... |
16 |
|
|
input(' Please enter the name of the m-file with the parameters for this run : ','s') ; |
17 |
|
|
feval(param_file_name) ; |
18 |
|
|
path = this_path |
19 |
|
|
cmdstr=['cd ' path ]; |
20 |
|
|
eval(cmdstr); |
21 |
|
|
path=pwd |
22 |
|
|
|
23 |
|
|
figure;hold on |
24 |
|
|
|
25 |
|
|
sizeit=size(iterations); |
26 |
|
|
|
27 |
|
|
ufilename=(['U.' iterations((1),1:10) ]); |
28 |
|
|
vfilename=(['V.' iterations((1),1:10) ]); |
29 |
|
|
uold=rdmeta(ufilename,'b'); |
30 |
|
|
vold=rdmeta(vfilename,'b'); |
31 |
|
|
for i=2:sizeit(1) |
32 |
|
|
ufilename=(['U.' iterations((i),1:10) ]); |
33 |
|
|
vfilename=(['V.' iterations((i),1:10) ]); |
34 |
|
|
unew=rdmeta(ufilename,'b'); |
35 |
|
|
vnew=rdmeta(vfilename,'b'); |
36 |
|
|
udif=(unew-uold).^2; |
37 |
|
|
vdif=(vnew-vold).^2; |
38 |
|
|
uold=unew; |
39 |
|
|
vold=vnew; |
40 |
|
|
timeu(i)=sum(sum(sum(udif+vdif))); |
41 |
|
|
plot(eval(iterations((i),1:10)),timeu(i),'o');drawnow |
42 |
|
|
end |
43 |
|
|
|
44 |
|
|
title(descriptor) |
45 |
|
|
xlabel('timestep') |
46 |
|
|
ylabel('change in velocity') |
47 |
|
|
grid |
48 |
|
|
|