Top Banner
MATLAB eXtended Finite Element Method (MXFEM) User's Guide Matthew Jon Pais Structural and Multidisciplinary Optimization Group Mechanical and Aerospace Engineering Department University of Florida Gainesville, FL 32611 April 30, 2010
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: User Manual

MATLAB eXtended Finite Element Method

(MXFEM)

User's Guide

Matthew Jon Pais

Structural and Multidisciplinary Optimization Group

Mechanical and Aerospace Engineering Department

University of Florida

Gainesville, FL 32611

April 30, 2010

Page 2: User Manual

2

Table of Contents

Chapter 1: Introduction ................................................................................... 3

Chapter 2: eXtended Finite Element Method ................................................. 4

Chapter 3: Level Set Method .......................................................................... 6

Chapter 4: Fracture Mechanics ....................................................................... 8

Chapter 5: Reanalysis.................................................................................... 10

Chapter 6: Use of MXFEM........................................................................... 12

Chapter 7: Examples ..................................................................................... 17

1. Center Crack in a Finite Plate Under Uniaxial Tension ....................................... 17

2. Edge Crack in a Finite Plate Under Uniaxial Tension.......................................... 17

3. Circular Inclusion in a Finite Plate ....................................................................... 18

4. Circular Void in a Finite Plate .............................................................................. 18

5. Paris Crack Growth Law....................................................................................... 18

6. Crack Growth in Presence of a Hard/Soft Inclusion............................................. 18

7. Crack Initiation Angle for Crack Initiating from a Hole in a Plate ...................... 19

Appendix: Auxiliary Stress Fields ................................................................ 20

References ..................................................................................................... 21

Page 3: User Manual

3

Chapter 1: Introduction Modeling crack growth in a traditional finite element framework is a challenging engineering task.

Originally the finite element framework was modified to accommodate the discontinuities that are caused

by phenomena such as cracks, inclusions and voids. The finite element framework is not well suited for

modeling crack growth because the domain of interest is defined by the mesh. At each increment of crack

growth, at least the domain surrounding the crack tip must be remeshed such that the updated crack

geometry is accurately represented.

Here, a simple two-dimensional plane stress and plane strain XFEM implementation within

MATLAB is presented. The extended finite element method (XFEM) along with the level set method can

be used to alleviate many of the inconveniences of using the finite element method (FEM) to model the

evolution of a crack. Special enrichment functions are added to the traditional finite element framework

through the partition of unity framework. For modeling the strong discontinuity of a cracked body two

enrichment functions are used. The Heaviside step function represents the discontinuity away from the

crack tip, and the linear elastic asymptotic crack tip displacement fields are used to account for

discontinuity at the crack tip. The crack is represented independent of the mesh by the enrichment functions

which allows for the crack geometry to be updated without a need to create/update a new mesh on the

domain. In addition, enrichment functions for a bimaterial crack are presented. For the case of a material

interface, an enrichment function is used which combines distance from the weak discontinuity and the

absolute value function. Finally, for a void, a step function is used such that the global displacement

approximation equals zero within the void.

Crack growth was modeled by combining the maximum circumferential stress criterion for predicting

the direction of crack growth. Either a constant crack growth increment or the Paris law is used to

incrementally grow a crack. The stress intensity factors needed for these models were calculated using the

domain form of the J-integral interaction integrals.

Page 4: User Manual

4

Chapter 2: eXtended Finite Element Method The extended finite element method

1,2 (XFEM) allows discontinuities to be represented independent

of the finite element mesh by exploiting the partition of unity finite element method3 (PUFEM). Arbitrarily

oriented discontinuities can be modeled independent of the finite element mesh by enriching all elements

cut by a discontinuity using enrichment functions satisfying the discontinuous behavior and additional

nodal degrees of freedom. In general the approximation of the displacement field in XFEM takes the

following form:

h( ) N ( ) ( )d

I I I

I I

x x xυ∈Ω ∈Ω

= +

∑ ∑u u a (2.1)

where Ω is the entire domain and dΩ is the domain containing discontinuities. In Eq. (2.1), N ( )I x are the

traditional finite element shape function, ( )xυ is the discontinuous enrichment function, and Iu , Ia are

the traditional and enriched degrees of freedom (DOF). Note that where dΩ Ω = ∅∩ the enrichment

function ( )xυ vanishes. As the discontinuities are not defined by the finite element mesh the level set

method is used to track the discontinuities. The approximation in Eq. (2.1) does not satisfy interpolation

property; i.e., ( )hI Ix≠u u due to enriched degrees of freedom. A common practice to satisfy the

interpolation property in implementations of XFEM is to 'shift' the enrichment function4 such that

( ) ( ) ( )I Ix x xυ υϒ = − . (2.2)

where ( )I xϒ is the shifted enrichment function for the ith node and ( )I xυ is the value of ( )xυ at the i

th

node. Thus, the interpolation property is recovered as the shifted enrichment function ( )I xϒ vanishes at

the node. Here lower case variables are used to represent the unshifted enrichment functions.

Crack Enrichment

For the modeling of a crack in a homogeneous material, two different enrichment schemes are

employed. For an element completely cut by a crack the Heaviside2 enrichment function is used such that

Above Crack

Below Crack

1h( )

1x

+= −. (2.3)

Thus a discontinuity is explicitly added to an element cut by a crack.

For the case of an element containing the crack tip the functions originally introduced by Fleming5 for

