MATLAB MATLAB: Fluid Flow - Curl of a Vector Field

AI Thread Summary
The discussion centers on calculating vorticity from a velocity field represented by matrices of fluid position and velocity (x, y, u, v) obtained through particle image velocimetry. The user seeks to derive a matrix representing the curl of the velocity field, specifically looking for clarity on how MATLAB's curl function performs this calculation. It is noted that MATLAB uses finite differences to compute partial derivatives, applying central differences for interior data points and single-sided differences for edge points. The user expresses gratitude for the clarification after having overlooked this detail in the documentation. The focus remains on understanding the mathematical process behind the curl calculation and seeking further advice on implementation.
Tallus Bryne
Messages
34
Reaction score
8
TL;DR Summary
Looking for a mathematical description of what exactly the MATLAB curl function does when doing something like [curlz, cav] = curl(x,y,u,v).
I am working with some data which represents the fluid position and velocity for each point of measurement as an x, y, u, and v matrix (from particle image velocimetry). I have done things like circulation, and discretizing the line integral involved was no problem. I am stuck when trying to calculate the vorticity at each point. Lets say each x, y, u, v matrix is NxN. I would like to find a NxN matrix which represents the curl of the associated velocity field. I'm aware of the curl function on MATLAB and how [curlz, cav] = curl(x,y,u,v) will do the job just fine. What I'm really wondering is how exactly MATLAB's curl function does this calculation, or just how it would be done on paper in a simple case. Aside from a solution, I'd also appreciate any advice or hints.
 
Physics news on Phys.org
From the "Algorithms" section of the documentation:

curl computes the partial derivatives in its definition by using finite differences. For interior data points, the partial derivatives are calculated using central difference. For data points along the edges, the partial derivatives are calculated using single-sided (forward) difference.
 
  • Like
Likes FactChecker
Wow. I don't know how many times I looked over that documentation page, even up to the previous section "Numerical Curl and Angular Velocity" and was somehow blind to the "Algorithms" each time. Appreciate the quick response, thanks!
 
Back
Top