PDF (letter size)
PDF (legal size)

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

Nasser M. Abbasi

Nov 27,2006 compiled on — Sunday December 31, 2017 at 09:59 PM

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

{     }   ◜[----◞◟---◝] {    }
   dx        ∂∂xζ  ∂∂xη     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
 Af (x, y)dxdy  =  −1  −1g(ζ,η) |J |d ζdη

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

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

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-          ∂u-           ∫ ∂u-∂v-   ∂u-∂v-      ∫
                ∂x v  nx +   ∂y v  ny dΓ −   ∂x ∂x +  ∂y ∂ydxdy +   f vdxdy = 0
Γ 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-∂vdxdy +   f vdxdy = 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 }          ∫
I1 = −     ∂∂vx  ∂∂vy     ∂∂xu    dxdy  +   fvdxdy
      Ω               ∂y           Ω
       j                             j

Consider the first integral from above

    ∫  (        ) {  ∂u }
I =      ∂v  ∂v      ∂∂xu   dxdy
         ∂x  ∂y      ∂y

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       − 1   ∂ζ
   ∂u∂y   = [J]     ∂∂uη


{  ∂v }        {  ∂v }
   ∂∂xv   = [J]− 1   ∂∂ζ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   [J]−T
   ∂x  ∂y       ∂ζ  ∂η

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

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


        [ (y  − y )  (x  − x ) ]   1
[J ]− T =     3   1     1   3    ------
          (y1 − y2)  (x2 − x1)   det[J ]

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 }            [          ]
Kj  =          1   0    [J]−T [J ]−1   − 1 1  0   det[J]dηdζ
      0 0  (   0   1  )              − 1 0  1

The integrand is



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


                 ⌊                                    ⌋
      ∫1∫1− ζ          b21 + c21  b2b1 + c2c1  b3b1 + c3c1
Kj  =      ---1--⌈  b2b1 + c2c1  b2 + c2   b3b2 + c3c2 ⌉ dηdζ
           det[J]   b b + c c  b b2 + c2c     b2+ c2
      0  0           3 1   3 1  3 2    32     3   3

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

             ⌊                                   ⌋
                 b21 + c21   b2b1 + c2c1  b3b1 + c3c1  ∫11∫−ζ
Kj  = ---1-- ⌈ b2b1 + c2c1  b2 + c2   b3b2 + c3c2 ⌉     dηdζ
      det[J]   b b + c c   bb2 + c2c     b2+ c2
                3 1   3 1  3 2    32     3   3     0 0

Now we evaluate ∫ 11∫−ζ

     d ηdζ
 0 0



             ⌊    2   2                          ⌋
        1        b1 + c1    b2b1 + c2c1 b3b1 + c3c1
Kj = --------⌈ b2b1 + c2c1    b22 + c22   b3b2 + c3c2⌉
     2 det[J]  b3b1 + c3c1  b3b2 + c3c2   b23 + c23

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 (x1,y1),(x2,y2),(x3,y3)  is given by

         (  x   y   1 )
    1-   (   1   1    )    1-
A = 2 det   x2  y2  1   =  2 (x1 (y2 − y3)+ x2 (y3 − y1)+ x3 (y1 − y2))
            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                          ⌋
  j   -1--⌈   b1 + c1   b2b12 + c22c1 b3b1 + c3c1 ⌉
K   = 4Aj    b2b1 + c2c1    b2 + c2   b3b22 + c32c2
             b3b1 + c3c1  b3b2 + c3c2   b3 + c3

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 a◝bove
         ∫  (         ){  ∂u }          ∫
I1 = −         ∂∂vx   ∂∂vy     ∂∂xu   dA     +   fvdA
         Ω                ∂y           Ω
          j                              j

We need to work on the second integral above  ∫
Ωj  and transform it to the natural coordinates.










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

                      (|   j  )|
     Aj (  j   j   j) {  f1j }
I3 = 3--  v1  v2  v3  |   f2 |
                      (   fj3 )

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   |⌉ = ⌈ b2b1 + c2c1   b22 + c22   b3b2 + c3c2 ⌉
    2j,1    2j,2    2,j3       b3b1 + c3c1 b3b2 + c3c2  b2 + c2
  K 3,1  K 3,2  K 3,3                                 3    3

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 = vj1N1 + vj2N2 + vj3N3

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   j
K  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

  1. Methods of computer modeling in Engineering & the sciences. Volume 1. Satya N. Atluri. Tech Science Press
  2. Lecture notes, MAE 207. Spring and Fall 2006. UCI. Instructor: Professor Atluri SN.
  3. Applied finite element analysis. Larry Segerlind.
  4. The finite element method for engineers. Kenneth Huebner.
  5. Mathematical methods in the physical sciences. 2nd edition. Mary Boas.
  6. 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