Loading [MathJax]/jax/output/CommonHTML/jax.js

Orthogonal Curvilinear Coordinates

Posted on January 16th, 2012
Previous Article :: Next Article

Imagine that you need to numerically solve a differential equation, let’s say the Poisson’s equation, 2ϕ=ρ/ϵ0, on an arbitrary curve. You can easily accomplish this using the Finite Difference Method, if (and this is a big if) the curve is aligned with one of the coordinate axes. If it’s not, like the curve shown in Figure 1, then you can derive the numerical scheme using the Finite Volume method. But this second approach is cumbersome. The scheme will be more complex since it will depend on two or three variables. Not only will this complicate the coding, it will also make the physical interpretation of the solution (which varies with the distance along the line) more difficult.

General orthogonal curvilinear coordinate system

So is there another option? We said in the introductions that the Finite Difference method can be used if the curve is aligned with a coordinate axis. So, why can’t we just define a new set of coordinates such that our curve becomes one of them?

Turns out we can – and this is the motivation for working in general orthogonal curvilinear coordinates. The difference between a general curvilinear system and the Cartesian one is that the axes orientation and scaling changes with the spatial position. But despite this, the axes always remain orthogonal. This is where the “orthogonal” part comes from (there are also non-orthogonal systems but those are more complicated to derive). You are already familiar with two curvilinear systems: the cylindrical and the spherical coordinates. In this post we will derive the math governing such systems. We will use it in a follow up post to develop the general curvilinear potential solver.

Figure 1. Schematic of a general curvilinear problem. We are interested in solving an equation along the arbitrary curve. We define a new orthogonal coordinate system that rotates with the curve tangent vector.

Scale Factors and Unit Vectors

Consider the position vector at some point in space. In the Cartesian coordinates, the position vector is given by r=xi+yj+zk. To be more general, we define the vector as r=x1i1+x2i2+x3i3. Now assume that at this point we have another orthogonal coordinate system (u1,u2,u3) such that ui=ui(x1,x2,x3). Similarly, a reverse relationship also exists, xi=xi(u1,u2,u3).

In order to define vector operators in this new coordinate system, we need to determine how the position vector changes with a change in this new coordinate system. The differential displacement in the u1 direction is given by
dr1=ru1du1=[x1u1i1+x2u1i2+x3u1i3]du1

The magnitude of this vector is |dr1|=|r/u1|du1=h1du1. The h1=|r/u1| term is called a scale factor. It relates the actual displacement in a given coordinate direction to the magnitude of the change of that coordinate.

With these definitions, we can define the unit vector in the u1 direction (basis vector),
e1=dr1|dr1|=1h1ru1
This expression can be rewritten as
h1e1=ru1

When both sides of the equations are squared (dot product), we obtain an expression for the magnitude of the scale factor,
h1=(x1u1)2+(x2u1)2+(x3u1)2

Of course, similar expressions exist in the two other directions.

Example: Scaling Factors in the Cylindrical Coordinate System

To demonstrate how this works, let’s consider the cylindrical coordinate. In these coordinates, (u1,u2,u3)=(r,θ,z). With (x1,x2,x3)=(x,y,z) we have the following transformation x=rcosθ, y=rsinθ, and z=z. Then

h1=hr=cos2θ+sin2θ+0=1h2=hθ=r2sin2θ+r2cos2θ=rh3=hz=1

This implies that in cylindrical coordinates a differential displacement is given by dr=drer+rdθeθ+dzez

Derivatives of Unit Vectors

We will next derive two important sets of relationships that deal with derivatives of coordinates and unit vectors. First, consider the expression ui. Since ui is a coordinate, regions with constant ui define isosurfaces in our 3D domain. This value changes only in the direction normal to these isosurface, i.e. the direction of the coordinate basis vector. This concept is illustrated in the image to the right. Hence we have
ui=uir=1hiei
This expression is just another form (inverse) of the scale factor definition given in the previous section.

