You are on page 1of 31

Transient Thermal Analysis

neglecting radiation and q


=
Applying Galerkin weighted residual method

= 0

x2

= 0

x1

Rearranging and removing ^ for convenience


+

x2

+
x1

= 0 (1)

Transient Thermal Analysis


=
=

+

=

+
1

+ =

2 1
6 1 2

1 1 1
2 1
= kA
+
1 1
6 1 2

Transient Thermal Analysis (thermal)


+ ) +1 = 1 + 1 + +1

Determine the temperatures


Heat removal rate and efficiency
Of the pin (Home Work)
If the density
c are 8900/3

And 375 0 respectively find the

Temperatures at the middle and end


1
With a time step of 0.1 s and = 2

Transient Thermal Analysis (thermal)


clear all;
clc;
clf;
stiff_mat;
fun;
T0=25*ones(1,nnode)';
dt=0.05;
k1=C+alpha*dt*K;
k2=C-(1-alpha)*K*dt;
f1=k1*T0;
k11=k1;
k11(1,1)=1;
f11=f1;
f11(1)=85;
f11(2)=f11(2)-k11(2,1)*f11(1);
k11(1,2)=0;
k11(2,1)=0;

T=k11\f11;
T1(1)=T(1);
T2(1)=T(2);
T3(1)=T(3);
F';
for i=1:60;
k1=C+alpha*dt*K;
k2=C-(1-alpha)*K*dt;
f1=k2*T+F'*dt;
T=k1\f1;
T=[85
T(2:nnode)];
T1(1+i)=T(1);
T2(1+i)=T(2);
T3(1+i)=T(3);
t=dt+i*dt;
hold on;
plot(t,T(1),'+ -', t,T(2),'+ -',t,T(3),'+ -')
end
hold off;

Transient Thermal Analysis-(stiff_mat)


a=0;b=0.02;nelem=2;
nnode=nelem+1;
h=b/nelem;
gnode=zeros(1,2);
elenode=zeros(2,2);
elenode1=zeros(2,2);
k_mat=zeros(nnode,nnode);
m_mat=zeros(nnode,nnode);
global hx kx rho c alpha p A;
hx=150;
kx=400;
rho=8900;
c=375;
alpha=2/3;
A=pi*.004^2/4;
p=pi*.004;
count=1;

for i=1:nelem
count=count+1;
z=i;
gnode(1)=z;
gnode(2)=gnode(1)+1;
for j=1:2
for k=1:2
elenode(j,k)=dN(j,k,0,h);
elenode1(j,k)=N(j,k,0,h);
end
end
for j=1:2
for k=1:2
kk=elenode(j,k);
mm=elenode1(j,k);
m=gnode(j);n=gnode(k);
k_mat(m,n)=k_mat(m,n)+kk;
m_mat(m,n)=m_mat(m,n)+mm;
end
end
end
K=k_mat*kx*A+hx*p*m_mat;
C=rho*c*A*m_mat;

Transient Thermal Analysis-Time discretization


Forward difference scheme
=

+ ()
= lim
0

+ ()

Substituting for in + =

+ ()
+ Ka() = f

+1
+ = +1 = ai + fi

( + = )

Transient Thermal Analysis-Time discretization


Backward difference scheme
( )

Substituting for in + =

( )
+ Ka() = f

( )
+ = ()

Multiplying with and re-arranging


+ = + f
It can be re-written as

+ + = + f +
+ +1 = i + f+1

( + = )

Transient Thermal Analysis-Time discretization


Central difference Scheme

+ ()

However instead of evaluating the other terms at time + ,


Use the average values

+ + ()
=
2

+ + ()
=
2

We have

+ ()
+ + () + + ()
+K
=

2
2

Multiplying through by isolating the terms containing ( + )

[ + + ]
+
+ =
() +
2
2
2

Transient Thermal Analysis-Time discretization


In terms of subscript notation
+

+ +1
+1 =
+
2
2
2

The three recurrence formulae can be combined into


+ ) +1 = 1 + 1 + +1
1

When = 0 or 2 1 the above equation reduces to forward difference formula


Central difference formula or backward difference formula

Time discretization- FEM


The time domain is discretized from time +
= + +1 +1
Applying Galerkin method with weight function
+1

