You are on page 1of 48

ASEN 5367 Advanced Finite Element Method

Term Project Report

Three-Dimensional Nonlinear FEM Analysis of


Vertically loaded Piled Raft

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

ASEN 5367 Advanced Finite Element Method


Term Project

Three-Dimensional Nonlinear FEM Analysis of


Vertically loaded Piled Raft
INTRODUCTION
Piled rafts are widely used as structure foundations. Due to the nonlinear properties of
geotechnical materials and complex boundary conditions, it is impossible to obtain
analytical results of such problems. Along with the rapid development of computers,
numerical methods are more and more widely used in geotechnical engineering. Among
these methods, finite element method (FEM) is a flexible, practical and effective means
for analyzing geotechnical engineering problems. By using FEM, stratified soil and nonlinear soil constitutive relation can be easily taken into consideration. Furthermore, FEM
can simulate many situations that can not be easily solved by test.
Because the dimensions of piled rafts are of the same magnitude in geometry and the
spatial effect is evident, it is better to use 3D FEM to analyze the problem.
THREE-DIMENSIONAL COUPLED NUMERICAL MODEL
In this project, three-dimensional FEM is used to simulate the piled raft system.
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 the
pile-soil interaction, it is necessary to adopt the infinite element to simulate displacement
boundary condition of the limitless boundary of the foundation soil. Using the numerical
method of the coupled finite element and infinite element to simulate foundation soil can
easily solve the difficulty caused by using the finite element only, meanwhile, the amount
of computing work reduces dramatically. In piled rafts, piles and soil bear the loads from
the superstructure together, but the material and mechanical properties of piles and
foundation soil are quite different, and the linkage between them is very special. The
interface can not only transfer some shear stress and normal stress, but also can slide and
detach if loads exceed a certain scope. Therefore, the interface element is required to
adopt to simulate the linkage between piles and soil. Thus, in the FEM analysis of pilesoil interaction, it is appropriate to use the coupled numerical model of the finite element,
the infinite element and the interface element to simulate this complicated system.
In this project, the finite element, the infinite element and the interface element in the
coupled numerical model are showed as follows.
1. Three-dimensional 8-node linear hexahedron element

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 )

where, (e ) is the element nodal displacement vector;

(e ) u1 , v1 , w1 , u 2 , v2 , w2 ,..., u8 , v8 , w8 T

B is the strain matrix,

[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]=

According to the derivative rule of composite function, we can get

let , is called Jacobian matrix.


Where,
= i
yi
zi
xi
x

yi

Ni
xi

i 1

Ni
zi

i 1

Ni
yi

i 1

Ni
zi

i 1

Derive N i , and get


Ni
1
8 i (1 i )(1 i )

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 )

Element stiffness matrix:

k (e)

11 11 11 [ B ]T [ D ][ B ] J ddd

Use Gause integral points,


2

k (e ) = ([ B]T [ D][ B] J ) H i H j H k
i 1

j 1 k 1

2. Three-dimensional 8-node infinite element


Shape function:
According to the modified shape function proposed by Zienkiewicz, the local
coordinate is used to correspond to the direction of the limitless extension, = +1
represents the infinite point.
The three-dimensional 8-node infinite element is divided into two parts: one is 0,
the other is>0 . When0, mapping is from the finite domain of the local-coordinate
system to the finite domain of the global-coordinate system, therefore, the shape function
is the same as the common finite element.
When0,

1 (1 i )(1 i )
4
(i 1,2,3,4)
Ni
1 (1 )(1 )(1 )

i
i
4
(i 5,6,7,8)

For the part of >0, mapping is from


the finite domain of the local-coordinate
system to the infinite domain of the
global-coordinate system, therefore,
when>0, the shape function is:

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

Displacement mapping function:


Since displacement function should satisfy the boundary condition that the
r

displacement of the infinite point is zero, suitable decay function f ( ri ) should be


r

selected. In this project, use f ( ri )

ri
r

xi 2 y i 2 z i 2
x2 y 2 z 2

(assume the original point of the

global-coordinate system as the decay center). Then the displacement function is:
Mi Mi0 f (

ri
)
r

where, M i0 is the same as Ni of 0, then

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