We next derive expressions for derivatives of unit vectors of form ep(eq/ur). Consider the second derivative
2ru2u1=u2(e1h1)=e1u2h1+e1h1u2
Similarly, by inverting the order of differentiation, we obtain
2ru1u2=u1(e2h2)=e2u1h2+e2h2u1

Since the order of differentiation does not matter, the two expressions are equal. We set them to each other, and also dot both sides with e1 to obtain
e1e1u2h1+e1e1h1u2=e1e2u1h2+e1e2h2u10+h1u2=e1e2u1h2+0
The first term on the LHS vanishes since a gradient is by definition normal to the surface of constant value which is what a basis vector gives us. The last term on the RHS also vanishes since the coordinate system is orthogonal, i.e. e1e2=e2e3=e3e1=0.

Finally,
e1e2u1=u1(e1e2)e1u1e2=0e1u1e2
again by orthogonality. We thus have
e2e1u1=1h2h1u2

These expression can be summarized in a general form as
epequp=1hqhpuqpqeqepup=1hqhpuqpqepep()=0pq or p=q

Gradient

The first vector operator we define is the gradient. The gradient is given by
f=i1fx1+i2fx2+i3fx3=i1(fu1u1x1+fu2u2x1+fu3u3x1)+i2(fu1u1x2+fu2u2x2+fu3u3x2)+i3()=fu1u1+fu2u2+fu3u3

By substituting uj=ej/hj we obtain the general expression for the gradient,
f=1h1fu1e1+1h2fu2e2+1h3fu3e3

Gradient in Cylindrical Coordinates

As an example, using the previously calculated scale factors, the gradient in cylindrical coordinates is given by
f|cyl=frer+1rfθeθ+fzez

Derivation using vector transformation

As a little aside, the steps given above are just one of many different approaches for obtaining the gradient. See the references listed below for additional approaches. As an example of an alternative, using the method in [1], we can obtain the same expression by considering vector transformation. Using the index notation, the gradient operator is written as
(f)i=xiϕ
By chain rule we have
xiϕ=ujxiujf

We can next multiply and divide the right hand side by hj. In writing proofs using the index notation, it is a common practice to perform substitutions like this to come up with terms that correspond to some other previously defined terms, or to terms that will allow us to utilize identities. In this case, this multiplication gives us the vector transformation,
(f)i=hjujxi1hjujf=aji(f)j
and hence gradient in the new coordinate system is defined by
(f)j=1hjujf
which is the same as the expression given above.

Divergence

Divergence is computed directly from the definition of the gradient,
f=(e1h1u1+e2h2u2+e3h3u3)(e1f1+e2f2+e3f3)

Evaluating just the first (e1f1) term we get
(f)1=e1h1u1(e1f1)+e2h2u2(e1f1)+e3h3u3(e1f1)

We next expand each of the terms above, starting with the first one,
e1h1u1(e1f1)=e1h1e1u1f1+e1h1f1u1e1=1h1f1u1
since the first term is zero as noted above in the section on derivatives of unit vectors.

For the second term we get
e2h2u2(e1f1)=e2h2e1u2f1+e2h2f1u2e1=1h21h1h2u1f1
since e2e1=0 by orthogonality, and the previously derived identity is used for the other term.

We obtain a similar expression for the last term,
e3h3u3(e1f1)=e3h3e1u3f1+e3h3f1u3e1=1h31h1h3u1f1

Combining these pieces together, we get an expression for the first component of divergence,
(f)1=1h1f1u1+1h2h1h2u1f1+1h1h3h3u1f1
or, in a more compact way,
(f)1=1h1h2h3u1(f1h2h3)

The other two terms are derived in a similar fashion, giving us the expression for divergence
f=1h1h2h3[u1(f1h2h3)+u2(f2h3h1)+u3(f3h1h2)]

As an example, in the cylindrical coordinates we have
(f)|cyl=1r[r(rfr)+θ(fθ)+uz(rfz)]=1rr(rfr)+1rfθθ+fzuz

The Laplace Operator

The Laplacian is a combination of a divergence and a gradient, i.e. 2f=f=g where g=f. We have
2f=3j=11h1h2h3uj(h1h2h3hjfj)=3j=11h1h2h3uj(h1h2h3hj1hjfuj)