the representing crack tip displacement fields in the element-free Galerkin (EFG) method and repeated by

Belytschko1 are repeated. The near tip displacement field takes the form of the following four functions

1 4( ), sin , cos , sin cos , sin cos2 2 2 2

x r r r rα α

θ θ θ θφ θ θ= −

=

(2.4)

where r and θ are the polar coordinates in the local crack-tip coordinate system. Note that the crack tip

enrichment functions in Eq. (2.4) introduces a discontinuity across the crack in the element containing the

tip, while the Heaviside function in Eq. (2.3) does in the elements cut by the crack. When a node would be

enriched by both Eqs. (2.3) and (2.4), only Eq. (2.4) is used.

Bimaterial Crack Enrichment

For the case of a bimaterial crack, the enrichment functions introduced by Sukumar6 are used. Due to

the oscillatory nature of the singularity a more complex near tip displacement field is required which takes

the form of

Page 5: User Manual

5

( ) ( )( ) ( )

( ) ( )

( ) ( )

( ) ( )

- -1 12

-

- -

( ), cos log e sin , cos log e cos ,2 2

cos log e sin , cos log e cos ,2 2

cos log e sin sin , cos log e cos sin ,2 2

sin log e sin , sin log e cos ,2 2

sin log e sin , sin log e2

x r r r r

r r r r

r r r r

r r r r

r r r r

εθ εθα α

εθ εθ

εθ εθ

εθ εθ

εθ εθ

θ θφ ε ε

θ θε ε

θ θε θ ε θ

θ θε ε

θε ε

= − =

( ) ( ) cos ,

2

sin log e sin sin , cos log e cos sin2 2

r r r rεθ εθ

θ

θ θε θ ε θ

(2.5)

where r and θ are polar coordinates in the local crack tip coordinate system and ε is a constant which is

a bimaterial constant given by

1 1log

2 1

βε

π β

− = + (2.6)

where β is the second Dundurs7 parameter given by

( ) ( )( ) ( )

1 2 2 1

1 2 2 1

1 2 1 2

1 1

v v

v v

µ µβ

µ µ

− − −=

− + − (2.7)

where µ is the shear modulus and v is Poisson's ratio. Please refer to the paper by Sukumar6 for the

derivatives of these enrichment functions with respect to the global coordinate system.

Inclusion Enrichment

Sukumar8 was the first to try and represent a material interface using an enrichment in XFEM. This

enrichment took the form

( ) ( )I I

I

x N xψ ζ= ∑ (2.8)

where Iζ are the nodal level set values for the material interface level set function. This solution however,

lead to issues with blending between the enriched and unenriched elements. To improve the convergence

rate a minimization problem was formulated which improved the convergence.

Moës9 then addressed the problem using a modified absolute value enrichment where

( ) ( ) ( )I I I I

I I

x N x N xψ ζ ζ= −∑ ∑ . (2.9)

This enrichment was shown to have optimal convergence. In addition, note that the enrichment function

goes to zero at all nodes such that it does not need to be shifted like many other enrichment functions.

Void Enrichment

Voids8,10

have been modeled independent of the finite element mesh using a different enrichment

strategy which takes the form of

( ) V( ) N ( )hI I

I

x x x∈Ω

= ∑u u (2.10)

where V( )x is the void enrichment taking a value of 0 inside the void and 1 outside the void. In two-

dimensions, integration is performed only in the portion of an element containing material and nodes with

support completely within in void are fixed.

Page 6: User Manual

6

Chapter 3: Level Set Method The level set method is a versatile method for computing and analyzing the evolution of an interface Γ

in two or three dimensions, which was introduced by Osher and Sethian11. The interface bounds an open

region Ω . The velocity of the evolving interface can depend on position, time, interface geometry and the

physics of the underlying problem. The level set function will be used for representing the material

interface between the fiber and matrix as well as the geometry of a crack.

The level set function ( ( ), )x t tφ is a continuous function, where ( )x t is a point in the domain Ω . The

level set function has the following properties

( ( ), ) 0 for

( ( ), ) 0 for

( ( ), ) 0 for

x t t x

x t t x

x t t x

φ

φ

φ

< ∈ Ω> ∉ Ω= ∈ Γ

(11)

Therefore, the boundary of interest at any given time t can be located by finding ( )x t that satisfies the

following equation:

( ( ), ) 0x t tφ = (12)

The boundary is commonly referred to as the zero level set of φ which can be abbreviated as oφ . Equation

(12) is commonly referred to as the level set equation. The typical approach to using the level set equation

to propagate a moving front over time is to differentiate with respect to time which yields

( )

0( )

x t

t t x t

φ φ∂ ∂ ∂+ ⋅ =

∂ ∂ ∂ (13)

Equation (13) can be rewritten as

, 0t Vφ φ+ ⋅ ∇ =

(14)

where V

is the velocity field. This partial differential equation can then be solved numerically by

discretizing and using a finite difference approach to approximate the gradient of φ . The derivative of φ

with respect to the time t can be approximated using the forward difference method as

1

0n n

n nVt

φ φφ

+ −+ ⋅ ∇ =

(15)

which can be rewritten into a more convenient form for updating φ in two-dimensions as

( )1, ,

n n n n n nx y

t u vφ φ φ φ+ = −∆ + (16)

where u and v are the x and y components of the evolving interface velocity. The time step t∆ is

