Velocity, Vorticity, and Curling into a fetal position….
When you’re in school and college, Math teachers constantly cram theories and formulas down your throat at a pace that could choke even the heartiest of mammals, but never give you any practical applications of any of it. So it tends to fall into the “memorize it in the short term” category, and you forget it the day after the test. And then it comes back to bite you in the ass during finals…
Warning: This blog entry is highly math-centric. If you don’t feel up to wading through some tough calculus and generally getting a headache, I suggest you turn back now or go learn about Whistling at women.
Today I was blessed with a project that involves visualizing “Vortex Tubes” from a dataset. I have a velocity vector at every point in my dataset, and need to get Vortex Tubes from it. Ok, a little research and talking to coworkers reveals that “Vortex Tubes” are just isosurfaces on a Vorticity field, and Vorticity is “easily” computed from Velocity. Alrighty then… So how do you compute Vorticity? No one could really tell me anything more than what google says: vorticity = curl(velocity) .. Ok, that doesn’t help much.
So what is “curl” ? Unfortunately, I was curling into the fetal position around this point, but I don’t think that’s what it meant. Well, digging around google turns up alot of resources that describe this entry from answers.com:

ooooookaaaaaayy… I’m in a bit over my head. The only thing I really recognize much in that page is the Gradient operator. That I understand, we did that in Calculus. The rest of this is mostly gibberish.. dF(x)/dy ?
Well, I spent most of today thinking about it, and finally made the following realizations:
* dx, dy, and dz are all constant and equal to 1. Since my grid points are all evenly spaced, and uniformly distributed.
* I can compute (with vtk’s vtkImageGradient class) a 3d gradient vector for a scalar field.
* Computing a 3d gradient vector for a field, is basically the same as computing it’s derivative based on x, y, & z respectively. So the 2nd component of the grandient of the Velocity’s X vector is dF(x)/dy .
So a few minutes later, and some pretty nasty VTK pipelining, I finally got it all to work. Another practical application found for another obscure mathematical theory. It’s moments like this, however, that your Math teachers always thought about. Why someone couldn’t print exactly what I’ve just posted in this blog entry, I don’t know. Maybe someone, someday will find this useful. Who knows, maybe the Bikini Calculus folks will do an episode and explain it all. I wonder if I could reference it in a conference paper then?

