CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Cross Product in Vorticity Confinement (

Kastenfrosch May 12, 2010 09:35

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:

which says
"(...) 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?

agd May 12, 2010 12:00

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.

Kastenfrosch May 12, 2010 13:05

OK, thank you, that would solve the syntactical problem :).

but isn't vorticity defined as x w
with w = (u,v)?
or 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?

praveen May 12, 2010 13:14

Thats correct. There is only one component of vorticity as you have written. It points in the z direction.

Kastenfrosch May 13, 2010 15:19

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 :)

praveen May 14, 2010 00:08


Originally Posted by Kastenfrosch (Post 258683)
Ah, so you do a 3D-Cross-Product, even though your simulation is in 2D.
Thank you very much for your help :)

Yes, thats correct.

Toorop July 30, 2010 06:45

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 18:50.