governed by the Courant-Friedrichs-Lewy (CFL) condition12. The CFL condition ensures that the

approximation of the solution to the partial differential equation given in Eq. (13) is convergent. The

limiting parameter for the time step in two-dimensions can be written as

( )( )

max ,

max ,

x yt

u v

∆ ∆∆ < (17)

where x∆ and y∆ represent the grid spacing in the x and y-directions.

For modeling a composite material, a fiber in a matrix will be considered. The level set function

associated with a cylindrical fiber in the composite is denoted ( )ζ x and calculated as

Page 7: User Manual

7

( ) ( ) ( )2 2

i c i c cx x y y rζ = − + − −x (18)

where ix and iy are the coordinates of the thi node in the domain, cx and cy are the coordinates of the

center of the fiber and cr is the fiber radius.

The analytical form of the level set function as in Eq. (27) is limited for simple geometries. In addition,

when the interface moves according to Eq. (23), the new interface will not have a simple analytical

expression. Stolarska13 introduced an extension of the level set method for modeling the evolution of a one-

dimensional curve in a piecewise linear fashion with a particular focus on representing the evolution of a

crack. Instead of having analytical expression of the level set function, a discrete value is assigned at each

node of finite elements, and the location of zero level set is found using interpolation.

Sukumar8 proposed additional enrichments via the level set method for the modeling of holes and

inclusions. Two level set functions φ and ψ are needed to track the growth of an open curve in this case a

crack: one for the crack path and the other for the crack tip. In this extension the crack path is represented

as the zero level set of ( ( ), )x t tψ . The ψ level set is oriented such that its zero level set passes through the

current crack tip and is oriented in the direction of the crack tip speed function. The zero level set of

( ( ), )x t tφ is then given by the line intersecting the current crack tip and orthogonal to the zero level set of

ψ .

For the φ and ψ level set functions, each grid point is assigned a distance from that point to the

nearest point of that function's zero level set. The sign of the distance for the ψ level set function is

positive on the side counter-clockwise from the direction of the crack tip speed function and negative on

the clockwise side. The sign of the distance function for the φ function is positive on the side in the

direction of crack growth and negative on the opposite side. The crack is defined to be the locations where

the following conditions are true

( )( )( ), 0

( ), 0

x t t

x t t

φ

ψ

≤=

. (19)

Page 8: User Manual

8

Chapter 4: Fracture Mechanics The amount of crack growth depends up on the chosen crack growth law and type of problem being

solved. The maximum circumferential stress criterion14 is used to evolve the crack in which the crack will

propagate in the direction where θθσ is a maximum. The angle of crack growth is given by

( )21

2arctan 84

I Ic II

II II

K Ksign K

K Kθ

= − + (3.1)

where IK and IIK are the mixed-mode stress intensity factors. The magnitude of the incremental crack

growth can be determined either using a constant crack growth increment, typically assumed to be 1/10 of

the initial crack length or using Paris Law. Recall that Paris Law15 is given by

( )mda

C KdN

= ∆ (3.2)

where C and m are Paris Law constants. Tanaka16 gave a version of K∆ suitable for mixed-mode stress

intensity factors where

4 44 8I IIK K K∆ = + . (3.3)

The incremental crack growth length is given by

( )ma CN K∆ = ∆ . (3.4)

Thus, the direction of crack growth is a function of mixed-mode stress intensity factors. The domain

forms of the interaction integrals14,17

are used to calculate the mixed-mode stress intensity factors. For a

general mixed-mode situation the relationship between the J-integral and the stress intensity factors as

2 2I II

eff eff

K KJ

E E= + (3.5)

where effE is defined by a state of plane stress or plane strain as

2

, plane stress

, plane strain1

eff

E

E E

v

= −

(3.6)

where E is Young's modulus and v is Poisson's ratio. In order to calculate the mixed-mode stress intensity

factors, an auxiliary stress state is superimposed onto the stress and displacement fields from the XFEM

analysis. The auxiliary stress and displacement equations are chosen to be those derived by Westergaard18

and Williams19 which are given in the Appendix. For the case of a bimaterial crack, refer to Sukumar

6 for

the auxiliary fields for this crack configuration. The XFEM solutions are denoted with superscript (1) as ( )1ijσ ,

( )1ijε and ( )1

iu , while that from the auxiliary state as ( )2ijσ ,

( )2ijε and ( )2

iu .

Recall that the J-integral20 takes the form of

ki i jk j

i

uJ Wn n d

Γ

∂ = − Γ

∂ ∫ (3.7)

where W is the strain energy density and i denotes the crack tip opening direction, which is assumed to

correspond to the global x-direction, denoted 1x . Equation (3.7) can be rewritten as

1 11

ij ij j

uJ W n d

xδ σ

Γ

∂ = − Γ

∂ ∫ . (3.8)

The two stress states can be superimposed into Eq. (3.8) such that

Page 9: User Manual

9

( ) ( )( ) ( ) ( )( ) ( ) ( )( )( ) ( )( )(1 2)1 2

1 2 1 2 1 21 1

1

1

2i i

j jij ij ij ij ij ij

u uJ n d

xσ σ ε ε δ σ σ

+

Γ

∂ + = + + − + Γ ∂ ∫ . (3.9)

The J-integrals for pure state 1 and auxiliary state 2 can be separated from Eq. (3.9), which leaves an

interaction term such that