+ = 0

1 =

+1

= + 1 = 0 +1 = + =
+1

2 =

=
+1

1
1 2
1
= ;
=

If we take = 1

If we take = 1
+1

Time discretization- FEM

+ =

1
1
1 + +1 +

=0

1
+

+1

1
+
+1

1
1
1
1
+ +1 + + +1
+ +1 = 0
2
2
2
2
+

+ +1
+1 =
+
2
2
2

+ ) +1 = 1 + 1 + +1
1

When = 0 or 2 1 the above equation reduces to forward difference formula


Central difference formula or backward difference formula

Vibration- FEM

Vibration-Example

Vibration-Example

= = , = = 32.2 12 / 2
0.283
=
= 7.324 104
32.2 12

Vibration-Example

Vibration-Example

Vibration-Example: mode shapes(2


elements)

Vibration-Example: first three mode shapes(20


elements) of a straight bar

Matlab code-stiff_mat.m
a=0;b=0.10;nelem=20;
nnode=nelem+1;
h=b/nelem;
gnode=zeros(1,2);
elenode=zeros(2,2);
elenode1=zeros(2,2);
k_mat=zeros(nnode,nnode);
m_mat=zeros(nnode,nnode);
global E A rho;
E=200e9;
A=pi*.10^2/4;
rho=7800;

for i=1:nelem
z=i;
gnode(1)=z;
gnode(2)=gnode(1)+1;
for j=1:2
for k=1:2
elenode(j,k)=dN(j,k,0,h);
elenode1(j,k)=N(j,k,0,h);
end
end
for j=1:2
for k=1:2
kk=elenode(j,k);
mm=elenode1(j,k);
m=gnode(j);n=gnode(k);
k_mat(m,n)=k_mat(m,n)+kk;
m_mat(m,n)=m_mat(m,n)+mm;
end
end
end
K=k_mat*E*A;
M=rho*A*m_mat;

Matlab code-vibration.m
Other prograns N.m, dN.m and
functions are the same as the
general 1D program

clear all;
clc;
clf;
stiff_mat;
M1=M(2:nnode,2:nnode);
K1=K(2:nnode,2:nnode);
y1=zeros(nelem,1);
y2=zeros(nelem,1);
y3=zeros(nelem,1);
y4=zeros(nelem,1);
y5=zeros(nelem,1);
[c d]=eig(K1,M1);
for j=1:nelem
y1(j)=c(j,1);
y2(j)=c(j,2);
y3(j)=c(j,3);
end
y1=[0 y1']';
y2=[0 y2']';
y3=[0 y3']';
x=linspace(a,b,nnode);
plot(x,y1,x,y2,x,y3)

Higher order elements: 1D quadratic


In formulating the truss element and the one-dimensional heat conduction element,
only line elements having a single degree of freedom at each of two nodes are
considered. While quite appropriate for the problems considered, the linear element is
by no means the only one-dimensional element that can be formulated for a given
problem type. Figure depicts a three-node line element in which node 2 is an interior
node. The interior node is not connected to any other node in any other element in the
model. Inclusion of the interior node is a mathematical tool to increase the order of
approximation of the field variable. Assuming that we deal with only 1 degree of
freedom at each node, the appropriate polynomial representation of the field variable
is

Higher order elements: 1D quadratic


Applying the general procedure outlined previously in the context of the
beam element, we apply the nodal (boundary) conditions to obtain

from which the interpolation functions are obtained via the following
sequence

Higher order elements: 1D quadratic


clear all;
syms U u1 u2 u3 a0 a1 a2
U=[u1;u2;u3];
C=[1 0 0; 1 L/2 L^2/4; 1
a=inv(C)*U;
N=[1 x x^2]*a;
N=collect(N,u1);
u2=0;u3=0;
p=eval(coeffs(expand(N),
N1=p(1,2);
syms u2;
u1=0;u3=0;
p=eval(coeffs(expand(N),
N2=p(1,2);
syms u3;
u1=0;u2=0;
p=eval(coeffs(expand(N),
N3=p(1,2);
N=[N1 N2 N3];

x L;

L L^2];

u1));

>> N.'
ans =

u2));

u3));

(2*x^2)/L^2 - (3*x)/L + 1
(4*x)/L - (4*x^2)/L^2
(2*x^2)/L^2 - x/L

Higher order elements: 1D quadratic- natural


clear all;
coordinates
= 0 + 1 + 2

varies from -1 to 1
= 1 = 0 1 + 2
= 1
= 0 = 0 = 2
= 1 = 0 + 1 + 2 = 3

1
1
2 = 1
3
1

1 1 0
0 0 1
1 1 2

0
1 1 1
1 = 1 0 0
2
1 1 1
0
= 1 2 . 1
2

1
2
3

syms U u1 u2 u3 a0 a1 a2 x L r;
U=[u1;u2;u3];
C=[1 -1 1; 1 0 0; 1 1 1];
a=inv(C)*U;
N=[1 r r^2]*a;
N=collect(N,u1);
u2=0;u3=0;
p=eval(coeffs(expand(N), u1));
N1=p(1,2);
syms u2;
u1=0;u3=0;
p=eval(coeffs(expand(N), u2));
N2=p(1,2);
syms u3;
u1=0;u2=0;
p=eval(coeffs(expand(N), u3));
N3=p(1,2);
N=[N1 N2 N3];
N1= r^2/2 - r/2
N2= 1 - r^2
N3= r^2/2 + r/2

Higher order elements: 1D quadratic- natural coordinates


If the end node are numbered 1 and 2 and the middle node as 3 the shape functions
are as shown below
N1= r^2/2 - r/2
N2= r^2/2 + r/2
N3= 1 - r^2
Or
1
1
2
1
2 = + 1
2
3 = (1 + )(1 )
1 =

1
1 = 1
2
1
2 = 1 +
2
3 = (1 + )(1 )

Higher order elements: 1D quadratic- natural coordinates

Higher order elements: 1D quadraticclear all;


syms U u1 u2 u3 a0 a1 a2 x L;
hx=30; kx=168;A=.005*.001;p=2*(.005+.001);
U=[u1;u2;u3];
N1=((2*x^2)/L^2 - (3*x)/L + 1);
N2=((2*x^2)/L^2 - x/L);
N3=((4*x)/L - (4*x^2)/L^2);
N=[N1 N2 N3]; dN=diff(N);
K1=kx*A*int(dN.'*dN,0,L)+hx*p*int(N.'*N,0,L);
K2=kx*A*int(dN.'*dN,0,L)+hx*p*int(N.'*N,0,L);
ff1=hx*p*20*int(N.',0,L);
ff2=hx*p*20*int(N.',0,L);
L=0.04;
K1=eval(K1);
K2=eval(K2);f1=eval(ff1);f2=eval(ff2);
K11=ex_rows(K1,2,3);K11=ex_cols(K11,2,3);
K22=ex_cols(K2,2,3);K22=ex_rows(K22,2,3);
f11=ex_rows(f1,2,3);f22=ex_rows(f2,2,3);
K11=[K11 zeros(3,2);zeros(2,5)];
K22=[zeros(2,5);zeros(3,2) K22];
Kg=K11+K22;

f11=[f11;zeros(2,1)]; f22=[zeros(2,1);f22];
fg=f11+f22;
Kg(1,1)=1;Kg(1,2)=0;Kg(1,3)=0;fg(1)=100;
Kg(5,5)=Kg(5,5)+hx*A;
fg(5)=fg(5)+hx*A*20;
T=Kg\fg;
x=[0 .02 .04 .06 .08];
m=sqrt(hx*p/(kx*A));
T0=20;Tw=100;L=0.08;
T1=T0+(Tw-T0)*cosh(m*(L-x))/cosh(m*L);
TT=[T T1'];
display(TT);
plot(x',T,'rd-',x',T1','b+-')

Higher order elements: 1D quadratic- natural coordinates


Quadratic

Linear

100

100

100

75.2737

75.2269

75.0387

60.1591

60.0864

59.7901

52.0278

51.8858

51.5633

49.4659

49.2468

48.9064

100
quadratic
exact
linear

90

80
Temperature

Exact

70

60

50

40

0.01

0.02

0.03

0.04
Length

0.05

0.06

0.07

0.08

You might also like