surface integral of discrete data
41 views (last 30 days)
Show older comments
I would like to compute the circulation of a velocity field. I think that the best way would be to compute the vorticity and then calculate the surface integral. At the moment I have computed vorticity using curl(X,Y,U,V) Where X,Y,U,V are all 2D matrices. Now that I have vorticity, how can I calculate the surface integral of vorticity? I found solutions if the velocity field can be defined by a function, but not if it is a set of descrete points.
thanks
0 Comments
Answers (2)
Richard Brown
on 22 Apr 2012
This came up recently -- in this thread there is code for computing the surface area based on dividing a regular mesh into triangles:
2 Comments
Richard Brown
on 23 Apr 2012
Sorry, I read your question too fast and pointed you to code for surface area, not surface integral. In this case it's even easier, as your "surface" that you're integrating over is just the xy plane, and the vorticity is all oriented directly upwards. So the surface integral is simply
dx = 0.01;
dy = 0.01;
x = 0:dx:3;
y = 0:dy:1;
[X,Y] = meshgrid(x,y);
U = X.^2.*Y;
V = X.*Y;
[W,~] = curl(X,Y,U,V);
[m,n] = size(W);
vort = 0.25 * (W(1:m-1,1:n-1) + W(1:m-1,2:n) + W(2:m,1:n-1) + W(2:m,2:n));
circulation = sum(vort(:))*dx*dy
A couple of notes:
- Make sure you call curl with two output arguments, otherwise it returns the angular velocity only
- The vorticity that you're integrating over is evaluated at the centre of each rectangle, hence the averaging expression on the vort = line
2 Comments
Richard Brown
on 23 Apr 2012
And you could do it without the averaging by defining your grid slightly differently
x = (dx/2):dx:(3-dx/2);
y = (dy/2):dy:(1-dy/2);
circulation = sum(W(:)) * dx * dy
Sindhu
on 7 Mar 2014
I also have the same problem statement. "To find Circulation in the yz plane". I understand the coding till the vorticity part. But why do you take an averaged value for vorticity? This is hopefully first order accurate and what should I do If I need second order accuracy? Please suggests me some books or sites to understand the calculations. I went through few lectures on surface integral and parameterization of surfaces. It seems to be confusing and I could not figure out what is the math behind it.
See Also
Categories
Find more on Fluid Dynamics 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!