( ) ( ) ( ) ( )1 2 1 2 1,21 1 1J J J I+ = + + (3.10)

where ( )1,2I is the interaction term and is given by

( ) ( ) ( )( )

( )( )2 1

1 21,2 1,21

1 1

i ij jij ij

u uI W n d

x xδ σ σ

Γ

∂ ∂ = − − Γ ∂ ∂ ∫ (3.11)

where ( )1,2W is the interaction strain energy density

( ) ( ) ( ) ( ) ( )1 2 2 11,2ij ij ij ijW σ ε σ ε= = . (3.12)

Since we are superimposing two cracked configurations onto one another we can also write Eq. (3.5)

as

( )

( ) ( )( ) ( ) ( )( )2 21 2 1 21 2

1I I II II

eff eff

K K K KJ

E E+ + +

= + . (3.13)

Expanding and rearranging terms from Eq. (3.13) yields

( ) ( ) ( )( ) ( ) ( ) ( )( )1 2 1 2

1 2 1 21 1 1

2 I I II II

eff

K K K KJ J J

E+ +

= + + . (3.14)

Setting Eq. (3.10) and Eq. (3.14) equal leads to the relationship

( )( ) ( ) ( ) ( )( )1 2 1 2

1,22 I I II II

eff

K K K KI

E

+= . (3.15)

The stress intensity factors for the current state can be found by separating the two modes of fracture. By

selecting ( )2 1IK = and ( )2 0IIK = , we are able to solve for ( )1IK such that

( )( )1,Mode I

1

2eff

I

I EK = . (3.16)

A similar procedure can also be followed such that ( )1IIK is given by

( )( )1,Mode II

1

2eff

II

I EK = . (3.17)

The contour defining ( )1,2I is converted to an area integral by using a smoothing function q . This

function takes a value of 1 on the innermost contour and a value of 0 on the outermost contour. At any

point in A , the linear shape functions are used to interpolate the value of q . The divergence theorem can

be used to give the following equation for the domain form of the interaction integral.

( ) ( ) ( ) ( ) d2 1

1 21,2 1,21

1 1

i ijij ij

jA

u u qI W A

x x xσ σ δ ∂ ∂ ∂ = − − ∂ ∂ ∂ ∫ (3.18)

Page 10: User Manual

10

Chapter 5: Reanalysis Recall that the approximation of the displacement in XFEM takes the form

( ) ( ) ( ) ( )4

1

h

I I I I I

I

u x N x u H x a x bαα

α=

= + + Φ

∑ ∑ (19)

and the corresponding finite element stiffness matrix takes the form

uu ua ub

T

ua aa ab

T T

ub ab bb

K K K

K K K K

K K K

=

. (20)

It can be noticed from Eq. (19) that the stiffness component associated with the traditional finite

element approximation is not a function of the crack location, which implies that the uuK component of

the stiffness matrix will be constant at each iteration of crack growth. This implies that the changing

portion of the stiffness matrix is the enriched portion, which will be small compared to the unenriched

portion. Furthermore, it can also be noticed that while the Heaviside enrichment term is a function of the

crack location within an element, that once an element has been enriched with the Heaviside enrichment its

stiffness value will not change in any future iterations, meaning that the stiffness components containing

subscript a will be constant for future iterations of crack growth.

Thus it is only necessary to consider elements which convert from a crack tip enrichment to a Heaviside

enrichment as a result of crack growth and new elements containing crack tips at each iteration after the

initial iteration. If an incremental crack growth increment of a∆ which is proportional to the elemental

length is considered then for any iteration after the initial iteration the stiffness matrix in only about 10

elements per tip must be considered instead of the entire domain. This clearly leads to a drastic decrease in

the computational time required for the simulation of crack growth in the XFEM environment.

Further increases in reducing computational time may be achieved by considering an incremental

Cholesky factorization of the global stiffness matrix. This algorithm is based on the realization that the

crack exists in a relatively small area of the total domain being modeled. Furthermore, of the enriched

domain, a large amount of the domain can be considered to be constant as the result of the Heaviside

enrichment. Recall that the Cholesky factorization of a matrix A takes the form

11 12 11 11 21

21 2212 22 22

0

0

T T

T

T T

A A L L LA LL

L LA A L

= = = . (21)

where

( )

( )

11 11

21 11 12

22 22 21 21

T

T

L chol A

L L A

L chol A L L

=

=

= −

. (22)

With the above algorithm, 11A can be considered to be equivalent to

Page 11: User Manual

11

11

uu ua

T

ua aa

K KA

K K

=

(23)

in the first iteration. Then the components of the global stiffness matrix associated with the crack tip can be

considered as

12 22,ub

bb

ab

KA A K

K

= =

. (24)

Then 11A can be kept and reused at future iterations of crack growth. Then the above algorithm can be

used to find the factorization for the new constant stiffness matrix components as a result of new Heaviside

nodes. The new factorization can be appended to the end of the previous iteration's 11A , then Eqs. (22) and

(24) can be used to factor the new crack tip stiffness matrix. Due to limitations in sparse division present

within MATLAB, the above algorithm has not been implemented in this work. Instead the global stiffness

matrix is modified at each increment and factored from scratch within MATLAB. An iterative procedure

such as the one introduce by Wu4 could also be used to solve the system of equations.

Page 12: User Manual

12

Chapter 6: Use of MXFEM The MATLAB code has been prepared such that the user modifies the inputQuasiStatic.m file, then

