Professional Documents
Culture Documents
Name: YU BAO
ID# 800-58-1279
May 5, 2003
Content:
Introduction -------------------------------------------------------------------------------- 1
Three-Dimensional Coupled Numerical Model --------------------------------------- 1
Three-dimensional 8-node linear hexahedron element ------------------------- 1
Three-dimensional 8-node infinite element -------------------------------------- 3
Three-dimensional 8-node interface element ------------------------------------ 7
Discussion ---------------------------------------------------------------------------- 9
Automatic Mesh Generation ------------------------------------------------------------- 9
Material Nonlinearity --------------------------------------------------------------------- 12
Case Study (Behavior of Vertically Loaded Piled Rafts) ---------------------------- 13
Conclusions --------------------------------------------------------------------------------- 19
Reference ----------------------------------------------------------------------------------- 19
Appendix: FEM Code
Shape function:
1
(1 i )(1 i )(1 i )
8
(i 1,2,...,8)
Ni
Coordinate interpolation:
8
x N i xi
y N i yi
i 1
z N i zi
i 1
i 1
Displacement interpolation:
8
u N i ui
v N i vi
i 1
w N i wi
i 1
i 1
Element strain:
(e ) x , y , z , xy , yz , yz T B (e )
(e ) u1 , v1 , w1 , u 2 , v2 , w2 ,..., u8 , v8 , w8 T
[B]=[B1B2B8]
Ni / x
0
0
Ni / y
0
0
Ni / z
Ni / y
Ni / x
Ni / z
Ni / y
Ni / z
Ni / x
[Bi]=
yi
Ni
xi
i 1
Ni
zi
i 1
Ni
yi
i 1
Ni
zi
i 1
Ni 1 (1 )(1 )
i
i
8 i
Ni
1
i (1 i )(1 i )
8
Thus,
Ni
Ni
1
J
y
Ni
Ni
Ni
Ni
Element stress:
[ D][ B] ( e)
where D is elastic matrix of 3D problem.
E (1 )
[ D]
(1 )(1 2 )
1
1
1
0
1 2
2(1 )
0
0
1 2
2(1 )
1 2
2(1 )
k (e)
11 11 11 [ B ]T [ D ][ B ] J ddd
k (e ) = ([ B]T [ D][ B] J ) H i H j H k
i 1
j 1 k 1
1 (1 i )(1 i )
4
(i 1,2,3,4)
Ni
1 (1 )(1 )(1 )
i
i
4
(i 5,6,7,8)
1 (1 i )(1 i ) /(1 )
2
(i 1,2,3,4)
1 (1 )(1 )(1 ) /(1 )
i
i
4
(i 5,6,7,8)
Ni
Coordinates:
N x
i i
i 1
8
N y
i
i 1
8
N z
i i
i 1
ri
r
xi 2 y i 2 z i 2
x2 y 2 z 2
global-coordinate system as the decay center). Then the displacement function is:
Mi Mi0 f (
ri
)
r
ri
1
4 (1 i )(1 i )( r )
(i 1,2,3,4)
Mi
r
1 (1 )(1 i )(1 i )( i )
r
4
(i 5,6,7,8)
Thus, the displacement
M u
i i
i 1
8
M v
i i
i 1
8
M w
i
i 1
Element strain:
(e ) x , y , z , xy , yz , yz T B (e )
6
(e ) u1 , v1 , w1 , u 2 , v2 , w2 ,..., u8 , v8 , w8 T
[B]=[B1B2B8]
M i
x
M i
y
Bi
M i
M i
z
0
M i
x
M i
z
0
M i
z
(i 1,2,...,8)
M i
y
M i
x
r
r
M i M i 0 f ( i ) N i f ( i )
r
r
f r
M i M i0
ri
f ( ) M i0
x
x
r
r x
N i ri
r
N i ri
r
( ) N i ( i2 ) x
( ) N i ( i ) x2
x r
x r
r r
r r
( ) Ni ( i ) 2
y
y r
r r
M i N i ri
r
( ) N i ( i ) z2
z
z r
r r
N
Derive i with respect to the global coordinates, get
Ni
Ni
1
J
y
Ni
Ni
Ni
Ni
and
ri
x i2 y i2 z i2
x2 y2 z2 (
i 1
N i xi ) 2 (
i 1
N i yi ) 2 (
N z )
i i
i 1
get
x i2 y i2 z i2
x i2 y i2 z i2
M i
N i
(
) Ni (
)
x
x
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
x
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
3-41
similarly,
x i2 y i2 z i2
x i2 y i2 z i2
M i N i
(
) Ni (
)
y
y
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
y
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
3-42
x i2 y i2 z i2
x i2 y i2 z i2
M i
N i
(
) Ni (
)
z
z
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
z
( N i x i ) 2 ( N i y i ) 2 ( N i z i ) 2
Element stress
[ D][ B] ( e )
{ }T
Thus,
{F }
[k ] ( e )
[ B]
[ D ][ B ]dV { }
[ B ]T [ D ][ B ] J ddd { }
[ B ]T [ D][ B ] J ddd
Because we only care about the deformation and stress of the finite domain, the nodal
displacement of the infinite element need to be coagulated to the finite element boundary
(namely, the four nodes on the facet I, as shown in Fig.1). The method is shown in detail
as follows:
Divide the calculated element stiffness matrix of the infinite element [K] into four
blocks, meanwhile, {} and {F} are also divided into blocks, that is:
k11 k12
1
F1
[ k]=
{}=
{F}=
k 21 k 22
2
F2
where {} represents the nodal displacement vector and {F} represents the nodal force
vector.
Then:
k11 k12 1 F1
k
=
21 k 22 2 F2
k11 1 k12 2 F1
(*)
k 21 1 k 22 2 F2
To eliminate 2 , from the second equation of (*), we get:
1
2 k 22
( F2 k 21 1 ) Put2 into the first equation of (*),then:
k11 1 k12 [k 22 1 ( F2 k 21 1 )] F1
( k11 k12 k 22 1 k 21 ) 1 F1 k12 k 22 1 F2
facet I: (i =1,2,3,4)
facet II: (i =5,6,7,8)
The coordinate shift:
4
8
N i xi
x
x N i xi
i 5
i 1
4
8
N i y i facet II y
N i yi
facet I y
i 5
i 1
4
8
z N z
z
N i zi
i i
i 5
i 1
(7)
(3)
II
(2)
(6)
(8)
(4)
(5)
(1)
Fig.2
i 1
4
i 5
8
u N i ui
facet I v
N v
i i
i 1
4
u N i ui
facet II v
w N w
i i
N v
i 5
8
i i
w N w
i i
i 1
i 5
where
and
u =uI - uII,
N1
0
0
0
N1
0
0
0
N1
... N 4
... 0
... 0
0
N4
0
0
0
N4
N1
0
0
0
N1
0
0
0
N1
... N 4
...
0
...
0
0
N4
0
0
0
N 4
On the interface, the relative displacement and stress of the tangential direction and the
normal direction should be considered, therefore, the normal direction of any point on the
interface is regarded as axis x, then a variable coordinate system xyz is established
where yz is the tangential plane.
In the variable coordinate system xyz:
{w}=[L]{w}=[L][B]{}
where [L] is the coordinate shift matrix:
l x ' x l x ' y lx ' z
where lxx represents the direction cosine of the angle between the axis x and x.
Denote [L][B]=[B], then the stress of any point in the element is:
{ ' } [ D ' ]{ ' } [ D ' ][ B ' ]{ }
'
[ D ' ] 0 k xy
0 (the dimension of kx', kxy' and kxz' is force*length-3 )
'
0
0 k xz
where kx represents the compressive rigidity of the direction x , kxy represents the shear
rigidity of the direction y, and kxz represents the shear rigidity of the direction z.
Make the nodal displacement as the basic unknowns, according to the principle of the
virtual work:
[K]=
1 1
1 1 [ B ]
10
Discussion:
Because of the property of the infinite boundary of foundation soil, FEM is subject to
great limitation to simulate this semi-infinite medium. Therefore, in the analysis of pilesoil interaction problems, it is necessary to adopt the infinite element to simulate
displacement boundary conditions of the limitless boundary of the foundation soil.
Besides, the mechanic property of the interface between pile and soil is special, which not
only can transfer a certain amount of shear force, but also can slide. Therefore, it is
important to employ the interface element to simulate the frictional behavior between pile
and soil in the numerical analysis. Hence, if the finite element, the infinite element and
the interface element are coupled, the numerical model can well simulate the geometrical
and the mechanical behavior of the pile-soil interaction.
AUTOMATIC MESH GENERATION
The first thing to do FEM analysis is to discretize the continuous structure and
generate FEM meshes. Input of element information, such as nodal coordinates, material
parameter, nodal number, element number and so on, is called pre-processing. Manual
input is very time-consuming and subject to careless type error. Sometimes it is even
impossible to do pre-processing by hand when the number of nodes and elements is great.
In this project, a computing method of automatic mesh generation is proposed and the
code is developed.
First, consider the simplest case. Assume a three-dimensional object can be described
by one 8-node hexahedron, as shown in the figure. The geometry of the spatial structure
is determined by 8 basic points P1~P8, whose coordinates are ( xi , y i , z i ) , (i=1, 2,...,8).
Define the element nodes E ( P1 , P2 ,..., P8 ) . Suppose the number of nodes in the
opposite facets is same. Transform this element into the regular cubic domain, thus the
local coordinates are shown in the figure. The edges P1 P2 , P2 P3 , in the original
element correspond to the edges P1 ' P2 ' , P2 ' P3 ' , . Suppose n, m and l are the
number of nodes on the axis , , and , respectively. Then the number of elements on
axis , , and are n-1, m-1 and l-1, respectively. The local coordinates of each node
in the cube are:
s 1
j
s 1
k
s 1
i , j ,k 2
i , j ,k 2
s 1
s 1
s 1
s 1
s 1
m
s 1
l
s 1
s 1
i , j ,k 2 / 1
s 1
along direction; >1 represents the size of meshes gets larger and larger along
direction.
The global coordinates are:
i 1
8
i 1
8
i 1
x i ( , , ) xi
y i ( , , ) yi
z ( , , ) z
i
i
1
(1 i )(1 i )(1 i )
8
i=1,2,...,8
For 8-node hexahedron element, suppose the order of nodal number can be calculated as
the following rule: first, from 1 to 1 ; then from 1 to 1 ; finally
1 to 1 .
Thus, the series number of each node in the meshes is,
N i , j , k nm( k 1) n(i 1) j
E i , j , k ( N i 1, j 1, k 1 , N i 1, j ,k 1 , N i , j ,k 1 , N i , j 1,k 1 , N i 1, j 1, k , N i 1, j , k , N i , j , k , N i , j 1, k )
12
pre-processing mesh
z (m)
-5
-10
-15
-20
4
-2
y (m)
-4
-4
-2
x (m)
interface-element mesh
z (m)
-5
-10
-15
-20
4
y (m)
-2
-4
-4
-2
x (m)
13
MATERIAL NONLINEARITY
Soil is highly nonlinear material. In this project, Duncan-Chang hyperbolic constitutive
model is used.
Duncan-Chang hyperbolic model:
d 1 3
Et
d 1
3 const
R f 1 3
1 3 f
Ei
Ei K i Pa 3
Pa
1 3 f can be determined based on Mohr-Coulomb failure rule,
1 3 f 2c. cos 2 3 sin
1 sin
3
Et 1
K i Pa
2c. cos 2 3 sin
Pa
14
R f failure ratio
D t
d1
d
2
d2
d2
d1
d2
d2
d2
d1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
d3
0
0
d3
0
0
d 3
where,
d1
Et (1 t )
(1 t )(1 2 t )
d2
t
* d1
1 t
d3
1 2 t
* d1
2(1 t )
pre-processing mesh
z (m)
-5
-10
-15
-20
4
-2
y (m)
-4
-4
-2
x (m)
interface-element mesh
z (m)
-5
-10
-15
-20
4
y (m)
-2
-4
-4
-2
x (m)
16
Results:
1. Load-displacement curve of the piled raft system. (Displacement is measured at
the center of the raft.)
load-displacement curve of piled raft
0
50
displacement (mm)
100
150
200
250
300
350
400
450
50
100
150
200
250
300
load on the raft (Kpa)
350
400
450
2. Compare the load-displacement curve of piled raft with the single pile under the
raft.
load-displacement curve of piled raft and pile
0
50
displacement (mm)
100
Piled raft
150
200
Pile only
250
300
350
400
450
1000
2000
3000
4000
load (KN)
5000
6000
7000
8000
17
displacement (mm)
100
Piled raft
200
Raft only
300
400
500
600
50
100
150
200
250
300
load on the raft (Kpa)
350
400
450
10
15
20
25
30
35
40
18
10
15
20
25
30
35
10
15
20
25
30
35
19
80
118.6745
70
60
50
40
30
20
10
5
10
15
20
25
30
35
20
[2] Zienkiewicz, O.C., et al, A novel boundary infinite element, Int. J. Numer. Meth. Eng.,
Vol. 19, 393~404, 1983
[3] Bao, Y. Three-dimensional Nonlinear FEM Analysis of Pile-soil Interaction. Master
thesis, Tianjin University, China, 2001
Computer Codes (using Matlab) are attached. (All the codes are developed by me.)
Appendix
1. Pre-processing code
dat1
dat2
dat3
dat4
dat5
dat6
dat7
%pre-processing program
for n=1:n0(1)
for m=1:3
nxyz(n,m)=nxyz(n,m)-1;
end
end
ise=0; %ise record total amount of element
for n=1:n0(1)
ise=ise+nxyz(n,1)*nxyz(n,2)*nxyz(n,3);
end
nk=[1,1,1,1,1]; %nk(1)is local point
%nk(2)is whole element
%nk(3)is whole point
21
22
23
for j=1:nxyz(n,2)
n1=[ns(j,k),ns(j+1,k),ns(j,k+1),ns(j+1,k+1)];
for m=1:nxyz(n,1)
lf(nk(2),:)=[n1(4)+m-1,n1(4)+m,n1(3)+m,n1(3)+m-1,...
n1(2)+m-1,n1(2)+m,n1(1)+m,n1(1)+m-1,lod(n,9)];
%lf record local element point number
nk(2)=nk(2)+1;
end
end
end
end
np=[nk(3)-1,nk(2)-1];
%use whole point number represent single element information
for k=1:np(2)
for i1=1:8
mn=lf(k,i1);
lf(k,i1)=ip(mn);
end
end
%distribute pile element
if nps>0
ms=[1,1,0]; %new point,pile,interface
for ie=1:np(2)
m1=lf(ie,1:4);
m4=lf(ie,5:8);
w=[sum(z(m4,1))/4,sum(z(m4,2))/4,sum(z(m4,3))/4];
if w(3)<=h(1)&w(3)>h(2)+0.1%&w(1)<h(3)&w(2)<h(5)
for k=1:nps
if abs(w(1)-pl(k,1))<0.2&abs(w(2)-pl(k,2))<0.2
lf(ie,9)=2;
%2 is concrete
%form new and old number contrast
jye=0;
if ms(1)>8
for i=1:ms(1)-1
if m4(1)==jxj(i,2)
jye=1;
break % for i
end
end
end %if ms(1)
if jye==0
jxj(ms(1),1:2)=[np(1)+1,m4(1)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m4(1),:);
jxj(ms(1),1:2)=[np(1)+1,m4(2)];
24
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m4(2),:);
jxj(ms(1),1:2)=[np(1)+1,m4(3)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m4(3),:);
jxj(ms(1),1:2)=[np(1)+1,m4(4)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m4(4),:);
end % if jye
jys=0;
if ms(1)>8
for i=1:ms(1)-1
if m1(1)==jxj(i,2)
jys=1;
break % for i
end
end
end %if ms(1)
if jys==0
jxj(ms(1),1:2)=[np(1)+1,m1(1)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m1(1),:);
jxj(ms(1),1:2)=[np(1)+1,m1(2)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m1(2),:);
jxj(ms(1),1:2)=[np(1)+1,m1(3)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m1(3),:);
jxj(ms(1),1:2)=[np(1)+1,m1(4)];
ms(1)=ms(1)+1;
np(1)=np(1)+1;
z(np(1),:)=z(m1(4),:);
end % if jys
jps(ms(2))=ie;
ms(2)=ms(2)+1;
break % for k
end %if abs
end % for k
end % if w(3)
end %ie
25
ms(1)=ms(1)-1;
ms(2)=ms(2)-1;
%form number of pile element and interface element
for k=1:ms(2)
ms(3)=ms(3)+1;
nr=lf(jps(k),1:8);
for l=1:8
for lj=1:ms(1)
if nr(l)==jxj(lj,2)
lf(jps(k),l)=jxj(lj,1);
end
end
end
jcm(ms(3),1:8)=[lf(jps(k),[6,5,1,2]),nr([6,5,1,2])];
ms(3)=ms(3)+1;
jcm(ms(3),1:8)=[lf(jps(k),[7,6,2,3]),nr([7,6,2,3])];
ms(3)=ms(3)+1;
jcm(ms(3),1:8)=[lf(jps(k),[8,7,3,4]),nr([8,7,3,4])];
ms(3)=ms(3)+1;
jcm(ms(3),1:8)=[lf(jps(k),[5,8,4,1]),nr([5,8,4,1])];
end
%refine the element information of interface
%add a interface at the bottom of the pile
for ie=1:np(2)
if lf(ie,9)==2&z(lf(ie,1),3)<h(2)+0.5 %search for the pile bottom
ms(3)=ms(3)+1;
jcm(ms(3),1)=lf(ie,2);
jcm(ms(3),2)=lf(ie,1);
jcm(ms(3),3)=lf(ie,4);
jcm(ms(3),4)=lf(ie,3);
for i=1:ms(1)
if jcm(ms(3),1)==jxj(i,1)
jcm(ms(3),5)=jxj(i,2);
end
if jcm(ms(3),2)==jxj(i,1)
jcm(ms(3),6)=jxj(i,2);
end
if jcm(ms(3),3)==jxj(i,1)
jcm(ms(3),7)=jxj(i,2);
end
26
if jcm(ms(3),4)==jxj(i,1)
jcm(ms(3),8)=jxj(i,2);
end
end%i
end %if
end %ie
%interface located between the raft and soil
nct=0; %nct is recorder of the raft element
for ie=1:np(2)
if lf(ie,9)==3
nct=nct+1;
raft(nct)=ie;
for i3=1:4
jian=0;
for i4=1:ms(1)
if lf(ie,i3)==jxj(i4,2)
lf(ie,i3)=jxj(i4,1);
jian=1;
break
end
end%i4
if jian==0
ms(1)=ms(1)+1;
np(1)=np(1)+1;
jxj(ms(1),1)=np(1);
jxj(ms(1),2)=lf(ie,i3);
lf(ie,i3)=jxj(ms(1),1);
z(lf(ie,i3),1:3)=z(jxj(ms(1),2),1:3);
end %if jian
end %i3
bbs=0;
for i5=1:nps
x11=1/4*(z(lf(ie,1),1)+z(lf(ie,2),1)+z(lf(ie,3),1)+z(lf(ie,4),1));
x22=1/4*(z(lf(ie,1),2)+z(lf(ie,2),2)+z(lf(ie,3),2)+z(lf(ie,4),2));
if abs(x11-pl(i5,1))<0.01&abs(x22-pl(i5,2))<0.01
bbs=1;
break
end %if abs
end %i5
if bbs==0
ms(3)=ms(3)+1;
jcm(ms(3),1)=lf(ie,2);
jcm(ms(3),2)=lf(ie,1);
jcm(ms(3),3)=lf(ie,4);
jcm(ms(3),4)=lf(ie,3);
27
for i2=1:ms(1)
if jcm(ms(3),1)==jxj(i2,1)
jcm(ms(3),5)=jxj(i2,2);
end
if jcm(ms(3),2)==jxj(i2,1)
jcm(ms(3),6)=jxj(i2,2);
end
if jcm(ms(3),3)==jxj(i2,1)
jcm(ms(3),7)=jxj(i2,2);
end
if jcm(ms(3),4)==jxj(i2,1)
jcm(ms(3),8)=jxj(i2,2);
end
end %i2
end %if bbs
end %if lf(ie,9)==3
end %ie
%distinction of inner and outer facet
ma(1:n0(2))=0;
for k=1:n0(1) %super elment
%form element facet information
fa(1,1:4)=lod(k,[1,2,6,5]);
fa(2,1:4)=lod(k,[2,3,7,6]);
fa(3,1:4)=lod(k,[3,4,8,7]);
fa(4,1:4)=lod(k,[4,1,5,8]);
fa(5,1:4)=lod(k,[4,3,2,1]);
fa(6,1:4)=lod(k,[5,6,7,8]);
for l=1:6
mr=min(fa(l,1:4));
ma(mr)=ma(mr)+1;
if fa(l,1)==mr
nc(mr,ma(mr),1:3)=fa(l,[2,3,4]);
elseif fa(l,2)==mr
nc(mr,ma(mr),1:3)=fa(l,[3,4,1]);
elseif fa(l,3)==mr
nc(mr,ma(mr),1:3)=fa(l,[4,1,2]);
elseif fa(l,4)==mr
nc(mr,ma(mr),1:3)=fa(l,[1,2,3]);
end
end
end % for k
%find same facet in the relevant
mu=[0,0];
for i=1:n0(2)
jsh=ma(i);
28
for j=1:ma(i)
if jsh==1
if nc(i,j,1:3)~=0
mu(2)=mu(2)+1;
lcv(mu(2),1:4)=[i,nc(i,j,1),nc(i,j,2),nc(i,j,3)];
end
else
if nc(i,j,1:3)~=0
jok=1;
for k=j+1:ma(i)
if nc(i,j,1:3)==nc(i,k,1:3)|...
nc(i,j,1:3)==nc(i,k,[3,2,1])|...
nc(i,j,1:3)==nc(i,k,[2,3,1])|...
nc(i,j,1:3)==nc(i,k,[3,1,2])|...
nc(i,j,1:3)==nc(i,k,[1,3,2])|...
nc(i,j,1:3)==nc(i,k,[2,1,3])
mu(1)=mu(1)+1; %mu(1) is inner
lun(mu(1),1:4)=[i,nc(i,j,1),nc(i,j,2),nc(i,j,3)];
nc(i,k,1:3)=0;
jsh=jsh-1;
jok=0;
end % if nc
end%for k
if jok==1
mu(2)=mu(2)+1;
lcv(mu(2),1:4)=[i,nc(i,j,1),nc(i,j,2),nc(i,j,3)]; %outer facet
end%if jok
jsh=jsh-1;
end%if nc
end%if jsh
end
end
%use figure output element mesh
figure
li=zeros(4,2);
for ie=1:mu(2)
li(1,:)=lcv(ie,[1,2]);
li(2,:)=lcv(ie,[2,3]);
li(3,:)=lcv(ie,[3,4]);
li(4,:)=lcv(ie,[4,1]);
qzz(1:4,1:3)=zb(lcv(ie,1:4),:);
xx(1:3)=qzz(1:3,1);
yy(1:3)=qzz(1:3,2);
zz(1:3)=qzz(1:3,3);
29
a=(yy(2)-yy(1))*(zz(3)-zz(1))-(zz(2)-zz(1))*(yy(3)-yy(1));
b=(zz(2)-zz(1))*(xx(3)-xx(1))-(xx(2)-xx(1))*(zz(3)-zz(1));
c=(xx(2)-xx(1))*(yy(3)-yy(1))-(yy(2)-yy(1))*(xx(3)-xx(1));
if c>=-0.0001&a<=0.0001&b<=0.0001
p=[zb(li(1,1),1),zb(li(2,1),1),zb(li(3,1),1),zb(li(4,1),1);...
zb(li(1,2),1),zb(li(2,2),1),zb(li(3,2),1),zb(li(4,2),1)];
q=[zb(li(1,1),2),zb(li(2,1),2),zb(li(3,1),2),zb(li(4,1),2);...
zb(li(1,2),2),zb(li(2,2),2),zb(li(3,2),2),zb(li(4,2),2)];
t=[zb(li(1,1),3),zb(li(2,1),3),zb(li(3,1),3),zb(li(4,1),3);...
zb(li(1,2),3),zb(li(2,2),3),zb(li(3,2),3),zb(li(4,2),3)];
plot3(p,q,t,'b')
title('interface-element mesh')
hold on
end
end
for ie=1:ms(3)
li(1,:)=jcm(ie,[1,2]);
li(2,:)=jcm(ie,[2,3]);
li(3,:)=jcm(ie,[3,4]);
li(4,:)=jcm(ie,[4,1]);
p=[z(li(1,1),1),z(li(2,1),1),z(li(3,1),1),z(li(4,1),1);...
z(li(1,2),1),z(li(2,2),1),z(li(3,2),1),z(li(4,2),1)];
q=[z(li(1,1),2),z(li(2,1),2),z(li(3,1),2),z(li(4,1),2);...
z(li(1,2),2),z(li(2,2),2),z(li(3,2),2),z(li(4,2),2)];
t=[z(li(1,1),3),z(li(2,1),3),z(li(3,1),3),z(li(4,1),3);...
z(li(1,2),3),z(li(2,2),3),z(li(3,2),3),z(li(4,2),3)];
plot3(p,q,t,'r')
hold on
end
zoom on
hold off
end%if
%infinite element pre-processing
nwxy=0; %nwxy record infinite number
for i=1:np(2)
s1=sum(z(lf(i,1:8),1))/8;
s2=sum(z(lf(i,1:8),2))/8;
if s1>=xw(1)-0.8|s2>=xw(2)-0.8|s1<=xw(3)+0.8|s2<=xw(4)+0.8
s=0;
for j=1:8
zs(j)=z(lf(i,j),1); %find x facet's infinite
end
30
for j=1:8
if abs(zs(j)-xw(1))<0.1
s=s+1;
l(s)=j;
end
end
if s==4
nwxy=nwxy+1;
for j=1:4
z2(j)=z(lf(i,l(j)),2)+z(lf(i,l(j)),3);
end
for j=1:4
if z2(j)==min(z2)
lw(nwxy,1)=lf(i,l(j));
else
if z2(j)==max(z2)
lw(nwxy,3)=lf(i,l(j));
end
end
end
for j=1:4
if z2(j)~=min(z2)&z2(j)~=max(z2)
if abs(z(lf(i,l(j)),3)-z(lw(nwxy,1),3))<0.1
lw(nwxy,2)=lf(i,l(j));
else
lw(nwxy,4)=lf(i,l(j));
end
end
end
end %if s==4
s=0;
for j=1:8
zs(j)=z(lf(i,j),2); %find y facet's infinite
end
for j=1:8
if abs(zs(j)-xw(2))<0.1
s=s+1;
l(s)=j;
end
end
if s==4
nwxy=nwxy+1;
for j=1:4
z2(j)=z(lf(i,l(j)),1)+z(lf(i,l(j)),3);
end
for j=1:4
31
if z2(j)==min(z2)
lw(nwxy,2)=lf(i,l(j));
else
if z2(j)==max(z2)
lw(nwxy,4)=lf(i,l(j));
end
end
end
for j=1:4
if z2(j)~=min(z2)&z2(j)~=max(z2)
if abs(z(lf(i,l(j)),3)-z(lw(nwxy,2),3))<0.25
lw(nwxy,1)=lf(i,l(j));
else
lw(nwxy,3)=lf(i,l(j));
end
end
end
end %if s==4
%*****************
s=0;
for j=1:8
zs(j)=z(lf(i,j),1); %find x facet's infinite
end
for j=1:8
if abs(zs(j)-xw(3))<0.1
s=s+1;
l(s)=j;
end
end
if s==4
nwxy=nwxy+1;
for j=1:4
z2(j)=z(lf(i,l(j)),2)+z(lf(i,l(j)),3);
end
for j=1:4
if z2(j)==min(z2)
lw(nwxy,2)=lf(i,l(j));
else
if z2(j)==max(z2)
lw(nwxy,4)=lf(i,l(j));
end
end
end
for j=1:4
if z2(j)~=min(z2)&z2(j)~=max(z2)
32
if abs(z(lf(i,l(j)),3)-z(lw(nwxy,2),3))<0.1
lw(nwxy,1)=lf(i,l(j));
else
lw(nwxy,3)=lf(i,l(j));
end
end
end
end %if s==4
s=0;
for j=1:8
zs(j)=z(lf(i,j),2); %find y facet's infinite
end
for j=1:8
if abs(zs(j)-xw(4))<0.1
s=s+1;
l(s)=j;
end
end
if s==4
nwxy=nwxy+1;
for j=1:4
z2(j)=z(lf(i,l(j)),1)+z(lf(i,l(j)),3);
end
for j=1:4
if z2(j)==min(z2)
lw(nwxy,1)=lf(i,l(j));
else
if z2(j)==max(z2)
lw(nwxy,3)=lf(i,l(j));
end
end
end
for j=1:4
if z2(j)~=min(z2)&z2(j)~=max(z2)
if abs(z(lf(i,l(j)),3)-z(lw(nwxy,1),3))<0.1
lw(nwxy,2)=lf(i,l(j));
else
lw(nwxy,4)=lf(i,l(j));
end
end
end
end %if s==4
end % if s1,s2
end
33
figure
for ie=1:nwxy
li(1,:)=lw(ie,[1,2]);
li(2,:)=lw(ie,[2,3]);
li(3,:)=lw(ie,[3,4]);
li(4,:)=lw(ie,[4,1]);
pp=[z(li(1,1),1),z(li(2,1),1),z(li(3,1),1),z(li(4,1),1);...
z(li(1,2),1),z(li(2,2),1),z(li(3,2),1),z(li(4,2),1)];
qq=[z(li(1,1),2),z(li(2,1),2),z(li(3,1),2),z(li(4,1),2);...
z(li(1,2),2),z(li(2,2),2),z(li(3,2),2),z(li(4,2),2)];
tt=[z(li(1,1),3),z(li(2,1),3),z(li(3,1),3),z(li(4,1),3);...
z(li(1,2),3),z(li(2,2),3),z(li(3,2),3),z(li(4,2),3)];
plot3(pp,qq,tt,'m')
%title('infinite-element mesh')
hold on
end
hold off
save fempre2 np lf lw nwxy z
34
35
36
%pressure is positive
%make zyl in a decreasing order
zyl=sort(zyl);
zyl=zyl(3:-1:1);
% Duncan-Chang non-liner model
% element major stress zyl has already known
sf=(2*c*cos(fi)+2*zyl(3)*(zyl(3)/zyl(2)).^(1/3)*sin(fi))/(1-sin(fi));
% sf is strength damage value
if zyl(3)>-2*c*cos(fi)/(1+sin(fi)) %**
if zyl(1)-zyl(3)<sf %***
sd=(zyl(1)-zyl(3))/sf; %sd is stress level
%if sd>0.95
% sd=0.95;
%end
% get element tangle module Et
et=(1-rf*sd).^2*ck*pa*(zyl(3)/pa).^ckn;
% get element volume tangle module Kt
gg=et*(1-ut)/(1+ut)/(1-2*ut);
d(1,1)=gg;
d(1,2)=gg*ut/(1-ut);
d(1,3)=gg*ut/(1-ut);
d(2,1)=gg*ut/(1-ut);
d(2,2)=gg;
d(2,3)=gg*ut/(1-ut);
d(3,1)=gg*ut/(1-ut);
d(3,2)=gg*ut/(1-ut);
d(3,3)=gg;
d(4,4)=gg*(1-2*ut)/2/(1-ut);
d(5,5)=gg*(1-2*ut)/2/(1-ut);
d(6,6)=gg*(1-2*ut)/2/(1-ut);
end%***
end%**
yl=d*(-b)*dt;
dyl=yl.';
yly((ie-1)*8+ig,1:6)=yly((ie-1)*8+ig,1:6)+dyl(1:6);
dyl=yly((ie-1)*8+ig,1:6)+s0;
x1=-sum(dyl(1:3));
x2=dyl(2)*dyl(3)+dyl(3)*dyl(1)+dyl(1)*dyl(2) ...
-dyl(4).^2-dyl(5).^2-dyl(6).^2;
x3=-dyl(1)*dyl(2)*dyl(3)+dyl(1)*dyl(5).^2+ ...
dyl(2)*dyl(6).^2+dyl(3)*dyl(4).^2- ...
2*dyl(4)*dyl(5)*dyl(6);
q1=-x1.^2/3+x2;
q2=2*(x1/3).^3-x1*x2/3+x3;
37
if q2>0
r1=sqrt(abs(q1)/3);
else
r1=-sqrt(abs(q1)/3);
end
r2=q2/(2*r1.^3);
r3=acos(r2);
zyl=zeros(1,3);
zyl(1)=real(-2*r1*cos(r3/3)-x1/3);
zyl(2)=real(-2*r1*cos(r3/3+2*pi/3)-x1/3);
zyl(3)=real(-2*r1*cos(r3/3+4*pi/3)-x1/3);
%zyl store 3 main stresses
%pressure is positive
%make zyl in a decreasing order
zyl=sort(zyl);
zyl=zyl(3:-1:1);
% Duncan-Chang non-liner model
% element major stress zyl has already known
sf=(2*c*cos(fi)+2*zyl(3)*(zyl(3)/zyl(2)).^(1/3)*sin(fi))/(1-sin(fi));
% sf is strength damage value
if zyl(3)>-2*c*cos(fi)/(1+sin(fi)) %**
if zyl(1)-zyl(3)<sf %***
sd=(zyl(1)-zyl(3))/sf; %sd is stress level
%if sd>0.95
% sd=0.95;
%end
% get element tangle module Et
et=(1-rf*sd).^2*ck*pa*(zyl(3)/pa).^ckn;
% get element volume tangle module Kt
gg=et*(1-ut)/(1+ut)/(1-2*ut);
d(1,1)=gg;
d(1,2)=gg*ut/(1-ut);
d(1,3)=gg*ut/(1-ut);
d(2,1)=gg*ut/(1-ut);
d(2,2)=gg;
d(2,3)=gg*ut/(1-ut);
d(3,1)=gg*ut/(1-ut);
d(3,2)=gg*ut/(1-ut);
d(3,3)=gg;
d(4,4)=gg*(1-2*ut)/2/(1-ut);
d(5,5)=gg*(1-2*ut)/2/(1-ut);
d(6,6)=gg*(1-2*ut)/2/(1-ut);
end %***
end %**
38
end%if lf(ie,9)==1
ke=ke+b.'*d*b*det(jacb)*h2(i)*h2(j)*h2(k);
ig=ig+1;
end %i
end %j
end %k
for j=1:8
nx=lf(ie,j);
for k=1:8
ny=lf(ie,k);
if ie==1&j==1&k==1
zgx=[3*nx-2,3*nx-2,3*nx-2,3*nx-1,3*nx-1,3*nx-1,3*nx,3*nx,3*nx];
zgy=[3*ny-2,3*ny-1,3*ny,3*ny-2,3*ny-1,3*ny,3*ny-2,3*ny-1,3*ny];
zgv=[ke(3*j-2,3*k-2),ke(3*j-2,3*k-1),ke(3*j-2,3*k), ...
ke(3*j-1,3*k-2),ke(3*j-1,3*k-1),ke(3*j-1,3*k), ...
ke(3*j,3*k-2),ke(3*j,3*k-1),ke(3*j,3*k)];
zg=sparse(zgx,zgy,zgv,np1,np1);
else
zg(3*nx-2,3*ny-2)=zg(3*nx-2,3*ny-2)+ke(3*j-2,3*k-2);
zg(3*nx-2,3*ny-1)=zg(3*nx-2,3*ny-1)+ke(3*j-2,3*k-1);
zg(3*nx-2,3*ny)=zg(3*nx-2,3*ny)+ke(3*j-2,3*k);
zg(3*nx-1,3*ny-2)=zg(3*nx-1,3*ny-2)+ke(3*j-1,3*k-2);
zg(3*nx-1,3*ny-1)=zg(3*nx-1,3*ny-1)+ke(3*j-1,3*k-1);
zg(3*nx-1,3*ny)=zg(3*nx-1,3*ny)+ke(3*j-1,3*k);
zg(3*nx,3*ny-2)=zg(3*nx,3*ny-2)+ke(3*j,3*k-2);
zg(3*nx,3*ny-1)=zg(3*nx,3*ny-1)+ke(3*j,3*k-1);
zg(3*nx,3*ny)=zg(3*nx,3*ny)+ke(3*j,3*k);
end%if ie==1
end
end
end % corresponse 'ie'
save stress1 yly
%interface element stiffness matrix
jch=[-1,1,1,-1,-1,1,1,-1;-1,-1,1,1,-1,-1,1,1];
g2=[-0.577350,+0.577350]; %Gause integrate point
h2=[1.0,1.0];
u0=0.002; %relative displacement
ne=0.9; %parameter of e-shaped curve
%w1=zeros(ms(3)*4,3);
load jw1 %employ last step relate displacement
for ie=1:ms(3) %for each interface element
39
ke=zeros(24,24);
d=zeros(3,3);
b=zeros(3,24);
dt=zeros(24,1);
l=zeros(3,3);
for j=1:8
nx=jcm(ie,j);
dt(3*j-2)=ww(3*nx-2);
dt(3*j-1)=ww(3*nx-1);
dt(3*j)=ww(3*nx);
%get element point displacement
end
d(1,1)=2.5*10.^4; % compression stiffness
i3=1;
for k=1:2
for j=1:2
for i1=1:4
xj(i1)=1/4*(1+jch(1,i1)*g2(j))*(1+jch(2,i1)*g2(k));
end
for i1=1:4
b(1,3*i1-2)=xj(i1);
b(2,3*i1-1)=xj(i1);
b(3,3*i1)=xj(i1);
end
for i1=5:8
b(1,3*i1-2)=-xj(i1-4);
b(2,3*i1-1)=-xj(i1-4);
b(3,3*i1)=-xj(i1-4);
end
for i1=1:4
xjd(1,i1)=1/4*jch(1,i1)*(1+jch(2,i1)*g2(k));
xjd(2,i1)=1/4*jch(2,i1)*(1+jch(1,i1)*g2(j));
end
z1=zeros(4,3);
for i1=1:4
z1(i1,1)=z(jcm(ie,i1),1);
z1(i1,2)=z(jcm(ie,i1),2);
z1(i1,3)=z(jcm(ie,i1),3);
end
jaj=xjd*z1; %jaj is Ni' in the global coordinates
jacb=zeros(3,3);
jacb(1,1:3)=[1,1,1];
jacb(2,1:3)=jaj(1,1:3);
jacb(3,1:3)=jaj(2,1:3);
f1=jacb(2,2)*jacb(3,3)-jacb(2,3)*jacb(3,2);
f2=jacb(3,1)*jacb(2,3)-jacb(2,1)*jacb(3,3);
40
f3=jacb(2,1)*jacb(3,2)-jacb(2,2)*jacb(3,1);
% f1,f2,f3 is jacb's algebra remainer
dis=sqrt(f1.^2+f2.^2+f3.^2);
l(1,1)=f1/dis;
l(1,2)=f2/dis;
l(1,3)=f3/dis;
% l(1,1:3) is x' direction's cos
% y'=x'*z
f1=-l(1,2);
f2=l(1,1);
f3=0;
dis=sqrt(f1.^2+f2.^2+f3.^2);
if abs(dis)<0.001 %if z is parallel to x', y'=y*x'
f1=l(1,3);
f2=0;
f3=-l(1,1);
dis=sqrt(f1.^2+f2.^2+f3.^2);
end
l(2,1)=f1/dis;
l(2,2)=f2/dis;
l(2,3)=f3/dis;
%l(2,1:3) is y' direction's cos
% z'=x'*y'
f1=l(1,2)*l(2,3)-l(1,3)*l(2,2);
f2=l(2,1)*l(1,3)-l(1,1)*l(2,3);
f3=l(1,1)*l(2,2)-l(1,2)*l(2,1);
dis=sqrt(f1.^2+f2.^2+f3.^2);
l(3,1)=f1/dis;
l(3,2)=f2/dis;
l(3,3)=f3/dis;
b2=l*b;
w2=b2*dt;%w2 is increasement
x0=0;
for i1=1:4
x0=x0+xj(i1)*z1(i1,3);
end
dat11
s0=k0*r0*x0;
for j1=1:3
w1((ie-1)*4+i3,j1)=w1((ie-1)*4+i3,j1)+w2(j1);
w2(j1)=w1((ie-1)*4+i3,j1);
41
end
sl=d(1,1)*w2(1);
sl=sl+s0;
a=(c+sl*tan(fi))*(1-ne);
b=-log(1-ne)/u0;
if sl>0
d(2,2)=a*b*exp(b*(u0-abs(w2(2))));
d(3,3)=a*b*exp(b*(u0-abs(w2(3))));
else
d(2,2)=0;
d(3,3)=0;
end
zh1=jacb(2,2)*jacb(3,3)-jacb(3,2)*jacb(2,3);
zh2=jacb(3,1)*jacb(2,3)-jacb(2,1)*jacb(3,3);
zh3=jacb(2,1)*jacb(3,2)-jacb(3,1)*jacb(2,2);
zhi=sqrt(zh1.^2+zh2.^2+zh3.^2);
ke=ke+b2.'*d*b2*zhi*h2(j)*h2(k);
i3=i3+1;
end %j
end %k
for j=1:8
nx=jcm(ie,j);
for k=1:8
ny=jcm(ie,k);
zg(3*nx-2,3*ny-2)=zg(3*nx-2,3*ny-2)+ke(3*j-2,3*k-2);
zg(3*nx-2,3*ny-1)=zg(3*nx-2,3*ny-1)+ke(3*j-2,3*k-1);
zg(3*nx-2,3*ny)=zg(3*nx-2,3*ny)+ke(3*j-2,3*k);
zg(3*nx-1,3*ny-2)=zg(3*nx-1,3*ny-2)+ke(3*j-1,3*k-2);
zg(3*nx-1,3*ny-1)=zg(3*nx-1,3*ny-1)+ke(3*j-1,3*k-1);
zg(3*nx-1,3*ny)=zg(3*nx-1,3*ny)+ke(3*j-1,3*k);
zg(3*nx,3*ny-2)=zg(3*nx,3*ny-2)+ke(3*j,3*k-2);
zg(3*nx,3*ny-1)=zg(3*nx,3*ny-1)+ke(3*j,3*k-1);
zg(3*nx,3*ny)=zg(3*nx,3*ny)+ke(3*j,3*k);
end
end
end %ie
save jw1 w1
g2=[-0.577350,+0.577350]; %Gause integrate point
h2=[1.0,1.0];
42
43
44
b(5,3*i1)=xmd(2,i1);
b(6,3*i1-2)=xmd(3,i1);
b(6,3*i1)=xmd(1,i1);
end
ke=ke+b.'*d*b*det(jacb)*h2(j)*h2(k)*1.0;
end %j
end %k
%then consider >0
for k=1:2
for j=1:2
d=zeros(6,6);
% Ni isn't the same as <=0
for i1=1:4
xf(1,i1)=-1/2*g2(2)*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k))/(1-g2(2));
end
for i1=5:8
xf(1,i1)=1/4*(1+g2(2))*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k))/(1-g2(2));
end
% get Ni'
for i1=1:4
xfd(1,i1)=-1/(2*(1-g2(2)).^2)*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xfd(2,i1)=-1/2*g2(2)*jw(1,i1)*(1+jw(2,i1)*g2(k))/(1-g2(2));
xfd(3,i1)=-1/2*g2(2)*jw(2,i1)*(1+jw(1,i1)*g2(j))/(1-g2(2));
end
for i1=5:8
xfd(1,i1)=1/(2*(1-g2(2)).^2)*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xfd(2,i1)=1/4*(1+g2(2))*jw(1,i1)*(1+jw(2,i1)*g2(k))/(1-g2(2));
xfd(3,i1)=1/4*(1+g2(2))*jw(2,i1)*(1+jw(1,i1)*g2(j))/(1-g2(2));
end
% calculate jacobi matrix
for i1=1:4
z1(i1,1:3)=z(lw(ie,i1),1:3);
z1(i1+4,1)=z(lw(ie,i1),1)*2;
z1(i1+4,2)=z(lw(ie,i1),2)*2;
z1(i1+4,3)=z(lw(ie,i1),3);
end
za=sum(z1(1:8,3))/8;
dat11
x0=0;
for i1=1:8
x0=x0+xf(1,i1)*z1(i1,3);
end
s0=[k0*r0*x0,k0*r0*x0,r0*x0,0,0,0];%initial stress
zyl=[s0(3),s0(1),s0(2)];
45
46
ra=cj(1).^2+cj(2).^2+cj(3).^2;
rg=sqrt(ra);
for i1=1:8
xmd(1,i1)=zwh(1,i1)*r(i1)/rg-xf(i1)*r(i1)/rg*cj(1)/ra;
xmd(2,i1)=zwh(2,i1)*r(i1)/rg-xf(i1)*r(i1)/rg*cj(2)/ra;
xmd(3,i1)=zwh(3,i1)*r(i1)/rg-xf(i1)*r(i1)/rg*cj(3)/ra;
end
b=zeros(6,24);
for i1=1:8
b(1,3*i1-2)=xmd(1,i1);
b(2,3*i1-1)=xmd(2,i1);
b(3,3*i1)=xmd(3,i1);
b(4,3*i1-2)=xmd(2,i1);
b(4,3*i1-1)=xmd(1,i1);
b(5,3*i1-1)=xmd(3,i1);
b(5,3*i1)=xmd(2,i1);
b(6,3*i1-2)=xmd(3,i1);
b(6,3*i1)=xmd(1,i1);
end
ke=ke+b.'*d*b*det(jacb)*h2(j)*h2(k)*1.0;
end %j
end %k
% put infinite element rigid into total rigid matrix
k11=ke(1:12,1:12);
k12=ke(1:12,13:24);
k21=ke(13:24,1:12);
k22=ke(13:24,13:24);
% divide element rigid into 4 parts
k11=k11-k12*inv(k22)*k21; %condense to finite element boundary
% do infinite element 1~4 point
for j=1:4
nx=lw(ie,j);
for k=1:4
ny=lw(ie,k);
zg(3*nx-2,3*ny-2)=zg(3*nx-2,3*ny-2)+k11(3*j-2,3*k-2);
zg(3*nx-2,3*ny-1)=zg(3*nx-2,3*ny-1)+k11(3*j-2,3*k-1);
zg(3*nx-2,3*ny)=zg(3*nx-2,3*ny)+k11(3*j-2,3*k);
zg(3*nx-1,3*ny-2)=zg(3*nx-1,3*ny-2)+k11(3*j-1,3*k-2);
zg(3*nx-1,3*ny-1)=zg(3*nx-1,3*ny-1)+k11(3*j-1,3*k-1);
zg(3*nx-1,3*ny)=zg(3*nx-1,3*ny)+k11(3*j-1,3*k);
zg(3*nx,3*ny-2)=zg(3*nx,3*ny-2)+k11(3*j,3*k-2);
zg(3*nx,3*ny-1)=zg(3*nx,3*ny-1)+k11(3*j,3*k-1);
zg(3*nx,3*ny)=zg(3*nx,3*ny)+k11(3*j,3*k);
end %k
end %j
end % ie
47
for i=1:np(1)
if abs(z(i,3)+20)<0.1
zg(3*i,:)=0;
zg(:,3*i)=0;
zg(3*i,3*i)=1;
p(3*i)=0;
end
%if abs(z(i,1))<0.1
% zg(3*i-2,:)=0;
% zg(:,3*i-2)=0;
% zg(3*i-2,3*i-2)=1;
% p(3*i-2)=0;
% end
% if abs(z(i,2))<0.1
% zg(3*i-1,:)=0;
% zg(:,3*i-1)=0;
% zg(3*i-1,3*i-1)=1;
% p(3*i-1)=0;
% end
end % i
48