CFD Online URL
[Sponsors]
Home > Forums

Q-criterion isosurfaces in MATLAB

Register Blogs Members List Search Today's Posts Mark Forums Read

Rate this Entry

Q-criterion isosurfaces in MATLAB

Posted July 1, 2013 at 12:33 by sbaffini

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
Posted in Uncategorized
Views 1537 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 14:49.