runs xfemQuasiStatic.m from the MATLAB Command Window to solve a quasi-static crack problem. For

an optimization problem the user modifies both inputOptimization.m and xfemOptimization.m and runs

inputOptimization.m to solve the given problem. A detailed description of the input variables follows as

well as a brief summary of the functions which make up the complete code follows.

bimatctipNodes.m

This function calculates the values of the enrichment functions at the nodes enriched with the bimaterial

crack tip enrichment function.

boundaryCond.m

This function applies boundary conditions on the domain. Options included in the current package include

fixing the bottom of the rectangular domain in the y-direction and bottom left hand corner with respect to x

and y, edge crack, half center crack, full center crack, rollers on bottom and left edge, and symmetric about

midpoint. For the case of voids, the additional fixed degrees of freedom are also calculated and added to the

system of equations.

calcDOF.m

This function calculates the total number of degrees of freedom in the system considering traditional,

Heaviside, crack tip, bimaterial crack tip, and inclusion degrees of freedom.

connectivity.m

This function calculates the global XYZ coordinates of all the nodes, defines element connectivity and also

begins to build the NODES matrix which keeps track of the numbering for the enriched degrees of

freedom.

crackCoord2Length.m

This function creates a vector a which consists of the crack length at each iteration from CRACK. This

function is independent of the main code.

ctipNodes.m

This function calculates the values of the enrichment functions at the nodes enriched with the crack tip

enrichment function.

elemStress.m

This function calculates the nodal stress values for the given geometry. If an element by element stress plot

is to be made, then the nodal stress values may or may not be averaged based on the user's specifications.

enrElem.m

This function identifies the enriched elements or the enriched elements which will be modified by the

reanalysis algorithm.

forceVector.m

This function creates the global force vector.

Page 13: User Manual

13

gauss.m

This function contains the values of integration points and weights needed for Gauss quadrature in

quadrilaterals and triangles.

growCrack.m

This function determines the angle and magnitude of the next crack growth increment from all crack tips.

The direction of future crack growth is determined based on the maximum circumferential stress criterion.

If the Paris Law constants are assigned in inputQuasiStatic.m then the Paris Law with the Tanaka mixed-

mode correction are used to determine the increment of crack growth. If the effective stress intensity factor

does not exceed the critical stress intensity factor no crack growth occurs and the iterations of growth exit.

heaviNodes.m

This function calculates the values of the enrichment functions at the nodes enriched with the Heaviside

enrichment function.

inputLoadHistory.m

Allows for variable amplitude, uniaxial tension loading in the y-direction. The value of amplitude at each

iteration is input into loadHistory vector within inputLoadHistory.m. For the use of variable amplitude

loading, FORCE in inputQuasiStatic should be empty.

inputOptimization.m

Follows the same layout as inputQuasiStatic.m however, the optimization problem also requires the

modification of the xfemOptimization.m file in order for the crack to be moved at each iteration of the

optimization. See benchmark for example. Note that based on the optimization being performed, the use of

this file may be drastically different.

inputQuasiStatic.m

The following input variables are used to define the problem of interest: DOMAIN, MAT, CRACK, INC,

VOID, GROW, FORCE, BC, PLOT. In order for an analysis to successfully run, the minimum required

variables to be defined are DOMAIN, MAT, GROW, FORCE and BC. A listing of the variables, their size

and their meaning follows.

DOMAIN

This variable defines the rectangular domain and mesh density for the given analysis.

DOMAIN(1) = number of elements in the x-direction

DOMAIN(2) = number of elements in the y-direction

DOMAIN(3) = element length in x-direction

DOMAIN(4) = element length in y-direction (currently DOMAIN(3) must equal DOMAIN(4))

MAT

This variable defines the material properties for the given analysis.

MAT(1) = Young's modulus for domain

MAT(2) = Poisson's ratio for domain

MAT(3) = Young's modulus for inclusion

MAT(4) = Poisson's ratio for inclusion

MAT(5) = plane stress (1) or strain (2)

MAT(6) = plane stress thickness

MAT(7) = critical stress intensity factor for domain

Page 14: User Manual

14

CRACK

This variable defines the points which define the linear segments of the crack.

CRACK(i,1) = x-coordinate of the 1st point of the ith segment

CRACK(i,2) = y-coordinate of the 1st point of the ith segment

CRACK(i+1,1) = x-coordinate of the 2nd point of the ith segment, 1st point of the (i+1)th segment

CRACK(i+1,2) = y-coordinate of the 2nd point of the ith segment, 1st point of the (i+1)th segment

INC

This variable defines the location of the inclusion. Two options are provided, either a linear section cutting

the domain into two pieces or circular inclusion(s).

INC(i,1) = x-coordinate of center of inclusion i

INC(i,2) = y-coordinate of center of inclusion i

INC(i,3) = radius of inclusion i

INC(i,1) = x-coordinate of first point defining linear inclusion

INC(i,2) = y-coordinate of first point defining linear inclusion

INC(i,3) = x-coordinate of second point defining linear inclusion

INC(i,4) = y-coordinate of second point defining linear inclusion

VOID

This variable defines the location of the voids. Circular void(s) are available.

VOID(i,1) = x-coordinate of center of void i

VOID(i,2) = y-coordinate of center of void i

VOID(i,3) = radius of void i

GROW

This variable defines how many iterations of crack growth will occur as well as how the growth is modeled.

