CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Q-criterion

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By sbaffini
  • 1 Post By Santiago

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2013, 07:32
Default Q-criterion
  #1
New Member
 
Carlo
Join Date: Apr 2013
Posts: 2
Rep Power: 0
imaginor is on a distinguished road
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

imaginor is offline   Reply With Quote

Old   April 29, 2013, 12:16
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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
Far and bkay like this.
sbaffini is offline   Reply With Quote

Old   April 30, 2013, 03:19
Default
  #3
New Member
 
Carlo
Join Date: Apr 2013
Posts: 2
Rep Power: 0
imaginor is on a distinguished road
Thanks a lot...
imaginor is offline   Reply With Quote

Old   April 30, 2013, 09:04
Default
  #4
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
sbaffini

Can you please write a blog with all this cool stuff (and also for LES)
Far is offline   Reply With Quote

Old   April 30, 2013, 14:32
Default
  #5
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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.
sbaffini is offline   Reply With Quote

Old   July 1, 2013, 11:31
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
It took me a while to actually understand what you meant by blog. I'm doing it now
sbaffini is offline   Reply With Quote

Old   July 1, 2013, 13:12
Default
  #7
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
I am still trying to understand
Far is offline   Reply With Quote

Old   July 1, 2013, 13:21
Default
  #8
Far
Super Moderator
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,553
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
@sbaffini: You have wonderful skills
Far is offline   Reply With Quote

Old   July 1, 2013, 14:14
Default
  #9
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Still, they are quite difficult to exchange with money

Thanks
sbaffini is offline   Reply With Quote

Old   July 11, 2018, 14:48
Default uits for Q-criterion
  #10
New Member
 
Josh
Join Date: Jul 2018
Posts: 1
Rep Power: 0
engineerjlittle is on a distinguished road
I have a simple question what units are used for q-criterion
engineerjlittle is offline   Reply With Quote

Old   July 11, 2018, 15:55
Default
  #11
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
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
You leave out the important stuff here: the calculation of the velocity gradients, which is not difficult, but needs care
Santiago is offline   Reply With Quote

Old   July 11, 2018, 15:58
Default
  #12
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 15
Santiago is on a distinguished road
Quote:
Originally Posted by Santiago View Post
You leave out the important stuff here: the calculation of the velocity gradients, which is not difficult, but needs care
Nevermind my answer, i read incorrectly
sbaffini likes this.
Santiago is offline   Reply With Quote

Old   July 11, 2018, 16:00
Default
  #13
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dimensions are velocity squared over length squared, which is inverse time squared.
sbaffini is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 09:48
[ICEM] low edge criterion value problem mraxx ANSYS Meshing & Geometry 6 April 30, 2013 09:03
Asymptotic stopping criterion is not working rob50904 STAR-CCM+ 2 January 28, 2013 08:25
convergence criterion Dominique FLUENT 5 November 24, 2006 02:36
Convergence criterion Moose Main CFD Forum 5 June 9, 2005 20:39


All times are GMT -4. The time now is 20:27.