Cross Product in Vorticity Confinement
When Vorticity confinement force is described, it's always written as follows:
In the 2D case: how can i compute the cross product (ψ x w) ?
Isn't ψ a vector (the gradient of a scalar field) and w a scalar (the vorticity in the 2D case is a scalar)?
And isn't the cross product of a vector and a scalar undefined?
When searchin in google for
"Cross product of a scalar"
the only site, that doesn't say ".. and a vector is not defined" is the following:
"(...) the cross product of a scalar and
a vector is
a × b = (−a*b_2, a*b_1)."
I think that's also the way that nvidea implemented vorticity confinement in its example code.
Can anybody explain this to me? is it really a cross product of a scalar and a vector? And why do 99% of the sites say this is impossible?
Vorticity in 2D is not a scalar, it is a vector with one nonzero component directed out of the plane. So all vector operations are applicable.
OK, thank you, that would solve the syntactical problem :).
but isn't vorticity defined as
http://http.developer.nvidia.com/GPU...inks/U2207.GIF x wor as wikipedia says:
Or is the definition altered for 2D?
How does the vector exactly look like, that should i use then in the cross product?
Thats correct. There is only one component of vorticity as you have written. It points in the z direction.
I got it :)
Ah, so you do a 3D-Cross-Product, even though your simulation is in 2D.
Thank you very much for your help :)
Minus sign confusion
I'm implementing Jos Stam's Stable Fluids method and I would like to add vorticity confinement to create a more detailed flow.
My implementation is in 2D and I have a simple problem with the very last step:
psi = [ psi_x, psi_y, 0]
w = [ 0, 0, vort_z ]
With the cross product:
f_vc_x = dx * e * psi_y * vort_z
f_vc_y = dx * e * psi_x * -vort_z
My headache is that I've found in other source codes that my minus sign could be wrong (minus goes to the f_vc_x component instead of the y part).
It's a simple cross product, but really can't figure out what is wrong. Am I missing something fundamental? Thanks!
PS: hopefully, it's ok to post my question here since my problem is quite related.
|All times are GMT -4. The time now is 15:09.|