GROW(1) = Total number of cycles

GROW(2) = Crack growth increment

GROW(1) = Total number of cycles

GROW(2) = Number of cycles per growth increment

GROW(3) = Paris Law constant

GROW(4) = Paris Law exponent

FORCE

This variable determines the applied loading to the rectangular domain.

FORCE(1) = uniaxial tension in global x (1) or y (2) direction

FORCE(2) = magnitude of force in the x-direction along applied direction

FORCE(3) = magnitude of force in the y-direction along applied direction

BC

This variable determines which boundary conditions should be applied to the rectangular domain.

BC(1) = 1, bottom edge roller, bottom left corner fixed

BC(1) = 2, edge crack

BC(1) = 3, half center crack

BC(1) = 4, full center crack

BC(1) = 5, rollers bottom and left edges

BC(1) = 6, symmetric about midpoint

PLOT

This variable controls which plots are output by the MATLAB code. For all cases 1 = Yes, 0 = No.

PLOT(1,1) = plot level set functions

PLOT(1,2) = plot phi level set functions

PLOT(1,3) = plot psi level set function

PLOT(1,4) = plot zeta level set function (inclusions)

Page 15: User Manual

15

PLOT(1,5) = plot chi level set function (voids)

PLOT(1,6) = plot the discontinuity on the level set plot

PLOT(1,7) = define the narrow band level set radius for crack as integer for number of elements

PLOT(2,1) = plot mesh

PLOT(2,2) = plot node numbers

PLOT(2,3) = plot element numbers

PLOT(2,4) = plot enriched nodes (blue circle - Heaviside, blue square - crack tip, black circle - inclusion)

PLOT(2,5) = plot discontinuities (crack, inclusion, voids)

PLOT(2,6) = plot J-domain search radius

PLOT(3,1) = plot the deformed mesh

PLOT(3,2) = plot node numbers

PLOT(3,3) = plot element numbers

PLOT(3,4) = enriched nodes (blue circle - Heaviside, blue square - crack tip, black circle - inclusion)

PLOT(3,5) = plot deformed crack (inner element only)

PLOT(3,6) = deformation scaling factor (if zero, calculated by code)

PLOT(4,1) = plot the stress on an element-by-element basis

PLOT(4,2) = average nodal stress values

PLOT(5,1) = plot the stress contours, default is contour lines

PLOT(5,2) = plot the filled stress contours

PLOT(5,3) = plot the Von Mises stress contour only

Examples of PLOT for Various Outputs

Plot the phi and psi level sets with default narrow band radius:

PLOT(1,:) = [1 1 0 0 0 0 0];

Plot the phi, psi, zeta and chi level sets with default narrow band radius:

PLOT(1,:) = [1 1 1 1 1 0 0];

Plot the phi, psi, zeta and chi level sets with 10 element narrow band radius:

PLOT(1,:) = [1 1 1 1 1 0 10];

Plot the mesh with node numbers:

PLOT(2,:) = [1 1 0 0 0 0 0];

Plot the mesh with enriched nodes and discontinuities:

PLOT(2,:) = [1 0 0 1 1 0 0];

Plot the σxx, σyy, and σxy stress contours:

PLOT(5,:) = [1 1 0 0 0 0 0];

Plot only the Von Mises stress contours:

PLOT(5,:) = [1 1 1 0 0 0 0];

JIntegral.m

This function calculates the mixed-mode stress intensity factors for the traditional or bimaterial crack tip

enrichment functions. The default J-domain search radius is 4 elements around the crack tip. The stress

intensity factors are retuned such that the last tip in CRACK is first and the first tip in CRACK is second.

levelSet.m

This function creates the φ , ψ , ζ and χ level set functions used to track the crack tips, crack body, voids

and inclusions. In addition this file defines the locations of the enriched degrees of freedom and assign

these enriched nodes tracking values in the NODES matrix.

Page 16: User Manual

16

plotContour.m

This function plots the stress contours and discontinuities. The option for a filled contour is provided.

plotDeformation.m

This function plots the deformed mesh. Options are available for plotting node and element numbers, the

enriched nodes are available.

plotLevelSet.m

This function plots the φ , ψ , ζ and χ level set functions. The discontinuities may be plotted.

plotMain.m

This function controls which plots are created based on inputQuasiStatic.m

plotMesh.m

This function plots the finite element mesh. Options are available for plotting node and element numbers,

the enriched nodes, the discontinuities and the J-domain radius.

plotStress.m

This function plots the stress distribution within each element and discontinuities. The option to average

nodal stress values is available.

stiffnessMatrix.m

This function calculates the global stiffness matrix for the system of equations.

subDomain.m

This function subdivides elements containing discontinuities into triangles so that accurate integration can

be performed in these elements.

updateStiffness.m

This function performs the reanalysis algorithm on the stiffness matrix.

xfemOptimization.m

This function is optimized by the desired function in order to optimized the user defined function.

xfemQuasiStatic.m

This function controls the calling of the various functions such that the desired analysis functions well. This

is the function which is run in the command window such that the analysis runs.

Page 17: User Manual

17

Chapter 7: Examples The following examples are given to show that the provided code provides accurate results for a

variety of problems which have well known theoretical values. Please refer to the Examples folder in the

provided download file which contains the input files for these Example problems.

1. Center Crack in a Finite Plate Under Uniaxial Tension

