Q-criterion isosurfaces in MATLAB
Let us suppose you have the following matrices:
x(nx,ny,nz): x coordinates of your grid
y(nx,ny,nz): y coordinates of your grid
z(nx,ny,nz): z coordinates of your grid
dudx(nx,ny,nz): x-wise derivative of x-wise velocity component
dudy(nx,ny,nz): y-wise derivative of x-wise velocity component
.
.
.
dwdz(nx,ny,nz): z-wise derivative of z-wise velocity component
This is, more or less, how i would put it down in Matlab the task of plotting Q isosurfaces (tipically used for flow visualization in DNS/LES):
%MATLAB CODE
iso_q=100; %Pick your number here
%Definition of Q
q=-0.5*(dudx.^2+dvdy.^2+dwdz.^2)-dudy.*dvdx-dudz.*dwdx-dvdz.*dwdy;
%Plotting a Q isosurface, Q=iso_q
figure()
p=patch(isosurface(x,y,z,q,iso_q));
set(p,'FaceColor','red','EdgeColor','none');
daspect([1,1,1])
axis tight
ax = -1; ay = 1; az = 1;
view([ax,ay,az]);
camroll(240)
camlight
lighting gouraud
%END OF MATLAB CODE
x(nx,ny,nz): x coordinates of your grid
y(nx,ny,nz): y coordinates of your grid
z(nx,ny,nz): z coordinates of your grid
dudx(nx,ny,nz): x-wise derivative of x-wise velocity component
dudy(nx,ny,nz): y-wise derivative of x-wise velocity component
.
.
.
dwdz(nx,ny,nz): z-wise derivative of z-wise velocity component
This is, more or less, how i would put it down in Matlab the task of plotting Q isosurfaces (tipically used for flow visualization in DNS/LES):
%MATLAB CODE
iso_q=100; %Pick your number here
%Definition of Q
q=-0.5*(dudx.^2+dvdy.^2+dwdz.^2)-dudy.*dvdx-dudz.*dwdx-dvdz.*dwdy;
%Plotting a Q isosurface, Q=iso_q
figure()
p=patch(isosurface(x,y,z,q,iso_q));
set(p,'FaceColor','red','EdgeColor','none');
daspect([1,1,1])
axis tight
ax = -1; ay = 1; az = 1;
view([ax,ay,az]);
camroll(240)
camlight
lighting gouraud
%END OF MATLAB CODE
Total Comments 0