This document in PDF

Review of FEM solution for the torsion problem of a rectangular cross section

Nasser M. Abbasi. Nov 27,2006

June 23, 2014

1 Introduction

This is a review of the FEM solution to the torsion problem of a rectangular cross section beam. First a description of the problem is given, then a description of the FEM method is shown, followed by a simple numerical worked example.

2 The problem

The problem is to solve the Poisson 2D problem for rectangular cross section. This equation is the mathematical model for a beam under torsion as described in the following diagram.


Since we are using a triangle elements for the FEM mesh, the cross section mesh is the preferred mesh to use as shown in this diagram.


3 The big picture

Before going into the details of the FEM solution it might be useful to look at the big picture.


The following diagram shows more description of the methods.


4 Mathematical derivation

4.1 Derivation of the symmetric weak form of the 2D Poisson equation

The following diagram shows the steps to obtain the symmetric weak for of the 2D Poisson PDE


4.2 Converting the symmetric weak form equation from the global Cartesian coordinates system to natural coordinates system

Converting the integral equations from the global Cartesian coordinates system to what is called the natural coordinates system (the local coordinates system) is a standard step used in FEM.

"A local coordinates system that relies on the element geometry for its definition and whose coordinates range between zero and unity within the element is known a natural coordinates system. Such system have the property that one particular coordinate has unit value at one node of the element and zero value at the other nodes: its variation between nodes is linear"1

Integration of shape functions when they are written in the natural coordinates are simplified since the origin is now located on the element. These are the main reasons for changing from global coordinates to the natural coordinates. For simple geometries, one can avoid having to do this coordinates transformation, but in general and in practice it is the standard procedure to do.

I found that most of the technical and mathematical difficulties involved are in this step. So more details will be spend on this.

The global coordinates of the element is shown in this diagram


Given an equation or expression where the independent variables in the equation are x,y  (the global Cartesian coordinates system) and we wish to express this same equation using the independent variables ζ,η  , then we perform coordinates transformations.

Given that x = x (ζ,η)  and y = y(ζ,η )  , we first find the differentials of the old coordinates system (i.e. dx,dy  ) in terms of the differentials of the new coordinates system (d ζ ,d η  )

The matrix that represents this mapping between the differentials in the old coordinates system and the new coordinates system us called the Jacobian (some books call the determinant of this matrix as the Jacobian). It is important to note that this mapping is between the differentials of the independent variables in the two coordinates system, and not between the variables themselves.

Hence we write

(      )    ◜⌊---◞ ◟---◝⌋ (     )
||{      ||}      ∂x   ∂x   ||{     ||}
   dx       ||  ∂ζ   ∂η ||    dζ
|      | =  ⌈         ⌉ |     |
|(  dy  |)       ∂y∂ζ-  ∂∂yη   |(  dη |)

J  is also written as

     ∂ (x,y )
J =  -------
     ∂ (ζ,η )

The main use for the Jacobian is in change of variables from one coordinates system to another, and also in performing area and volume integrals.


Hence, converting an integral from the global coordinates to the natural coordinates can be done as follows

∫                 ∫  1∫  1
   f (x, y)dx dy =         g (ζ,η)|J|d ζ dη
  A                 −1  −1

When the natural coordinates are area coordinates (which is the case here), we should modify the above to become

∫                 ∫ 1 ∫ 1−L1
   f (x, y)dxdy  =            g(L1,L2 ) |J | dL2dL1
 A                 0   0

The area coordinates (L1, L2,L3)  are illustrated in this diagram


It is important to realize that the shape functions N1,N2, N3   used will be the same as the area coordinates.

Let us now start from the symmetric weak form equation, with the goal to convert it to the natural coordinates (see previous diagram for the derivation of this equation)

      ∫        (     )       (     )         ∫                          ∫
                 ∂u-v  n   +   ∂u-v  n  dΓ −    ∂u-∂v- +  ∂u-∂v-dx dy +   f vdx dy = 0
                 ∂x     x      ∂y     y         ∂x ∂x     ∂y ∂y