The theoretical Mode I stress intensity factor IK for this configuration is given as

( )IK F aλ σ π= (5.1)

where σ is the applied nominal stress, 2a is the crack length and ( )F λ is a factor associated with the

finite effect of the plate21 given by

( ) ( )( )2 4sec 1 0.025 0.062

Fπλ

λ λ λ= − + (5.2)

and λ is the ratio between the crack length and the width of the plate given as

a

Wλ = (5.3)

where 2W is the width of the plate.

Here the following values are used, a = 1, W = 3, σ = 1. This corresponds to a theoretical Mode I stress

intensity factor of 1.90. Two models are used and for each case the elemental length is 1/20 which

corresponds to a mesh of size 60 x 200. When half of the center crack is modeled the calculated stress

intensity factors are KI = 1.86 and KII = 0.003, which are in good agreement with theoretical values. When

the full center crack is modeled the calculated stress intensity factors are KI = 1.88 and KII = -2.02E-4 at the

right tip and KI = 1.88 and KII = -0.61E-4 at the left tip, which are also in good agreement with theoretical

values.

2. Edge Crack in a Finite Plate Under Uniaxial Tension

The theoretical Mode I stress intensity factor IK for this configuration is given as

( )IK F aλ σ π= (5.4)

where σ is the applied nominal stress, a is the crack length and ( )F λ is a factor associated with the

finite effect of the plate22 given by

( ) 2 3 41.12 0.231 10.55 21.72 30.39F λ λ λ λ λ= − + − + (5.5)

and λ is the ratio between the crack length and the width of the plate given as

a

Wλ = (5.6)

where W is the width of the plate.

Here the following values are used, a = 1, W = 3, σ = 1. This corresponds to a theoretical Mode I stress

intensity factor of 3.17. For an elemental length of 1/20 which corresponds to a mesh of size 60 x 120, the

calculated stress intensity factors are KI = 3.17 and KII = 0.0011, which are in good agreement with

theoretical values.

Page 18: User Manual

18

3. Circular Inclusion in a Finite Plate

Here an inclusion with E = 70 GPa and v = 0.3 and radius 0.5 is placed in the center of a plate of size 6 x 10

with E = 50 GPa and v = 0.3 which is subjected to a unit tension in the y-direction. The stress values were

calculated using ANSYS and the resulting stress plots were compared to the MATLAB XFEM

implementation.

4. Circular Void in a Finite Plate

Here a void of radius 0.3 is placed in the center of a plate of size 3 x 3 which is subjected to a unit stress in

the y-direction. The stress plot for yyσ is in excellent agreement with the expected 3σ stress concentration

at the edges of the hole.

5. Paris Crack Growth Law

Here the XFEM code is used to grow a crack until the Mode I stress intensity factor reaches the critical

value. The example used for comparison is one in which a center crack of length 0.02 is on the wall of a

pressure vessel with applied pressure 0.06 MPa, radius of 3.25 m and thickness of 0.00248 m. The material

properties are those of an aluminum alloy with E = 70 GPa and v = 0.33. The XFEM simulates growth in

increments of 100 cycles up to 4500 for crack growth in an infinite plate. At each increment, the XFEM

values are compared to those of the theoretical current crack size from Paris Law15, which are given as

1

11 2212 2

m mm

N o

m pra NC a

t

π −− = − + (5.7)

where N is the number of cycles, C is the Paris Law constant, m is the Paris Law exponent, and oa is

the initial crack length. A comparison of the XFEM and Paris Law values are given in Figure 1.

0 500 1000 1500 2000 2500 3000 3500 4000 45000.02

0.03

0.04

0.05

0.06

0.07

0.08

Number of Cycles

Cra

ck L

ength

(m

)

Comparison on Analytical Paris Law and XFEM with Paris Law Growth Increments

Paris Law

XFEM

Figure 1. Comparison of XFEM and Paris Law predictions of crack growth.

6. Crack Growth in Presence of a Hard/Soft Inclusion

Here an example problem used by Bordas23 is repeated. In this problem, a domain of width 4 and height 8

contains a circular inclusion with radius 1 and center at width/2 and height/4. An initial edge crack of 0.5 is

located along the left edge of the domain at height/2. The inclusion is either harder or softer than the main

material with a ratio of 10 or 0.1. The crack is grown until it passes the inclusion. Results correspond very

well to published results. Note that the boundary conditions are not specified in the paper and that the

Page 19: User Manual

19

resulting difference between the assumed and published solution are most likely a result of different

boundary conditions.

7. Crack Initiation Angle for Crack Initiating from a Hole in a Plate

Here an example optimization problem is solved of the form

( )

s.t.

min

2 2

G θ

π πθ

− ≤ ≤ (5.8)

for a plate with a hole under uniaxial tension. The theoretical solution is 0 degrees, while the optimization

result is an initial angle of -1.7287e-005 degrees.

Page 20: User Manual

20

Appendix: Auxiliary Stress FieldsThe auxiliary stresses derived by

Westergaard and Williams are

111 3 3

cos 1 sin sin sin 2 cos cos2 2 2 2 2 22

I IIK Kr

θ θ θ θ θ θσ

π

= − − +

(A1)

221 3 3

cos 1 sin sin sin cos cos2 2 2 2 2 22

I IIK Kr

θ θ θ θ θ θσ

π

= + +

(A2)

( )33 11 22vσ σ σ= + (A3)

231

cos22

