Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Q-criterion #29

Open
Shrediquette opened this issue Jan 29, 2021 · 3 comments
Open

Implement Q-criterion #29

Shrediquette opened this issue Jan 29, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Shrediquette
Copy link
Owner

As nicely shown in invariant2_factor.m
in https://github.com/Tianshu-Liu/OpenOpticalFlow

@Shrediquette Shrediquette added the enhancement New feature or request label Jan 29, 2021
@Shrediquette Shrediquette self-assigned this Jan 29, 2021
@Shrediquette
Copy link
Owner Author

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

@Shrediquette
Copy link
Owner Author

#!MC 1400

Created by Tecplot 360 build 14.0.2.35002

$!ALTERDATA
EQUATION = '{Q} = 0'

$!VarSet |NUMVARSINIT| = |NUMVARS|
$!VarSet |NUMVARSINIT| += 1

$!PROMPTFORTEXTSTRING |U|
INSTRUCTIONS = "Enter the variable number for U"
$!PROMPTFORTEXTSTRING |V|
INSTRUCTIONS = "Enter the variable number for V"
$!PROMPTFORTEXTSTRING |W|
INSTRUCTIONS = "Enter the variable number for W"

$!GLOBALTHREEDVECTOR UVAR = |U|
$!GLOBALTHREEDVECTOR VVAR = |V|
$!GLOBALTHREEDVECTOR WVAR = |W|

$!ALTERDATA
EQUATION = '{dudx} = ddx(u)'
$!ALTERDATA
EQUATION = '{dvdx} = ddx(v)'
$!ALTERDATA
EQUATION = '{dwdx} = ddx(w)'
$!ALTERDATA
EQUATION = '{dudy} = ddy(u)'
$!ALTERDATA
EQUATION = '{dvdy} = ddy(v)'
$!ALTERDATA
EQUATION = '{dwdy} = ddy(w)'
$!ALTERDATA
EQUATION = '{dudz} = ddz(u)'
$!ALTERDATA
EQUATION = '{dvdz} = ddz(v)'
$!ALTERDATA
EQUATION = '{dwdz} = ddz(w)'
$!ALTERDATA
EQUATION = '{s11} = {dudx}'
$!ALTERDATA
EQUATION = '{s12} = 0.5*({dudy}+{dvdx})'
$!ALTERDATA
EQUATION = '{s13} = 0.5*({dudz}+{dwdx})'
$!ALTERDATA
EQUATION = '{s22} = {dvdy}'
$!ALTERDATA
EQUATION = '{s23} = 0.5*({dvdz}+{dwdy})'
$!ALTERDATA
EQUATION = '{s33} = {dwdz}'
$!ALTERDATA
EQUATION = '{Omga12} = 0.5*({dudy}-{dvdx})'
$!ALTERDATA
EQUATION = '{Omga13} = 0.5*({dudz}-{dwdx})'
$!ALTERDATA
EQUATION = '{Omga23} = 0.5*({dvdz}-{dwdy})'
$!ALTERDATA
EQUATION = '{s2o2_11} = {s11}**2 + {s12}**2 + {s13}**2 - {Omga12}**2 - {Omga13}**2'
$!ALTERDATA
EQUATION = '{s2o2_12} = {s11}{s12} + {s12}{s22} + {s13}{s23} - {Omga13}{Omga23}'
$!ALTERDATA
EQUATION = '{s2o2_13} = {s11}{s13} + {s12}{s23} + {s13}{s33} - {Omga12}{Omga23}'
$!ALTERDATA
EQUATION = '{s2o2_22} = {s12}**2 + {s22}**2 + {s23}**2 - {Omga12}**2 - {Omga23}**2'
$!ALTERDATA
EQUATION = '{s2o2_23} = {s12}{s13} + {s22}{s23} + {s23}{s33} - {Omga12}{Omga13}'
$!ALTERDATA
EQUATION = '{s2o2_33} = {s13}**2 + {s23}**2 + {s33}**2 - {Omga13}**2 - {Omga23}*2'
$!ALTERDATA
EQUATION = '{Q} = 2
{Omga12}*2 + 2{Omga13}*2 + 2{Omga23}**2 - {S11}**2 - {S22}**2 - {S33}*2 - 2{S12}*2 - 2{S13}*2 - 2{S23}**2'

$!VarSet |NUMVARSFIN| = |NUMVARS|
$!DELETEVARS [|NUMVARSINIT|-|NUMVARS|]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant