Date post: | 08-Aug-2018 |
Category: |
Documents |
Upload: | aswith-r-shenoy |
View: | 215 times |
Download: | 0 times |
of 31
8/22/2019 Introduction to FEM-2
1/31
Transient Thermal Analysis
= neglecting radiation and q
= Applying Galerkin weighted residual method
= 0
x
x = 0
Rearranging and removing ^ for convenience
=
x
x = 0 (1)
8/22/2019 Introduction to FEM-2
2/31
Transient Thermal Analysis
=
= = 6 2 11 2
=
= = kA
1 1 11 1
6 2 11 2
=
=
8/22/2019 Introduction to FEM-2
3/31
Transient Thermal Analysis (thermal) ) + = 1 1 +
Determine the temperatures
Heat removal rate and efficiency
Of the pin (Home Work)
If the density c are 8900/And 375 respectively find theTemperatures at the middle and end
With a time step of 0.1 s and
=
8/22/2019 Introduction to FEM-2
4/31
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;
8/22/2019 Introduction to FEM-2
5/31
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
endfor 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;
8/22/2019 Introduction to FEM-2
6/31
Transient Thermal Analysis-Time discretization
= = lim ()
()
Substituting for in = ( = )
() K a ( ) = f
+ = + = a f
Forward difference scheme
8/22/2019 Introduction to FEM-2
7/31
Transient Thermal Analysis-Time discretization
( ) Substituting for in = ( = ) ( )
K a ( ) = f
Backward difference scheme
( ) = ()Multiplying with and re-arranging
= f
It can be re-written as
= f
+ = f+
8/22/2019 Introduction to FEM-2
8/31
Transient Thermal Analysis-Time discretization
Central difference Scheme
= ()2 = ()2
() However instead of evaluating the other terms at time , Use the average values
We have
() K ()2 = ()2 Multiplying through by isolating the terms containing ()
2 =
2 ()[ ]
2
8/22/2019 Introduction to FEM-2
9/31
Transient Thermal Analysis-Time discretization
In terms of subscript notation
2 + = 2 + 2 The three recurrence formulae can be combined into
) + = 1 1 +
When = 0 or 1 the above equation reduces to forward difference formulaCentral difference formula or backward difference formula
8/22/2019 Introduction to FEM-2
10/31
Time discretization- FEM
The time domain is discretized from
time
= ++Applying Galerkin method with weight function
= 0
= + + =
1 = 0 + = =
= + =
If we take = 1
= 1
; =
1
8/22/2019 Introduction to FEM-2
11/31
Time discretization- FEMIf we take = 1
= 1 1 1
+ 1
+ 1
+
= 0
+ 12 12 + 12 12 + = 0
2 + =
2 + 2
) + = 1 1 + When = 0 or 1 the above equation reduces to forward difference formulaCentral difference formula or backward difference formula
8/22/2019 Introduction to FEM-2
12/31
Vibration- FEM
8/22/2019 Introduction to FEM-2
13/31
8/22/2019 Introduction to FEM-2
14/31
8/22/2019 Introduction to FEM-2
15/31
8/22/2019 Introduction to FEM-2
16/31
Vibration-Example
8/22/2019 Introduction to FEM-2
17/31
Vibration-Example
=
= , = = 32.2 12 /
= 0.28332.212 =7.32410
8/22/2019 Introduction to FEM-2
18/31
Vibration-Example
8/22/2019 Introduction to FEM-2
19/31
Vibration-Example
8/22/2019 Introduction to FEM-2
20/31
Vibration-Example: mode shapes(2
elements)
8/22/2019 Introduction to FEM-2
21/31
Vibration-Example: first three mode shapes(20
elements) of a straight bar
8/22/2019 Introduction to FEM-2
22/31
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;
8/22/2019 Introduction to FEM-2
23/31
Matlab code-vibration.mclear 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);
endy1=[0 y1']';
y2=[0 y2']';
y3=[0 y3']';
x=linspace(a,b,nnode);
plot(x,y1,x,y2,x,y3)
Other prograns N.m, dN.m and
functions are the same as the
general 1D program
8/22/2019 Introduction to FEM-2
24/31
Higher order elements: 1D quadraticIn 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 notconnected 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
8/22/2019 Introduction to FEM-2
25/31
Higher order elements: 1D quadratic
Applying the general procedure outlined previously in the context of thebeam element, we apply the nodal (boundary) conditions to obtain
from which the interpolation functions are obtained via the following
sequence
8/22/2019 Introduction to FEM-2
26/31
Higher order elements: 1D quadratic
clear all;
syms Uu1u2u3a0a1a2xL;
U=[u1;u2;u3];
C=[1 0 0; 1 L/2 L^2/4; 1 L L^2];
a=inv(C)*U;
N=[1 x x^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];
>> N.'
ans =
(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
8/22/2019 Introduction to FEM-2
27/31
Higher order elements: 1D quadratic- natural
coordinates
=
varies from -1 to 1
= 1 = = = 0 = = = 1 = =
= 1 1 11 0 01 1 1
= 1 1 11 0 0
1 1 1
= 1 . N1= r^2/2 - r/2
N2= 1 - r^2
N3= r^2/2 + r/2
clear all;
syms Uu1u2u3a0a1a2xLr;
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];
8/22/2019 Introduction to FEM-2
28/31
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/2N2= r^2/2 + r/2
N3= 1 - r^2
= 12 1 = 12 1 = ( 1 ) ( 1 )
Or
= 12 1 = 12 1 = ( 1 ) ( 1 )
8/22/2019 Introduction to FEM-2
29/31
Higher order elements: 1D quadratic- natural coordinates
8/22/2019 Introduction to FEM-2
30/31
Higher order elements: 1D quadratic-
clear 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+-')
8/22/2019 Introduction to FEM-2
31/31
Higher order elements: 1D quadratic- natural coordinates
Exact 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
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.0840
50
60
70
80
90
100
Length
Temperature
quadratic
exact
linear