Vorticity Calculations



Hello,
> I am starting to delve into fluid mechanics. Though I will use
> extensively Fortran or C for computational tasks, I am interested in
> analytical results.
Which ones?
> I am sure that Maxima is capable of working ouyt cross products, but I
> wonder if it is any difficult to work out the curl of a vector field,
> as it is needed for instance when I want to get the vorticity (defined
> as the curl of a velocity field).
I recommend to look at share/tensor and exterior algebra package there.
In maxima itensor notations the curl can be introduced in two ways.
1) curl_B: 'levi_civita([],[i,l,n])*B([n],[],l).
Currently, simplification algorithms of itensor does not work very well with 
antisymmetric  tensor products. So maxima will not able to cancel even such 
a simple thing like 'levi_civita([],[i,l,n])*B([n],[],l,i) (divergence of 
curl). There is a way over if to consider the derivative symbolically. Say 
define the derivative operator via U([n],[])
Then the curl will be  curl_B: 'levi_civita([],[i,l,n])*U([l],[])*B([n],[]).
then maxima will be abbe to simplify 
U([i],[])*'levi_civita([],[i,l,n])*U([l],[])*B([n],[])

curl:'levi_civita([],[i,l,n])*U([l],[])*B([n],[]);
(%o27)         levi_civita([], [i, l, n]) U([l], []) B([n], [])
(%i28) div_curl:U([i],[])*curl;
(%o28)    levi_civita([], [i, l, n]) U([i], []) U([l], []) B([n], [])
(%i29) canform(%);
(%o29) levi_civita([], [j1, j2, j3]) U([j1], []) U([j2], []) B([j3], [])
(%i30) applyb1(div_curl,lc_u,lc_l);
(%o30) levi_civita([], [j21, j20, j19]) U([i], [])
 (kdelta([j19], [i]) (kdelta([j20], [n]) kdelta([j21], [l])
 - kdelta([j20], [l]) kdelta([j21], [n]))
 - kdelta([j20], [i]) (kdelta([j19], [n]) kdelta([j21], [l])
 - kdelta([j19], [l]) kdelta([j21], [n]))
 + (kdelta([j19], [n]) kdelta([j20], [l])
 - kdelta([j19], [l]) kdelta([j20], [n])) kdelta([j21], [i])) U([l], [])
 B([n], [])/6
(%i31) canform(contract(expand(%)));
(%o31)                                 0

2) We have the exterior algebra package capabilities within itensor. So if you 
consider one form (covariant vector) which has one to one correspondence with 
usual  vector field on the manifold with metric. Then, the exterior 
derivative of one-form corresponds to curl of vector field. The identities of 
vector calculus can be easily reproduce within exterior algebra of one-forms.   
 Especially,  the conservation of two Hopf's like invariants in ideal MHD is 
considered inside  plazma.dem and helicity.dem (there are in share/tensor as 
well).


best regards,
Valery