How to calculate vorticity and rotation of the vector field
93 views (last 30 days)
Show older comments
Petr Michalek on 2 Sep 2021
Commented: Bjorn Gustavsson on 3 Sep 2021
I need to calculate the vorticity and rotation of the vector field with the curl function, but I get only Infs and NaNs results. I have 4000 snapshots of a 2D flow field, each snapshot is 159x99 vectors, containts x and y coordinates in mm and U and V components in m/s. The x and y variables are 159x99 double, the Udatar and Vdatar variables are 4000x159x99 double. The included MAT file contains the first snapshot of the flow field.
For the beginning I want to calculate the curl for the first snapshot. Thanks for your help.
close all; clear;
I=159; J=99; IJ=[159 99];
[curlz1,cav1] = curl(x,y,Ures1,Vres1);
Bjorn Gustavsson on 3 Sep 2021
From the help of curl:
[CURLZ, CAV] = curl(U,V) assumes
[X Y] = meshgrid(1:N, 1:M) where [M,N]=SIZE(U).
Since curl is a differential operator you simply have to divide by dx and dy, in the correct places...
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!