I want to write Navier-Stokes equations in generalised orthogonal frame of reference in Mathematica. I therefore want to expand gradient and other vector calculus operations using metric factors such that Grad[ϕ[x1, x2, x3], {x1, x2, x3}] expands as
$$\nabla \phi = \frac{1}{h_1} \frac{\partial \phi}{\partial x_1} \mathbf i_1 + \frac{1}{h_2} \frac{\partial \phi}{\partial x_2} \mathbf i_2 + \frac{1}{h_3} \frac{\partial \phi}{\partial x_3} \mathbf i_3,$$
where h1, h2 and h3 are maintained in the Mathematica's output so I can express the equations, after simplifying the expansions, in a desired reference frame. I do not really know how to make Mathematica use the metrics h.
Could you provide me with some methodology for this?
grad= {1/h1 D[#,x1], 1/h2 D[#,x2],1/h3 D[#,x3]}&. – Daniel Huber Jan 29 '24 at 18:09