Γ external boundary                              Ωj                        Ωj

Since the first integral above is carried along the boundaries of the whole domain itself (not along the boundaries of the individual elements themselves) and since we set the value of the test function v  to be zero at the boundaries of the domain, the first part of the above integral is zero. Hence the above integral become

  ∫                         ∫
−   ∂u-∂v-  + ∂u-∂v-dx dy +    fvdx dy =  0
    ∂x ∂x     ∂y ∂y
 Ωj                         Ωj

In the following derivations, everything is done on an element j  , hence all the u,v,  and element nodes coordinates x1,y1   , etc.. should have a superscript j  on, as in uj,vj etc..  . To make things easier to read, I will not put the superscript j  but will add it back at the end.

Consider first the second integral from (1) Which can be rewritten as

                     (      )
      ∫  (         ) ||   ∂u ||          ∫
                     {   ∂x }
I1 = −      ∂∂vx  ∂∂vy   |      |  dxdy  +    fv dx dy
      Ωj             |(   ∂u |)          Ωj

Consider the first integral from above

                   (      )
    ∫  (         ) ||{   ∂u ||}
          ∂v  ∂v       ∂x
I =       ∂x  ∂y   |      | dx dy
    Ωj             |(   ∂∂uy |)

The above is written with reference to the global coordinates system. However, We want our trial and test functions to be defined in the natural coordinates system (where things are simpler). So we need a way to transform the above integral (2A) to the natural coordinates system.

Assume we have the mapping x =  x(ζ,η)  and y = y (ζ, η)  (we will see how to obtain this mapping below). This mapping tells us how the global coordinates themselves change as a function of the natural coordinates. Now we can use differentiation chain rule to see how the trial and test functions themselves change relative the global coordinates.


Similarly for the test function


To make things more clear, we rewrite the above using matrix notation. For the trial function


and similarly for the test function


From (3) and (4), we see the following inverse transformations

(      )         (     )
|      |         |     |
|{   ∂u- |}         |{  ∂u |}
    ∂x    =  [J ]− 1   ∂ζ
||(   ∂u- ||)         ||(  ∂u ||)
    ∂y              ∂η


(      )         (     )
|      |         |     |
|{   ∂∂vx |}         |{  ∂∂vζ |}
         =  [J ]− 1
||(   ∂v ||)         ||(  ∂v ||)
    ∂y              ∂η

Now transpose the column vector in (6) to be a row vector because that is how it is laid out in the integral (2A), ( and remember to change the order when transposing a product)

(         )    (         )
   ∂v  ∂v        ∂v   ∂v     − T
   ∂x  ∂y   =    -∂ζ   ∂η   [J ]

Now we are ready to convert the integral I2   in eq (2A) to the natural coordinates system (these are area coordinates, notice the integral limits and the order of integration)


Where we used the standard relationship that

dxdy =  det[J]d ηdζ

Remember to put dη  first before d ζ  since the inner limit is on ζ.

Now that we have everything in the natural area coordinates system, we can do the integration. One small point left, which is to determine the differentials involved in (7).

For this we now need to decide on the actual form of the trial and test functions and on the mapping between the global and the natural coordinates system. The following explains this part, we will come back to the above integral once we have obtained the differentials ∂v, ∂v, ∂u, ∂u
∂ζ ∂η  ∂ζ ∂η  and determined the Jacobian.

The following diagram shows the linear transformation we will use. This is a standard transformation where the natural coordinates are called the area coordinates described more below.


We see from the above diagram that


From the above we obtain the following differentials


Now, we consider the trial and test functions. based on the above transformation shown in eq (8), We see that the linear trial and test functions can also be written in similar transformation


Again, immediately, we obtain the following differentials from the above expressions


Hence the Jacobian can now be evaluated (see eq(3) for reference)


And its inverse is

        ⌊                      ⌋

   −1   |  (y3 − y1)  (y1 − y2) |    1