where, (e ) is the infinite element nodal displacement vector;

(e ) u1 , v1 , w1 , u 2 , v2 , w2 ,..., u8 , v8 , w8 T

B is the strain matrix,

[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

similarly, we can get


M i N i ri
r y

( ) 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 )

Infinite element stiffness matrix


Based on the virtual work principle,

{ }T {F} {}T { }dV { }T [B]T [D][B]{ }dV


V

{ }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

denote k=k11-k12k22-1k21 and F=F1-k12k22-1F2


then: [k]{}={F}
At this time, only the displacements of the four nodes on the facet I is remained.
Consequently, every number in [k] and {F} can be added to the corresponding position
of the global stiffness matrix and the total load vector respectively.
3. Three-dimensional 8-node interface element
There exists bond strength between the pile and soil. In this project, the interface
element is used to simulate the frictional behavior of pile-soil interface. Since the study
for three-dimensional interface element is still deficient, as shown in Fig.2, a threedimensional 8 nodes interface element without thickness is proposed in which the nodal
displacement is the basic unknown amount. The stiffness matrix of this interface element
is calculated and it can be easily added to the global stiffness matrix.
Shape function:
N i 1 (1 i )(1 i )
4

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

The displacement shift:

(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

In the global coordinate system, the nodal displacement vector {} is:


{}={u1,v1,w1,u8,v8,w8}T
Choosing the linear displacement pattern, the relative displacement of a couple of
point on facet I and facet II of the interface element in the global coordinate system is:
{w} {u , v, w}T [ B ]{ }

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

[ L] l y ' x l y ' y l y ' z


l z 'x l z ' y l z '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 ' ]{ }

where [D] is the elastic matrix of the interface material


k x'
0
0

'
[ 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

' T [ D ' ][ B ' ] J dd

1 1 [ B ]

= K 1 1 [ B ]T [ L]T [ D ' ][ L][ B ] J dd


1 1

where [K] is the element stiffness matrix of the interface element.

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

where, i=1,2,m; j=1,2,,n; k=1,2,,l. , and are proportional factor on the


axis , , and , respectively. For example, <1 represents the size of meshes gets
smaller and smaller along direction; =1 represents the size of meshes is the same
11

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

where i is interpolation function,


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

(i 1,2,..., m, j 1,2,..., n, k 1,2,..., l )

The series number of each element is,

M i , j ,k ( n 1)( m 1)(k 1) ( n 1)(i 1) j

(i 1,2,..m 1, j 1,2,..., n 1, k 1,2,..., l 1)

The element nodal number sequence is

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:

If 3 Const , the relationship of 1 3 1 can be approximately described as


hyperbolic curve.
1
1 3
a b 1
d 1 3
1

then, the initial elastic modulus Ei


1 0
d 1
a
1
1

and the ultimate strength 1 3 u



a b 1
b
1 3 f
let failure raio R f
1 3 u
then the tangent elastic modulus at each stress level
1

d 1 3
Et
d 1

3 const

R f 1 3

1 3 f

Ei

According to Janbu empirical formula,


n


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

then, we can get


2
R f (1 sin )( 1 3 )

3
Et 1

K i Pa
2c. cos 2 3 sin
Pa

c, soil strength index

14

R f failure ratio

K i , n constants determined by test

Therefore, the elastic matrix D t changes with stress level.

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 )

Use the increment method to solve the nonlinear problem.


1) Divide the total load into finite steps of small load increments.
t
2) Use the last step stress i 1 to compute the tangent elastic matrix D i of the
current step.
3) Form the stiffness matrix K ti .
4) Solve the linear equation K i i F i to obtain the displacement increment
i , and the updated total displacement i i 1 i
5) Obtain i and i based on i , then make the sum of increments to get
i and i .
6) Repeat 1) ~ 5) until the total load is exerted.
BEHAVIOR OF VERTICALLY LOADED PILED RAFT
Parameters:
The pile is calculated according to the linear constitutive relation, and the piles
diameter is 0.8m, its length 10m, its elastic modulus E=2.8*107 Kpa, the Poisson ratio
=0.2. Soil in the calculating domain is assumed to be homogeneous, and there is a layer
of hard rock at the location of 20m below the soil surface. Soil is calculated according to
Duncan-Chang hyperbolic constitutive model with the parameters: K=571, n=0.82,
Rf=0.75,=39o, c=0. In the process of computing, the Poissons ratio is assumed
constant, =0.30. The raft is calculated according to the linear elastic constitutive model,
its depth is 0.5m, its plane size is 4m*4m, its elastic modulus E=2.8*107 Kpa, and its
Poissons ratio =0.2.
Pre-processing mesh
15

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

