Curl, Divergence calculation from velocity data

조회 수: 2 (최근 30일)
Turbulence Analysis
Turbulence Analysis 2020년 8월 6일
답변: Turbulence Analysis 2020년 8월 7일
Hi,
I have calculate the Curl, Divergence from the velocity data file available in 4650 x 4 array. Here 1, 2, 3, and 4 columns reprsents x, y, u, v. I have tried with below script, but I am getting some error. Please help..
X = data (:,1);
Y = data (:,2);
UU = data (:,3);
VV = data (:,4);
[X,Y] = meshgrid(X,Y);
[UU, VV] = meshgrid(UU,VV);
f = curl(UU,VV);
  댓글 수: 2
Sudheer Bhimireddy
Sudheer Bhimireddy 2020년 8월 6일
"some error" doesn't help much. Post your error so that we can help.
Turbulence Analysis
Turbulence Analysis 2020년 8월 7일
Hi, The error msg is as below
Index in position 1 is invalid. Array indices must be positive integers or logical values.

댓글을 달려면 로그인하십시오.

답변 (3개)

Bruno Luong
Bruno Luong 2020년 8월 7일
편집: Bruno Luong 2020년 8월 7일
Your data is already gridded, no need to gridded on top of it
load('matlab.mat')
UU=reshape(data(:,3),[75 62]);
VV=reshape(data(:,4),[75 62]);
X=reshape(data(:,1),[75 62]);
Y=reshape(data(:,2),[75 62]);
close all
figure
quiver(X,Y,UU,VV);
f = curl(UU,VV);
figure
imagesc(f');
  댓글 수: 1
Turbulence Analysis
Turbulence Analysis 2020년 8월 7일
Hi, Bruno,
Many thanks for your quick reply..
Actually, I am getting only vector plot. Stiil, getting below error while exceuting 'curl'
Index in position 1 is invalid. Array indices must be positive integers or logical values.

댓글을 달려면 로그인하십시오.


Turbulence Analysis
Turbulence Analysis 2020년 8월 7일
Hi, Bruno,
Now, I am able to execute curl function. However, it seems, some mistake in curl computtaion. Actually, the calculated vorticity should look something similar to the attached fig.
Furthermore, I would like to get the vector plot and vorticty plot on the same fig, I tried with 'hold on', but I am not gettting correct figure..
I would be great if you could help me with this...
  댓글 수: 5
Turbulence Analysis
Turbulence Analysis 2020년 8월 7일
Thnaks..
For instnace if I need to get only dVx/dy , how to implement this ..

댓글을 달려면 로그인하십시오.


Turbulence Analysis
Turbulence Analysis 2020년 8월 7일
Hi,
Many thanks for your support..
For gradieant I have used as follows
[dx, dy]= gradient (UU');
I am getting good results
I am getting good results...

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by