GithubHelp home page GithubHelp logo

Implement Q-criterion about pivlab HOT 3 OPEN

Shrediquette avatar Shrediquette commented on May 30, 2024
Implement Q-criterion

from pivlab.

Comments (3)

Shrediquette avatar Shrediquette commented on May 30, 2024

https://de.mathworks.com/matlabcentral/answers/1566758-find-q-criterion-and-lambda2-from-velocity-values?s_tid=srchtitle

from pivlab.

Shrediquette avatar Shrediquette commented on May 30, 2024

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

from pivlab.

Shrediquette avatar Shrediquette commented on May 30, 2024

#!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|]

from pivlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.