[J]  =  |⌈                      |⌉ -------
          (x1 − x3)  (x2 − x1)   det [J ]


        ⌊                      ⌋

   −T   ||  (y3 − y1) (x1 − x3) || ---1---
[J]   = ⌈                      ⌉ det [J ]
           (y1 − y2) (x2 − x1)

Now that we have all the differentials needed, we can now go back to the integral in eq (7) and compute it:


Now we can evaluate Kj  .

            (           )
            ||           ||            ⌊           ⌋
      ∫ 11∫−ζ|||  − 1  − 1 |||
   j        {           }    −T    −1|  − 1 1  0 |
K   =           1    0    [J]   [J ]  |⌈           |⌉ det [J]dη dζ
       0 0  ||||           ||||               − 1 0  1
            |(           |)
                0    1

The integrand is



b1 = y2 − y3, b2 = y3 − y1, b3 = y1 − y2, c1 = x3 − x2, c2 = x1 − x3, c3 = x2 − x1


                  ⌊                                     ⌋
                  |    b21 + c21   b2b1 + c2c1  b3b1 + c3c1 |
      ∫1 1∫−ζ      |                                     |
Kj  =       --1---||                 2   2               || d ηdζ
            det[J]|  b2b1 + c2c1   b2 + c2    b3b2 + c3c2 |
      0  0        ⌈                                     ⌉
                     b3b1 + c3c1 b3b2 + c3c2    b23 + c23

But the integrand is a constant, hence we take it out of the integral

             ⌊                                     ⌋
                 b2 + c2    b2b1 + c2c1  b3b1 + c3c1
             ||    1    1                           || ∫1∫1−ζ
Kj  = ---1---|                2    2               |      d ηd ζ
      det [J ]|| b2b1 + c2c1   b2 + c2    b3b2 + c3c2 ||
             ⌈                                     ⌉ 0  0
               b3b1 + c3c1  b3b2 + c3c2    b23 + c23

Now we evaluate  1 1− ζ
∫ ∫
     d ηdζ

0  0



              ⌊                                     ⌋
                   b2+ c2    b b + c c   b b +  cc
              ||     1   1     2 1   2 1   3 1   3 1 ||
  j   ---1----|                 2   2               |
K  =  2det [J]||  b2b1 + c2c1   b2 + c2   b3b2 + c3c2 ||
              ⌈                                     ⌉
                 b3b1 + c3c1 b3b2 + c3c2   b2+  c2
                                            3   3

But from (10) we see that

det[J] = x3 (y1 − y2) + x1(y2 − y3) + x2(y3 − y1)

and the area of a triangle with corners at (x ,y ),(x  ,y ),(x ,y )
  1  1     2  2    3  3  is given by

           (            )

           |  x1  y1  1 |
     1     ||            ||    1
A  = --det |  x2  y2  1 | =  --(x1(y2 − y3) + x2 (y3 − y1) + x3 (y1 − y2))
     2     |(            |)    2

              x3  y3  1

Hence we get

   (    )
det [J ]j  = 2Aj

Therefore we can replace    (   j)
det  [J ] by    j
2A  everywhere. Rewrite the local stiffness matrix in terms of the local element area:

          ⌊                                     ⌋
                2   2
          |    b1 + c1   b2b1 + c2c1 b3b1 + c3c1 |
  j   -1--||                                     ||
K  =  4Aj ||  b2b1 + c2c1   b22 + c22   b3b2 + c3c2 ||
          ⌈                                     ⌉
             b b + c c   b b + c c     b2+  c2
              3 1   3 1   3 2   3 2     3   3

Now that we have Kj  we plug it back into eq (11)


And now that we completed this integral we go back to eq (2) :

       This is the integral we just-completed above
         ◜            ◞◟(      )   ◝
         ∫  (         ) ||{   ∂u ||}         ∫
               ∂v  ∂v       ∂x
I1 = −         ∂x  ∂y   |      | dA    +    fvdA
         Ωj             |(   ∂∂uy |)         Ωj

