(OverVector[U])·∇(OverVector[U]) = -(OverVector[U])×∇×(OverVector[U])+∇((U^2)/2)

Introduction

As a boy, Richard Feynman wrote in his notebook:
THE MOST REMARKABLE
FORMULA
IN MATH
(e^(iπ))+1=0
At the risk of seeming somewhat less sophisticated,
let me express similar enthusiam for:
(OverVector[U])·∇(OverVector[U]) = -(OverVector[U])×∇×(OverVector[U])+∇((U^2)/2)

In finding the components of (OverVector[U])·∇(OverVector[U]), one might expect much tedium in differentiating unit vectors in non-Cartesian coordinate systems.  But with the use of  (OverVector[U])·∇(OverVector[U]) = -(OverVector[U])×∇×(OverVector[U])+∇((U^2)/2), we can avoid that tedium.  This treatise The ARPS and COAMPS Coordinate System should be read before attempting to understand this notebook.

Vector Calculus Functions

Given a list a with the three compents of (OverVector[a]), a list q with the three coordinates,  and a list h with three scale factors find the curl.  The formula has two flavors CurlExpl and Curl. CurlExpl uses the total derivative Dt, and explicity expresses what coordinates are held constant so the differentiation is a partial differentiation. Curl is useful if neither a and h are expressed explicitly in terms of the q; it's only benefit being that the output is slightly easier to read.

CurlExpl[a_,q_,h_]:={
	(Dt[h[[3]]a[[3]],q[[2]],
				Constants->{q[[1]],q[[3]]} ]
		-Dt[h[[2]]a[[2]],q[[3]],
					Constants->{q[[1]],q[[2]]} ])
	/(h[[2]]h[[3]]),
			(Dt[h[[1]]a[[1]],q[[3]],
				Constants->{q[[1]],q[[2]]} ]
		-Dt[h[[3]]a[[3]],q[[1]],
					Constants->{q[[2]],q[[3]]} ])
	/(h[[1]]h[[3]]),	
		(Dt[h[[2]]a[[2]],q[[1]],
				Constants->{q[[2]],q[[3]]} ]
		-Dt[h[[1]]a[[1]],q[[2]],
					Constants->{q[[1]],q[[3]]} ])
	/(h[[1]]h[[2]])}

Curl[a_,q_,h_]:={
		((Dt[h[[3]]a[[3]],q[[2]] ]
		-Dt[h[[2]]a[[2]],q[[3]] ])
	/(h[[2]]h[[3]])),
		((Dt[h[[1]]a[[1]],q[[3]] ]
		-Dt[h[[3]]a[[3]],q[[1]] ])
	/(h[[1]]h[[3]])),
	((Dt[h[[2]]a[[2]],q[[1]] ]
		-Dt[h[[1]]a[[1]],q[[2]] ])
	/(h[[1]]h[[2]]))}

Two flavors of divergence of (OverVector[a]) , but they are not used here.

DivExpl[a_,q_,h_]:={
	Dt[h[[2]]h[[3]]a[[1]],q[[1]],
			Constants->{q[[2]],q[[3]]}]
				/(h[[1]]h[[2]]h[[3]]),
+Dt[h[[1]]h[[3]]a[[2]],q[[2]],
				Constants->{q[[1]],q[[3]]}]
				/(h[[1]]h[[2]]h[[3]]),
+Dt[h[[1]]h[[2]]a[[3]],q[[3]],
			Constants->{q[[1]],q[[2]]}]
				/(h[[1]]h[[2]]h[[3]])}

Div[a_,q_,h_]:={
	Dt[h[[2]]h[[3]]a[[1]],q[[1]]]
				/(h[[1]]h[[2]]h[[3]]),
+Dt[h[[1]]h[[3]]a[[2]],q[[2]]]
				/(h[[1]]h[[2]]h[[3]]),
+Dt[h[[1]]h[[2]]a[[3]],q[[3]]]
				/(h[[1]]h[[2]]h[[3]])}

Two flavors of the gradient of a.

GradExpl[a_,q_,h_]:={
	Dt[a,q[[1]],
			Constants->{q[[2]],q[[3]]}]/h[[1]],
Dt[a,q[[2]],
			Constants->{q[[1]],q[[3]]}]/h[[2]],
Dt[a,q[[3]],
			Constants->{q[[1]],q[[2]]}]/h[[3]]}

Grad[a_,q_,h_]:={
Dt[a,q[[1]]]/h[[1]],
Dt[a,q[[2]]]/h[[2]],
Dt[a,q[[3]]]/h[[3]]}

Two flavors of (OverVector[U])·∇(OverVector[U]):

UDelUExpl[u_,q_,h_]:=-Cross[u,CurlExpl[u,q,h]]+GradExpl[Dot[u,u]/2,q,h]//Simplify

UDelU[u_,q_,h_]:=-Cross[u,Curl[u,q,h]]+Grad[Dot[u,u]/2,q,h]//Simplify

Let's Try It!

We need to specify a list holding velocity components an a list holding coordinates.  A bug(?) in Mathematica prevented me from using subscripts without triggering some strange behavior.

vel={v1,v2,v3};

coords={q1,q2,q3};

Spherical

qsphere={r,colat,lon};

hsphere={1,r,r*Sin[colat]};

sphterms=UDelUExpl[vel,qsphere,hsphere]

Check out Holton, or similar textbook, to see if the above is the correct form of (OverVector[U])·∇(OverVector[U]) for
spherical coordinates.

general case

scalef={h1,h2,h3};

Let's calculate something simple first, the curl:

vort=Curl[vel,coords,scalef]

generalcase=UDelU[vel,coords,scalef]

explform=UDelUExpl[vel,coords,scalef]

Lambert conformal

mapfactors={1/m,1/m,1};

lambert=UDelU[vel,coords,mapfactors]

Uterm=lambert[[1]]

Vterm=lambert[[2]]