Homework 6
2D finite elements
0
Note that the compact form for this partial differential equation is: ([k ]T ) + Q =
kx
[k ] =
0
where the conductivity matrix is
0
k y
.
qn = q n on S q
ST
w Tx w Ty
T
kx
w + ky
w dA = k x x nx w + k y y n y w dS
k
+
ky
dA
A x
S
A x x x
y y
y
y
y
x
Page 1 of 17
Homework 6
2D finite elements
Show that this is the equivalent component form of the compact expression used
in class and also given in the lecture notes:
qn
where =
qn qx nx + q y n y is the normal heat flux on the surface whose unit normal
vector is=
n nx i + n y j . Provide the final weak form for this problem.
(b) Consider now a convection boundary condition given by=
q n h(T f T ) on S q . For
this case, provide the new weak form and then derive the finite element matrix
equation K ed e = f e of the heat flow problem. You dont need to do any specific
element calculations. Leave the element stiffness and load vectors in terms of
integrals involving the basis functions N e and their derivatives B e .
Show the contributions to the stiffness and load vectors that result from the
convection boundary condition.
Solution:
The governing differential equation is
T
T
(kx )+ (ky )+ Q = 0
x x y y
with Q a known heat source per unit area and the following boundary conditions
T = T0 ( prescrived) on ST
qn = qn on Sq
a) Multiplying the governing differential equation by w and integrating over the
surface area A gives
To integrate by parts, we start with the compact formula from the lecture notes
Page 2 of 17
Homework 6
2D finite elements
b dw
d
dT
dT
dT
= k(x)
w
k(x)
dx )
a dx (k(x) dx ) wdx
a
dx
dx
dx
a
Substituting the matrix components into the compact formula gives
b
Performing matrix multiplication and dot products gives us the final formula for
integration by parts given in the problem. The two forms are equivalent.
Page 3 of 17
Homework 6
2D finite elements
Substituting the heat flux gives the final weak form for this problem.
In matrix form,
w T w T
k
+
k
dA + QwdA = 0
x x x y y y
A
w T w T
k
+
k
dA = + QwdA
x x x y y y
[ ] [][ ] + = +
Replacing the integrals with the sum of integrals over the finite elements gives,
where
Page 4 of 17
Homework 6
2D finite elements
where
and
Consider a triangular panel made of two isotropic materials with thermal conductivities
of k1 = 4 W C 1 and k2 = 8 W C 1 as shown in the figure. A constant temperature of
T = 10 C is prescribed along the edge BC. The edge AB is insulated and a linear
distribution of flux, q = 15 x W m 1 , is applied along the edge AC. Point source
P = 45 W is applied at=
( x 3,=
y 0). Plate dimensions are in meters.
For the finite element mesh, consider two triangular elements, ABD and BDC. Carry out
calculations manually and find the temperature and flux distributions in the plate.
Solution:
Recall the final weak form from the lecture notes.
Local Nodes and Global Nodes:
Page 5 of 17
Homework 6
N1 N 2 N 3
2D finite elements
y1e y2e
x2e x1e
e=1
2A1 = 6
3 0
1
B = 3 2
6
0 2
3
3
0
K 1 = 3 13/ 3 4 / 3
0 4 / 3 4 / 3
1 3 3 0
B =
6 0 2 2
1
1T
e=2
2A 2 = 6
3 2
1 3 3 0 2 T 1
B =
B = 3 0
6 2 0 2
6
0 2
13 9 4
2
2
K = 9 9 0
3
4 0 4
2
Assembling yields:
3
K=
0
13 6 4
6 6 0
4 0 4
3
f = f + f + r
fe = [N e ] q d
T
f1y = 0
1 1 1 1 1
1
1
1
1
2A1 (x2 y3 x3 y2 + (y2 y3 )x + (x3 x2 )y
2
1
= 1 (x13 y11 x11y13 + (y13 y11 )x + (x11 x13 )y 15xdx
0 2A
1 (x1y1 x1 y1 + (y1 y1 )x + (x1 x1 )y
1
2
2
1
2A1 1 1 2 1
Page 6 of 17
Homework 6
2D finite elements
x
1
2
10
2
x
1
1
15xdx f y=0 = 20
fy = 0 =
0 2
0
0
x
2
2
40
4
x
2
2
and similarly fy = 0 = 1+ 15xdx f y=0 = 50
2
2
0
0
45 [ N ] ( x 3, y)d
2
f = 45 [ N ] =x
2
3,=
y 0
1
2
1
f = 45
2
0
In fact, this point source is just like a point force F acting at middle of the element
boundary which in finite element is represented by F/2 at each node.
10
10 + 0 + 0
60 + 45 / 2 + 0 75 / 2
Assembling
=
f + f + r =
50 + 45 / 2 + r3 (55 / 2) + r3
r4
r4
3 3 0
3 13 6 4 T 75 / 2
2 =
so
0 6 6
0 10 (55 / 2) + r3
r4
4 10
0 4 0
and solving the inner matrix for the temperatures and temperature gradient, we get that:
Page 7 of 17
Homework 6
2D finite elements
T1 = 1.9167 r3 = 56
T2 = 5.25
r4 = 19
The heat flux can be calculated as q =k T , so the matrix form would be
[q ] = k[ B ][T ] . Therefore, for each element, heat flux vector can be calculated as:
1.9167
q1x
6.667
1 3 3 0
=
1
1
1
5.25
k1 B {d } =
4
{q } =
1 =
6.333
6 0 2 2
q y
10
5.25
qx2
19
1 3 3 0
=
2
2
10
k2 B {d } =
8
{q } =
2 =
12.667
6 2 0 2
q y
10
2
(a) Develop an appropriate mapping to map the actual element into the 2 2 master
element shown in the figure.
(b) Verify the mapping is good.
(c) Compute N 3 / y , where N 3 ( , ) is the third interpolation function for the master
element. Give the value of the derivative at node 3 of the element.
(d) Compute 64 N 2 N 3 dA , where N 2 ( , ) and N 3 ( , ) are the second and the third
A
interpolation functions for the master element and A is the area of the actual
element. Use numerical integration with a 11 Gauss quadrature formula.
(e) Compute 4 N 3c dc , where c is the line 3-4 of the element and N 3c is the third
C
interpolation function for the master element expressed in a coordinate that runs
along this line. Use numerical integration with a two-point Gauss quadrature
formula.
Solution:
a)
Page 8 of 17
Homework 6
2D finite elements
x = x j N j ( , )
j =1
M
y = y j N j ( , )
j =1
x = 2N1 + 4 N 4
y = 2N1 + 3N 2
so we obtain the following mapping:
1
x = (3+ 3 )
2
1
y = (5 5 + )
4
b)
x x
1
x = (3+ 3 )
dx
d
2
and
Since =
,
1
dy y y d
y = (5 5 + )
4
1
1
(1 )
(3 + )
dx 2
d
2
dy = 1
(1 ) 1 (5 + ) d
4
4
Therefore,
1
1
(3 + )
(1 )
1
7 3
2
J = 2
= [(3 + )(5 + ) (1 )(1 )] = + +
1
1
8
4 2 4
(1 ) (5 + )
4
4
If = 1, = 1 (worst case scenario), we still have J =
1
> 0 so the mapping is
2
Page 9 of 17
Homework 6
2D finite elements
N 3 N 3 N 3
+
=
y y
y
x
dx
We can write =
dy y
x
d
, therefore,
y d
1
x x
y
dx 1
d
=
=
d
y y dy J y
x
dx
x dy
1 x
=
y
J
Since N 3 =
( + 1)( + 1)
, using the chain rule:
4
N 3 N 3 N 3
=
+
y
y y
+1
=
=
1 x 1 + 1 x
)+
J
4 J
1
1
1
[(1 + ) (1 ) + (1 + )( )(3 + )]
2
4J
2
1
1 + 2 +
[1 + 2 + ] =
4J
7 + 2 + 3
at node 3 (x,y)=(0,0) which corresponds to ( , ) = (1,1) . At this point we compute:
N3
1 + 2 +
1+ 2 +1
1
=
7 + 2 + 3
7+2+3
3
y
d)
Page 10 of 17
Homework 6
2D finite elements
=
64 N 2 N3dA
1 1
)(N
)J w
=
64( )( )(1.75)(4)
64(N=
4 4
2 (0,0)
3 (0,0)
=
e 1 =e 1
A
28
e)
On Line 3-4,
The third interpolation function for the master element expressed along this line is:
1
1
N 3c =
(1 + )(1 + ) =
(1 + )
4
2
Therefore, the integration can be evaluated as
x
x
c 4 N3c dc = c 2(1 + )dx = c 2(1 + )( d + d )
As = 1 , d = 0 , so
x
x
d )
c 2(1 + )( d + =
x
d
1 2(1 + )=
2(1 + )( 2 )(3 + )d
1
(1 + )(3 + 1)d
=
Ps. One can also note that the integration from node 3 to node 4 is in the positive xdirection while the corresponding integration in is in the negative direction (from =1
to =-1). So dx = - 4/2 d. The minus sign comes from the different orientation in the
integration using each of two variables and 4/2=L/2 is the familiar Jacobian for 1D linear
interpolation (after all the 2D basis functions on the boundary =1 are nothing but the 1D
basis functions!).
Page 11 of 17
Homework 6
2D finite elements
T
(k x
) (k y
)=
f in
x
x y
y
where T is the temperature (in C ), k x and k y are the conductivities [in W/(m C )] along
the x and y directions, respectively and f is the internal heat generation per unit volume
in (W/m3).
The essential boundary conditions here involve the specification of the temperature T .
The natural boundary condition involves the specification of the heat flux qn such that:
(k x
T
T
nx + k y
n y ) + (T T ) qn =
0
x
y
where is the convective heat transfer coefficient [in W/(m C )] and T is (ambient)
temperature of the surrounding fluid medium and qn is specified heat flux.. The first
term accounts for heat transfer by conduction, the second by convection and the third
accounts for the specified heat flux.
a) Derive the weak form for this type of problems and give explicit expressions for
the element stiffness matrix and element load vector. Assume parts of the
boundary with essential boundary conditions and the rest with the above natural
boundary condition. How this last condition affects the stiffness matrix?
b) Now consider a series of heating cables placed in a conducting medium, as shown
in the figure. The medium has conductivity of k x = 10 W/(cm C ) and k y = 15
W/(cm C ), the upper surface is exposed to a temperature of -5 C , and the lower
surface is bounded by an insulating medium. Assume that each cable is a point
source of 250 W/cm. Take the convection coefficient between the medium and
the upper surface=
to be 5 W/(cm 2 C) . Use a 8 8 mesh of linear quadrilateral
elements in the computational domain (use any symmetry available in the
problem). Plot the temperature contour. Then Check the convergence of the mesh.
Page 12 of 17
Homework 6
2D finite elements
Hint: Use symmetry of the problem, we can reduce the computational domain to that
shown in the figure. The heat input at the node where the cable is located is 125 W/cm
located at node 63. The boundary conditions at the upper boundary is that of convective
type, at the right and left boundaries the heat flux is zero (because of symmetry), and at
the lower boundary the heat flux is zero because of the insulation.
Solution:
(a) As the governing equation of this problem is:
Kx
0
Define [K e ] =
0
, then,
K y
So, the element stiffness matrix and load vector can be expressed as:
Page 13 of 17
Homework 6
and
2D finite elements
b) Matlab Solutions
MatLab Modifications:
InputGrid.m:
Using the symmetry in the problem, set the x range from 0 to 2cm, and the y range from
0 to 8cm, with 8 elements in both the x and y directions. Use quadratic elements, with 2
spatial dimensions.
if strcmpi(load_grid,'no')==1
xl = 0.0;
xr = 2.0;
direction
yb = 0.0;
direction
yt = 8.0;
nx = 8;
ny = 8;
ElementType = 1;
% 1: Q4 2: T3
nsd = 2;
3)
BoxGrid_2D(xl,xr,yb,yt,nx,ny); % Use the provided box grid
generator
end
InputData.m:
Plot the mesh, boundaries, contours and vectors.
plot_mesh
plot_node
plot_boundary
plot_contour
plot_vector
is_exact
=
=
=
=
=
=
'yes';
'no';
'yes';
'yes';
'yes';
'no';
Only boundary 3 has a non-zero natural boundary condition. Boundaries 1,2,4 as shown
in the plot of the boundaries have zero heat fluxes.
IsBoundaryCondition = [0 0 1 0];
Page 14 of 17
2D finite elements
D = [10 0;
0 15];
specifyEssBCValue.m:
Since there is no specified temperatures on the boundaries, there is no essential BC
condition. Thus,
dof = [];
vals =[];
specifyNaturalBCValue.m:
Input the specified natural boundary condition on side 3. Since,
We obtain:
Thus, we input:
if ( sideInd == 3 ) % Add the NC value below
alpha = -5;
beta = 5*(-5);
end
ff.m
Since there is no internal generation of heat,
value = 0;
NodalSoln.m
Input the value of half the point source of 125W/cm at node 63. (Half the point source
due to symmetry)
R(63)= R(63)+ 125;
Since there are no essential boundary conditions, there is no need to partition the matrix.
Directly solve for the temperatures. There is no reaction vector.
d=K\R
rf= 0;
There are no changes made to integrads.m and integrands4side.m as they match the weak
form of this problem.
MATLAB Results:
Page 15 of 17
Homework 6
2D finite elements
FE solution: Heat flux
2D Grid Plot
8 3 33 3 3 33 3
4
7
4
7
2
6
4
6
2
5
4
5
2
4
3
4
3
2
2
4
2
2
1
4
1
2
0 1 11 1 1 11 1
0
1
2
1
x
Comparing the temperature contour with the ANSYS solution with the same number of
elements,
Page 16 of 17
Page 17 of 17