Q-criterion
Hi,
could you help me to create a Matlab script for visualization of vortex by Q-criterion? I have the gradient of velocity gained by DNS with software Channelflow. This file because of the construct for becomes 4-D double: 32x33x32x9, where 9 indicates le nine components of the gradient in every nodes. How can I write the script to display the vortex by the Q-criterion? Q = 0.5(Ω^2− S^2), where Ω=tr[ΩΩt ]^1/2and S=tr[SSt ]^1/2 with S = 1/2 (∇v + (∇v)t) and Ω= 1/2(∇v - (∇v)t) but how I use ∇v ? In Matlab, please. Thanks a lot |
Let us suppose you have the following matrix:
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: %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 hope it works |
Thanks a lot... ;)
|
sbaffini
Can you please write a blog with all this cool stuff (and also for LES) |
Dear Far,
i'm glad you appreciate my contributions. I admit that is now a long time i'm thinking about putting all this stuff together in some place that i already identified as a cfd-online blog... However, as you may imagine, time is never enough as all the material would require some modifications or testing before being directly posted for the general use. In contrast, posting specific answers once in a while is more easy and directly useful for the one who asked. Nonetheless, as my working group was also considering this opportunity to "share stuff", i promise i will now seriously consider posting on a blog. |
It took me a while to actually understand what you meant by blog. I'm doing it now ;)
|
;) I am still trying to understand :D
|
@sbaffini: You have wonderful skills
|
Still, they are quite difficult to exchange with money ;)
Thanks |
uits for Q-criterion
I have a simple question what units are used for q-criterion
|
Quote:
|
Quote:
|
Dimensions are velocity squared over length squared, which is inverse time squared.
|
All times are GMT -4. The time now is 11:41. |