We need to work on the second integral above ∫
   fv dA

Ωj  and transform it to the natural coordinates.










But det [J]j = 2Aj  Hence the above becomes

                        (      )
                        ||    j ||
         (            ) |||   f1 |||
     Aj                 {      }
I3 = -3-   vj1  vj2  vj3   |   fj2 |
                        |||      |||
                        |(   fj |)

Now we have the integral in eq (2) completed. We now have our local equations completed. Here it is. We next need to assemble them.



⌊                   ⌋   ⌊                                     ⌋
|  Kj1,1  Kj1,2  Kj1,3 |   |    b21 + c21    b2b1 + c2c1 b3b1 + c3c1 |
|                   |   |                                     |
||  Kj    Kj    Kj   || = ||  b b + c c     b2+ c2    b b + c c  ||
|   2,1   2,2   2,3 |   |   21    2 1     2   2     3 2   3 2 |
⌈    j     j     j  ⌉   ⌈                                     ⌉
   K3,1  K3,2  K3,3        b3b1 + c3c1  b3b2 + c3c2   b23 + c23

4.3 Note on the shape functions

Looking at the trial function in eq (9), repeated here

          (       )     (       )
uj = uj1 + uj2 − uj1 ζ + uj3 − uj1  η

Hence we see that


And since we are looking for a trial function to be of the form u1 (Basis1 ) + u2(Basis2 ) + u3(Basis3 )  we see from the above that the 3 shape or basis functions are the following


And since we are using the Galerkin method, where the test function uses the same basis functions as the trial function, we can write the test function as

vj = vjN1 + vjN2 + vjN3
      1      2       3

5 Assembly of the global stiffness matrix

The global stiffness matrix K  is always square and symmetric and positive definite. (At least for structural analysis). Recall a positive definite matrix K  is one such that for any nonzero vector x  we always have   ∗
x Ax  > 0  where  ∗
x is the conjugate of x.  Properties of positive definite matrix is that all its eigenvalues are positive, and it has positive determinant, and hence a positive definite matrix is always invertible.

In addition, the global stiffness matrix is banded. This means that all non-zero elements are found along bands close to the main diagonal of the matrix. Within the band itself, some values can be zero.

The width of the band is a function of the numbering of the nodes used. Different node numbering can result in smaller band width. We want to have as small a band width as possible to take advantage of some numerical methods that can utilize banded matrices.

Band width can be reduced if we keep the node numbering in each element as close as possible to each others.

Now that we have found the local stiffness matrix Kj  for element j  we can assemble the global stiffness matrix as shown in this diagram. The direct stiffness construction method is used. This is explained in the following diagram


6 Assembly of the global load vector

This follows in similar fashion as above. The 3 elements Load vector {f} for element j  is added to the entries of the global load vector {F } using the node numbering mapping.

7 Modification of the final global stiffness matrix and load vectors and final solution

Now we have the following equation

[K ]{u } = {F }

Where K  is the assembled global stiffness matrix and {F } is the assembled global load vector. Before we solve for {u } , which is the stress function at all the nodes, we must modify K  and F  to take care of the given boundary conditions. I attach below 2 pages from a book which gives a good explanation and small example on this point.

Now that we have the modified K ∗ and F ∗ you can solve for {u} using your favorite linear equations solver.



8 Conclusion

The following are the main steps in solving the torsion problem described in this report.


9 References

Methods of computer modeling in Engineering & the sciences. Volume 1. Satya N. Atluri. Tech Science Press
Lecture notes, MAE 207. Spring and Fall 2006. UCI. Instructor: Professor Atluri SN.
Applied finite element analysis. Larry Segerlind.
The finite element method for engineers. Kenneth Huebner.
Mathematical methods in the physical sciences. 2nd edition. Mary Boas.
Fellow students reports and code from MAE 207 projects: Roy Culver , Paul Nylandres, Q Wang. see other related reports on my MAE 207 class web page