Professional Documents
Culture Documents
PROCESSES
dT2 k
(T1 T2 ) T 2’
dx W2
L
Enthalpy balance for COUNTER-CURRENT
BOUNDARY problem,
missing temperature at x=0
dT1 k
(T1 T2 ) T 1’
dx W1 x
dT2 k
(T1 T2 ) T 2’
dx W2
(k is heat transfer coefficient related to unit length of channel, Wi heat capacity of
streams)
NAP5
ODE heat exchangers
Equations for temperature profiles in a matrix form are as follows
d special case for co-
[T ] [[ A]] [T ] current flow
dx
T1 k / W1 k / W1
[T ] [[ A]]
T2 k / W2 k / W2
The matrix [[A]] is constant (for constant k), the ODE system is therefore linear and
can be transformed from a coupled to a separated system by linear transformation
[T ] [[U ]] [ Z ]
where [[U]] is the eigenvector matrix of [[A]] satisfying
[[ A]] [[U ]] [[U ]] [[ ]] a matrix multiplied by its eigenvector gives the same
eigenvector (scaled by eigenvalue)
Z i ( x) di ei x
because [[]] is diagonal
Solution of ODE i 1, 2,...
[ Z ] e[[ ]] x [d ] [[e x ]] [d ]
diagonal matrix
Backtransformation
[T ( x)] [[U ]] [[ex ]] [d ] coefficients dj are
determined by
Ti ( x) U ij e j d j
boundary conditions
x
j
NAP5
ODE heat exchangers
Specific case of 2channels and co-current arrangement of HE
T1 ( x) U11d1e1 x + U12d 2e2 x
T2 ( x) U 21d1e1 x + U 22d 2e2 x
Eigenproblem of [[A]]2 x 2 can be solved analytically :
0 0
k / W1 k / W1 1 W2
[[ A]] [[U ]] [[]] 1 1
k / W2 k / W2 1 W1 0 k (W + W )
1 2
verify eigenproblem sol;ution in MATLABu (k=1, w1=1, w2=2) the result is the same, only the order of
vectors is exchanged, and eigenvectors
a=[-1 1;0.5 -0.5];
are normalised to the unit Eucleid norm.
[u,l]=eig(a) It has no effect upon the results.
u=
-0.8944 -0.7071
0.4472 -0.7071
l=
-1.5000 0
0 0
NAP5
ODE heat exchangers
Generalisation for more complicated HE and HEN (Heat Exchanger Networks)
Heat exchangers have often more than 2 streams (generally N-streams) and each stream (channel) is
divided into M sub-channels (eg because the inlet and outlet ports of various streams are in different
locations or heat transfer coefficient changes along the flow direction). Let us assume that all N streams is
divided into M sub-channels (M> N), the position of the input subchannels is given by the vector [x '] position
and outputs the vector [x'']. Subchannel i (i = 1,2, ..., M) corresponds to the temperature Ti(x), heat capacity
Wi (constant), and the heat transfer coefficient kij with all other sub-channels (also constant). This data is
sufficient to write an enthalpy balance of subchannels M and to formulate system of M-differential equations
d
[T ] [[ A]] [T ]
dx
This system is solved by previous procedure (finding the eigenvalues and eigenvectors of [[A]] and
solving separated equations). The result is a vector of temperature profiles in M subchannels, expressed
by M-coefficients of yet unknown vector [d]
[T ( x)] [[U ]] [[ex ]] [d ]
From this equation we can determine the input and output temperatures of M subchannels (substituting
the coordinates [x '], [x'']). Some of the inputs/outputs of subchannels are input/output channels (ie the
whole heat exchanger), some express only and internal linking. These links of subchannels are
represented by binary matrix [[G]]MxM whose rows correspond to the inputs and outputs of the column
(Gij=1 means that the input of i-th sub-channel is the output of j-th sub-channel), by the matrix of inputs
[[G ']]MxN (G'ij=1 means that the input of i-th subchannel is the input of j-th stream) and by the matrix of
outputs [[G'']]NxM (G''ij=1 means that the output of i-th stream is and the output of j-th sub-channel).
NAP5
ODE heat exchangers
N-coefficients of [d] is determined from the boundary conditions (the prescribed inlet temperature at N
streams). The requirement that the outlet temperature of subchannels are simultaneously input temperature
subchannels downstream (it is defined by matrix [[G]]), represents the missing M-N conditions.
Inlet temperature of all subchannels are therefore either the heat exchanger inlet temperature or outlet
temperature of the downstream sub-channel, ie
[T ( x' )]M [[G ' ]]MxN [T ' ]N + [[G ]]MxM [T ( x' ' )]M
[[U ]]MxM [[e x ' ]]MxM [d ]M [[G ' ]]MxN [T ' ]N + [[G ]]MxM [[U ]]MxM [[e x '' ]]MxM [d ]M
([[V ' ]]MxM [[G ]]MxM [[V ' ' ]]MxM ) [d ]M [[G ' ]]MxN [T ' ]N
[T '']N [[G '']]NxM [[V '']]MxM ([[V ']]MxM [[G ]]MxM [[V '']]MxM ) 1 [[G ']]MxN [T ']N
Xing Luo, Meiling Li, Wilfried Roetzel: A general solution for one-dimensional multistream heat exchangers and their
networks. International Journal of Heat and Mass Transfer 45 (2002) 2695–2705
NAP5
ODE heat exchangers
The previous method is appropriate when the ODE are linear and if there exists an
analytical solution. If the coefficients of heat transfer are not constant (but are
independent of the temperature) the exchanger channels can be divided into
smaller subchannels with constant mean values k (see above). If the coefficient k
is temperature dependent, it would be necessary to repeat the process iteratively
(and in each iteration to solve their own eigenproblem for the matrix [[A]]
depending on temperature).
It is alternatively possible to use numerical integration (repeated solution of the initial problem): Missing
initial condition (x=0) must be estimated and gradually refined in repeated integration (eg by Runge Kutta)
so as to best meet the remaining boundary conditions (for x=L). This is called the shooting method
and it's actually an optimization problem of minimization the norm of the difference between the prescribed
boundary conditions and numerical prediction for x=L (in MATLAB the function fminsearch optimizes the
parameters of missing initial conditions).
You can try a different approach of estimating the missing initial conditions at x=0, execution of integration
from x=0 to x=L, and then carry out the solution in the reverse direction from x=L to x=0, but with the
predicted values (x=L) replaced with prescribed boundary terms. The whole procedure must be repeated
several times (zig zag method) and not always converge (see next example).
NAP5
ODE heat exchangers
Example of two channels HE of length L=1, T1’=90
90
cocurrent and countercurrent arrangement 85
75
dtdx=zeros(2,1); dtdx=zeros(2,1); 55
w1=1; w2=2; k=1; w1=1; w2=2; k=1; 50
dtdx(1)=-k/w1*(t(1)-t(2)); dtdx(1)=-k/w1*(t(1)-t(2));
dtdx(2)=k/w2*(t(1)-t(2)); dtdx(2)=-k/w2*(t(1)-t(2));
45 T2’=40
40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
cocurrent arrangement is
INITIAL problem
90
(therefore easy) >> sol=ode45(@dts,[0 1],[90 40]);
>> plot(sol.x,sol.y) 80
T 1’
countrercurrent by the
70
zig-zag method
s=ode45(@dtp,[0,1],[90,50]);
for i=1:10
60
n=length(s.x);
s=ode45(@dtp,[1,0],[s.y(1,n),40]);
50
n=length(s.x);
s=ode45(@dtp,[0,1],[90,s.y(2,n)]);
end 40 T 2’
plot(s.x,s.y)
30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
NAP5
ODE dryers, extractors…
Flow-through (continuous) devices such as contactors, reactors or dryers (co-
current, counter) are solved almost as well as heat exchangers. Only the
balancing equations of heat transfer are added to equation analogous to the
mass transfer.
So, again the numerical integration methods (Runge Kutta), method of
shooting, etc. are used
Example:
Bruce D.M., Giner S.A.: Mathematicall Modelling of Grain Drying in Counter-flow Beds.
J.Agric.Engng.Res. (1993),pp.143-161
Solution by Euler, Runge Kutta, shooting method.
NAP5
Pipelines networks
The piping network is
made up of straight
sections, bends and turns.
In a broader sense also by
machines like pumps,
accumulators, valves.
The aim is to determine the
pressure profile along the
pipe and flow distribution in
branches.
Consider a special case: a steady flow-rate, constant cross section. Derive the
previous equation p k
(k ) gx
x x x
There is only the pressure p(x) in this equation, and the mass flow rate (which is
constant) was eliminated. The left side represents the friction loss, the right side
buoyancy (when the density depends on the temperature and the temperature
along the channel change). The coefficient k is constant in the laminar flow regime
and decreases with increasing Reynolds number in the turbulent regime.
This ordinary differential equation will be used for explanation of principles of the
method of weighted residuals (MWR) and its special variant of finite element
method (FEM). What is the residue of differential equations? What remains to
the right side, when all terms will transfer to the left
p k
(k ) g x res ( x)
x x x
If p(x) is exact solution the
residual function res(x) is zero
NAP5
Pipeline network FEM, MWR Finite Element Method Method of Weighted Residuals
The method of weighted residuals collected from the possible options p(x) such that
nullifies integrals of residuals multiplied by the selected weight (test) function w(x)
( p j
0 j 1 x
(k
x
) g x
x
) wi dx 0 i 1, 2,..., N
xi wi(x) xi wi(x)
FEM - weight functions FVM weight functions are
x are continuous and first
derivative exists
x discontinuous at finite
volume boundaries
N i N j k
N L L
p j ( k dx) N i g x dx
j 1 0
x x 0
x
Matrix coefficients Kij and right side vector bi are integrals over the entire pipe
network (L is the total length of all branches). These integrals are calculated as
the sum of integrals over individual finite elements.
NAP5
Finite Element Method
In a general finite element only two base and weighting functions corresponding to
two nodes i, j are nonzero. The element therefore contributes only to 4 entries of the
matrix (Kii, Kjj Kij Kji). Because the derivatives of linear Ni(x) are constant the integral
contribution of element is calculated easily as
Ni Nj
ke 1 1
[[ K ]]e j
Le 1 1 i
Le
The assembled matrix [[K]] is singular in this phase, as soon as the boundary
conditions are not specified (and distribution of pressures is not unique). The
boundary conditions have to be prescribed at all end-nodes of mesh:
End pressures (the correponding row of [[K]] is substituted by 1 at diagonal and
the right hand side is prescribed pressure).
As soon as the mass flowrate is prescribed at an end-node the flowrate is
substituted as the right hand side bi.
NAP5
Finite Element Method
System of linear algebraic equations can be solved either by direct methods
(characterized by a finite number of steps, example is Gauss elimination method,
frontal method ) or iteration methods (e.g. Gauss Seidel overrelaxation, or method
of conjugated gradients). The system matrix [[K]] is sparsed (in a row
corresponding to a node connecting only 2 elements are only 3 nonzero entries)
and therefore special storage methods are used for sparse matrices, e.g.
Band Sky Line
matrix matrix
Profit is not only a memory saving but first of all speed of computation. For example
the Gauss elimination with a full and asymetric matrix N x N requires N3/3 floating
point multiplication. Using the band matrix algorithm the number of operations is
reduced to N.Nb2/2, where Nb is the band width.
For small problems (for example pipe networks) it is sufficient to use a standard
Gauss eliminatiom and to write the solution of [[K]][p]=[b] in MATLAB as
p=K\b
NAP5
Finite Element Method
Matrix of equations for nodal values of pressures is a constant only at
laminar.flows. For turbulent or non-Newtonian flows the matrix [[K]] is a function of
Reynolds number and calculated pressure drop (k(p)). The system is non-linear
and must be solved iteratively
[[ K ( p ( k 1) )]][ p ( k ) ] [b]
where k is index of iteration (and a new matrix [[K]] must be assembled at each
iteration).
Systém of nonlinear equations can be used by previously introduced substitution
method (Picard) or by using Newton Raphson method, that is a straightforward
generalisation of Newton‘s tangent-line method. The method is based upon Taylor
expansion of residuals.
( k 1)
N N N
K ( p ) ( k 1)
j 1
K ij ( p ( k 1)
) p ( k 1)
j bi + (
j 1 m 1
im
p j
pm + K ij ( p ( k 1)
))( p (k )
j p ( k 1)
j )0
residuum residuum / p
NAP5
Finite Element Method
Historical remark: Galerkin method and FEM
In russsian literature the Galerkin method is referred to Bubnov method published in 1914 (Bubnov
I.G.: Stroitelnaja mechanika korablja. II. SPB-Tipografija morskogo ministerstva – Bubnov was a
designer of battleships). Galerkin published his works later Galerkin B.G. K voprosu ob issledovajii
naprjazenij i deformacij v uprugom izotropnom tele, Doklady Akademii Nauk SSSR, 1930, Ser.A,
No.14, s.353-358. FEM application of Galerkin method was developed much later in connection to
analysis of catastrophes of british jet-liners Comet. Turner M.J. et al: Stiffness and deflection analysis
of complex structures. J. of Aeronautical Sciences, 23, pp.805-823 (1956).
NAP5
Pipe networks – circulation model
Fluid flow in a model of blood circulation (physical model in the laboratory of
cardiovascular mechanics). The model demonstrates that the FEM need not be
designed by Galerkin or even by weighted residual methods (in this case only
Bernoulli and continuity equations are used).
NAP5
Pipeline network - nodes
Nodal parameter are pressure p and the volumetric flowrate Q. It means that nodes
cannot be located at the branching points, where the flowrate is not defined!
9 7
25 24
12 6 21
26 8 5
10
11 It is not possible to define
13 pressure and flowrate at a
node simultaneously!!!
4 3
23
1
-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 X [m]
NAP5
Pipeline network - elements
Two different FE: two-nodes element generate 2 equations (Bernoulli’s equation
along streamline between nodes 1,2 and continuity equation) and a three-nodes FE
generating 3 equations (Bernoulli 1,2 and 1,3 plus continuity equation). Equations of
system are not generated by assembly of elements contributions. Equations are
generated directly at an element level. Number of unknowns agrees with the
number of generated equations: Number of
2N-Nb = 2Mp+3Mv elements BRANCH
Number of
Number of nodes
elements PIPE
d x2,y2,z2 p2,Q2
Number of end-
nodes
x1,y1,z1 p1,Q1
x2,y2,z2 p2,Q2
V1(2,3,4,23,d1,d2,d2) x3,y3,z3 p3,Q3
P1(1,2,d1) d1
x4,y4,z4
x1,y1,z1 p1,Q1
NAP5
Pipeline network - Bernoulli
Previous solution is based upon Bernoulli equation derived by integration of
momentum balance along streamline between nodes 1 and 2
dv 2 2 p2 p1
L12 + (v2 v1 ) + + g x ( x2 x1 ) + ez12 0
dt 2
The last term ez12 , energy loss [J/kg], depends on flowrate Q, apparent viscosity,
local losses, seez E.Fried, E.I.Idelcik: Flow resistance, a design guide for engineers, E.I.Idelcik:
Handbook of hydraulic resistances.
d 128 LQ 38 8Q 2
L ez12 t 4 + (1.2 + ) 2 4
d Re d
Q2
8Q12 300Q1 128 Q1L1 Q2 L2
d2 Q3 ez12 2 4 (k + 1) 12t + + ( + )
d1 d1
t1 t2
L2 3
d14
d24
d1
p1 p2 150
L1 12 (k + 1) 12t +
v1 2
Re1
2
Q1
NAP5
Pipeline network MATLAB
MATLAB possible solution: mainpq.m
Analogy in shells
Kirchhoff plate – cross section perpendicular to the deformed mid plane
9analogy to Bernoulli beam)
Mindlin plate is analogy to Timoshenko beam
NAP5
Truss, beam, shells FEM
Following examples share the following features:
Solution is based upon deformation method, calculating displacements and
rotations at nodes (stresses are calculated ex post).
Deformation method corresponds to Lagrangean principle of minimum of total potentiual energy. There exist another
principles based upon complementary energy (Castiggliano) when primary results are forces or hybrid principles (Hu
Waschizu) calculating both kinematic and dynamic varibles as primary unknowns..
EAe 1 1
[[ K ]]e
Le 1 1
NAP5
Trusses FEM
In this way it could be possible to solve only the simplest 1D problem of serially
connected springs in the direction x. Nodal displacements are generally vectors
ux,uy (2D case), uz (3D case).
Local matrices must be transformed to a global coordinate system shared by all
finite elements. For example the local element matrix 2 x 2 is to be transformed to
4 x 4 matrix in planar construction (each node is characterized by two
displacements ux, uy).
Transform from local to global coordinatge system concerns only rotations (one
rotation at 2D and three rotations at 3D frames).
y
u ux1 Fx1 c 0
uy
ux u 1 c s 0 0 u y1 F s 0 F 1
y1
u Fx 2 0
u
0 0 c s x2 c F 2
x 2
uy2 y2 0
F s
NAP5
Trusses FEM
Equations in local coordinate system
EAe 1 1 u 1 F 1
Le 1 1 u 2 F 2
After transformation
c 0 ux1 Fx1
EAe s 0 1 1 c s 0 0 u y1 Fy1
Le 0 c 1 1 0 0 c s ux 2 Fx 2
0 s u F
y2 y2
Final matrix in thee coordinate systém x,y
c2 cs c 2 cs
2 >> t=[c^2 c*s;c*s s^2];
EA cs s 2
cs s
[[ K ]]e e 2 >> ke=[t -t;-t t]
Le c cs c 2 cs
2
cs s 2
cs s
NAP5
Truss
Example 5
x=[0 1 0 1 2]; y=[0 0 1 1 2];
y con=[1 3; 2 3; 2 4; 3 4; 3 5; 4 5];
e5 a=[4e-4 4e-4 4e-4 4e-4 4e-4 4e-4];
e6 nu=length(x)
3 e4 ne=length(a)
4 n=2*nu;
k=zeros(n,n);b=zeros(n,1); assembly
e1 e2 e3 for e=1:ne
[kl,ig]=kloc(e,x,y,con,a);
x k(ig(1:4),ig(1:4))=k(ig(1:4),ig(1:4))+kl(1:4,1:4);
end
1 2 for i=1:4
k(i,:)=0;k(i,i)=1; nulové posuvy v uzlech 1,2 a
end zatížení -100N v uzlu 5 (ošklivé
řešení, platí jen pro danou topologii)
b(n)=-100;
Connectivity matrix p=k\b;
b
4 uzj N j 2 uzj N j
Ni ( EI
j
+ Fx j
+ k uzj N j f z )dx 0
a
x 4
x 2
j
Per partes integration is applied twice with the aim to decrease order of derivatives
2 Ni N j Ni N j
b 2 b
The terms at boundary points resulting from per partes integration are neglected.
This is consistent with the assumption that strong boundary conditions (fixed
deformations) are applied or that there is no loading at boundary (free ends).
NAP5
Beams (pipes)
If you are not interested in details, skip these gray pages
The Bernoulli beam is described by ODE, relating bending moment M and resistive moment
2u z
EI 2 M ( x)
x
Where the second derivative is a measure of curvature (1/d 2u/dx2 radius of circular arc).
Bending moment can be caused by transversal force (reaction M=Fz(b-x)), but also by axial force Fx
2M F 2u z 4u z 2u z
M F ( x) (uz (b) uz ( x)) Fx Fx 2 EI 4 + Fx 2 0
x 2 x x x
This equation is a basis for stability analysis of axially loaded beams (Euler stability).
Bending moment M(x) corresponding to isolated transversal forces is only a linear function of x-coordinate and its second
derivative is zero. Only a continuous transversal loading or a continuous elastic support give moments with non-zero second
derivative
b x
M 2M 4u z
b
M ( x)
0
f z ( x + )d
x
f z ( )d
x
x 2
f z ( x) EI 4 f z ( x)
x
b
x Derivative of integral with
variable upper bound
M(x) M(x)
fz
NAP5
Beams (pipes)
Lets return back to the weighted residual method
4u z 2u z
b
2 w 2u z w u z 3u z u z w 2u z b
b
2 w 2u z w u z w
b M(b)
a x2 x 2 + + a 0
b
(EI F w( ku f )) dx [ wF M ]
x x x
x z z z
M(b)
Fz(a)
Cantilever beam loaded constant torque M. Linear The same task, but using the cubic basis functions.
basis functions. Nodes have a single parameter, Nodal parameters are displacement and rotation.
the displacement uz. Zero rotation at the fixed (x Zero rotation can be prescribed, but the solution with
= 0) or not possible to prescribe. a large number of elements ignores this condition
5 5
4 Exact solution
Mx 2 In the solution shown in the 4 20 elements
uz ( x)
3
1 1
0 0
-1 -1
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Boundary conditions, which a priori ensures each approximation solutions are called strong, while the boundary conditions
transferred to the integral formula MWR application integration by parts are weak. For differential equations 2s-th order
weak boundary conditions in a least s-normal derivatives, boundary conditions with lower derivatives are strong. For
second order differential equations are strong boundary conditions prescribed values and weak conditions include the first
derivative, while the fourth order equation (like bending plates) are strong boundary condition values and first derivative
(displacements and rotations, ie kinematic conditions), poor conditions concern until the second or third derivative (stressful
conditions, the second derivative of corresponding moments M = EId 2u / dx2, the third derivative of a rolling force F = -EI
d3u / dx3). Compliance with weak boundary conditions is a matter of correct choices integral formula for the method of
weighted residuals and can not enforce them by fixing the nodal parameters.
NAP5
Beams (pipes)
The final formulation of the Galerkin method of weighted residuals for
Bernoulli’s beam on elastic foundation
Fz
M
Fx
z
x
fz
2 Ni N j Ni N j Ni
b 2 b
j x2 x2 x x x
[ ( EI F + kN i N j ) dx ]u zj N i f z dx + [ N i Fz +
x
M ]b
a
a a
Remark.: Do not forget that this is still only very simplified model of the beam, functioning only
for small deformations, slender beams (not considering shear forces as Timošenko model) and
does not even have axial stiffness. The model calculates only with a bending stiffness!
NAP5
Beams (pipes)
Significant difference from the problem with trusses is that there are now the
second derivatives of basis functions in the integrand and therefore it is not
possible to use linear polynomials - basis functions must be constructed so as to
have a continuous first derivative, for example the Hermite cubic polynomials
Base function having zero first
Basis function equal to 0 on all
derivative e at all nodes and in a
nodes and in single node is the
single node the value is 1
first derivative equal to 1 N zi ( x)
N di (x)
i i+1
( x xi 1 ) 2 ( x xi ) i i+1
( x xi 1 )2 (3xi xi 1 2 x)
N di ( x) N zi ( x)
Expression of
deflection line
( xi xi 1 )2 ( xi xi 1 )3
uz ( x) uz1N z1 ( x) + 1Nd1 ( x) + uz 2 N z 2 ( x) + 2 N d 2 ( x)
Substituting Hermite polynomials into integrand results to a system of linear
algebraic equations whose matrix is the sum of three matrices
[[ K ]] [[ K M ]] Fx [[ K F ]] + [[ M ]]
[[KM]] bending stiffness, [[KF]] geometrical stiffness, [[M]] is mass matrix
NAP5
Beams (pipes)
Results for element of length L
Nodal parameters
u zi (transversal displacement
and rotation)
i
12 6 L 12 6 L
6 L 2 L2
2 Ni N j
2
1 L
EI 4 L2
[[ K M ]] EI dx 3
0.8
x 2
x 2
L 12 6 L
0
Stiffness matrix
0.6
N1 sym 4 L2
N2
0.4 N3
36 3L 36 3L
N4
3L L2
0.2
Ni N j 4 L2
L
1
0
[[ K F ]] dx
30 L 36 3L
0 0.5 1
x x
-0.2
0
Geometry stiffness
sym 4 L2
N1 1 3( x / L) 2 + 2( x / L)3
2 156 22 L 54 13L
2N x (1 2 x / L + ( x / L ) )
L 4 L2 13L 3L2
N3 3( x / L) 2 2( x / L)3 [[ M ]] kNi N j dx
kL
420 156 22 L
N 4 x ( x / L + ( x / L) )
2
2
0
Mass matrix
sym 4 L
NAP5
Beams (pipes) MATLAB
12 6 L 12 6 L
4 L2 6 L 2 L2
EI
function [kstif,kgeom,mass,ig]=kloc(ie,x,y,con,ei,k) [[ K M ]] 3
L 12 6 L
EI=ei(ie);E=200e9;
i1=con(ie,1);i2=con(ie,2); sym 4 L2
ig=[2*i1-1 2*i1 2*i2-1 2*i2];
l=((x(i1)-x(i2))^2+(y(i1)-y(i2))^2)^0.5; 36 3L 36 3L
kstif=EI*E/l^3*[12 6*l -12 6*l;6*l 4*l^2 -6*l 2*l^2; 4 L2 3L L2
1
-12 -6*l 12 -6*l;6*l 2*l^2 -6*l 4*l^2]; [[ K F ]]
30 L 36 3L
kgeom=1/(30*l)*[36 3*l -36 3*l;3*l 4*l^2 -3*l -l^2;
-36 -3*l 36 -3*l;3*l -l^2 -3*l 4*l^2]; sym 4 L2
mass=k*l/420*[156 22*l 54 -13*l;22*l 4*l^2 13*l -3*l^2;
54 13*l 156 -22*l;-13*l -3*l^2 -22*l 4*l^2]; 156 22 L 54 13L
4 L2 13L 3L2
kL
Nodal [[ M ]]
u zi parems 420 156 22 L
i sym 4 L2
These matrices can be used to construct several elements, but only oriented
along the axis x (mass matrix will be use when analyzing vibration of beams,
geometric stiffness matrix for the investigation of stability). In each node are two
calculated parameters, deflection and bending angle of deflection. We can not use
the coordinate transformation for rotating the truss beams as well as for rods,
because the cantilever element has zero stiffness in the x direction. The addition
of stiffness matrix of the beam stiffness of the element type of rod is shown in the
following example.
NAP5
Beams frame 1/3
Stiffness matrix of steel beam + truss
uy z
function [kstif,ig]=klocp(ie,x,y,con,ei,ea) AL2 AL2
EI=ei(ie);EA=ea(ie); E=200e9; I 0 0 0 0
i1=con(ie,1);i2=con(ie,2); ux I
ig=[3*i1-2 3*i1-1 3*i1 3*i2-2 3*i2-1 3*i2]; 12 6 L 0 12 6 L
l=((x(i1)-x(i2))^2+(y(i1)-y(i2))^2)^0.5; EI 4 L2 0 6 L 2 L2
[[ K ]] 3
c=(x(i2)-x(i1))/l;s=(y(i2)-y(i1))/l; L AL2
r=[c s 0;-s c 0;0 0 1];z=zeros(3,3); 0 0
I
Q=[r z;z r];
12 6 L
km=EI*E/l^3*[EA*l^2/EI 0 0 -EA*l^2/EI 0 0; sym
0 12 6*l 0 -12 6*l; 4 L2
0 6*l 4*l^2 0 -6*l 2*l^2;
-EA*l^2/EI 0 0 EA*l^2/EI 0 0;
0 -12 -6*l 0 12 -6*l;
Previous matrix [[KM]] extended by first and fourth
0 6*l 2*l^2 0 -6*l 4*l^2]; rows and columns (inserting stiffness matrix of
kstif=Q'*km*Q; truss)
Transformation to global
coordinate system
Internal forces and moments are calculated as the product of stiffness matrix of
particular element times displacement vector (in this element). For example element 2
f=kl*p(ig(1:6))
kl local stiffness matrix
f= ig selects 6 corresponding displacements
from the vector of global displacements p.
0 Fx2
100.0000 Fy2
100.0000 M2 arm of force 1m, force 100 N
0 Fx3
-100.0000 Fy3
0.0000 M3
NAP5
Rotationally symmetric shells
In rotationally symmetric vessels loaded eg. by internal pressure exist normal
membrane stresses (formulas of type pr / s), but at the locations, where the
curvature or thickness of wall changes, bending and shear stresses appears (wave
of stresses in range typically (rs) ). The vessel is then to be understood as a shell.
FEM systems, e.g. ANSYS, COSMOS, ... always contain spatial shell elements
(curved triangles or quadrangles), but for application to rotationally symmetric shells
are sufficient and important only 2-nodal elements (representing a conical ring).
Perhaps the most successful element of this type already suggested about 30 years ago ing.Vykutil (VUT
Brno), is implemented in Femina and is easy to write in MATLAB
See Schneider P., Vykutil J.:Aplikovaná metoda konečných prvků, skripta VÚT Brno, 1997.
function [kstif,bp,ig]=kloc(ie,x,y,con,he,pe)
% kstif(6x6) matice tuhosti, bp(6) zatížení tlakem, ig(6) indexy globální soustavy c s 0 c s 0
% ie index elementu,x(),y() globalni souradnice, con(:,2) konektivita L L
0 0 0 0
% he() tloušťky stěn, pe() vnitřní přetlaky 2r 2r
1 0 0 1
[[ B]]5 x 6
E=200e9;mi=0.28;h=he(ie);p=pe(ie); 0 0 1
i1=con(ie,1);i2=con(ie,2); L 0 sL sL
0 0 0
ig=[3*i1-2 3*i1-1 3*i1 3*i2-2 3*i2-1 3*i2]; 2r 2r
L L
r1=y(i1);r2=y(i2); s c s c
l=((x(i1)-x(i2))^2+(r1-r2)^2)^0.5; 2 2
r=(r1+r2)/2;
c=(x(i2)-x(i1))/l;s=(r2-r1)/l;
b=1/l*[-c -s 0 c s 0; 1 0 0 0
0 l/(2*r) 0 0 l/(2*r) 0; 1 0 0 0
0 0 -1 0 0 1; h2 h2
0 0 s*l/(2*r) 0 0 s*l/(2*r); Eh 0 0 0
-s -c l/2 s -c l/2]; [[ D]]5 x 5 12 12
1 2
h 2
h2
d=E*h/(1-mi^2)*[1 mi 0 0 0; 0 0 0
mi 1 0 0 0; 12 12
0 0 h^2/12 mi*h^2/12 0; 5(1 )
0 0 0 0
0 0 mi*h^2/12 h^2/12 0; 12
0 0 0 0 5*(1-mi)/12];
kstif=r*l*b'*d*b;
pl=p*l/8;
bp=[-pl*s*(3*r1+r2) pl*c*(3*r1+r2) 0 -pl*s*(3*r2+r1) pl*c*(3*r2+r1) 0];
Pressure loading
NAP5
Rotationally symmetric shells
Solution of system [[K]][u]=[b] is vector of generalized displacements,
for element with nodes 1,2
N
u x1
r=y 2
u y1 ur1 M
rz1=
[u ] 1 1
ux2 ux1
u
y2
x
2
Eh Eh u x 2 u x1 u u r1 u + u r1
5 generalized forces: N ( + ) [ cos + r 2 sin + r 2 ]
1 2
1 2
L L 2R
N [N/m] meridian membrane force
Eh Eh u u x1 u u r1 u + u r1
N ( + ) [ ( x 2 cos + r 2 sin ) + r 2 ]
N [N/m] circumferential force 1 2
1 2
L L 2R
5Eh u u x1 u u r1 + 1
Q [ x2 sin + r 2 cos + 2 ]
12(1 + ) L L 2
NAP5
FEM 2D and 3D elements
Truss, beam, but also the rotary shell are typical 1D finite elements
corresponding to ordinary differential equations for displacement, deflection or
rotation of a single independent variable (length in the direction of the
coordinate axis of the element). Analogous equations for displacements,
deflections or rotations also applies to 2D or 3D elements (eg. triangles,
tetrahedrons, hexahedron ...). Basis weight functions and Ni are, however, a
function of x, y, z (again it may e.g. linear or Hermite polynomials). Application
of Galerkin method and implementation of assembly, boundary conditions and
the solution of system of algebraic equations is the same for 1D, 2D or 3D
elements.
The 2D and 3D problems differ from the 1D problems more or less formally,
because corresponding differential equations are partial differential equations
and not ordinary differential equations (because there is more than one
independent variable, x,y,z). A solution of partial differential equations will be a
subject of next lecture ...
NAP5
What is important
p k
FEM for solution of popeline networks (k ) g x
(incompressible fluid, steady state). x x x
N i N j k
N L L
p j ( k dx) N i g x dx
Finite element PIPE j 1 x x x
ke 1 1
0 0
[[ K ]]e
Le 1 1
Assembly of elements to global matrix for e=1:ne
[kl,ig]=kloc(e);
k(ig(1:2),ig(1:2))=k(ig(1:2),ig(1:2))+kl(1:2,1:2);
end
NAP5
What is important
What is the difference between truss, beam and membrane, shell.
FEM for trusses
2u x EAe 1 1
EA 2 + f x 0 [[ K ]]e
x Le 1 1
Transformation from local coordinate systém of element to global coordinate u
x1
systém x,y
u 1 c s 0 0 u y1
u 2 0 0 c s ux 2
u
y2
FEM for beams. Cubic polynomials
4u z 2u z
EI 4 + Fx 2 + kuz f z
x x
Bending and geometrical stiffness, mass matrix
2 Ni N j N N j
L 2 L L
[[ K M ]] EI dx [[ K F ]] i dx [[ M ]] kN i N j dx
0
x 2
x 2
0
x x 0