IIIKr

θσ

π= (A4)

311

sin22 r

θσ

π

−= (A5)

121 3 3

sin cos cos cos 1 sin sin2 2 2 2 2 22

I IIK Kr

θ θ θ θ θ θσ

π

= + −

(A6)

and the auxiliary displacements are

( ) ( ) 11

cos cos sin 2 cos2 2 2 2I II

ru K K

θ θκ θ κ θ

µ π= − + + + (A7)

( ) ( ) 21

sin sin cos 2 cos2 2 2 2I II

ru K K

θ θκ θ κ θ

µ π= − + − + (A8)

32

sin2 2III

ru K

θ

µ π= (A9)

where µ is the shear modulus and κ is the Kosolov constant.

Page 21: User Manual

21

References 1Belytschko, T., Black, T., "Elastic crack growth in finite elements with minimal remeshing." International

Journal for Numerical Methods in Engineering, Vol. 45, 1999, pp. 601-620.

2Moës, N., Dolbow, J., Belytschko, T., "A finite element method for crack growth without remeshing."

International Journal for Numerical Methods in Engineering, Vol. 46, 1999, pp. 131-150.

3Babuska, I., Melenk, J., "The Partition of Unity Method." International Journal for Numerical Methods in

Engineering, Vol. 40, 1997, pp. 727-758.

4Belytschko, T., Moës, N., Usui, S., Parimi, C., "Arbitrary discontinuities in finite elements." International

Journal for Numerical Methods in Engineering, Vol. 50, 2001, pp. 993-1013.

5Fleming, M., Chu, A., Moran, B., Belytschko, T., "Enriched Element-Free Galerkin Methods for Crack

Tip Fields." International Journal for Numerical Methods in Engineering, Vol. 40, 1997, pp. 1483-1504.

6Sukumar, N., Huang, Z., Prévost, J., Suo, Z., "Partition of unity enrichment for bimaterial interface

cracks." International Journal for Numerical Methods in Engineering, Vol. 59, 2004, pp. 1075-1102.

7Dundurs, J., "Edge-bonded dissimilar orthogonal elastic wedges." Journal of Applied Mechanics, Vol. 36,

1969, pp. 650-652.

8Sukumar, N., Chopp, D., Moës, N., Belytschko, T., "Modeling holes and inclusions by level sets in the

extended finite-element method." Computer Methods in Applied Mechanics and Engineering, Vol. 190,

2001, pp. 6183-6200.

9Moes, N., Cloirec, M., Cartraud, P., Remacle, J., "A Computational Appraoch to Handle Complex

Microstructure Geometries." Computer Methods in Applied Mechanics and Engineering, Vol. 192, 2003,

pp. 3163-3177.

10Daux, C., N, M., Dolbow, J., Sukumar, N., Belytschko, T., "Arbitrary branched and intersecting cracks

with the extended finite element method." International Journal for Numerical Methods in Engineering,

Vol. 48, 2000, pp. 1741-1760.

11Osher, S., Sethian, J., "Fronts propagating with curvature dependent speed: Algorithms based on

Hamilton-Jacobi formulations." Journal of Computational Physics, Vol. 79, 1988, pp. 12-49.

12Courant, R., Friedrichs, K., Lewy, H., "On the partial difference equations of mathematical physics."

Mathematische Annalen, Vol. 100, 1928, pp. 32-74.

13Stolarska, M., Chopp, D., Moës, N., Belytschko, T., "Modelling crack growth by level sets in the

extended finite element method." International Journal for Numerical Methods in Engineering, Vol. 51,

2001, pp. 943-960.

14Shih, C., Asaro, R., "Elastic-plastic analysis of cracks on bimaterial interfaces: part I - small scale

yielding." Journal of Applied Mechanics, Vol. 55, 1988, pp. 299-316.

15Paris, P., Gomez, M., Anderson, W., "A Rational Analytic Theory of Fatigue." The Trend in Engineering,

Vol. 13, 1961, pp. 9-14.

16Tanaka, K., "Fatigue Crack Propagation from a Crack Inclined to the Cyclic Tension Axis." Engineering

Fracture Mechanics, Vol. 6, 1974, pp. 493-507.

Page 22: User Manual

22

17Yau, J., Wang, S., Corten, H., "A mixed-mode crack analysis of isotropic solids using conservation laws

of elasticity." Journal of Applied Mechanics, Vol. 47, 1980, pp. 335-341.

18Westergaard, I., "Bearing pressures and cracks." Journal of Applied Mechanics, Transactions ASME, Vol.

61, 1939, pp. A49-A53.

19Williams, M., "On the stress distribution at the base of a stationary crack, ." Journal of Applied

Mechanics, Vol. 24, 1957, pp. 109-114.

20Rice, J., "A path integral and the approximate analysis of strain concentration by notches and cracks."

Journal of Applied Mechanics, Vol. 35, 1968, pp. 379-386.

21Mukamai, Y. (ed.), Stress Intensity Factors Handbook, Pergamon Press, 1987.

22Brown, W., Srawley, J., "Plain strain crack toughness testing of high-strength metallic materials." ASME

STP 410, Vol., 1966, pp. 12.

23Bordas, S., Vinh Nguyen, P., Dunany, C., Nguyen-Dang, H., Guidoum, A., "An extended finite element

library." International Journal for Numerical Methods in Engineering, Vol. 2, 2006, pp. 1-33.