In the expanded form, this is
2f=1h1h2h3[u1(h2h3h1fu1)+(h1h3h2fu2)+(h1h2h3fu3)]

Again, using the previously defined scale factors, we find the Laplacian in cylindrical coordinates,
2f|cyl=1r[r(rfr)]+1r[θ(1rfθ)]+1r[z(rfz)]=1r[r(rfr)]+1r22fθ2+2fz2

Curl

The final piece that is missing in the arsenal of vector calculus is the curl. Again using the definition of divergence we have
×f=(e11h1u1+e21h2u2+e31h3h3)×(e1f1+e2f2+e3f3)
which we can evaluate using the standard determinant approach, i.e.,
×f=1h1h2h3|h1e1h2e2h3e3/u1/u2/u3h1f1h2f2h3f3|

By plugging in the scale factors, we find that in the cylindrical coordinates,
(×f)|cyl=1r|erreθez/r/θ/zfrrfθfz|=1r(fzθrfθz)er(fzrfrz)eθ+1r((rfθ)rfrθ)ez

You will find additional definitions and the forms of these vector operators in spherical coordinates on the Wikipedia page Del in Cylindrical and Spherical Coordinates.

References

This article was based primarily on author’s notes from MAE 221, Fluid Mechanics, taught by Dr. Michael Myers at the George Washington University in the Fall of 2008. It was a tough class but definitely worth it! Additional useful resources include:

  1. Orthogonal, curvilinear coordinates, author unknown. This document provides a very nice treatment of coordinate transformation using the index notation. Unfortunately, I could no longer find it online. Please contact me if you have the link, or if you would like my copy of this document.
  2. Orthogonal Curvilinear Coordinates from Calculus III by Dr. Will Sutherland, Queen Mary University of London
  3. Orthogonal Curvilinear Coordinates by Dr. Phyllis R. Nelson, ECE, Cal Poly Ponoma
  4. Orthogonal Curvilinear Coordinates by Prof. H.M. Atassi, MAE, University of Notre Dame
  5. Ortogonal Curvilinear Coordinates, Prof. Baron Peters, Chem. Eng, UC Santa Barbara
  6. Curvilinear Coordinates by Prof. Frederick Stern, Intermediate Mechanics of Fluids, U. Iowa
  7. Curvilinear Coordinates on Wikipedia (a very generalized, math-heavy treatment)

9 comments to “Orthogonal Curvilinear Coordinates”

  1. January 16, 2012 at 8:46 am

    Feel free to leave a comment if you have any questions or comments. I did my best to check all equations, but since this article is bit math heavy, it is possible that something slipped through the cracks. Let me know if you find any mistakes.

  2. ambikasamy
    March 26, 2012 at 5:50 am

    please give the answer for laplace operators in orthogonal curvelinear co-ordinates and theirexplicit form in cartesion co-ordinates

  3. Joaquin
    March 27, 2014 at 8:02 am

    Hi,
    you solve the case in which you know the relationship between axes.
    But I am interested in the plot you made, where the axes are varying along an arbitrary curve.
    How should I approach this case? (I only need h1, h2 and h3)
    thanks

  4. Prashanth
    June 2, 2017 at 6:57 am

    Hi ,
    Pls tell the answer for Show that spherical co- ordinate system is orthogonal

  5. Anant Badal
    October 29, 2017 at 6:18 pm

    How it is that
    ui=frac1hiei

  6. Anant Badal
    October 29, 2017 at 6:21 pm

    How is it that
    ui=1hiei

    • Doug Plumb
      October 22, 2019 at 2:06 pm

      del ui points in the same direction as ui and is: (say del 2)

      unit in del 2 direction = (del 1 X del 3) / abs (del 1 X del 3)

      unit in d/du2 direction = (dR/du2)/abs (dR/du2) R denotes vector. Or dR/ds. dR/ds = (dR/du2)/abs(dR/du2

      s is arc length

Leave a Reply to Joaquin

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile=""> In addition, you can use \( ...\) to include equations.