3. Compare the load-displacement curve of piled raft with raft


load-displacement curve of piled raft and raft

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

4. Vertical displacement contour in soil domain


Vertical displacement contour in piled raft (p=200Kpa)
80
70
60
50
40
30
20
10
0

10

15

20

25

30

35

40

18

Vertical displacement contour in the raft without pile (p=200Kpa)


80
70
-0.047368
60
50
40
30
20
10
5

10

15

20

25

30

35

5. Vertical stress contour due to the uniform pressure in soil domain


Vertical stress contour of piled raft
80
70
60
50
40
30
20
10
5

10

15

20

25

30

35

19

Vertical stress contour of raft without pile


65.81958
92.24702

80

118.6745
70
60
50
40
30
20
10
5

10

15

20

25

30

35

DISCUSSIONS AND CONCLUSIONS


1. Because of geometrical characteristics of piled rafts, it is appropriate to use 3D
FEM to simulate the system.
2. Foundation soil has infinite boundary. Therefore, FEM is subject to great
limitation to simulate this semi-infinite medium. Using coupled finite element and
infinite element model can easily overcome the difficulty caused by using FEM
only and the amount of computing work can decrease dramatically.
3. The interface between piles and soil can not only transfer shear stress and normal
stress, but also it can slide and detach. Therefore, interface element should be
adopted to simulate the linkage between pile and soil.
4. If the finite element, infinite element and interface element are coupled, the
numerical model can well simulate the complicated pile-soil system.
5. In 3D FEM analysis, pre-processing work is important. The technique of
automatic mesh generation should be developed to match the development of 3D
FEM analysis.
6. Material nonlinearity can be solved linearly within a small loading increment.
Reference:
[1] Bao, Y. & Gu, X.L A spatial coupled numerical model for pile-soil interaction,
Design & Inspection for Pile Foundations, Construction Material Industrial Press of
China, May/2001.

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

%nk(4)is boundary trace


%nk(5)is boundary point
for n=1:n0(1)
for k=1:8
for l=1:3
jzb(k,l)=zb(lod(n,k),l); %local location
end
end
x=[-1,-1,-1;1,-1,-1;1,1,-1;-1,1,-1;...
-1,-1,1;1,-1,1;1,1,1;-1,1,1];
sum1=[0.0,1.0];
sm1=1.0;
for k=3:nxyz(n,1)+1
sum1(k)=sum1(k-1)*cxyz(n,1);
sm1=sm1+sum1(k);
end
sum2=[0.0,1.0];
sm2=1.0;
for k=3:nxyz(n,2)+1
sum2(k)=sum2(k-1)*cxyz(n,2);
sm2=sm2+sum2(k);
end
sum3=[0.0,1.0];
sm3=1.0;
for k=3:nxyz(n,3)+1
sum3(k)=sum3(k-1)*cxyz(n,3);
sm3=sm3+sum3(k);
end
r(3)=1.0; %r is local location of every divided point
for iz=1:nxyz(n,3)+1
r(3)=r(3)-2*sum3(iz)/sm3;
r(2)=1.0;
for iy=1:nxyz(n,2)+1
r(2)=r(2)-2*sum2(iy)/sm2;
ns(iy,iz)=nk(1); %first number of each row y in layer z
r(1)=-1.0;
for ix=1:nxyz(n,1)+1
r(1)=r(1)+2*sum1(ix)/sm1;
for k=1:8
sp(k)=0.125*(1+r(1)*x(k,1))*(1+r(2)*x(k,2))...
*(1+r(3)*x(k,3)); %sp is shape function
end
y=[0.0,0.0,0.0];
%y is location of every point
for k=1:8
y=y+sp(k)*jzb(k,:);
end

