20 |
Lx=dx*nx; |
Lx=dx*nx; |
21 |
Ly=dy*(ny-1); % Solid wall in North |
Ly=dy*(ny-1); % Solid wall in North |
22 |
|
|
23 |
|
% Variable resolution |
24 |
|
y=(1:ny)/(ny-0)-0.5; |
25 |
|
dy=1-0.3*exp( -(5*y).^2 ); |
26 |
|
%dy=ones(1,ny); % Constant resolution |
27 |
|
dy=dy/sum(dy(1:ny-1))*Ly; |
28 |
|
fid=fopen('dy.bin','w',ieee); fwrite(fid,dy,prec); fclose(fid); |
29 |
|
|
30 |
% Coordinates |
% Coordinates |
31 |
xc=((1:nx)-0.5)*dx; |
xc=((1:nx)-0.5)*dx; |
32 |
yc=((1:ny)-0.5)*dy-Ly/2; |
yf=-Ly/2+[0 cumsum(dy)]; |
33 |
|
yc=(yf(1:end-1)+yf(2:end))/2; |
34 |
zf=[0 -cumsum(dz)]; |
zf=[0 -cumsum(dz)]; |
35 |
zc=(zf(1:end-1)+zf(2:end))/2; |
zc=(zf(1:end-1)+zf(2:end))/2; |
36 |
[X,Y]=ndgrid(xc,yc); |
[X,Y]=ndgrid(xc,yc); |