Introduction To Finite Element Method Dr. R. Krishnakumar Department of Mechanical Engineering Indian Institute of Technology, Madras Lecture - 26
Introduction To Finite Element Method Dr. R. Krishnakumar Department of Mechanical Engineering Indian Institute of Technology, Madras Lecture - 26
Introduction To Finite Element Method Dr. R. Krishnakumar Department of Mechanical Engineering Indian Institute of Technology, Madras Lecture - 26
Dr. R. Krishnakumar
Department of Mechanical Engineering
Indian Institute of Technology, Madras
Lecture - 26
We had a very detailed introduction for thermal problems yesterday. Now, I am sure all
of you are clear as to what the thermal problems are that we are interested in and what is
its application is and so on. Let us get back to the important derivation that you want to
do.
In other words, we have to look at the finite element implementation of the theory,
probably what you have learnt in your earlier classes on heat transfer. We start first with
of course the differential equation and then we go over to the functional. Yes, this route, I
am not deriving this route from the differential equation to this functional, because that is
again quite involved. Let us just skip that, because that you may have to spend about one
to one and a half hours on that. But if people are interested, there are standard text books
that are available. That has more to do with calculus of variations and so on. Let us
assume that for that differential equation, we can put down a functional of this form. That
part let us assume and go ahead. People who are interested, they can look at J N Reddy
Finite Element Analysis or Applied Functional Analysis by J N Reddy. That book gives
you as to how to convert; given a differential equation, how do you convert it or how do
you get a functional? These things are explained in that book. If you are interested, you
can have a look at it.
Let us start here. Of course this has to go with the boundary conditions which we have
discussed. Let us look at small, small but important point, when we convert this into a
two dimensional problem.
I already told you that we were looking at the sheet, yesterday we said that we were
looking at the sheet and I just skipped the issue as to how to specify heat transfer and do
it still in 2D. For example, I am going to weld these two sheets. Strictly when I consider a
problem of two dimensions, then the surface becomes here, what? Line; so, boundary
conditions I would say are specified only along this. In fact I had mentioned that
yesterday and the functional is also valid for that strict two dimensional boundary
condition or two dimensional process where for example, heat transfer takes place
outside. This is for example very close to a plane strain problem, where for example
because of the geometry, because of the geometry there is no stress, sorry or rather the
strain perpendicular to the plane of this board and in a similar fashion when you are
looking at a very long piece and you are looking at temperature distribution, then there
will not be any heat transfer perpendicular to this board; there will not be any heat
transfer perpendicular to this board and hence this kind of boundary condition is fine.
On the other hand, I am going to look at a problem like this, a thin sheet, say for example,
I want to find out the temperature distribution due to welding. Then how does the heat
transfer take place in this problem? Yeah, that is correct. Basically it is perpendicular to
the plane of this board, the lateral direction perpendicular to the plane of the board. Then,
I have problems of equating this or treating the problem in the same fashion as that of this
problem.
Here there is no heat transfer from here, but here all the heat transfer takes place only in
this, from this particular face. It may be one face or it can be both the faces, this face as
well as the face that is behind, both the faces, in which case you have to modify this
functional with an additional term for one side. if there are two sides, two terms with an
additional term which is given by this equation.
Look at this equation, so that equation or this is added to this. Is that clear? We will keep
that aside for the time being, because it is very simple to add it. It is no big deal, because
how we are going to do is, very logically we are going to proceed. So, there is not a
problem. But look at this equation. You would recognize that there is qB, h both of them
are there. In other words, there can be a heat flux due to, for example, welding, which I
had said qB, heat flux due to welding. There can be a convection term. That convection
term is given by this multiplication of h. Both of them can co exist in this particular form.
Is that clear? Now, we will go ahead and put our, time being we lift this, we will add it
ultimately. In fact you can do that as an exercise, if that term is included, how would the,
how the complete finite element formulation looks like? You can do that by adding it
later.
We already saw that I have to write down T is equal to N Te and that this T, that is equal
to B Te. Is that clear? Now, I have to substitute this into this expression. Is it clear? Let us
see, what is that I am going to get? What is this matrix, by the way? Kappa matrix, call
this as Kappa. Do not confuse this with k, Kappa matrix for isotropic material where k is
the same in all directions. What does it become? k 1 zero zero 1. So, k k in the diagonal,
It is a 2 by 2 matrix, so, k becomes, k takes diagonal terms and off diagonal terms go to
zero. This is for an isotropic material. Is that clear? Now, how do you write this equation
with the help of this? You have to do a small jugglery.
For the time being, just to make things clear in this particular derivation let us only look
at 2D. That means this v right now, is replaced by S, surface and the surface is by the
boundary line. That is all. Just you can replace these two for the time being. I mean it is
very simple, if you want to extend it. That is not a big problem, you can just extend that.
How do you write it, what are the things that are there? What happens to this?
This becomes Te transpose B Te. What I will do is I will say that Te transpose half into
integral, say S, B transpose kappa B say dS or you can retain dv itself, into Te. B is, of
course, a matrix, I need not tell that. Then T transpose Q, T becomes minus, it is all
inside the integral of course; so, Te transpose, I think I will put a bracket here. T
transpose Q now becomes Te transpose N transpose. So, this becomes N transpose Q and
T transpose rho C T dot, what happens to T transpose? That is Te transpose N transpose.
Is there any confusion? This is, actually the whole thing is integral. I think, I should put,
let me put integral separately or if you want it together you can put it. So, all these things
are inside the integral. All of them are inside the integral. I think better I shift half here,
so that there is no confusion; half is here, so, there is no confusion. Half is only for this
term; sorry, half is only for this term. So, I will put everything under the integral; N
transpose Q.
How do you handle this term? T transpose is Te transpose N transpose, so, Te transpose I
have already taken out, so, this becomes plus N transpose, N transpose rho C. What is T
dot? Yeah, wait, wait, wait; let us, yeah, this is one thing. That is a very good answer,
because that needs some explanation. What is T dot? T is equal to NT. What is T dot?
Dow T by dow small t that is the rate of change of temperature with respect to time. In
this N Te, what is going to change with respect to time?
(Refer Slide Time: 13:15)
Te not N; so T dot now becomes N Te dot, so, rho C N Te dot. These are the terms which
are inside the dv, so, the whole thing or dS because you said that we will consider it as a
surface. Is that clear? How about this? Minus, minus, what happens to this term?
If you want, you can put that separately as minus S Te transpose N transpose qB; a line.
Say, let us say l Te transpose N transpose qB say dl. Next is again Te transpose N
transpose h Tf. I know this is a very, very long expression; it just keeps going, but plus
wait, wait. Yeah, minus is outside. So, I am right, minus. Next term only becomes plus;
plus add this to Ne transpose (pl check) h N and so on. Just write it down, I think whole
expression you can write it down. I will write down. Since all of you know how to do it, I
will write down the final expression for this. What is my next step?
My next step is to, what is my next step? Differentiate it with respect to Te. Pi, you know
what is to be done? Pi I had substituted it.
10
So my next step is dow pi by dow Te is equal to zero. So, dow pi by dow Te is equal to
zero. Half Te transpose B transpose k B Te. Actually, this whole thing is multiplied by Te.
This becomes, you remember the same thing as half k transpose sorry u transpose ku
becomes ku. So, the first term becomes B transpose k B Te. B transpose k B Te. Let me
call a matrix K, let me call this is K is equal to integral S B transpose k B say dS. Yeah, k
is this. This is Kappa, sorry, K, Kappa B transpose dS. Is that clear? First thing, let me
give another name say C, let me give another name C to N transpose rho C N; N
transpose rho C N dS. Another name for rho transpose, sorry, N transpose rho C N dS.
Let me call, let me give one more name. What is this? Anyway, what is this? Is it very
similar to stiffness matrix? It is very similar to stiffness matrix. So, let me call as h N
transpose h, where is it, Tf; let me call this as h N transpose, no, there is one more h term
is here. Yeah, yeah, yeah, this term; this term, this term, now becomes, this, this, one.
11
Let me call for that h is equal to integral S N transpose h N dS. No, no, yeah, dl
obviously, because it is a line integral. Let me call this as say rQ.
12
So, in other words, let me call as rQ is equal to N transpose QdS. Note this each of them
carefully. Just let me review this. k is equal to B transpose Kappa B dS, C is equal to N
transpose rho C N dS, h is equal to N transpose h N dl. rQ is equal to N transpose Q dS.
Let me call I have to consume so many things; yeah, this also is there. No, no, one
minute. Why I am doing this is, because later when there is a problem, whenever there is,
something is zero, you can just put it as zero. It is not a problem that is why. Let me call
this as say, rq N transpose qB dl.
Have I consumed everything? One more term? Which is the term that is there? rh.
13
Yes, so, let me call this say rh, line element, N transpose h Tf dl. Have a look at this for a
minute, you know, all these terms, term number 1 2 3 4 5 6. Before we go further, we will
interpret each of these terms from our knowledge. Obviously all these terms are going to
enter my ultimate equation to solve the final heat transfer problem. In fact, that you can
write it straight away. I am going to do that next step, but this matrix is something like
the stiffness matrix. This matrix is actually a matrix which is related with T dot e
and is very similar to, this is what is called as capacitance matrix, first of all note that.
This is called as capacitance matrix and is very similar to in a dynamic situation a
damping that is or mass matrix, sorry mass matrix that is given. In mass matrix, we write
it as mx double dot in dynamics. Here, it is T dot. Second order and first order, there is a
difference. That is what is called as the capacitance matrix or C matrix.
This matrix here is very similar to what we have not seen, but very similar to what we
call as elastic foundation material and elastic foundation. Let us not worry about that
right now. This matrix what is rQ is a force term, something like a force matrix. It is
something like a force matrix and this is the force due to internal heat generation. What
can you relate this to? What can you relate this to? What? No, no, no; not internal. This is
internal heat generation. I am trying to relate this to what you know already. What is it?
14
Body forces; very similar to body forces, yeah, gravity which is acting throughout the
volume of the body, so, this is due to body forces and this is due to surface forces. This is
due to surface forces and this is also very similar to the surface forces. Only thing here it
is a new matrix which is for convection. Is this clear, so far this derivation, clear? Look at
this once more, all these one by one; you know, term one by one. Try to assimilate these
terms. N transpose rho C N dS, B transpose kappa B dS, then N transpose h N dl, N
transpose Q dS, N transpose qB dl and N transpose h Tf dl. The only difference if it is 3D
is that dl will be replaced by S dS and this dS will be replaced by dv. That is it. Now, I
will give you 2 minutes. You have to now get me the final equation form, how it will
look like?
Differentiating this, a very straight forward differentiation and look at these expressions
and I want to write down the final equation. Let me give you two minutes to write down.
Just note these things and then write down the final form.
Look at these things. T dot e, let me go one by one. T dot e, so, what will be T dot e? C,
will that be there? Will it be there? Yes, this corresponds to this, because in my original
equation it was multiplied by Te transpose T dot. Remember that and hence this one
15
becomes C T dot Te dot. Look at that dot there. What would be the other things that will
be there? K; will only K be with Te? Is there anything else which will be with Te? h; so, I
would say plus K plus h Te. Is that right? Then, no, no, no, no, plus you have made a
mistake; plus that is right. C Te dot plus K h Te, then all other guys will move now to the
right hand side. Is that clear or if you want, you can put it left hand side and equal to zero,
either way.
Now, tell me correctly with signs what are the terms that you would get from this
equation?
r capital Q, what is the sign that it is there? Minus here, so, when you go there it will
become plus. rQ plus, plus then Tf that term plus rh then plus small rq, plus small rq. Is
there any question? Is it clear how we got this equation? We started with the differential
equation, we formed the functional, substituted my well known shape functions and other
things, differentiated the functional with respect to Te and ultimately wrote down, nicely
collected these terms and wrote down, different matrices and ultimately got an equation
of this form. Is that clear, is that clear, any question? Yeah. No, I have brought it to the
right hand side. I have brought it to the right hand side. Q is considered to be positive
16
when it flows in. I have brought it to the right hand side and hence I am writing it like
this; look at your signs.
Now, the question is that what sort of problem can we solve with this? Can we solve a
transient problem with this? Yes, obviously because, T dot e is there. If you want to look
at the steady state problem, what do I do? I just remove the T dot e terms. Now, is that
clear? How am I going to solve this problem? How am I going to solve a transient
problem? Steady state problem is simple. If I remove this, then this becomes something
like a K matrix. So, K Te is equal to some r, simultaneous equation with temperature
being specified at some boundary condition. The procedure is exactly the same.
Temperature specification is something like a displacement being specified; the
procedure of solving the problem is exactly the same as what you would have done for
displacement. Is that clear?
How am I going to solve this problem, where I have T dot e? I am going to solve this
with an approach called as an incremental approach. I am going to solve them using an
incremental approach. What is it? It is very similar to what probably some of you would
have learnt as finite difference scheme. There are number of ways of doing it. The
simplest one is say T dot is replaced by say Tn+1 minus Tn divided by delta T. What is n
and n+1? Now, I am going to introduce some new terminologies which you may have to
know. Is that clear?
Have a look at that expression again and I am going to introduce some things new.
17
I am going to put some subscripts called Tn and Tn+1. I am going to introduce what is
called as delta t. These are three new things which I am going to introduce; Tn, Tn+1, delta
t. How do you solve a transient problem? We solve the problem by starting at time t is
equal to zero, at time t is equal to zero and give certain initial conditions or in other
words T0 is known. This is known and that is the initial condition. Is it clear? Then what I
do is I increment the time. With the results at t is equal to zero, I calculate t at t plus delta
t. The number of increments that I make, that number is written as n. That number that I
make is written as n, then n+1 and so on. So n+1 is actually time at t plus delta t. If n is at
t, n+1 is at t plus delta t. Is that clear?
Look at this expression. Look at this expression and how do you think we can write down
the final form? Have a look at that here. So, T dot e is my culprit there. I have to write it,
write T dot e. There are two ways in which I can do it. There are number of ways. We
will generalize the way in which we can write down T dot of n+1. If T dot is not there
then, obviously, no n+1, no n, because we are in a steady state situation.
18
What I am going to do is I am going to write Tn+1 is equal to 1 minus beta. What is beta?
We will come to this in a minute; 1 minus beta into say T dot n plus beta into T dot n+1.
The whole thing multiplied by, the whole thing multiplied by delta t. Look at this
expression, look at this expression. What happens when beta is equal to zero? We come
to a very simple approximation for delta t when beta is equal to zero, sorry, for Tn+1,
when beta is equal to zero, then Tn+1 is equal to T dot n delta t. In other words, what is
that we do? We use the slope of the temperature. What is after all this T dot n? Dow t by
dow small t at n; dow T by dow small t at the point n. We approximate it, the Tn+1 by
knowing the slope at n. Dow T by dow small t at n multiplied by delta T gives me Tn+1. In
other words, Tn+1 is explicitly determined. Knowing the previous slope, knowing the
slope of the previous problem or previous step, I calculate the current Tn+1 from that.
What happens when beta is equal to 1? What happens when beta is equal to 1?
19
Then, look at this. Tn+1 is equal to T dot n+1 into delta t; T dot n+1 into delta t. In other
words, we calculate the temperature at n+1 using the knowledge of the slope in the
current step, which means that we are in the, we have what is called as an implicit
scheme, we have what is called as an implicit scheme. The whole point here is to say
what slope you use. After all slope into delta t, dow T by dow small t into delta t, will
give me my new Tn+1. The whole idea here is to find out what is the slope that I have to
use.
On the other hand, I can use beta is equal to half, beta is equal is equal to half. What
happens, just check up what happens when beta is equal to half? I think I made one small
error. I have to add this Tn anyway, sorry. I have to add this Tn here, this because after all,
yeah, Tn and that is understood because delta t by delta t into dt. So, what happens when
beta is equal to half? When beta is equal to half, you take the slope to be the average
between the n and n+1. Is it clear?
20
Such a scheme, where you take beta is equal to half is called as the Crank Nicolson
scheme or sometimes people call this as midpoint rule because you are taking the
midpoint and is the most popular among the schemes that are used to write down or
approximate Tn+1, so that when beta is equal to half, Tn+1 is equal to of course Tn plus half
into T dot n plus half into T dot n+1. You take an average of the slope between n and
n+1. Mathematical analysis has been done for these three conditions, more than three
conditions. Infact, you can have beta to be 2 by 3, the weightage given can vary. This is
called Galerkin scheme. When beta is equal to 2 by 3, it is called as the Galerkin scheme.
People have done lot of numerical analysis or worked on this problem and they said or
they found out that the first scheme, the explicit schemes are conditionally stable. They
said that these schemes are conditionally stable. All of you have heard about the terms
stable, stability, conditionally stable and so on. No? Let me explain. The question that
comes to our mind is that look you have defined delta t as a step which takes us through
the complete solution. We can start at T is equal to zero and go up to say T is equal to 5
seconds or 10 seconds or 3 hours, whatever it is. What is the step I should take? Can I
take whatever step I want? That is the question that you will have in mind? Why is that
step becomes important? Please note that at every step, I have to solve the problem, solve
21
this equation, I have to solve this equation. At every step, I have to reconvert this, solve
this equation, get it into simultaneous equation and keep going.
That means larger that number of steps I have, more the time I am going to solve this
problem. Very clear; so, the first question that comes to your mind is why should I take
100 steps, why not I finish it in 10 steps? Immediately another intuition tells you that
look, if you are going anywhere take only 10 steps. Then what suffers? Accuracy is sure
to suffer. I mean it is very clear. But, apart from accuracy there is also what is called as
stability, there is what is also called as stability. There is lot of theory into stability.
22
Again, we may not have time to go into this stability, but stability means unbounded
oscillations; unbounded oscillations. What does it mean? What is meant by unbounded
oscillations?
Suppose, after the solution or as I go along with respect to time I plot the temperature. I
start plotting the temperature with respect to time. There can be say, some variation like
23
this. This is what is called as oscillation. The oscillation may now grow and they become
unbounded, may become unbounded or it need not actually oscillate like this, but it can
oscillate like this and so on. Suppose I take one point, let us say one point in the domain
of interest and start following this point with respect to time, then the solution becomes
unbounded. We say at this point of time that the solution is not stable, the solution is not
stable.
Please note that oscillations are different from unbounded oscillations, stability
oscillations are different from stability. The solution may oscillate. If I say like that what
is means is the temperature may oscillate a bit with respect to time and it can stabilize,
whatever be the result. It can oscillate a bit from one step to the other step, something like
this. Say for example, it can oscillate like this, as long as it does not go unbounded, does
not go unbounded. In other words, what I mean by unbounded is in 10 steps it may go to
infinity, 10 to the power of 32 and so on. As long as it is not unbounded, we say that the
solution oscillates, but the solution is stable. Is it clear?
On the other hand, it can, the oscillations can lead to complete instability. It has been
found that there is a limit for delta t; that we will discuss in the next class, what the limit
is. There is a limit for delta t, when beta is less than half, when beta is less than half, for
these solutions or in other words when beta is less than half, the solutions are
conditionally stable; when beta is less than half the solutions are conditionally stable. In
other words, I have to put a restriction on delta t. For beta greater than equal to half, note
what is that beta? Beta is here. When beta is greater than equal to half, then the solution is
unconditionally stable; unconditionally stable. I want you to distinguish this clearly,
because students get confused between the two. These two are different from accuracy.
They are different from accuracy. It has been found that see, one of the, before even I go
further, one of the things that immediately you would conclude is that, then I will take all
the time beta is equal to 1.
I am away from that line that you have drawn on beta is equal to half. I will go to beta is
equal to 1. Why should I go to beta is equal to half? Infact, you told that beta is equal to
24
half is very popular and called this as a Crank Nicolson scheme. Why should I go there?
Why not I go to beta is equal to 1? But, when you go to beta is equal to 1, does anyone
know about this, probably you studied in numerical analysis? No? I am giving you only
the results because this is a topic by itself. When beta is equal to 1, the scheme is only
first order accurate. It is accurate only up to delta T, first order accurate. That is both beta
is equal to zero and beta is equal to 1, these schemes are only first order accurate. That
means that the accuracy suffers. Though you can get unstable, I mean, solution without
problems of stability, though the stability problem can be solved, accuracy is a different
story altogether and the solution suffers and hence the solution is not accurate. On the
other hand, when beta is equal to half, you get a second order accurate solution.
I will summarize this again in the next class, but I want you to note this down. Look at
beta is equal to half. It is, one, unconditionally stable; whatever be the delta t, you are
going to get a nice result. The accuracy increases, but look at that but. But, oscillations
are not eliminated, oscillations are not eliminated. In other words, especially when the
transients are large, Crank Nicolson schemes start oscillating. This has lot of practical
significance. For example, many people who do casting simulation, simulation of a
casting process, after all what is the simulation of casting process? It is heat transfer,
transient heat transfer problem. How do we deal with it? We will look at it after I finish
this thing. They use Crank Nicolson scheme, but when they use Crank Nicolson scheme,
they will initially find that, especially initially they will find that, the temperature of the
mould which they would have probably put as 35 degrees would go to 28 degrees. They
will be wondering whether they made a mistake. Immediately when the metal is poured
initial condition t is equal to zero, metal has very high temperature, start the stimulation;
you will suddenly find that the 35 degree mould goes to 28 degrees. Then you will
immediately think that there is some drastic problem that you have done, I mean, drastic
mistake you have committed, there is a problem and so on.
No; infact, I know a student who wasted nearly 3 weeks to 4 weeks looking at the result
all the time, looking at the code, finding out if there is some mistake that he has done and
not finding out any error in his code, breaking his head. Then, I asked him what the
25
problem is and he said my temperature in the mould goes down. Then I said this is an
oscillation. He said Crank Nicolson scheme is the best scheme I studied, so, why is that
giving, why is it that this scheme gives rise to oscillations? Please note that this is the
problem, because people get confused with stability, with oscillation, with accuracy. All
of them are different things. Crank Nicolson scheme, especially initially when you start
would result in oscillations, but will give you a very nice result, accurate result if you just
smoothen that out, dampen that out, then you will get a nice result, but there will be an
oscillation.
We will now continue. What we have to do is very simple. We have to substitute this into
my original equation and develop a scheme to carry on with the solution. We will do that
in the next class.
26