22

%set up pre-processing data


if n==1
if ix==1|iy==1|iz==1|ix==nxyz(n,1)+1|...
iy==nxyz(n,2)+1|iz==nxyz(n,3)+1
is(nk(5))=nk(3);
nk(5)=nk(5)+1;
end
for l=1:3
z(nk(3),l)=y(l); %z is total location of point
end
ip(nk(1))=nk(3);
nk(3)=nk(3)+1;
nk(1)=nk(1)+1;
end
if n>1
if ix==1|iy==1|iz==1|ix==nxyz(n,1)+1|...
iy==nxyz(n,2)+1|iz==nxyz(n,3)+1
a=1;
for k=1:nk(5)-1
if abs(y-z(is(k),:))<0.01
ip(nk(1))=is(k);
nk(1)=nk(1)+1;
a=100;
break
end
end
if a~=100
is(nk(5))=nk(3);
nk(5)=nk(5)+1;
z(nk(3),:)=y;
ip(nk(1))=nk(3);
nk(3)=nk(3)+1;
nk(1)=nk(1)+1;
end
else
z(nk(3),:)=y;
ip(nk(1))=nk(3);
nk(3)=nk(3)+1;
nk(1)=nk(1)+1;
end
end
end
end
end
% deal with single element point number order
for k=1:nxyz(n,3)

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

2. FEM Analysis code (form global stiffness matrix)


%non-linear model
%zg is global stiffness matrix
np1=3*np(1);
%spatial 8 nodes element stiffness matrix
g2=[-0.577350,+0.577350]; %Gause integrate point
h2=[1.0,1.0];
jlc=[-1,1,1,-1,-1,1,1,-1;-1,-1,1,1,-1,-1,1,1;-1,-1,-1,-1,1,1,1,1];
%mapping element
%yly=zeros(np(2)*8,6);
load stress1 %employ last step stress
for ie=1:np(2)
d=zeros(6,6);
dt=zeros(24,1);
for j=1:8
nx=lf(ie,j);
dt(3*j-2)=ww(3*nx-2);
dt(3*j-1)=ww(3*nx-1);
dt(3*j)=ww(3*nx);
end

34

if lf(ie,9)==2|lf(ie,9)==3 %judge whether is pile


if lf(ie,9)==2
ee=2.8*10.^7; %concrete elastic modulus
end
if lf(ie,9)==3
ee=2.8*10.^7;
end
u=0.2; % concrete poisson's ratio
gg=ee*(1-u)/(1+u)/(1-2*u);
d(1,1)=gg;
d(1,2)=gg*u/(1-u);
d(1,3)=gg*u/(1-u);
d(2,1)=gg*u/(1-u);
d(2,2)=gg;
d(2,3)=gg*u/(1-u);
d(3,1)=gg*u/(1-u);
d(3,2)=gg*u/(1-u);
d(3,3)=gg;
d(4,4)=gg*(1-2*u)/2/(1-u);
d(5,5)=gg*(1-2*u)/2/(1-u);
d(6,6)=gg*(1-2*u)/2/(1-u);
end
ke=zeros(24,24);
ig=1;
for k=1:2
for j=1:2
for i=1:2
for i1=1:8
xn(i1)=1/8*(1+jlc(1,i1)*g2(i))*(1+jlc(2,i1)*g2(j))*(1+jlc(3,i1)*g2(k));
end
xd=zeros(3,8);
for i1=1:8 % get Ni'
xd(1,i1)=1/8*jlc(1,i1)*(1+jlc(2,i1)*g2(j))*(1+jlc(3,i1)*g2(k));
xd(2,i1)=1/8*jlc(2,i1)*(1+jlc(1,i1)*g2(i))*(1+jlc(3,i1)*g2(k));
xd(3,i1)=1/8*jlc(3,i1)*(1+jlc(1,i1)*g2(i))*(1+jlc(2,i1)*g2(j));
end
for i1=1:8
z1(i1,1)=z(lf(ie,i1),1);
z1(i1,2)=z(lf(ie,i1),2);
z1(i1,3)=z(lf(ie,i1),3);
end
jacb=xd*z1;
jacbn=inv(jacb);

35

zhd=jacbn*xd; %Ni' in the whole location


b=zeros(6,24);
for i1=1:8
b(1,3*i1-2)=zhd(1,i1);
b(2,3*i1-1)=zhd(2,i1);
b(3,3*i1)=zhd(3,i1);
b(4,3*i1-2)=zhd(2,i1);
b(4,3*i1-1)=zhd(1,i1);
b(5,3*i1-1)=zhd(3,i1);
b(5,3*i1)=zhd(2,i1);
b(6,3*i1-2)=zhd(3,i1);
b(6,3*i1)=zhd(1,i1); %strain matrix [B]
end
if lf(ie,9)==1
dyl=zeros(1,6);
d=zeros(6,6);
za=sum(z(lf(ie,1:8),3))/8;
dat11
x0=0;
for i1=1:8
x0=x0+xn(i1)*z1(i1,3);
end
s0=[k0*r0*x0,k0*r0*x0,r0*x0,0,0,0];%initial stress
dyl(1:6)=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;
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

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

jw=[-1,1,1,-1,-1,1,1,-1;-1,-1,1,1,-1,-1,1,1]; % infinite element local coordinates


% calculate infinite element elastic matrix
% infinte element stiffness matrix
for ie=1:nwxy
ke=zeros(24,24);
% first consider <=0
for k=1:2
for j=1:2
d=zeros(6,6);
for i1=1:4
xh(1,i1)=-1/4*g2(1)*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
% xh is infinite element shape function
end
for i1=5:8
xh(1,i1)=1/4*(1+g2(1))*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
end
for i1=1:4
xhd(1,i1)=-1/4*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xhd(2,i1)=-1/4*g2(1)*jw(1,i1)*(1+jw(2,i1)*g2(k));
xhd(3,i1)=-1/4*g2(1)*(1+jw(1,i1)*g2(j))*jw(2,i1);
% xhd is Ni'
end
for i1=5:8
xhd(1,i1)=1/4*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xhd(2,i1)=1/4*(1+g2(1))*jw(1,i1)*(1+jw(2,i1)*g2(k));
xhd(3,i1)=1/4*(1+g2(1))*(1+jw(1,i1)*g2(j))*jw(2,i1);
end
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+xh(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)];
% 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));

43

% sf is strength damage value


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);
jacb=xhd*z1;
jacbn=inv(jacb);
zwh=jacbn*xhd; %Ni' in the whole
for i1=1:8
r(i1)=sqrt(z1(i1,1).^2+z1(i1,2).^2+z1(i1,3).^2);
end
cj=xh*z1; % cj is Nixi, Niyi, Nizi respectively
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-xh(1,i1)*r(i1)/rg*cj(1)/ra;
xmd(2,i1)=zwh(2,i1)*r(i1)/rg-xh(1,i1)*r(i1)/rg*cj(2)/ra;
xmd(3,i1)=zwh(3,i1)*r(i1)/rg-xh(1,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);

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

% 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
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);
jacb=xfd*z1;
jacbn=inv(jacb);
%non-equal parameter element ,displace-function require get <=0 Ni'
for i1=1:4
xhd(1,i1)=-1/4*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xhd(2,i1)=-1/4*g2(2)*jw(1,i1)*(1+jw(2,i1)*g2(k));
xhd(3,i1)=-1/4*g2(2)*jw(2,i1)*(1+jw(1,i1)*g2(j));
end
for i1=5:8
xhd(1,i1)=1/4*(1+jw(1,i1)*g2(j))*(1+jw(2,i1)*g2(k));
xhd(2,i1)=1/4*(1+g2(2))*jw(1,i1)*(1+jw(2,i1)*g2(k));
xhd(3,i1)=1/4*(1+g2(2))*jw(2,i1)*(1+jw(1,i1)*g2(j));
end
zwh=jacbn*xhd;
%zwh is mapping function's Ni' in the whole location
for i1=1:8
r(i1)=sqrt(z1(i1,1).^2+z1(i1,2).^2+z1(i1,3).^2);
end
cj=xf*z1;

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

You might also like