Sie sind auf Seite 1von 99

SPRINGER BRIEFS IN APPLIED SCIENCES AND

TECHNOLOGY  COMPUTATIONAL MECHANICS

Michael Trapp
Andreas Öchsner

Computational
Plasticity for
Finite Elements
A Fortran-Based
Introduction
SpringerBriefs in Applied Sciences
and Technology

Computational Mechanics

Series editors
Holm Altenbach, Lehrstuhl Technische Mechanik, Institut für Mechanik,
Otto-von-Guericke-Universität Magdeburg, Magdeburg, Germany
Andreas Öchsner, Faculty of Mechanical Engineering, Esslingen University of
Applied Sciences, Esslingen am Neckar, Germany
Lucas F. M. da Silva, Department of Mechanical Engineering, University of Porto,
Porto, Portugal
More information about this series at http://www.springer.com/series/8886
Michael Trapp Andreas Öchsner

Computational Plasticity
for Finite Elements
A Fortran-Based Introduction

123
Michael Trapp Andreas Öchsner
TU Munich Faculty of Mechanical Engineering
Munich Esslingen University of Applied Sciences
Germany Esslingen am Neckar
Germany

ISSN 2191-530X ISSN 2191-5318 (electronic)


SpringerBriefs in Applied Sciences and Technology
ISSN 2191-5342 ISSN 2191-5350 (electronic)
SpringerBriefs in Computational Mechanics
ISBN 978-3-319-77205-9 ISBN 978-3-319-77206-6 (eBook)
https://doi.org/10.1007/978-3-319-77206-6
Library of Congress Control Number: 2018933499

© The Author(s) 2018


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publication does not imply, even in the absence of a specific statement, that such names are exempt from
the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, express or implied, with respect to the material contained herein or
for any errors or omissions that may have been made. The publisher remains neutral with regard to
jurisdictional claims in published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by Springer Nature


The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface

In this book, we want to demonstrate the use of the classic programming language
FORTRAN for numerical computing in the context of the finite element method.
For this purpose, we are focusing specifically on the subject of computational
plasticity.
FORTRAN is a programming language, specifically designed for scientific and
engineering applications. Since its initial release in the 1950s, many upgrade fea-
tures have been added.
FORTRAN has asserted itself due to its practical use. Unlike earlier programs
with machine or assembly code, FORTRAN uses higher language with abstract
words and syntax, which automize computation instructions. This makes the code
easy to read and write, and much less prone to bugs.
A decided advantage of FORTRAN is its flexibility. As it does not depend on a
particular computing system, a transfer is very simple. In this context, it should be
noted that all classical finite element packages are written in this language. Some
even offer an interface to link one’s own code to the commercial package. As a
general-purpose tool, FORTRAN is a modern alternative for numerical computing
and scientific programming. As opposed to many numerical software, FORTRAN
is always transparent and easy to work with.
We look forward to receiving some comments and suggestions for the next
edition of this textbook.

Gold Coast, Australia Michael Trapp


January 2018 Andreas Öchsner
Griffith University

v
Acknowledgements

It is important to highlight the contribution of the students which helped to finalize


the content of this book. Their questions, comments and struggle during different
lectures, assignments and final examinations helped us to structure this book.
Furthermore, we would like to express our sincere appreciation to the Springer
Publisher, especially to Dr. Christoph Baumann, for giving us the opportunity to
realize this book.

vii
Contents

1 Theoretical Foundation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Behavior of Elasto-Plastic Materials . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 One-Dimensional Continuum Approach . . . . . . . . . . . . . . . . . . . . . 7
2.1 One-Dimensional Continuum Theory . . . . . . . . . . . . . . . . . . . . . 7
2.2 FORTRAN Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 One-Dimensional Finite Element Approach . . . . . . . . . . . . . . . . . . . 19
3.1 One-Dimensional Finite Element Theory . . . . . . . . . . . . . . . . . . 19
3.2 FORTRAN Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4 Three-Dimensional Finite Element Approach . . . . . . . . . . . . . . . . . 33
4.1 Three-Dimensional Finite Element Theory . . . . . . . . . . . . . . . . . 33
4.2 FORTRAN Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5 Summary and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6 FORTRAN Source Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.1 One-Dimensional Continuum Model . . . . . . . . . . . . . . . . . . . . . . 48
6.2 One-Dimensional Finite Element Models . . . . . . . . . . . . . . . . . . 53
6.3 One-Dimensional CPP Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 68
6.4 Three-Dimensional Finite Element Model . . . . . . . . . . . . . . . . . . 71
Appendix A: FORTRAN Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

ix
Symbols and Abbreviations

Latin Symbols (Capital Letters)


A Area, cross-sectional area
C Elasticity matrix
E Young’s modulus
E int Intermediate modulus
E pl Plastic modulus
E elpl Elasto-plastic modulus
~
E (Approximated) tangent modulus
F Yield condition
Ftot (Applied (total)) force
F int Internal force
I Identity matrix
J1 First invariant
J2 Second invariant
J3 Third invariant
K Tangent stiffness
~
K Intermediate stiffness
K (Global) tangent stiffness matrix
L Length
L Auxiliary matrix
~
L Auxiliary matrix
Q Plastic potential

Latin Symbols (Small Letters)


dim Dimension
f Yield criterion
h Hardening function
k Hardening function
k Yield or flow stress

xi
xii Symbols and Abbreviations

kinit Initial flow stress


m Vector of residuals
q General hardening parameter
r Function of flow direction
r (Force) residual
rr Stress residual
rj Effective plastic strain residual
rF Yield condition residual
s Deviatoric stress
t Time
u Displacement
utot Total (prescribed) displacement
v Solution vector, vector of unknowns
1 Auxiliary vector f1; 1; 1; 0; 0; 0gT
2 Auxiliary vector f1; 1; 1; 2; 2; 2gT

Greek Symbols (Capital Letters)


D Incremental difference

Greek Symbols (Small Letters)


d Difference between iterations
j Effective plastic strain
” Poisson’s ratio
D‚ Effective plastic strain increment
r Stress
e (Total) Strain

Mathematical Symbols
 Multiplication sign (used where essential)
…T Transposed
(…)−1 Inverse
@n Nth partial derivative with respect to n
@nn
a Vector, tensor or matrix
det ¼ j. . .j Determinant/absolute value
sgn Signum function
N Natural numbers 1, 2, 3…

Indices, Superscripted
…° Volumetric
…’ Deviatoric
Symbols and Abbreviations xiii

…el Elastic
…elpl Elasto-plastic
…pl Plastic
…init Initial, at the start of plastic regime
…j Of iteration j
…m Of element m
…i Of node i
…t Trial

Indices, Subscripted
…c Compression
…eff Effective
…eq Equivalent, effective
…long Longitudinal
…n Of increment n
…t Tension
…tvs Transversal
. . .T Tangent, tangential
…x x-direction
…y y-direction
…z z-direction

Abbreviations
1D One-dimensional
2D Two-dimensional
3D Three-dimensional
const Constant
CPP Closest point projection algorithm
FE Finite element(s)
FEM Finite element method
FIBE Fully implicit backwards Euler method
lin Linear
non-lin Non-linear
NR Newton–Raphson method
PR Poisson’s ratio ”
red Reduced
SIBE Semi-implicit backwards Euler method
tol Tolerance
v.M. von Mises
Chapter 1
Theoretical Foundation

Abstract This introduction discusses a general approach to model elasto-plastic


materials. A mathematical model is established based on the governing equations of
elasto-plasticity.

1.1 Behavior of Elasto-Plastic Materials

Ductile solids subjected to a uniaxial external load (a total force F0 ) produce in the
elasto-plastic range a yield stress k within the body that leads to strain (deformation)
ε of the material. A fundamental objective of material models is to find a relation
between the strain ε and the acting stress σ. Figures 1.1a and b show examples of
one-dimensional stress-strain curves for elasto-plastic materials [13].
As long as the initial yield stress kcinit (for compression) or ktinit (for tension) is not
reached, the deformation is purely elastic. In the elastic regime, the (incremental)
stress-strain relation is linear, expressed explicitely by Hooke’s law [31]:

σ = Eε = Eεel . (1.1)

The slope is equal to a constant called the Young’s modulus E. After the applied
load is removed, the deformed object returns back to its original undeformed shape.
Accordingly, the yield stress k takes the same path for loading and unloading in the
stress-strain graph (under the assumption of isotropic hardening) [17].
Once the external load exceeds the initial yield stress k init of the material, elasto-
plastic deformation occurs. In this case, the deformation is no longer purely elastic,
but also plastic (permanent). An elasto-plastically deformed object does not return
back to its original undeformed shape, as loading and unloading paths are different
[6, 17].
Figure 1.1a shows an example of a loading and unloading path. During loading,
the slope in the plastic regime is equal to the elasto-plastic modulus E elpl [7, 31, 34]:


E elpl = . (1.2)

The Author(s) 2018 1


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_1
2 1 Theoretical Foundation

(a) (b)

Fig. 1.1 Uniaxial stress-strain graphs for an elasto-plastic material with (a) arbitrary isotropic
hardening and (b) linear and ideal isotropic hardening

Young’s modulus E and the elasto-plastic modulus E elpl are combined in the tangent
modulus Ẽ [26]: 
E, elastic regime
Ẽ = (1.3)
E elpl plastic regime .

During unloading, the unloading curve has the slope of Young’s modulus E. After
unloading, a plastic strain εpl remains. When reapplying the load, the loading path
is now different, because the yield strength function k is different [17].
An explicit function for all possible loading and unloading paths cannot be defined.
A usual alternative is to use the instantaneous stress and strain rates to describe a
particular position on the deformation path [26].

1.2 Mathematical Model

To simplify the model, we make the following assumptions for the following deriva-
tions:
1. The model is one-dimensional, albeit still abiding continuum laws.
2. Deformations are small, thus geometric nonlinearities are negligible.
3. Deformation does not lead to fracture.
4. The material is isotropic, behaving the same in all directions.
5. As the load is not reversed at any time, no kinematic hardening occurs.
6. The loading process is quasi-static and hence not time-dependent.
1.2 Mathematical Model 3

Yield Condition
To determine whether or not a plastic strain occurs, a yield condition F [3, 31] is
defined:


⎨< 0 : elastic material behavior
F(σ, q) = 0 : elasto-plastic material behavior . (1.4)


>0: invalid state (needs correction)

Besides the acting stress σ, the yield condition also depends on the past deformation
history [26], taken into account by some internal material variable q. The yield
condition is calculated, for example, by comparing a yield criterion f (σ) to an
experimental yield stress curve k = k(q), derived from uniaxial test data:

F(σ, q) = f (σ) − k(q) = σeff − k(q) . (1.5)

The yield criterion f (σ) is formulated with the effective stress σeff [18], a scalar value
derived from the acting stress components œ. In the special case of one-dimensional
loading, the effective stress equals the applied load œ = σ = σeff . For general three-
dimensional loading, finding a representative effective stress is more difficult. It is
not feasible to carry out experiments for all combinations of different multiaxial
stress states. Instead, yielding is predicted with yield condition theories such as the
von Mises or the Tresca yield conditions, discussed in Chap. 4.
Flow Rule
An infinitely small total strain increment dε can be divided into an elastic and a
plastic part [6, 17, 18, 31], as visualized in Fig. 1.1a:

dε = dεel + dεpl . (1.6)

The elastic part is evaluated with Eq. (1.1) (Hooke’s law):


dεel = . (1.7)
E

The evolution of the infitesimal plastic strain increments dεpl is described by the flow
rule [31]:
dεpl = dλr (σ, q) . (1.8)

The factor dλ ≥ 0 is called the consistency parameter and corresponds to the mag-
nitude of the increment:
pl
dλ = |dεpl | = dεeff . (1.9)

r stands for the function of flow direction and determines the sign of the value of
dεpl . Generally, r is described by some independent plastic potential Q, resulting in
4 1 Theoretical Foundation

the unassociated flow rule:


dQ
dεpl = dλ . (1.10)

If the yield condition F is used instead, the relation is called the associated flow rule
[6, 9, 17, 18]:
dF
dεpl = dλ . (1.11)

In the one-dimiensional case, further simplification leads to:

dF d( f (σ) − k(q)) d f (σ) d|σ| σ


r= = = = = = sgn(σ) . (1.12)
dσ dσ dσ dσ |σ|

Material Hardening
Plastic deformation causes material hardening, which in turn increases the yield
stress k. Further plastic deformation only occurs beyond the new yield limit. The
stress increment solely due to material hardening is [31]:

dσ = dk(q) = E pl (q)dεpl . (1.13)

The plastic modulus E pl dependends on some internal variable q. For isotropic


hardening [31], this inner variable corresponds to the equivalent plastic strain,
pl
q = κ = εeff (strain hardening formulation) [16]. An alternative formulation is given
with the volume specific plastic work w pl (work hardening formulation) [16], using
the following relation:
pl
dw pl = σdεpl = σeff dεeff . (1.14)

Rearranging Eq. (1.14) and substituting in Eq. (1.9) (flow rule) results in:

pl σdεpl σr (σ, q)
dq = dκ = dεeff = = dλ . (1.15)
σeff σeff
 

h(σ,q)

The hardening function h [31] describes the evolution of the hardening parameter,
pl
in our case dq = dκ = dεeff :
σr (σ, q)
h= . (1.16)
σeff

In the one-dimensional case, substituting Eq. (1.12) (function fo flow direction) in


Eq. (1.16) leads to:
h = (sgn (σ))2 = 1 . (1.17)

Isotropic hardening can be subdivded into three idealized types, shown in Fig. 1.1:
idealized, linear and arbitrary.
1.2 Mathematical Model 5

In the general case of arbitrary material hardening, the stress-strain relation in the
plastic regime is non-linear. This is due to the fact that the plastic modulus E pl and
the elasto-plastic modulus E elpl both are non-linear [34]:

dσ E E pl (κ)
E elpl (κ) = = . (1.18)
dε E + E pl (κ)

In contrast to arbitrary hardening, for linear hardening the plastic and elasto-plastic
moduli are both constant. This results in a linear stress-strain relation in the plastic
regime:
E E pl
σ = E elpl ε = ε . (1.19)
E + E pl

In the case of ideal plasticity, no hardening occurs (see Fig. 1.1b). Therefore the
plastic and elasto-plastic moduli vanish:

E pl = E elpl = 0 . (1.20)
Chapter 2
One-Dimensional Continuum Approach

Abstract In this chapter, the elasto-plastic material model is analyzed with numeri-
cal methods. For this purpose, simple tensile tests are carried out. The test geometry
is modeled in the simplest way, as a one-dimensional continuum. After the theory,
example numerical algorithms are discussed for different test setup conditions.

2.1 One-Dimensional Continuum Theory

Our objective is to conduct and analyze virtual uniaxial tensile tests.


A tensile test [3, 6, 31, 41, 42] is the most important and fundamental approach
to study the behavior of materials. In this test, a specimen with cross-sectional area
A and length L is exposed to a controlled load. The setup, as shown in Fig. 2.1, is
either force-controlled with a total force Ftot , or displacement-controlled with a total
displacement u tot .
After the deformation, the deformed specimen is of length L + L. The cross-
sectional area shrinks to A − A(x), x ∈ [− L2 , L2 ], to conserve mass. A strain
εtransv is measured, transversal to the longitudinal strain εlong . This is recorded by the
Poisson ratio ν [3]:
εtransv
ν=− . (2.1)
εlong

To simplify the model, we accept a small error by neglecting transversal strain and
by setting ν = 0. This results in an idealized pure uniaxial deformation.
Now, we want to find a stress-strain relationship and need to integrate the rate
equations. However, an analytic approach generally is not feasible, as the stress-
strain functions are not unique (explicit).
The alternative is to solve the model with numerical methods by using incremental
loads, as illustrated in Fig. 2.2. For every load increment, a local algorithm is applied.
The input consists of the values from the previous state at load increment n and an
external strain increment εn . The algorithm interprets the input and calculates the
values for the next state at load increment n + 1. The output now serves as input for
the next load increment, along with another strain increment.

The Author(s) 2018 7


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_2
8 2 One-Dimensional Continuum Approach

(a) (b)

Fig. 2.1 Tensile specimen: a unloaded and b loaded

Fig. 2.2 Illustration of the global integration algorithm


2.1 One-Dimensional Continuum Theory 9

Fig. 2.3 Graphic illustration of the one-dimensional Newton method

In a force-controlled setup, the total applied force Ftot is divided into n = inc >
0 increments σn , n = 1, 2, ..., inc. Although differently sized increments may
increase the accuracy of the results, we choose equally sized increments σ for
simplicity and educational purpose. Consequently, the stress σn , n = 0, 1, ..., inc is
known at every state.
The strain increments εn , n = 1, 2, ..., inc are evaluated with the Newton
(Newton- Raphson) method [15, 31, 34, 44], illustrated in Fig. 2.3.
Generally, the algorithm tries to find a specific zero x of a function f (x): First, an
appropriate point xn on the function graph is chosen. Then the point of intersection
xn+1 between the tangent line and the x-axes is evaluated. The tangent line goes
through the point f (xn ) and has a slope of f  (xn ). After a point xn+1 is found, its
function value f (xn+1 ) is the new starting point. The algorithm repeats itself until
subsequent iterations of the solution variable fall below a tolerance tol = xn+1 − xn .
The Newton method is summarized by the following iterative equation [28, 30, 31,
43]:
f (xn )
xn+1 = xn −  . (2.2)
f (xn )

Applied on our algorithm, Eq. (2.2) leads to:

j+1 σ
εn+1 = εnj − j
. (2.3)
Ẽ n

The iteration counter within the current increment n is denoted by j = 1, 2, .... The
j j
tangent modulus Ẽ n = Ẽ n (κ) is not constant and needs to be iterated as well, which
is explained later.
In a displacement-controlled setup, there is no need to calculate the strain incre-
ments εn = ε, as they are already defined.
10 2 One-Dimensional Continuum Approach

Fig. 2.4 Visualization of the predictor-corrector method

j
Once a strain increment εn is found, the values of the current increment are
updated using a local integration scheme. A classical example is the implicit back-
ward Euler method [30, 31, 43]: For every increment, a solution is first predicted.
In the case that the predicted solution is invalid, it is projected back towards a valid
state.
The algorithm consists of many predictor-corrector steps [15], as shown in Fig. 2.4,
for a displacement controlled setup. The stress increments σn in the plastic regime
are equal, as the hardening function is linear. The implicit backward Euler method
is also called predictor-corrector method, back projection method, radial return map-
ping or closest point projection.
An example predictor-corrector step [31, 39] is shown in Fig. 2.5. First, a trial
stress state σn+1
t
is evaluated:

σn+1
t
= σn + Eεn = σn + Eεnel . (2.4)

As the predictor step is purely elastic, the plastic strain εpl and the equivalent plastic
strain κ do not change:
κn+1
t
= κn . (2.5)

At this point, it needs to be determined if the trial state is valid [31, 39]. For this
purpose, Eq. (1.4) (yield condition) is applied. If the trial state is in the elastic regime
t
F(σn+1 , κn+1
t
) < 0, as shown in Fig. 2.6a, no correction needs to be made towards
the stress:
2.1 One-Dimensional Continuum Theory 11

Fig. 2.5 Illustration of a single predictor-corrector step

(a) (b) (c)

Fig. 2.6 Visualization of possible trial stress states for a predictor-corrector step: trial stress a in
the elastic regime b and c in the plastic regime

σn+1 = σn+1
t
. (2.6)

In this case, no plastic deformation occurs and the effective plastic strain does not
change:
κn+1 = κn+1
t
. (2.7)

However, if the trial state is in the plastic regime, the predicted step is invalid,
t
F(σn+1 , κn+1
t
) > 0, as shown in Figs. 2.6b and c. In this case, the trial state has to
be projected back towards a valid stress state. This is done by means of a plastic
pl
corrector σn [31, 39], visualized in Fig. 2.5:

σnpl = Eεnpl = Eλn r (σn ) . (2.8)


12 2 One-Dimensional Continuum Approach

To update all state values, another Newton algorithm is applied, this time within
the increment. First, a vector m of residuals is defined, containing the stress residual
rσ , the effective plastic strain residual rκ , and the yield condition residual r F [31]:
⎡ ⎤ ⎡ ⎤
rσ σ − σn+1
t
+ λEsgn(σ )
m = ⎣ rκ ⎦ = ⎣ κ − κnt − λ ⎦ = 0 , (2.9)
rF F(σ, κ)

where m is dependent on a vector of unknowns v:


⎤⎡
σ
v=⎣ κ ⎦. (2.10)

Now, the vector of unknowns is iterated by the use of Eq. (2.2) (Newton method):
 −1
j+1 j dm j j
v n+1 = v n+1 − (v ) m(v n+1 ) . (2.11)
dv n+1

The initial vector for the iteration is:


⎡ 0 ⎤ ⎡ t ⎤ ⎡ t ⎤
σn+1 σn+1 σn+1
v 0n+1 = ⎣ κn+1
0 ⎦ = ⎣ κn+1
t ⎦ = ⎣ κn ⎦ . (2.12)
λ0n+1 λtn+1 0

j
The matrix dm
dv
(v n+1 ) results from differentiating every component of m with respect
to every component of v [31]:
⎡ ∂rσ ∂rσ ∂rσ ⎤ ⎡ ⎤
E −1
j
∂σ ∂κ ∂λ 0 sgn(σn+1 )
dm j
(v n+1 ) = ⎣ ∂r
∂σ
κ ∂rκ ∂rκ ⎦
∂κ ∂λ
=⎣ 0 −1 1 ⎦. (2.13)
dv ∂r F ∂r F ∂r F j
∂σ ∂κ ∂λ sgn(σn+1 ) − dκ
dk
0

Inversion of Eq. (2.13) leads to:


⎡ ⎤
  dk j
−sgn(σn+1 ) dκ
dk j
sgn(σn+1 )
dm −1  j E ⎢ dκ

v n+1 = −E −1 ⎦ .
j
⎣sgn(σn+1 ) −1 (2.14)
dv E+ dk
E −1 dκ −E −1
j
dκ sgn(σn+1 ) dk

Generally, the iterated solution is not sufficient after just one iteration, as visualized
in Fig. 2.7b. The procedure needs to be repeated several times, until the solution
j+1 j
vector iterations fall below a prescribed tolerance tol > |v n+1 − v n+1 |.
In the special case of linear hardening ( dκ = E pl = const.), we only need one
dk

iteration, see Fig. 2.7a [26, 31]:


2.1 One-Dimensional Continuum Theory 13

(a) (b)

Fig. 2.7 Illustration of the predictor-corrector method for a linear hardening and b arbitrary hard-
ening

 
dm 0 −1
v n+1 = v 0 − (v ) m(v 0 )
dv
⎡ t⎤
σn
E
= ⎣ κn ⎦ − ×
0 E + E pl (2.15)
⎡ ⎤⎡ ⎤
E pl −sgn(σn+1 t
)E pl sgn(σn+1
t
) 0
⎣sgn(σn+1
t
) −1 −E −1 ⎦ ⎣ 0 ⎦ .
−1 pl
sgn(σn+1 )
t
E E −E −1 t
Fn+1

The third line of Eq. (2.15) leads to:


t
Fn+1
λn+1 = . (2.16)
E + E pl

Substituting Eq. (2.16) into the first line of Eq. (2.15) leads to:
 t 
Fn+1 E
σn+1 = 1 − σt . (2.17)
E + E pl |σn+1
t
| n+1

Substituting Eq. (2.16) into the second line of Eq. (2.15) results in:
t
Fn+1
κn+1 = κn + . (2.18)
E + E pl

In Fig. 2.8, the transition point (angular point) from the elastic to plastic regime
requires special consideration.
j
The following case differentiation is made for the tangent modulus Ẽ n [31]:
14 2 One-Dimensional Continuum Approach

Fig. 2.8 Visualization of the


intermediate modulus



⎨ E, elastic regime
Ẽ nj = E nint, j , transition regime . (2.19)

⎩ pl
E , plastic regime

To evaluate the intermediate modulus E int in the transition regime, the following
iteration is used:
j j
σn+1 σn+1 − σn
E nint, j = j
= j
. (2.20)
εn+1 εn+1 − εn

The secant method in Eq. (2.20) can be applied in a much broader sense to numerically
j
approximate the tangent modulus Ẽ n+1 for arbitrary material hardening [31]:

j j
j σn σn+1 − σn
Ẽ n+1 (κ) = j
= j
. (2.21)
εn εn+1 − εn

Now, we can condense the tangent modulus to one iterative equation, instead of
distinguishing between elastic and plastic regime.

2.2 FORTRAN Examples

An example problem with specific values is adopted from [31]. The setup is shown
in Fig. 2.9. One side of the specimen is fixed to a wall to facilitate calculation.
For now, we choose a linear material hardening function and prescribe a total
force Ftot . An example numerical solution algorithm is presented in Fig. 2.10. Every
step is recorded in the output file.
The external input text file is named ‘_Input.txt’ and is presented in Sect. 6.1. The
algorithm reads the following input values from the text file, see step (1) in Fig. 2.10:
Young’s modulus E, the plastic modulus E pl , the initial yield stress k init , the total
prescribed force Ftot , the total prescribed displacement u tot (not relevant for now),
2.2 FORTRAN Examples 15

(a) (b)

Fig. 2.9 Example tensile test setup for a 1D continuum model with a material properties and b
geometric properties

the specimen length L, the total number of increments inc, and the cross sectional
area A of the specimen. For better handling, a few more input values are introduced:
the tolerance values T olC P P and T ol I Loop for the Newton- Raphson iterations,
a flag LinC P P to switch between a linear and non-linear hardening function, and a
flag Fcontr olled to switch between a force-controlled and a displacement-controlled
setup. As we now consider a force-controlled setup and a linear hardening function,
we set both flags to ‘T’ (‘true’).
The main file for the continuum model, named ‘Conti1D.f’, is listed in Sect. 6.1,
along with the corresponding continuum subroutines file, named ’ContiSubrou-
tines1D.f’. We start at the initial increment n = 0 and set all values to 0, as shown
in step (2) of Fig. 2.10. This includes the acting stress σn , the applied force Fn , the
displacement u n , the total strain εn and the (effective) plastic strain κn . Furthermore,
we assume that the initial tangent modulus Ẽ 0 = E equals Young’s modulus, as we
start in the elastic regime.
As shown in step (3) of Fig. 2.10, a query n == inc now determines whether the
final increment n = inc is reached. As this is not yet the case, the increment counter
n is increased to n + 1, see step (4) of Fig. 2.10.
At this point, we enter the outer loop. In step (5) of Fig. 2.10, we reset the iteration
j
counter j = 0 and the iterated strain εn+1 = 0. Next, in step (6), we record the current
state values σn , u n and εn . Afterwards, in step (7), we calculate the force increment:

Ftot
F = . (2.22)
inc
From this, we calculate the stress increment:

F
σ = . (2.23)
A
Now, in step (8), we enter the inner loop. First, we increase the iteration counter to
j + 1. Then, in step (9), we calculate the strain and displacement increments:
16 2 One-Dimensional Continuum Approach

(1) input E, E pl , k init , Ftot , utot , L, inc, A

(2) initial state values σ0 = F0 = u0 = ε0 = κ0 = 0, Ẽ0 = E

(3) query
n == inc
no

(4) increment counter n+1

(5) iteration reset j = εjn+1 = 0

(6) values at previous state σn , un , εn

(7) load increment

outer loop
(force-controlled setup only) ΔF, Δσ

(8) iteration counter j+1

(9) deformation increment Δεj+1 j+1


n , Δun
yes

(10) iterated deformation εj+1 j+1


n+1 , un+1
inner loop

(11) yield function at trial state t


CPP
Fn+1 ≤0

no
(12) iterated solution (with CPP) Δλj+1
n+1 , σ j+1 j+1 j+1
n+1 , κn+1 , Ẽn+1

yes
(13) tolerance check εj+1 j
n+1 − εn+1 < tol

(14) values at next state σn+1 , εn+1 , un+1

(15) output σinc , uinc , εinc

Fig. 2.10 Flow chart of an example global integration algorithm for a one-dimensional continuum
model
2.2 FORTRAN Examples 17

j+1
σn+1 − σn+1
εnj+1 = j+1
, (2.24)
Ẽ n
u nj+1 = Lεnj+1 . (2.25)

j+1
In Eq. (2.24), the term σn+1 − σn+1 describes the remaining portion of the prescribed
stress increment σn = σ .
Next, stress and strain are updated, according to step (10):
j+1 j
εn+1 = εn+1 + εnj+1 , (2.26)
j+1 j
u n+1 = u n+1 + u nj+1 . (2.27)

At this point, the input data is complete and the CPP algorithm is executed. In
the Fortran codes, the file containing the CPP algorithm subroutines is named
’CPPSubroutines1D.f’ and can be found in Sect. 6.3.
The CPP algorithm begins by calculating a trial state, checked for validity with
the yield condition, as described in step (11). In case the trial state is elastic with
t
Fn+1 ≤ 0, the inner loop is exited. However, if the trial state is elasto-plastic with
t
Fn+1 > 0, the values need to be iterated, using Eq. (2.16) (to calculate λn+1 ),
Eq. (2.17) (to calculate σn+1 ) and Eq. (2.18) (to calculate κn+1 ), according to step
(12) of Fig. 2.10.
Next, a tolerance check is conducted, according to step (13). If the tolerance
j+1 j
tol < εn+1 − εn+1 is exceeded, the CPP algorithm is executed again. When the
tolerance is not exceeded any more, the algorithm exits the inner loop and returns to
the outer loop.
In the outer loop, the current (iterated) values are adopted as starting values for
the next increment n + 1, see step (14). The outer loop then repeats itself until the
final increment n = i. At last, in step (15), the output recorded in the corresponding
output file. In a variation of the setup, a function of the plastic modulus E pl (κ) is
considered:
E pl (κ) = 1.29 × 104 − 2.5 × 105 × κ . (2.28)

At step (12) in Fig. 2.10, the material hardening function is no longer linear and the
general form of the CPP algorithm has to be applied, see Eqs. (2.9)–(2.14). In the
Fortran program, the user chooses a non-linear function simply by setting the flag
LinC P P to ’F’ (’false’).
We now consider yet another test setup. This time, the setup is not force-controlled,
but instead displacement-controlled. This is achieved by setting the flag Fcontr olled
in the input file ’_Input.txt’ to ’F’ (’false’), see Sect. 6.2.
As before, we read the input variables, set all values to zero and assume Ẽ 0 = E.
In the outer loop, we again reset the iteration counter j = 0 and record the current
state values. However, in contrast to the force-controlled setup, the total displacement
is prescribed. Therefore, we do not calculate force increment, but instead calculate
the displacement and strain increments directly, see step (7) in Fig. 2.10:
18 2 One-Dimensional Continuum Approach

u tot
u = , (2.29)
inc
u
ε = . (2.30)
L
We also do not need to iterate the displacement and strain increments, see step (9) in
j+1 j+1
Fig. 2.10. After updating the displacement u n+1 (see Eq. 2.27) and the strain εn
(see Eq. 2.26), the CPP algorithm is executed. Analogously to the force-controlled
setup, the CPP algorithm needs to be adjusted according to the prescribed hardening
function. After the CPP algorithm, the inner loop is left and the state values in the
outer loop are updated. The outer loop is repeated until the final increment n = inc.
Chapter 3
One-Dimensional Finite Element
Approach

Abstract This chapter presents a different approach to compute problems of


plasticity, using a finite element formulation. Again, simple one-dimensional vir-
tual tensile tests are considered for the numerical analysis.

3.1 One-Dimensional Finite Element Theory

As before, the tensile test specimen is a bar with constant cross-sectional area A and
length L, modeled as a one-dimensional member. According to the finite element
method [40], this member is subdivided into m = 1, 2, ..., ele elements (Fig. 3.1),
and i = 1, 2, 3, ..., ele + 1 = nod nodes (Fig. 3.2).
The mathematical model differenciates between nodal values and elemental val-
ues. A displacement u i and force F i pertain to node i, while stress σ m , strain εm and
tangent modulus Ẽ m (u) correspond to element m.
For one element ele = 1 (and hence nod = ele + 1 = 2 two nodes), the defor-
mation u n+1 at the next increment n + 1 can be modeled with the following set of
non-linear equations [2, 23, 31]:
      1   
A Ẽ u 1n+1 − Ẽ u 1n+1 u n+1 Fn+1
1
 2   2  = , (3.1)
L − Ẽ u n+1 Ẽ u n+1 u 2n+1 Fn+1
2

where u in+1 denotes the displacement increment and Fn+1 i


the force increment at
the ith node and the nth increment. Equation (3.1) is the general form of the principle
finite element equation, which can generally be written as follows:

K (u)u = F , (3.2)

where K is the stiffness matrix, u is the increments of displacement and F is the


increment of the load vector.
The Author(s) 2018 19
M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_3
20 3 One-Dimensional Finite Element Approach

Fig. 3.1 Discretization of a one-dimensional specimen into ele elements

Fig. 3.2 Discretization of a one-dimensional specimen into nod nodes

An alternative representation for one element is given with the tangent stiffness
K = K̃ = K T = LA Ẽ [27, 34]:
      1   
K u 1n+1  −K u 1n+1 u n+1 Fn+1
1
= . (3.3)
−K u 2n+1 K u 2n+1 u 2n+1 Fn+1
2

As the specimen is fixed to the wall on the left-hand side, node i = 1 does not
move in position:
u 1n = u 1n = 0 ∀ n . (3.4)

Furthermore, we only apply a force Fn+1


2
= Fn+1 at the last node i = nod = 2,
hence Fn+1 = 0. Using the notation u n+1 = u 2n+1 , the second row of Eq. (3.1) leads
1

to:
A Ẽ (u n+1 )
u n+1 = Fn+1 . (3.5)
L
Equation (3.5) is satisfied only for an infinitesimal small disturbance dFn+1 ,
because Ẽ(u n+1 ) is only an incremental approximation of the exact modulus. Thus:

A Ẽ (u n+1 )
du n+1 = dFn+1 . (3.6)
L
However, in the actual numerical approach, the increment is finite. Assuming the
force increment is prescribed, the displacement is arbitrarily close to the final, fully
iterated value. Then, there must exist an arbitrary small force residual r such that
[7, 16, 31]:

A Ẽ (u n+1 )
r (u n+1 ) = u n+1 − Fn+1 = 0 (3.7)
L
= K (u n+1 ) u n+1 − Fn+1 = 0 . (3.8)
3.1 One-Dimensional Finite Element Theory 21

Application of the TAYLOR series of first order on the residual yields an iteration
equation [26, 31, 44]:

     ∂r
j  
j+1 j j+1 j
r u n+1 = r u n+1 + u n+1 − u n+1 = 0 , (3.9)
∂u n+1

 
j
δ u n+1

where j denotes the current iteration within the increment n. Rearranging Eq. (3.9)
yields the objective, an equation to iterate the displacement increment [26, 31, 44]:
 
j
r u n+1
j+1 j
u n+1 = u n+1 −  j . (3.10)
∂r (u)
∂u n+1

The derivative is not yet defined. Therefore, we rearrange Eq. (3.10) to obtain the
tangent stiffness K :
   
   j j+1 j
r u n+1 − r u n+1
j ∂r (u)
K u n+1 = ≈ . (3.11)
∂u n+1
j+1
u n+1 − u n+1
j

j
The tangent stiffness is only exact if either j → ∞ and/or u n+1 → 0. Substi-
tuting Eq. (3.11) into Eq. (3.10) yields [16]:
 
j
r u n+1
j+1 j
u n+1 = u n+1 −  . (3.12)
j
K u n+1

With the fully iterated incremental displacement from the previous increment
j=0
u n = u n+1 as starting value, Eq. (3.12) is evaluated in an iterative manner
j = 0, 1, 2, ... until falling under a user prescribed arbitrarily small tolerance t end >
j+1 j
u n+1 − u n+1 .
j+1
The tangent stiffness K n+1 for the next iteration is calculated by differentiating
Eq. (3.8) [31, 44]:
 j+1  j  
∂r (u) ∂ K (u) j j
= u n+1 + K u n+1 . (3.13)
∂u ∂u


n+1 n+1
 
j+1
= K u n+1

 j
∂ K (u)
The tangent stiffness derivative ∂u n+1
can be approximated, e.g. with the
forward Euler method [31]:
22 3 One-Dimensional Finite Element Approach

 j j
∂ K (u n ) K (u n+1 ) − K (u n )
= . (3.14)
∂u n+1
j
u n+1 − u n

Doing so saves the trouble of manually implementing all derivatives of different


input functions K (u) in the Fortran code.
Instead of a displacement dependent stiffness K (u), the input in our examples
is a generally nonlinear plastic modulus E pl = E pl (κ), dependent on the effective
E E pl (κ)
plastic strain κ. Therefore, the tangent modulus Ẽ = Ẽ(κ) = E+E pl (κ) is also depen-

dent on κ. Finding a functional relation κ = κ(u) = ε(u) − ε (u) is difficult, as the


el

displacement u is not subdivided into a plastic and elastic part, unlike the strain
ε = εel + εpl .
Hence we approximate the tangent modulus Ẽ by using Eq. (2.20), as before.
Following this, the tangent stiffness K = LA Ẽ is substituted in Eq. (3.10) to iterate
the displacement increment.
Now, a general test setup with m = ele ∈ N finite elements and i = nod = ele +
1 nodes is considered.
Multiple Elements
The system of equations is [2, 23, 31, 34]:

K u = F . (3.15)

The global stiffness matrix K contains the elemental stiffnesses K m [12, 31, 40]:
⎡ ⎤
K1 −K 1
⎢−K K + K
1 1 2 −K 2 ⎥
⎢ ⎥
⎢ −K 2 K 2 + K 3 −K 3 ⎥
⎢ ⎥
⎢ −K 3 K +K
3 4 ⎥

K =⎢ ⎥. (3.16)
... ... ... ⎥
⎢ ⎥
⎢ −K nod−3 K nod−3 + K nod−2 −K nod−2 ⎥
⎢ ⎥
⎣ −K nod−2 K nod−2 + K nod−1 −K nod−1 ⎦
−K nod−1 K nod−1

The displacement increment vector u contains the nodal displacement incre-


ments u i . As the specimen is fixed to the wall, there is no displacement at the first
node: ⎡ ⎤ ⎡ ⎤
u 1 0
⎢ u 2 ⎥ ⎢ u 2 ⎥
⎢ ⎥ ⎢ ⎥
⎢ u 3 ⎥ ⎢ u 3 ⎥
⎢ ⎥ ⎢ ⎥
⎢ u 4 ⎥ ⎢ u 4 ⎥
u = ⎢ ⎢ ⎥ =⎢⎢ ⎥. (3.17)
.. ⎥
⎢ .nod−2 ⎥ ⎢ .nod−2 .. ⎥ ⎥
⎢u ⎥ ⎢ ⎥
⎢ nod−1 ⎥ ⎢u nod−1 ⎥
⎣u ⎦ ⎣u ⎦
u nod u nod
3.1 One-Dimensional Finite Element Theory 23

And last, the force increment vector F contains nodal force increments F i .
In our examples, a force is only applied at the last node i = nod:
⎡ ⎤ ⎡ ⎤
F 1 0
⎢ F 2 ⎥ ⎢ 0 ⎥
⎢ ⎥ ⎢ ⎥
⎢ F 3 ⎥ ⎢ 0 ⎥
⎢ ⎥ ⎢ ⎥
⎢ F 4 ⎥ ⎢ 0 ⎥

F = ⎢ ⎥ ⎢
=⎢ ⎥. (3.18)
.. ⎥
⎢ . nod−2 ⎥ ⎢...⎥

⎢F ⎥ ⎢ 0 ⎥
⎢ ⎥ ⎢ ⎥
⎣F nod−1 ⎦ ⎣ 0 ⎦
F nod F

First, we consider a force-controlled setup. The derivation of the iteration equation


for the displacement increment vector is analogous to the scalar approach. We define
a residual force vector r such that [12, 31, 34]:

r(un+1 ) = K (un+1 )un+1 − F n+1 . (3.19)

Applying the Taylor series approximation of first order leads to [31, 44]:

     ∂r (u) j  
j+1 j j+1 j
r un+1 = r un+1 + un+1 − un+1 = 0 . (3.20)
∂u

n+1




  j
j δ un+1
=K un+1

Rearranging finally results in [31, 34]:


   
un+1 = un+1 − K −1 un+1 r un+1
j+1 j j j
(3.21)

A great disadvantage of the standard Newton method is that a computationally


expensive matrix inversion K −1 is neccessary at every iteration. The modified New-
ton method [34, 39, 44] is an alternative, visualized in Fig. 3.3. For this method, the
tangent stiffness matrix K n+1 = K 0 stays constant and hence no matrix inversion
needs to be made.
The tangent stiffness K n+1 ≤ K 0 of a yield stress function generally is decreas-
ing monotonously. If no modification is made towards the tangent stiffness, then
the iterated displacement increments are very small, resulting in a large number of
necessary iterations until convergence. This stiff behavior generally is a significant
disadvantage, which is why the standard Newton method often is a better approach.
Now, we consider a displacement-controlled setup with the same system of equa-
tions as before [31, 34, 36]:
24 3 One-Dimensional Finite Element Approach

Fig. 3.3 Visualization σ


of the modified
Newton- Raphson method
for a force-controlled setup

⎡ ⎤⎡ ⎤ ⎡ ⎤
K1 −K 1 0 0
⎢−K 1 K 1 + K 2 −K 2 ⎥ ⎢ u 2 ⎥ ⎢ 0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ −K 2 K 2 + K 3 −K 3 ⎥ ⎢ u 3 ⎥ ⎢ 0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ −K 3 K +K
3 4
⎥ ⎢ u ⎥ ⎢ 0 ⎥
4
⎢ ⎥⎢ ⎥=⎢ ⎥.
⎢ ... ... ... ... ... ... ... ⎥⎢ ... ⎥ ⎢...⎥
⎢ ⎥ ⎢ nod−2 ⎥ ⎢ ⎥
⎢ −K nod−3 K nod−3 + K nod−2 −K nod−2 ⎥ ⎢u ⎥ ⎢ 0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣ −K nod−2 K nod−2 + K nod−1 −K nod−1 ⎦ ⎣u nod−1 ⎦ ⎣ 0 ⎦
−K nod−1 K nod−1 u tot F
(3.22)

The global stiffness matrix K is given as input, as well as the prescribed displace-
ment increments u 1 = 0 and u nod = u tot .
The objective for now is calculate the nodal force increment F nod = F, which
is acting on the last node n = nod. This cannot be done directly because the nodal
displacement increments u i , i = 1, nod outside the boundary are unknown.
Instead, the system of equations can be solved manually by the method of insertion.
The second row of Eq. (3.22) yields:

K1 + K2 1 1
(K + K )u = K u ↔ u =
1 2 2 2
u 2 = K 1 u 2
3 3
+ 2 .
K2 K1 K
(3.23)
The third row of Eq. (3.22) yields:

K2 + K3 K2
− K 2 u 2 + (K 2 + K 3 )u 3 = K 3 u 4 ↔ u 4 = u 3
− u 2 .
K3 K3
(3.24)
Substitution of Eq. (3.23) into Eq. (3.24) yields:
 
K2 + K3 K1 + K2 K2 1 1 1
u = 4
− u = ... = K u
2 1 2
+ 2+ 3 .
K3 K2 K3 K1 K K
(3.25)
3.1 One-Dimensional Finite Element Theory 25

The sequence seems to follow a certain kind of systematics:


n−1
 −1
u = K u
n 1 2
Ki , 3 ≤ n < nod . (3.26)
i=1

This can be proven via full induction:


n−1  i −1
Statement: u n = K 1 u 2 i=1 K ∀ {n ∈ N | 3 ≤ n < nod}
2  i −1
Start: n = 3 yields u = K u
3 1 2 K , which is true, as shown in Eq. (3.23).
n−1  i=1

i −1
Assume: u = K u
n 1 2
i=1 K is true. Using this assumption proves:


n
 −1
u n+1 = K 1 u 2 Ki (3.27)
i=1
 n−1 
   
i −1 n −1
= K 1 u 2 K + K (3.28)
i=1


n−1
 −1  −1
= K u1 2
Ki +K 1 u 2 K n (3.29)
i=1


u n
1
K
= u n + u 2 . (3.30)
Kn
Rearranging Eq. (3.30) yields:
 
K n u n+1 − u n = K 1 (u 2 − u 1 ) = F n+1 = F 2 = 0 . (3.31)

As the force increments F n = 0 all vanish for 1 < n < nod, the statement is
true. Not necessarily so for the elemental stress σ m , e.g. in the case that the tangent
stiffnesses K m are not equal.
Q.E.D.: The statement Eq. (3.26) is valid.
With Eq. (3.26), the second last row of Eq. (3.22) can be rewritten as:


n−3   n−2 
 −1
− K n−2 K 1 u 2 (K i )−1 + K n−2 + K n−1 K 1 u 2 Ki −K n−1 u n = 0 .
i =1 i =1



u n−2 u n−1
(3.32)

Rearranging leads to:


n−1
 −1
u n = u 2 K 1 Ki . (3.33)
i =1
26 3 One-Dimensional Finite Element Approach

Finally, the last row of Eq. (3.22) yields:

F = K nod−1 u nod−1 + K nod−1 u nod


⎛ ⎞

nod−2
i −1
⎜ (K ) ⎟
⎜ i =1 ⎟ (3.34)
= K nod−1 u nod ⎜1 + nod−1 ⎟.
⎝  −1

(K )
i
i =1

3.2 FORTRAN Examples

An example problem with a single finite element ele = 1 is adopted from [31]. The
test setup is shown in Fig. 3.4 and an example Fortran program is presented in
Sect. 6.2.
First, we focus on a force-controlled setup. The respective algorithm is visualized
with a structural diagram in Fig. 3.5. All steps are recorded in the output file. In
step (1) of Fig. 3.5, the input is the same as for the continuum model, including the
cross-sectional area A, the initial yield stress k init , Young’s modulus E = Ẽ n=0 , the
length L and a prescribed force Ftot or displacement u tot .
Initially for n = 0, the state values (σn , εn , κn , u n and Fn ) are all reset to zero, see
step (2). Additionally, the initial tangent modulus Ẽ 0 = E is assumed to be elastic,
while the tangent stiffness K = LA Ẽ is derived from the tangent modulus.
In step (3), the query n == inc checks if the last increment is reached. If this
is not the case, the algorithm enters the outer loop. Here, the increment counter is
increased in step (4). Next, we reset both the iteration counter j = 0 and the iterated
j
displacement u n+1 = 0 in step (5). Afterwards, we update the state variables σn , εn
and u n in step (6). In step (7), we calculate the force increments F = inc Ftot
, as well
as the residual r = −F.

Fig. 3.4 Example of a


one-dimensional finite
element problem based on a
single element
3.2 FORTRAN Examples 27

(1) input E, E pl , k init , Ftot , utot , L, inc, A

EA
(2) initial state values σ0 = F0 = u0 = ε0 = κ0 = 0, K0 = L

(3) query
n == inc
no

(4) increment counter n+1

(5) iteration reset j = ujn+1 = 0

(6) values at previous state σn , un , εn

 
j=0
or {Δu, Δε}

outer loop
(7) load increment ΔF, rn+1

(8) iteration counter j+1

(9) deformation increment


(force-controlled setup) Δεj+1 j+1
n , Δun
yes

(10) iterated deformation εj+1 j+1


n+1 , un+1
inner loop

(11) CPP algorithm CPP

(12) iterated residual j+1 j+1


Kn+1 , rn+1
(force-controlled setup)

(13) tolerance check uj+1 j


n+1 − un+1 < tol

(14) values at next state σn+1 , εn+1 , un+1

(15) output σinc , uinc , εinc

Fig. 3.5 Flow chart of an example global integration algorithm for a one-dimensional model with
one finite element
28 3 One-Dimensional Finite Element Approach

In the inner loop, we first increase the iteration counter in step (8). Aftwards, in
step (9), we calculate the displacement increment, and from this the strain increment:
j+1
rn
u nj+1 = − j+1
, (3.35)
Kn
j+1
u n+1
εnj+1 = . (3.36)
L
In step (10), we update the displacement and the strain:
j+1 j
u n+1 = u n+1 + u nj+1 , (3.37)
j+1 j
εn+1 = εn+1 + εnj+1 . (3.38)

Now, in step (11), the CPP algorithm is called, which is the same algorithm already
used for the continuum model (see Sect. 6.3 for the code). The output, among others,
j+1
is an iterated tangent modulus Ẽ n . With this, the tangent modulus and the residual
are updated in step (12):

A j+1 j+1 j
K nj+1 = Ẽ r = rn+1 + K nj+1 u nj+1 . (3.39)
L n n+1
After updating the residual, the algorithm undergoes a tolerance check in step
j+1 j
(13), with the exit condition: tol > u n+1 − u n+1 . For the iteration, the algorithm is
then repeated from step (8). When the difference drops below the threshold tol, the
iterated state values are adopted in step (14) and make up the starting values for the
next increment n + 1.
The outer loop is repeated until the final increment n == i is reached, in which
case the algorithm ends in step (15).
For the displacement-controlled variation, no residual has to be formulated in step
(7), as the displacement increments u are already given. Instead, the displacement
increments can be calculated directly in this step. Similarly, in step (12), the residual
update is not neccessary. This leads to some simplifications.
In a new test, we now want to discretize the bar with multiple elements. An
example setup with multiple finite elements, adopted from [31], is shown in Fig. 3.6.
For the test, a bar with two different materials is analyzed. However, instead
of focusing on two elements, we consider a more general approach with m = ele
elements and i = ele + 1 = nod nodes. The structural diagram for the algorithm
is shown in Fig. 3.7. Each step is recorded in the output file. The corresponding
Fortran program is presented in Sect. 6.2.
In contrast to the setup with one finite element, the input file ’_input100.txt’ now
contains sets of elemental values Am , L m , E m , k init, m and E pl,m , see Sect. 6.2. The
algorithm stores, processes and transfers the data in arrays. Other input parameters,
including the total number of elements ele, the total number of nodes nod, the
3.2 FORTRAN Examples 29

(a) (b)

Fig. 3.6 Example setup with two finite elements and a linear hardening function

total number of increments inc and the total prescribed force Ftot stay scalars. The
algorithm reads the input from the text file, according to step(1) of Fig. 3.7.
In step (2), the force Fn and the elemental state values (σnm , εnm , and u m n ) are
all reset to zero. The elemental tangent moduli Ẽ nm = E m initially are set equal to
the respective elemental Young’s moduli E m . From this, the initial elemental tan-
m
gent stiffnesses K m = LAm Ẽ m are evaluated. This leads to the initial tangent stiffness
matrix K , see Eq. (3.16).
Next, the algorithm assesses the query n == inc in step (3), increases the incre-
ment counter to n + 1 in step (4) and then enters the outer loop. In step (5), the
algorithm resets the iteration counter j = 0 and the elemental displacement itera-
m, j
tions u n+1 = 0 for the tolerance check. Next, in step (6), the algorithm updates the
current state values: the force Fn , the nodal displacements u in , the elemental strains
εnm , and the elemental stresses σnm . In step (7), we calculate the force increment
F = inc Ftot
and prepare the residuals:

0 i = nod
rni = −Fni = . (3.40)
−Fni = − inc
Ftot
i = nod

Now, we enter the inner loop. In step (8), we increase the iteration counter to
j + 1. Then, in step (9), we invert the global tangent stiffness matrix K and evaluate
the displacement and strain increments as:
 −1 i, j
u m,
n
j+1
= u m,
n
j
− K nj rn , (3.41)
1  
εnm, j+1 = m u m+1,n
j+1
− u m,
n
j+1
. (3.42)
L
30 3 One-Dimensional Finite Element Approach

(1) input E m , E pl, m , k init, m , Ftot , utot , Lm , inc, Am , ele, nod

E m Am
(2) initial state values σ0m = F0 = ui0 = εm m m
0 = κ0 = 0, K0 = Lm , K

(3) query
n == inc
no
(4) increment counter n+1

(5) iteration reset j = ui, j


n+1 = 0

(6) values at previous state σnm , uin , εm


n

(7) residual (force-controlled setup)


i,j=0
{ΔF, rn+1 } or Δunod

outer loop
or pertubation increment
(displacement controlled setup)

(8) iteration counter j+1


(9) inverse stiffness matrix
(force-controlled setup) or
 −1
j+1
Kn+1 or ΔFnj+1
force increment yes
(displacement controlled setup)

(10) iterated deformation Δui,


n
j+1
, Δεm,
n
j+1
, εm, j+1 i, j+1
n+1 , un+1
inner loop

(11) CPP algorithm CPP

(12) iterated residual


(force-controlled setup) i,j+1
rn+1 m, j+1
, Kn+1 j+1
, Kn+1
and stiffness matrix


nod
(13) tolerance check ui, j+1 i, j
n+1 − un+1 < tol
i=1

m
(14) values at next state σn+1 , uin+1 , εm
n+1

m
(15) output σinc , uiinc , εm
inc

Fig. 3.7 Flow chart of an example global integration algorithm for a one-dimensional model with
multiple finite elements
3.2 FORTRAN Examples 31

With the increments, the deformation values are iterated in step (10):
m, j+1 m, j
u n+1 = u n+1 + u m,
n
j+1
, (3.43)
m, j+1 m, j
εn+1 = εn+1 + εnm, j+1 . (3.44)

The strain increments are input for the CPP algorithm, step (10), which subse-
quently iterates each elemental state individually, independent from each other.
m, j+1
The output of the CPP algorithm are the iterated elemental tangent moduli Ẽ n
m, j+1
and the updated elemental tangent stiffnesses K n . Now, in step (12), the iterated
tangent stiffness matrix K nj+1 can be assembled. The matrix is used to update the
i, j+1
residuals rn+1 , using the following equation:

j+1 j
r n+1 = r n+1 + K nj+1 u . (3.45)

To determine if more iterations are neccessary, a tolerance check is now necessary,


according to step (13). As an example tolerance criteria, we choose the absolute value
of the sum of the difference of subsequent nodal displacement iterations and compare
this value to a user prescribed tolerance tol:

nod  
 i, j+1 i, j 
 u n+1 − u n+1  < tol . (3.46)
i =1

In the case that the queue is not satisfied, another iteration is initiated. After the
iterations, the final values are carried over to the next increment, see step (14). The
outer loop is repeated until the final increment is reached and the algorithm ends, see
step (15).
In a different test setup, a total displacement u tot is prescribed, rather than a total
force. The displacement increment of the last node u nod is now evaluated directly
in step (7) of Fig. 3.7. As the deformation increment is already known, the definition
and iteration of the residual is not neccessary in steps (7) and (12), respectively. For
the same reason, the stiffness matrix does not need to be inversed in step (9). At this
j+1
step, the force increment Fn is evaluated instead, according to Eq. (3.34).
Chapter 4
Three-Dimensional Finite Element
Approach

Abstract In this chapter, a mathematical model of the material for the three-
dimensional case is discussed. Therefore, the governing equations for the one-
dimensional case are generalized and modified. Many quantities that were scalars in
the one-dimensional case are arranged as vector quantities now.

4.1 Three-Dimensional Finite Element Theory

For the model, we assume the same conditions as before, with the exception of
the one-dimensional model. In the three-dimensional space, with perpendicular axis
1, 2, 3 (or x, y, z), every arbitrary stress σ can be decomposed into stress components
σi j , as illustration in Fig. 4.1. The stress components are arranged in the Cauchy
stress tensor [3, 6, 31]:
⎡ ⎤ ⎡ ⎤
σ11 σ12 σ13 σx x σx y σx z
σi j = ⎣σ21 σ22 σ23 ⎦ = ⎣σ yx σ yy σ yz ⎦ . (4.1)
σ31 σ32 σ33 σzx σzy σzz

The stress acts on a plane with normal coordinate vector ei , i = 1, 2, 3, in direction


e j , j = 1, 2, 3. As the material is assumed isotropic, the tensor σi j = σ ji is sym-
metric and hence, in the case of the finite element method, saved in a column matrix
(or vector) with six independent stress components:
⎡ ⎤
σ11
⎢σ22 ⎥
⎢ ⎥
⎢σ33 ⎥
σ=⎢ ⎥
⎢σ12 ⎥ . (4.2)
⎢ ⎥
⎣σ13 ⎦
σ23

The Author(s) 2018 33


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_4
34 4 Three-Dimensional Finite Element Approach

Fig. 4.1 Illustration of the 3D Cauchy tensor

Analogously, the three-dimensional strain is described by a tensor:


⎡ ⎤
ε11 ε12 ε13
εi j = ⎣ε21 ε22 ε23 ⎦ . (4.3)
ε31 ε32 ε33

Normal stress components σi j , i = j relate to normal strain components εi j , i =


j via Young’s modulus E in a one-dimensional case [19, 42]:

σi j = Eεi j , i = j . (4.4)

Shear stress components σi j = τi j , i = j relate to shear strain components


γi j , i = j via the shear modulus G:

τab = Gγi j (4.5)

The shear modulus G is related to Young’s modulus E and Poisson’s ratio ν as


follows [13, 27]:
E
G= . (4.6)
2(1 + ν)

The general three-dimensional Hooke’s law is:

σ = Cε , (4.7)
4.1 Three-Dimensional Finite Element Theory 35

where C is the elasticity matrix [13, 19, 41, 42]:


⎡ ⎤
1−ν ν ν 0 0 0
⎢ ν 1−ν ν 0 0 0 ⎥
⎢ ⎥
E ⎢ ν ν 1 − ν 0 0 0 ⎥
C= ⎢ ⎥ . (4.8)
(1 + ν)(1 − 2ν) ⎢
⎢ 0 0 0 0.5(1 − 2ν) 0 0 ⎥

⎣ 0 0 0 0 0.5(1 − 2ν) 0 ⎦
0 0 0 0 0 0.5(1 − 2ν)

Neglecting Poisson’s effect, ν = 0, results in G = E


2
. Substituting in Eq. (4.5)
!
leads to σi j = Eεi j = Gγi j = E
γ ,
2 ij
thus γi j = 2εi j . Thus, the strain vector is [4]:
⎤ ⎡
⎡ ⎤ ⎡ ⎤
ε11 ε11 ε11
⎢ε22 ⎥ ⎢ ε22 ⎥ ⎢ε22 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ε33 ⎥ ⎢ ε33 ⎥ ⎢ε33 ⎥

ε=⎢ ⎥=⎢ ⎥ ⎢ ⎥ = L⎢ ⎥
γ 2ε ⎥ ⎢ε12 ⎥ . (4.9)
⎢ 12 ⎥ ⎢ 12 ⎥ ⎢ ⎥
⎣γ13 ⎦ ⎣2ε13 ⎦ ⎣ε13 ⎦
γ23 2ε23 ε23

The auxiliary matrix L is given by:


⎡ ⎤ ⎡ ⎤⎡ ⎤
1 0 0 0 0 0 1 0 0 0 0 0 1
⎢0 1 0 0 0 0⎥ ⎢0 1 0 0 0 0⎥ ⎢1⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥
⎢0 0 1 0 0 0⎥ ⎢ 0⎥ ⎢ ⎥
L=⎢ ⎥ = ⎢0 0 1 0 0 ⎥ ⎢1⎥ = I 1 , (4.10)
⎢0 0 0 2 0 0⎥ ⎢
⎥ 0⎥ ⎢
⎥ ⎥
⎢ ⎢0 0 0 1 0 ⎢2⎥
⎣0 0 0 0 2 0⎦ ⎣0 0 0 0 1 0⎦ ⎣2⎦
0 0 0 0 0 2 0 0 0 0 0 1 2

where 1 is an auxiliary vector.


For ν = 0, the elasticity matrix reduces to:
⎡ ⎤ ⎡ ⎤
1 0 0 0 0 0 E 0 0 0 0 0
⎢0 1 0 0 0 0⎥ ⎢0 E 0 0 0 0⎥
⎢ ⎥ ⎢ ⎥
⎢0 0 1 0 0 0⎥ ⎢ 0⎥
C = E⎢ ⎥ = ⎢0 0 E 0 0 ⎥. (4.11)
⎢0 0 0 0.5 0 ⎥
0⎥ ⎢ 0⎥
⎢ ⎢0 0 0 G 0 ⎥
⎣0 0 0 0 0.5 0 ⎦ ⎣0 0 0 0 G 0⎦
0 0 0 0 0 0.5 0 0 0 0 0 G

As the stress components σi j should preferably be independ of a coordinate sys-


tem, three main invariants I1 , I2 and I3 are introduced [22, 38]:
36 4 Three-Dimensional Finite Element Approach

I1 = σ11 + σ22 + σ33 , (4.12)



 
 

 σ11 σ12   σ22 σ23   σ11 σ13 
 + + 
I2 =  σ12 σ22   σ32 σ33   σ31 σ33  , (4.13)
= σ11 σ22 − σ12
2
+ σ22 σ33 − σ23
2
+ σ11 σ33 − σ13
2

I3 = det(σi j ) = |σi j | . (4.14)

An alternative formulation is given by the fundamental variants J1 , J2 and J3 [10,


11, 38]:

J1 = σ11 + σ22 + σ33 = I1 , (4.15)


1
J2 = I12 − I2 = σ11 σ22 + σ11 σ33 + σ22 σ33 , (4.16)
2
J3 = σ11 σ22 σ33 . (4.17)

The stress tensor σ can be split additively into a volumetric and deviatoric part
[18, 30, 38]: ⎡ ◦ ◦ ◦⎤ ⎡    ⎤
σ11 σ12 σ13 σ11 σ12 σ13
σi j = ⎣σ21 ◦ ⎦
+ ⎣σ21 σ22 σ23 ⎦ .
◦ ◦   
σ22 σ23 (4.18)
◦ ◦ ◦   
σ31 σ32 σ33 σ31 σ32 σ33

A deviatoric stress tensor acting on a body only changes its shape, while a volu-
metric stress only changes its volume.
The volumetric stress tensor σi◦j is given by:
⎡ ◦
⎤ ⎡1 ⎤
σ11 J
3 1
⎢σ ◦ ⎥ ⎢ 1 J1 ⎥
⎢ 22 ⎥ ⎢ 3 ⎥
⎢σ ◦ ⎥ ⎢ 1 J1 ⎥
◦ ⎢ 33 ⎥ ⎢
σi j = ⎢ ◦ ⎥ = ⎢ 3 ⎥ . (4.19)
⎢σ12 ⎥ ⎢ 0 ⎥⎥
◦ ⎦
⎣σ13 ⎣ 0 ⎦

σ23 0

On the other hand, the deviatoric stress tensor σi j is given by [9]:
⎡ ⎤ ⎡  ⎤ ⎡ ⎤
s11 σ11 σ11 − 13 J1
⎢s22 ⎥ ⎢σ22 ⎥ ⎢σ22 − 1 J1 ⎥


⎢ ⎥ ⎢  ⎥ ⎢ 3 ⎥
⎢s33 ⎥ ⎢σ ⎥ ⎢σ33 − 1 J1 ⎥
σi j = ⎢ ⎥ = ⎢ 33 ⎥=⎢ 3 ⎥ .


⎢s12 ⎥ ⎢σ ⎥ ⎢ σ12 ⎥
 (4.20)
⎢ ⎥ ⎢ 12 ⎥ ⎢ ⎥
⎣s13 ⎦ ⎣σ  ⎦ ⎣ σ13 ⎦
13

s23 σ23 σ23
4.1 Three-Dimensional Finite Element Theory 37

(a) (b)

Fig. 4.2 Illustration of a the von Mises yield criterion and b the Tresca yield criterion

  
Accordingly, the deviatoric invariants J1 , J2 , J3 are defined as:

J1 = s11 + s22 + s33 = 0 , (4.21)
 1
J2 = s ji si j (4.22)
2
1
= (σ11 − σ22 )2 + (σ11 − σ33 )2 + (σ22 − σ33 )2
6
+ σ12 2
+ σ13
2
+ σ23
2

 1 2 3
J3 = s11 s22 s33 = J3 − J1 J2 + J . (4.23)
3 27 1

Yield Condition
In the one-dimensional test, the yield criterion f (σ) = σeff corresponds to the one-
dimensional acting stress σ. Now, an arbitrary multi-dimensional stress state σ needs
to be reduced to a one-dimensional effective stress σeff . As practical tests are not
feasible, several yield criterion theories have been postulated instead. Among them
are the von Mises and the Tresca criterion, both shown in Fig. 4.2 for a two-
dimensional stress state. The shaded area in Fig. 4.2 represents the elastic range.
Any arbitrary stress state is composed of a normal component σ and a shear
component τ . Yielding will not occur if the stress state is within the yield surface.
Outside the yield surface, yielding will occur and the surface will expand in size due
to material hardening.
For a pure shear stress state, the von Mises criterion [7, 8, 18, 31, 34] predicts
that yielding only starts at stress τ = √13 kt , where kt is the tensile yield strength. The
Tresca yield criterion [8], on the other hand, predicts that yielding already starts
at τ = 21 kt . Thus, the Tresca criterion leads to a more conservative and careful
dimensioning.
38 4 Three-Dimensional Finite Element Approach

Fig. 4.3 Visualization of the three-dimensional von Mises yield condition

Fig. 4.4 Visualization of the three-dimensional Tresca yield condition

A three-dimensional visualization of the von Mises yield condition is shown


in Fig. 4.3, whereas a three-dimensional visualization is also shown for the Tresca
yield condition in Fig. 4.4.
4.1 Three-Dimensional Finite Element Theory 39

According to the three-dimensional von Mises yield condition [6, 30, 39], yield-

ing begins when the second deviatoric invariant J2 reaches a critical value:


F = f (σ) − k(κ) = 3J2 − k(κ) = 0 . (4.24)

Flow Rule
In the three-dimensional case, the flow rule [18, 30] is given as:

dεpl = dλr . (4.25)

For now, we also consider the associated flow rule:

dF
r = dλ . (4.26)

Hardening Function
Analogous to [30], we define the (isotropic) hardening function as:

σT r
h= . (4.27)
σeff

Return Mapping Algorithm


The return mapping algorithm procedure for the three-dimensional case is analogous
to the one-dimensional case. The vector of unknowns v, of dimensions 8 × 1, includes
6 stress components σi j , an effective plastic strain component κ and the consistency
parameter λ: ⎡ ⎤
σ11
⎢ σ22 ⎥
⎢ ⎥
⎢ σ33 ⎥ ⎡ ⎤
⎢ ⎥ σ
⎢ σ12 ⎥
v=⎢ ⎥=⎣ κ ⎦.
⎢ σ13 ⎥ (4.28)
⎢ ⎥ λ
⎢ σ23 ⎥
⎢ ⎥
⎣ κ ⎦

Hence, the vector of residuals is also of dimensions 8 × 1:


⎡ ⎤
C −1 σ − C −1 σ t + λr(σ, κ)
m(v) = ⎣ −κ + κt + λh(σ, κ) ⎦ . (4.29)
F(σ, κ)
40 4 Three-Dimensional Finite Element Approach

For the fully implicit backward Euler (FIBE) method [29–31, 43, 44], r, h and
F are evaluated at the next increment n + 1 at the current iteration i:
⎡ −1 i ⎤
C σ n+1 − C −1 σ tn+1 + λin+1 r(σ in+1 , κin+1 )
m(v in+1 ) F I B E = ⎣ −κin+1 + κtn+1 + Δλh(σ in+1 , κin+1 ) ⎦. (4.30)
F(σ n+1 , κn+1 )
i i

For the semi-implicit backward Euler (SIBE) method [29–31, 36, 44], the func-
tions are evaluated explicitly at the previous increment n:
⎡ ⎤
C −1 σ in+1 − C −1 σ tn+1 + λin+1 r(σ n , κn )
m(v in+1 ) S I B E =⎣ −κin+1 + κtn+1 + Δλh(σ n , κn ) ⎦. (4.31)
F(σ n , κn )

∂m
Newton’s method requires finding the derivative ∂v
, of dimensions 8 × 8:
⎡ −1 ∂r ∂r

C + Δλ ∂σ λ ∂κ r
∂m ⎣
(v) = ∂h
λ ∂σ ∂h
−1 + λ ∂κ h⎦ . (4.32)
∂v ∂F ∂F
∂σ ∂κ
0

The function of the flow direction is formulated with invariants:



∂F ∂ F ∂ J2
r= =  . (4.33)
∂σ ∂ J2 ∂σ

The term ∂∂JF is always constant. Assuming the von Mises yield condition, the
2
following relation can be derived:
√   1
∂F 3  −2
 = J2 . (4.34)
∂ J2 2

∂J
Thus, only the term ∂σ2 has to be evaluated each time. A general derivation is
given here using index notation [11]:

∂ J2 1 ∂ 1 ·k 1 ·k i j 1 ·k ·l
= · q (σi j σ − σk gi j σ − σk g σi j + σk σl gi j g )
ij ij ij
∂σ 2 ∂σ p 3 3 9
1 ∂ ·j i 1 ·k ·l
= ·q (σi σ· j − σk σl )
2 ∂σ p 3
1 i · ·q 1 1 (4.35)
= (σ· j gi p g jq + σi g·i p g j − σl·l g ·qp − σl·l g ·qp )
j
2 3 3
·q 1 ·l ·q
= σ p − σl g p
3
= s ·q
p ,
4.1 Three-Dimensional Finite Element Theory 41

where gi j is a metric tensor. In general, a metric tensor contains information about


the length and relative position of the basis vectors [5]. In the case of a Cartesian
coordinate system, gi j corresponds to the Kronecker delta [11, 19]:

1, i = j
δi j = (4.36)
0, i = j .

According to the Einstein convention [11, 19], an index appearing twice in an


expression (here once superscripted and once subscripted) implies a summation, e.g.:


dim 
dim
σi j σ i j = σi j σ i j , (4.37)
i=1 j=1

where dim is the dimension of the coordinate system.



∂ J2 ·q
The components of the tensor ∂σ
= s p can be saved in a vector as follows [31]:
⎡ ⎤ ⎡2 ⎤
100000 σ − 13 (σ yy + σzz )
3 xx
⎢0 1 0 0 0 0⎥ ⎢ 2 σ yy − 1 (σx x + σzz )⎥
⎢ ⎥ ⎢3 3 ⎥

∂ J2 ⎢0 0 1 0 0 0⎥ ⎢ 2 σzz − 1 (σx x + σ yy )⎥
= Ls = ⎢ ⎥ ⎢3
⎢0 0 0 2 0 0⎥ ⎢
3 ⎥

∂σ ⎢ ⎥⎢ σx y ⎥
⎣0 0 0 0 2 0⎦ ⎣ σ yz ⎦
000002 σzx
⎡2 ⎤ (4.38)
σ − 3 (σ yy + σzz )
3 xx
1
⎢ 2 σ yy − 1 (σx x + σzz )⎥
⎢ 23 3 ⎥
⎢ σzz − 1 (σx x + σ yy )⎥
=⎢⎢
3 3 ⎥.

⎢ 2σx y ⎥
⎣ 2σ yz ⎦
2σzx

The second derivative of the yield function with respect to the second deviatoric
invariant is defined as follows:
√   3
∂2 F 3  −2
 2 = − J2 . (4.39)
∂ J 2
4

The second derivative of the second deviatoric invariant with respect to the stress
yields:

∂ 2 J2 ∂
= (Ls)
∂σ 2 ∂σ
∂s
=L
∂σ
42 4 Three-Dimensional Finite Element Approach

·j
∂si
=L
∂σl·m
 
∂ ·j 1 ·j
= L ·m σi − σk·k gi
∂σl 3
  
∂ 1 k ·j
= L gi·i g·mj − σ g
∂σl·m 3 ·k i
  
∂ 1 ·n ·k · j
= L gl·i g·mj − σ g g
∂σl·m 3 k n i
 
1 ·j
= L gl·i g·mj − glk g mn gn·k gi
3
 
1 ·j
= L gl·i g·mj − gl·m gi
3
⎛ ⎡ ⎤ ⎞
1
⎜ ⎢ 1⎥ ⎟
⎜ ⎢ ⎥ ⎟
⎜ ⎢
1 ⎢ 1⎥ ⎥  ⎟
= L⎜
⎜ I − ⎢ ⎥ 1 1 1 0 0 0 ⎟

⎜ 3 ⎢0⎥ ⎟
⎝ ⎣0⎦ ⎠
0
:= L̃ = const.
−1
With all components present, the inverse ∂m ∂v
is now numerically evaluated,
and the solution vector v is iterated according to Eq. (2.11) (Newton method).

4.2 FORTRAN Examples

The idea for the three-dimensional test setup, shown in Fig. 4.5, is adopted from
[24]. A cube element of side length L = 1 is fixed to the wall on one side, thus nodes

Fig. 4.5 Test setup for


three-dimensional finite 8 7
element analysis

5 6 Y
X
4 Z
3

1 2
4.2 FORTRAN Examples 43

1, 4, 5, 8 do not move in position. A force is acting on multiple nodes 2, 3, 6, 7, in


multiple directions. The force is applied in increments, as before.
According to general finite element procedure, the stress state is not determined at
the node directly, but instead at a corresponding Gauss or integration point close by.
From there, the exact solution is extrapolated to the node. An element has the same
number of Gauss Points and nodes, eight in this example. The positions of the Gauss
Points depend on the chosen type of ansatz functions. A more detailed explanation
is given in [23]. Here, simple linear ansatz functions are used for example.
In the following example, the objective is to analyze the Gauss point closest to
node 1 over the course of the deformation. Unlike before, the algorithm only consists
of the local CPP algorithm within the increment, without the global algorithm. This
way, the algorithm can easily be included in another finite element program, where
a global algorithm already exists. A structural diagram of the algorithm is shown
in Fig. 4.6. The input of the algorithm consists of a strain increment ε, and the

(1) input Δε, C(E, ν)

(2) values at previous state σn , ε n , κ n

t
(3) trial state σn+1 , κtn+1

t

(4) yield condition F σn+1 , k κtn+1

j=0
(5) initial solution vector vn+1

(6) iteration counter reset j=0

(7) iteration counter increase j+1

j j
vn+1 , m(vn+1 )
inner loop

(8) solution vector and residual vector

j+1
(9) iterated solution vector vn+1

(13) tolerance check j+1 j


vn+1 − vn+1 < tol

(14) output: values at next state σn+1 , εn+1 , κn+1

Fig. 4.6 Flow chart of an example local CPP integration algorithm for a three-dimensional finite
element model
44 4 Three-Dimensional Finite Element Approach

elasticity matrix C, see step (1) of Fig. 4.6. Furthermore, the input also includes the
state values from the previous state, listed in step (2): the acting stress vector σn , the
total strain vector εn and the effective plastic strain κ.
Analogous to the one-dimensional CPP algorithm, first the trial stress is calculated,
see step (3):
σ tn+1 = σ n + Cεn+1 . (4.40)

Next, by using the yield condition F(σ t , k(κtn+1 )), the trial state is checked for
validity in step (4). In case the state is valid, the step is elastic and thus, the algorithm
skips to the output in step (14).
In the other case, the trial state values are saved in the initial vector of unknowns,
see step (5), and the iteration starts. Initially reset to j = 0 in step (6), the iteration
counter is increased in step (7). Next, the vector of unknowns v j , and the residual
vector m(v j ) are evaluated in step (8). From this, the vector of unknowns is iterated
in step (9). In the following tolerance check in step (13), the iterated solution vector
v j+1 is compared to the previous solution vector v j+1 . If the difference exceeds the
tolerance tol, the iteration process is repeated from step (7). The iteration process
continues until the difference for two consecutive steps falls under the threshold tol.
At this point, the iterated properties are the output, see step (14), and produce the
input state variables for the next increment.
Chapter 5
Summary and Outlook

Abstract This chapter summarizes the most important aspects of the previous chap-
ters and gives an outlook for further potential research.

Under an increasing load, metal-like solids display first elastic and eventually elasto-
plastic deformation, when the load exceeds the initial yield limit. Plastic deformation
leads to yielding, which increases the yield limit of the material. After removing the
load, a permanent deformation persists.
The deformation properties can be described by rate equations such as the yield
condition, the flow rule and the hardening rule. The equations can be solved numeri-
cally by an integration algorithm. Among these is the fully implicit backwards Euler
algorithm. For this purpose, the total load is applied incrementally. The state variables
are calculated for each subsequent increment.
The analysis is tested for simple tensile tests. First, a one-dimensional continuum
formulation of the geometry is applied. Next, a one-dimensional finite element for-
mulation is applied. Eventually, a three-dimensional finite element formulation is
applied. The virtual tests are carried out for different test conditions.
Fortran is compatible with other software. Some of the computational software
provide interfaces to include Fortran user subroutines. Fortran shares many sim-
ilarities with other software. Thus, it is a good alternative for programming the finite
element code. Although some modifications would be neccesary, the same code can
also be written with other non-finite element software, such as Maple, Mathemat-
ica, Matlab, etc. An advantage of Fortran is its compatibility with the majority of
programs.
Modification of the provided Fortran code is easy. Example variations of the test
conditions such as changing the hardening function are presented. Other possibilities
include changing the yield condition (e.g. implementing the Tresca yield condition
instead of the von Mises yield condition), flow rule etc. The code can easily be
extended by dropping certain model restrictions, such as allowing kinematic harden-
ing, failure, etc. In Fortran, derivatives have to be implemented manually. Differ-
ent software, such as Maple, allow for symbolic differentiation and thereforeprovide

The Author(s) 2018 45


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_5
46 5 Summary and Outlook

grounds for optimization of the code. Another alternative for implementation is to


change the numerical integration algorithm. Here, only the fully and semi-implicit
backwards Euler method have been implemented.
The test setup allows quick testing with many different input parameters. A next
step may be to automize material testing, e.g. via batch files for different input files.
Another possibility is to add more features, such as damage and fracture.
Chapter 6
FORTRAN Source Codes

Abstract This chapter discusses the Fortran source codes for the numerical
analysis.

To compile the code at hand, any Fortran compiler can be used. As an example,
we use the open-source compiler Gnu Fortran (GFortran). The results of the
numerical analysis are veryfied by use of the finite element program Marc Mentat,
Version 2014.2, see [24, 25, 33].
Fortran code has strict formatting rules [35], as it must be written from column
6 to (usually) column 72. For better visualization, we choose column 57 as upper
limit. Columns 1–5 contain optional statement labels, while column 6 is reserved for
optional line continuation characters (usually &). In Gnu Fortran, exclamation
marks ‘!’ in a line are followed by comments.
Every Fortran program and subprogram is divided into an implementation (dec-
laration) and interface (execution) part, strictly separated from each other.
In the implementation section [35], all variables and their data types are declared.
Implicit type declaration is allowed, but it is not good programming practice to do so.
Instead, the keyword ‘implicit none’ is used and all variables are declared explicitly.
The data type ‘real*8’ declares a real of double precision.
In the interface section [35], the program executes a set of rules, structured in
reusable modules. Fortran distinguishes two types of modules, functions and sub-
routines. A function return exactly one output parameter, while a subroutine returns
several values through its arguments. During execution, functions are called by the
main program with the keyword ‘function’ and subroutines are called with the key-
word ‘call’.
A complete program consists of a main program and arbitrary many modules,
implemented outside the main program. The main program starts with the key-
word ‘program’, modules start with ‘subroutine’ and functions start with ‘function’.
All programs end with the keyword ‘end’. A collection of useful general-purpose
subroutines, such as subroutines for matrix inversion, can be found in [35]. Further-
more, program codes for a wide range of example problems can be found in [14–16,
34, 36].

The Author(s) 2018 47


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6_6
48 6 FORTRAN Source Codes

Fig. 6.1: File structure of example Fortran programs

If a program is dispersed among several files, all other files must be included in
the main file by using the keyword ‘include’ [35]. Fortran files generally have the
extension ‘.f’. The file structure of the example programs is shown in Fig. 6.1.

6.1 One-Dimensional Continuum Model

The Fortran program for the continuum model is split into a main file ‘Conti1D.f’,
an input file ‘_Input.txt’ an two additional files with subroutines, ‘ContiSubrou-
tines1D.f’ and ‘CPPSubroutines1D.f’. For a successful compilation, all files must
be present.
6.1 One-Dimensional Continuum Model 49

Conti1D.f (main file)


1 program Conti1D
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !eps - strain at current iteration !
4 !epsinc - strain at beginning of increment !
5 !epsit - strain at previous iteration !
6 !deps - strain increment at current iteration !
7 !epspl - plastic strain at current iteration !
8 !epsplinc - plastic strain at beginning of inc !
9 !du - displacement increment at current iteration !
10 !utot - total prescribed displacement !
11 !u - displacement at current iteration !
12 !uinc - displacement at beginning of increment !
13 !ds - stress increment at current iteration !
14 !s - stress at current iteration !
15 !sinc - stress at beginning of increment !
16 !Ftot - total prescribed force !
17 !F - force at current iteration !
18 !dF - force increment at current iteration !
19 !Etil - intermediate/approximated modulus !
20 !E - YOUNG’s modulus !
21 !Epl - plastic modulus !
22 !A - cross section area of specimen !
23 !L - length of specimen !
24 !kinit - initial yield stress !
25 !tolILoop - tolerance of inner loop !
26 !tolCPP - tolerance of CPP algorithm !
27 !inc - total number of elements !
28 !n - increment counter !
29 !j - iteration counter within an increment !
30 !z - total iteration counter !
31 !input - input file reference number !
32 !output - output file reference number !
33 !tolexceeded - true when tolILoop is exceeded !
34 !linCPP - T=linear, F=non-linear CPP !
35 !Fcontrolled - input flag, force/displacement ctrl!
36 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37 implicit none
38 real*8 eps,epsinc,epsit,deps,epspl,epsplinc,
39 & du,utot,u,uinc,ds,s,sinc,Ftot,F,dF,Etil,E,
40 & Epl,A,L,kinit,tolILoop,tolCPP
41 integer inc,n,j,z,input,output
42 logical tolexceeded,linCPP,Fcontrolled
43 call ReadInput(inc,Ftot,utot,A,L,E,kinit,Epl,
44 & tolCPP,tolILoop,linCPP,Fcontrolled,input)
45 call SetInitValues(E,Etil,s,eps,epspl,u,F,z)
46 call WriteOutputFile(output)
47 do n=1,inc
48 call UpdateOuterLoop(j,sinc,s,epsplinc,
49 & epspl,epsinc,eps,epsit,uinc,u,deps,du,Ftot,utot,
50 & dF,ds,L,A,Etil,Fcontrolled,inc)
51 tolexceeded=.true.
52 do while (tolexceeded)
50 6 FORTRAN Source Codes

53 call UpdateInnerLoop(ds,Etil,L,u,j,deps,
54 & du,eps,epspl,s,dF,sinc,epsplinc,uinc,
55 & epsinc,Fcontrolled)
56 call CPP(deps,E,kinit,Epl,eps,epsinc,sinc,
57 & s,epspl,Etil,z,linCPP,tolCPP)
58 call UpdateOutputFile(A,F,du,u,eps,deps,
59 & epspl,s,n,j,output)
60 call checktol(eps,epsit,tolexceeded,
61 & tolILoop,Fcontrolled)
62 end do
63 end do
64 call CloseOutputFile(z,output)
65 end
66 include ’CPP1DSubroutines.f’
67 include ’ContiSubroutines1D.f’
ContiSubroutines1D.f
1 subroutine ReadInput(inc,Ftot,utot,A,L,E,kinit,Epl,
2 & tolCPP,tolILoop,linCPP,
3 & Fcontrolled,input)
4 implicit none
5 real*8 Ftot,utot,A,L,E,kinit,Epl,tolCPP,tolILoop
6 integer input,inc
7 logical linCPP,Fcontrolled
8 input=1
9 open(unit=input,file=’_Input.txt’,status=’old’)
10 read(input,*)
11 read(input,*)
12 read(input,*) inc,Ftot,utot,A,L,E,kinit,Epl,
13 & tolCPP,tolILoop,linCPP,Fcontrolled
14 close(unit=input)
15 end
16
17 subroutine WriteOutputFile(output)
18 implicit none
19 integer output,ele
20 output=2
21 open(unit=output,file="_Out.txt")
22 1 format (a,t5,a,t10,a,t25,a,t40,a,t55,a,t70,a,
23 & t85,a,t100,a/)
24 write(unit=output,fmt=1)"n","j","F","du","u",
25 & "deps","eps","epspl","s","[-]","[-]","[kN]",
26 & "[mm]","[mm]","[E-3]","[E-3]","[E-3]","[MPa]"
27 end
28

29 subroutine SetInitValues(E,Etil,s,eps,epspl,u,F,
30 & z)
31 implicit none
32 real*8 E,Etil,s,eps,epspl,u,F
33 integer z
34 s=0.D0
6.1 One-Dimensional Continuum Model 51

35 F=0.D0
36 u=0.D0
37 eps=0.D0
38 epspl=0.D0
39 Etil=E
40 z=0.D0
41 end
42

43 subroutine UpdateOuterLoop(j,sinc,s,epsplinc,
44 & epspl,epsinc,eps,epsit,
45 & uinc,u,deps,du,Ftot,utot,
46 & dF,ds,L,A,Etil,
47 & Fcontrolled,inc)
48 implicit none
49 real*8 sinc,s,epsplinc,epspl,epsinc,eps,deps,
50 & epsit,uinc,u,du,Ftot,dF,ds,utot,L,A,Etil
51 integer j,inc
52 logical Fcontrolled
53 j=0
54 sinc=s
55 uinc=u
56 epsinc=eps
57 epsit=0.D0
58 if(Fcontrolled)then
59 dF=Ftot/dble(inc)
60 ds=dF/(A*1.D6)
61 else
62 du=utot/dble(inc)
63 deps=du/L
64 end if
65 end
66

67 subroutine UpdateInnerLoop(ds,Etil,L,u,j,deps,
68 & du,eps,epspl,s,dF,
69 & sinc,epsplinc,uinc,
70 & epsinc,Fcontrolled)
71 implicit none
72 real*8 ds,Etil,L,deps,du,eps,epspl,s,u,
73 & dF,sinc,epsplinc,uinc,epsinc
74 integer j
75 logical Fcontrolled
76 j=j+1
77 if(Fcontrolled)then
78 deps=(sinc+ds-s)/Etil
79 du=deps*L
80 end if
81 eps=eps+deps
82 u=u+du
83 end
84
85 subroutine checktol(eps,epsit,tolexceeded,
86 & tolILoop,Fcontrolled)
87 implicit none
52 6 FORTRAN Source Codes

88 real*8 tol,eps,epsit,tolILoop
89 logical tolexceeded,Fcontrolled
90 tol=abs(eps-epsit)
91 tolexceeded=.true.
92 if(tol.lt.tolILoop.or..not.Fcontrolled)
93 & then
94 tolexceeded=.false.
95 end if
96 epsit=eps
97 end
98
99 subroutine UpdateOutputFile(A,F,du,u,eps,deps,
100 & epspl,s,n,j,output)
101 implicit none
102 real*8 F,du,u,eps,deps,epspl,s,A
103 integer n,j,output
104 2 format(i3.2,t5,i3.2,t10,f12.5,t25,f12.5,t40,
105 & f12.5,t55,f12.8,t70,f12.8,t85,f12.8,t100,
106 & f12.8/)
107 F=s*A*1.D6
108 write(unit=output,fmt=2) n,j,F/1.D3,du*1.D3,
109 & u*1.D3,deps*1.D3,eps*1.D3,epspl*1.D3,s
110 end
111

112 subroutine CloseOutputFile(z,output)


113 implicit none
114 integer z,output
115 write(unit=output,fmt=’(a,i5.1)’)
116 & "iteration count:",z
117 close(output)
118 end

The input file ‘_Input.txt’ is a simple text file with input parameters, each occu-
pying one line. The input parameters define the geometry and material properties of
the tensile test specimen. The first comment line indicates the order and unit of mea-
surement. Collecting the input in a separate input file allows the user to conventiently
and quickly vary the test setup parameters.
_Input.txt
1 inc[-],F0[N],u0[m],A[m^2],L[m],E[MPa],kinit[MPa],
2 Epl[MPa],TolCPP[-],TolILoop[-],LinCPP==,FControlled==
3 10
4 60000.
5 0.008
6 0.0001
7 0.4
8 70000.
9 350.
10 7000.
11 0.0000000001
12 0.0000000001
13 F
14 T
6.2 One-Dimensional Finite Element Models 53

6.2 One-Dimensional Finite Element Models

As before, the Fortran program for the FEM models is split into a main file, an
input file and two additional files with subroutines. For a successful compilation,
again all files must be present.
For the model with a single finite element, the main file is called ‘FEM1Ele1D.f’,
the input file ‘_Input.txt’ is adopted from the continuum model, and the subroutine
files are called ‘FEM1Ele1DSubroutines.f’ and ‘CPPSubroutines1D.f’.
For the model with multiple finite elements, the main file is called ‘FEMF100Ele1D.f’,
the input file is called ‘_input100.txt’ and the subroutines are called ‘FEM100Ele1D
Subroutines.f’ and ‘CPP1DSubroutines.f’.
FEM1Ele1D.f (main file)
1 program FEM1ele1D
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !utot - total prescribed displacement !
4 !Ftot - total prescribed force !
5 !eps - strain at current iteration !
6 !deps - strain increment of current iteration !
7 !epspl - plastic strain at current iteration !
8 !du - displacement increment of current iteration !
9 !u - displacement at current iteration !
10 !s - stress at current iteration !
11 !K - tangent stiffness at current iteration !
12 !F - force at current iteration !
13 !kinit - initial yield strength !
14 !A - cross section area of specimen !
15 !L - length of specimen !
16 !E - YOUNG’s modulus !
17 !Epl - plastic modulus !
18 !Etil - (approximated) tangent modulus !
19 !TolCPP - tolerance of CPP algorithm !
20 !TOlILoop - tolerance of inner loop !
21 !sinc - stress at beginning of current increment !
22 !epsinc - strain at beginning of current increment!
23 !uinc - displacement at beginning of current inc. !
24 !uit - displacement of previous iteration !
25 !dF - force increment at current iteration !
26 !r - residual at current iteration !
27 !inc - number of increments !
28 !n - increment counter !
29 !z - total iteration counter !
30 !j - iteration counter within an increment !
31 !output - output file reference number !
32 !input - input file reference number !
33 !linCPP - input flag, choose (non)linear CPP !
34 !Fcontrolled - input flag, force/displacement ctrl!
35 !tolexceeded - true if tolerance is exceeded !
36 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37 implicit none
54 6 FORTRAN Source Codes

38 real*8 utot,Ftot,eps,deps,epspl,du,u,s,K,F,
39 & kinit,A,L,E,Eelpl,Epl,Etil,TolCPP,
40 & TolILoop,sinc,epsinc,uinc,uit,dF,r
41 integer inc,n,z,j,output,input
42 logical linCPP,Fcontrolled,tolexceeded
43 call ReadInput(inc,Ftot,utot,A,L,E,kinit,Epl,tolCPP,
44 & tolILoop,linCPP,Fcontrolled,input)
45 call SetInitialValues1Ele(z,K,E,A,L,Etil,s,eps,
46 & epspl,u,F)
47 call WriteOutputFile(output)
48 do n=1,inc
49 call UpdateOuterLoop1Ele(sinc,s,uinc,u,
50 & epsinc,eps,dF,Ftot,r,
51 & du,Fcontrolled,utot,
52 & inc,j,uit,K)
53 tolexceeded=.true.
54 do while(tolexceeded)
55 call UpdateInnerLoop1Ele(du,r,u,deps,L,K,
56 & eps,j,Fcontrolled)
57 call CPP(deps,E,kinit,Epl,eps,epsinc,sinc,
58 & s,epspl,Etil,z,linCPP,tolCPP)
59 call UpdateResidual1Ele(A,L,du,Etil,K,r,
60 & uinc,u,Fcontrolled)
61 call UpdateOutputFile(A,F,du,u,eps,deps,
62 & epspl,s,n,j,output)
63 call checktol1Ele(u,uit,tolexceeded,
64 & tolILoop,Fcontrolled)
65 end do
66 end do
67 call CloseOutputFile(z,output)
68 end
69 include ’CPP1Dsubroutines.f’
70 include ’FEM1Ele1DSubroutines.f’
FEM1Ele1DSubroutines.f
1 subroutine ReadInput(inc,Ftot,utot,A,L,E,kinit,Epl,
2 & tolCPP,tolILoop,linCPP,
3 & Fcontrolled,input)
4 implicit none
5 real*8 Ftot,utot,A,L,E,kinit,Epl,tolCPP,tolILoop
6 integer input,inc
7 logical linCPP,Fcontrolled
8 input=1
9 open(unit=input,file=’_Input.txt’,status=’old’)
10 read(input,*)
11 read(input,*)
12 read(input,*) inc,Ftot,utot,A,L,E,kinit,Epl,tolCPP,
13 & tolILoop,linCPP,Fcontrolled
14 close(unit=input)
15 end
16
6.2 One-Dimensional Finite Element Models 55

17 subroutine WriteOutputFile(output)
18 implicit none
19 integer output
20 output=2
21 open(unit=output,file="_Out.txt")
22 1 format (/a,t5,a,t10,a,t25,a,t40,a,t55,a,t70,a,
23 & t85,a,t100,a/)
24 write(unit=output,fmt=1)"n","j","F","du","u",
25 & "deps","eps","epspl","s","[-]","[-]","[kN]",
26 & "[mm]","[mm]","[E-3]","[E-3]","[E-3]","[MPa]"
27 end
28
29 subroutine SetInitialValues1Ele(z,K,E,A,L,Etil,
30 & s,eps,epspl,u,F)
31 implicit none
32 real*8 K,E,A,L,Etil,s,eps,epspl,u,F
33 integer z
34 z=0
35 K=E*A*1.D6/L
36 Etil=E
37 s=0.D0
38 eps=0.D0
39 epspl=0.D0
40 u=0.D0
41 F=0.D0
42 end
43
44 subroutine UpdateOuterLoop1Ele(sinc,s,uinc,u,
45 & epsinc,eps,dF,Ftot,r,
46 & du,Fcontrolled,utot,
47 & inc,j,uit,K)
48 implicit none
49 real*8 F,sinc,s,uinc,u,epsinc,eps,K,uit,
50 & dF,Ftot,r,du,utot
51 integer inc,j
52 logical Fcontrolled
53 j=0
54 sinc=s
55 epsinc=eps
56 uinc=u
57 uit=0.D0
58 if(Fcontrolled)then
59 dF=Ftot/dble(inc)
60 r=-dF
61 else
62 du=utot/dble(inc)
63 end if
64 end
65

66 subroutine UpdateInnerLoop1Ele(du,r,u,deps,L,K,
67 & eps,j,Fcontrolled)
68 implicit none
69 real*8 du,r,K,u,deps,L,eps,A
56 6 FORTRAN Source Codes

70 integer j
71 logical Fcontrolled
72 if(Fcontrolled)then
73 du=-r/K
74 end if
75 j=j+1
76 u=u+du
77 deps=du/L
78 eps=eps+deps
79 end
80
81 subroutine UpdateResidual1Ele(A,L,du,Etil,K,r,
82 & uinc,u,Fcontrolled)
83 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
84 !update force residual !
85 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
86 implicit none
87 real*8 A,L,du,Etil,uinc,u,K,r,E
88 logical Fcontrolled
89 K=Etil*A*1.D6/L
90 if(Fcontrolled)r=r+K*du
91 end
92
93 subroutine UpdateOutputFile(A,F,du,u,eps,deps,
94 & epspl,s,n,j,output)
95 implicit none
96 real*8 F,du,u,eps,deps,epspl,s,A
97 integer n,j,output
98 2 format(i3.2,t5,i5.2,t10,f15.5,t25,f15.5,t40,
99 & f15.5,t55,f15.8,t70,f15.8,t85,f15.8,t100,f15.8)
100 F=s*A*1.D6
101 write(unit=output,fmt=2) n,j,F/1.D3,du*1.D3,
102 & u*1.D3,deps*1.D3,eps*1.D3,epspl*1.D3,s
103 end
104
105 subroutine checktol1Ele(u,uit,tolexceeded,
106 & tolILoop,Fcontrolled)
107 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
108 !check if tolerance is exceeded !
109 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
110 implicit none
111 real*8 tol,u,tolILoop,uit
112 logical tolexceeded,Fcontrolled
113 tol=abs(u-uit)
114 tolexceeded=.true.
115 if((tol.lt.tolILoop)
116 & .or.(Fcontrolled.eqv..false.))tolexceeded=.false.
117 uit=u
118 end
119
120 subroutine CloseOutputFile(z,output)
121 implicit none
122 integer z,output
6.2 One-Dimensional Finite Element Models 57

123 write(unit=output,fmt=’(a,i5.1)’)
124 & "iteration count:",z
125 close(output)
126 end
FEMF100Ele1D.f (main file)
1 program FEMU100ele1D
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !utot - total prescribed displacement !
4 !Ftot - total prescribed force !
5 !eps - strains at current iteration !
6 !deps - strain increments of current iteration !
7 !epspl - plastic strains at current iteration !
8 !du - displacement increments of current iteration!
9 !u - displacements at current iteration !
10 !s - stresses at current iteration !
11 !K - element stiffnesses at current iteration !
12 !Km - tangent stiffness matrix at current it. !
13 !Kmred - reduced tangent stiffness matrix !
14 !Kminv - inverse of tangent stiffness matrix !
15 !F - force at current iteration !
16 !kinit - initial yield strengths !
17 !A - cross section areas of specimen !
18 !L - element lengths of specimen !
19 !E - YOUNG’s moduli !
20 !Epl - plastic moduli !
21 !Etil - (approximated) tangent moduli !
22 !TolCPP - tolerance of CPP algorithm !
23 !TOlILoop - tolerance of inner loop !
24 !sinc - stresses at beginning of current increment!
25 !epsinc - strains at beginning of current inc. !
26 !uinc - displacements at beginning of current inc.!
27 !uit - displacements of previous iteration !
28 !dF - force increment at current iteration !
29 !r - residuals at current iteration !
30 !inc - number of increments !
31 !n - increment counter !
32 !z - total iteration counter !
33 !j - iteration counter within an increment !
34 !output - output file reference number !
35 !input - input file reference number !
36 !m - element counter !
37 !ele - number of elements !
38 !i - node counter !
39 !nod - number of nodes !
40 !linCPP - input flag, (non)linear CPP algorithm !
41 !Fcontrolled - input flag, force/displacement ctrl!
42 !tolexceeded - true if tolerance is exceeded !
43 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 implicit none
45 real*8 utot,Ftot,eps(100),deps(100),epspl(100),
58 6 FORTRAN Source Codes

46 & du(100),u(100),s(100),K(100),Km(100,100),
47 & Kmred(100,100),Kminv(100,100),F,kinit(100),
48 & A(100),L(100),E(100),Epl(100),Etil(100),TolCPP,
49 & TolILoop,sinc(100),epsinc(100),uinc(100),
50 & uit(100),dF,r(100)
51 integer inc,n,z,j,output,input,m,ele,i,nod
52 logical EqEle,LinCPP,FControlled,tolexceeded
53 call ReadInput100(Ftot,utot,A,L,E,kinit,Epl,
54 & TolCPP,TolILoop,inc,ele,nod,LinCPP,FControlled,
55 & input,EqEle)
56 call SetInitialValues100(A,F,E,inc,s,Etil,
57 & eps,epspl,u,z,L,ele,K,nod,Kmred,Km,r)
58 call WriteOutputFile100(output)
59 do n=1,inc
60 call UpdateOuterLoop100(eps,s,u,r,epsinc,sinc,
61 & dF,nod,ele,du,Km,uinc,F0,u0,inc,F,j,
62 & Fcontrolled)
63 tolexceeded=.true.
64 do while (tolexceeded)
65 call UpdateInnerLoop100(Kmred,Kminv,r,L,j,
66 & du,u,deps,eps,ele,nod,K,dF,F,A,Fcontrolled)
67 do m=1,ele
68 call CPP(deps,E,kinit,Epl,eps,epsinc,sinc,
69 & s,epspl,Etil,z,linCPP,tolCPP)
70 end do
71 call UpdateResidual100(Etil,A,L,du,K,
72 & Km,nod,ele,r,u,Kmred,E,s,uinc,
73 & Fcontrolled)
74 call UpdateOutputFile100(A,K,F,du,u,eps,
75 & deps,epspl,s,n,output,ele,j,nod,dF)
76 call checktol100(u,uit,tolexceeded,nod,
77 & tolILoop,Fcontrolled)
78 end do
79 end do
80 call CloseOutputFile(z,output)
81 end
82 include ’CPP1DSubroutines.f’
83 include ’FEM100Ele1DSubroutines.f’
FEM100Ele1D.f (main file)
1 program FEMU100ele1D
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !utot - total prescribed displacement !
4 !Ftot - total prescribed force !
5 !eps - strains at current iteration !
6 !deps - strain increments of current iteration !
7 !epspl - plastic strains at current iteration !
8 !du - displacement increments of current iteration!
9 !u - displacements at current iteration !
10 !s - stresses at current iteration !
11 !K - element stiffnesses at current iteration !
6.2 One-Dimensional Finite Element Models 59

12 !Km - tangent stiffness matrix at current it. !


13 !Kmred - reduced tangent stiffness matrix !
14 !Kminv - inverse of tangent stiffness matrix !
15 !F - force at current iteration !
16 !kinit - initial yield strengths !
17 !A - cross section areas of specimen !
18 !L - element lengths of specimen !
19 !E - YOUNG’s moduli !
20 !Epl - plastic moduli !
21 !Etil - (approximated) tangent moduli !
22 !TolCPP - tolerance of CPP algorithm !
23 !TOlILoop - tolerance of inner loop !
24 !sinc - stresses at beginning of current increment!
25 !epsinc - strains at beginning of current inc. !
26 !uinc - displacements at beginning of current inc.!
27 !uit - displacements of previous iteration !
28 !dF - force increment at current iteration !
29 !r - residuals at current iteration !
30 !inc - number of increments !
31 !n - increment counter !
32 !z - total iteration counter !
33 !j - iteration counter within an increment !
34 !output - output file reference number !
35 !input - input file reference number !
36 !m - element counter !
37 !ele - number of elements !
38 !i - node counter !
39 !nod - number of nodes !
40 !linCPP - input flag, (non)linear CPP algorithm !
41 !Fcontrolled - input flag, force/displacement ctrl!
42 !tolexceeded - true if tolerance is exceeded !
43 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 implicit none
45 real*8 utot,Ftot,eps(100),deps(100),epspl(100),
46 & du(100),u(100),s(100),K(100),Km(100,100),
47 & Kmred(100,100),Kminv(100,100),F,kinit(100),
48 & A(100),L(100),E(100),Epl(100),Etil(100),TolCPP,
49 & TolILoop,sinc(100),epsinc(100),uinc(100),
50 & uit(100),dF,r(100)
51 integer inc,n,z,j,output,input,m,ele,i,nod
52 logical EqEle,LinCPP,FControlled,tolexceeded
53 call ReadInput100(Ftot,utot,A,L,E,kinit,Epl,
54 & TolCPP,TolILoop,inc,ele,nod,LinCPP,FControlled,
55 & input,EqEle)
56 call SetInitialValues100(A,F,E,inc,s,Etil,
57 & eps,epspl,u,z,L,ele,K,nod,Kmred,Km,r)
58 call WriteOutputFile100(output)
59 do n=1,inc
60 call UpdateOuterLoop100(eps,s,u,r,epsinc,sinc,
61 & dF,nod,ele,du,Km,uinc,F0,u0,inc,F,j,
62 & Fcontrolled)
63 tolexceeded=.true.
64 do while (tolexceeded)
60 6 FORTRAN Source Codes

65 call UpdateInnerLoop100(Kmred,Kminv,r,L,j,
66 & du,u,deps,eps,ele,nod,K,dF,F,A,Fcontrolled)
67 do m=1,ele
68 call CPP(deps,E,kinit,Epl,eps,epsinc,sinc,
69 & s,epspl,Etil,z,linCPP,tolCPP)
70 end do
71 call UpdateResidual100(Etil,A,L,du,K,
72 & Km,nod,ele,r,u,Kmred,E,s,uinc,
73 & Fcontrolled)
74 call UpdateOutputFile100(A,K,F,du,u,eps,
75 & deps,epspl,s,n,output,ele,j,nod,dF)
76 call checktol100(u,uit,tolexceeded,nod,
77 & tolILoop,Fcontrolled)
78 end do
79 end do
80 call CloseOutputFile(z,output)
81 end
82 include ’CPP1DSubroutines.f’
83 include ’FEM100Ele1DSubroutines.f’
FEM100Ele1DSubroutines.f
1 subroutine ReadInput100(F0,u0,A,L,E,kinit,Epl,
2 & TolCPP,TolILoop,inc,ele,nod,LinCPP,FControlled,
3 & input,EqEle)
4 implicit none
5 real*8 F0,u0,A(100),L(100),E(100),kinit(100),
6 & Epl(100),TolCPP,TolILoop
7 integer inc,ele,m,input,nod
8 logical EqEle,LinCPP,Fcontrolled
9 input=1
10 open(unit=input,file=’_input100.txt’,
11 & status=’old’)
12 read(input,*)
13 read(input,*) ele
14 nod=ele+1
15 read(input,*)
16 read(input,*) EqEle
17 read(input,*)
18 read(input,*) inc
19 read(input,*)
20 read (input,*) F0
21 read(input,*)
22 read (input,*) u0
23 read(input,*)
24 if(eqEle.eqv..true.)then
25 read (input,*) A(1)
26 read(input,*)
27 read (input,*) L(1)
28 read(input,*)
29 read (input,*) E(1)
30 read(input,*)
6.2 One-Dimensional Finite Element Models 61

31 read (input,*) kinit(1)


32 read(input,*)
33 read (input,*) Epl(1)
34 do m=1,ele
35 A(m)=A(1)
36 L(m)=L(1)
37 E(m)=E(1)
38 kinit(m)=kinit(1)
39 Epl(m)=Epl(1)
40 end do
41 else
42 do m=1,ele
43 read(input,*)A(m)
44 end do
45 read(input,*)
46 do m=1,ele
47 read(input,*)L(m)
48 end do
49 read(input,*)
50 do m=1,ele
51 read(input,*)E(m)
52 end do
53 read(input,*)
54 do m=1,ele
55 read(input,*)kinit(m)
56 end do
57 read(input,*)
58 do m=1,ele
59 read(input,*)Epl(m)
60 end do
61 end if
62 read(input,*)
63 read (input,*)TolCPP
64 read(input,*)
65 read (input,*)TolILoop
66 read(input,*)
67 read (input,*)LinCPP
68 read(input,*)
69 read (input,*)Fcontrolled
70 close(unit=input)
71 end
72
73 subroutine SetInitialValues100(A,F,E,inc,s,Etil,
74 & eps,epspl,u,z,L,ele,K,nod,Kmred,Km,r)
75 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
76 !set initial values !
77 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
78 implicit none
79 real*8 A(100),E(100),L(100),s(100),Etil(100),
80 & eps(100),epspl(100),u(100),F,Kmred(100,100),
81 & Km(100,100),K(100),r(100)
82 integer inc,nod,ele,m,g,h,z,i
83 z=0
62 6 FORTRAN Source Codes

84 F=0.D0
85 do m=1,ele
86 Etil(m)=E(m)
87 s(m)=0.D0
88 eps(m)=0.D0
89 epspl(m)=0.D0
90 end do
91 do i=1,nod
92 u(i)=0.D0
93 end do
94 do m=1,ele
95 K(m)=Etil(m)*A(m)*1.D6/L(m)
96 end do
97 call getKm(Km,Kmred,K,ele,nod)
98 end
99
100 subroutine getKm(Km,Kmred,K,ele,nod)
101 implicit none
102 real*8 Km(100,100),K(100),Kmred(100,100)
103 integer g,h,m,ele,nod
104 do g=1,nod
105 do h=1,nod
106 Km(g,h)=0.D0
107 end do
108 end do
109 do m=1,ele
110 do g=1,nod
111 do h=1,nod
112 if((g.eq.h).and.(m.le.g).and.(g.le.m+1))then
113 Km(g,h)=Km(g,h)+K(m)
114 else if(((g+h-1).eq.2*m).and.(abs(g-h).eq.1))
115 & then
116 Km(g,h)=Km(g,h)-K(m)
117 end if
118 end do
119 end do
120 end do
121 do g=1,nod
122 do h=1,nod
123 Kmred(g,h)=Km(g+1,h+1)
124 end do
125 end do
126 end
127

128 subroutine WriteOutputFile100(output)


129 implicit none
130 integer output,ele
131 output=2
132 open(unit=output,file="_Out.txt")
133 1 format (t4,a,t9,a,t21,a,t36,a,t42,a,t55,a,t69,a/)
134 write(unit=output,fmt=1)"n","j","dF","F","i",
135 & "du","u","[-]","[-]","[kN]","[kN]","[-]","[mm]",
136 & "[mm]"
6.2 One-Dimensional Finite Element Models 63

137 end
138

139 subroutine UpdateOuterLoop100(eps,s,u,r,


140 & epsinc,sinc,dF,nod,ele,du,Km,uinc,
141 & F0,u0,inc,F,j,Fcontrolled)
142 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
143 !updates outer loop !
144 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
145 implicit none
146 real*8 eps(100),s(100),u(100),Km(100,100),r(100),
147 & epsinc(100),sinc(100),dF,uinc(100),F,du(100),F0,
148 & u0,uit(100)
149 integer n,nod,ele,i,m,j,inc,g,h
150 logical Fcontrolled
151 j=0
152 Finc=F
153 do i=1,nod
154 uinc(i)=u(i)
155 uit(i)=0.D0
156 end do
157 do m=1,ele
158 epsinc(m)=eps(m)
159 sinc(m)=s(m)
160 end do
161 if(Fcontrolled)then
162 dF=F0/dble(inc)
163 do i=1,nod
164 r(i)=0.D0
165 end do
166 r(nod)=-dF
167 else
168 du(nod)=u0/dble(inc)
169 end if
170 end
171
172 subroutine UpdateInnerLoop100(Kmred,Kminv,r,L,j,
173 & du,u,deps,eps,ele,nod,K,dF,F,A,Fcontrolled)
174 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
175 !updates inner loop !
176 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
177 implicit none
178 real*8 Kmred(100,100),r(100),u(100),deps(100),
179 & L(100),du(100),inv(100,100),eps(100),F,A(100),
180 & Kminv(100,100),Kserial(100),dF,K(100)
181 integer ele,nod,i,j,m,g,h
182 logical Fcontrolled
183 j=j+1
184 if(Fcontrolled)then
185 do i=1,nod
186 du(i)=0
187 end do
188 call getinv(Kmred,inv,ele)
189 do g=1,ele
64 6 FORTRAN Source Codes

190 do h=1,ele
191 Kminv(g+1,h+1)=inv(g,h)
192 end do
193 end do
194 do g=1,nod
195 do h=1,nod
196 du(g)=du(g)-Kminv(g,h)*r(h)
197 end do
198 end do
199 else
200 do m=1,ele-1
201 Kserial(m)=0.D0
202 end do
203 do i=1,nod-1
204 du(i)=0
205 end do
206 if(ele.eq.1)then
207 dF=K(ele)*du(nod)
208 end if
209 if (ele.gt.1)then
210 do m=1,ele
211 do h=1,m
212 Kserial(m)=Kserial(m)+1/K(h)
213 end do
214 end do
215 end if
216 if(ele.ge.2)then
217 du(2)=du(nod)/(K(1)*Kserial(ele))
218 dF=K(ele)*du(nod)*(1-Kserial(ele-1)/
219 & Kserial(ele))
220 end if
221 if(ele.gt.2)then
222 do m=3,ele
223 du(m)=du(2)*K(1)*Kserial(m-1)
224 end do
225 end if
226 end if
227 do i=1,nod
228 u(i)=u(i)+du(i)
229 end do
230 do m=1,ele
231 deps(m)=(du(m+1)-du(m))/L(m)
232 eps(m)=eps(m)+deps(m)
233 end do
234 end
235

236 subroutine UpdateResidual100(Etil,A,L,du,K,


237 & Km,nod,ele,r,u,Kmred,E,s,uinc,
238 & Fcontrolled)
239 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
240 !update force residual !
241 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
242 implicit none
6.2 One-Dimensional Finite Element Models 65

243 real*8 Etil(100),A(100),L(100),du(100),u(100),


244 & E(100),uinc(100),K(100),s(100),Km(100,100),
245 & Kmred(100,100),r(100)
246 integer nod,ele,m,g,h
247 logical Fcontrolled
248 do g=1,nod
249 do h=1,nod
250 Km(g,h)=0.D0
251 end do
252 end do
253 do m=1,ele
254 K(m)=Etil(m)*A(m)*10**6/L(m)
255 end do
256 if(Fcontrolled)then
257 call getKm(Km,Kmred,K,ele,nod)
258 do g=1,nod
259 do h=1,nod
260 r(g)=r(g)+Km(g,h)*du(h)
261 end do
262 end do
263 end if
264 end
265
266 subroutine UpdateOutputFile100(A,K,F,du,u,eps,
267 & deps,epspl,s,n,output,ele,j,nod,dF)
268 implicit none
269 real*8 A(100),K(100),du(100),u(100),dF,
270 & eps(100),deps(100),epspl(100),s(100),F
271 integer n,ele,output,i,j,nod
272 4 format(i5.2,i5.2,f15.4,f15.4)
273 5 format(t40,i5.3,f15.7,f15.7,f15.7,f15.7)
274 F=s(ele)*1.D6*A(ele)
275 write(unit=output,fmt=4)n,j,dF,F
276 do i=1,nod
277 write(unit=output,fmt=5)i,du(i)*1.D3,u(i)*1.D3,
278 & epspl(i),s(i)
279 end do
280 end
281
282 subroutine checktol100(u,uit,tolexceeded,nod,
283 & tolILoop,Fcontrolled)
284 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
285 !check if tolerance tolILoop is exceeded !
286 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
287 implicit none
288 real*8 tol,u(100),tolILoop,uit(100)
289 integer nod,i
290 logical tolexceeded,Fcontrolled
291 tol=0
292 tolexceeded=.true.
293 do i=1,nod
294 tol=tol+abs(u(i)-uit(i))
295 end do
66 6 FORTRAN Source Codes

296 if((tol.lt.tolILoop).or.
297 & (Fcontrolled.eqv..false.))tolexceeded=.false.
298 do i=1,nod
299 uit(i)=u(i)
300 end do
301 end
302
303 subroutine getinv(mat,inv,n)
304 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
305 !get invert inv of matrix mat, both of rank nxn !
306 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
307 implicit none
308 real*8 mat(100,100),inv(100,100),copy(100,100)
309 integer n,g,h
310 do g=1,n
311 do h=1,n
312 copy(g,h)=mat(g,h)
313 end do
314 end do
315 call matrixinv(copy,inv,n)
316 end
317

318 subroutine matrixinv(a,b,n)


319 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
320 !Author: Potirniche GP, P.E.,Ph.D. !
321 !University of Idaho !
322 !11 September, 2008 !
323 !subroutine evaluates inverse b of nxn matrix a !
324 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
325 implicit none
326 real*8 big,a(100,100),b(100,100),dummy
327 integer g,h,k,l,m,n,gRow
328 do g=1,n
329 do h=1,n
330 b(g,h)=0.0D0
331 end do
332 b(g,g)=1.0D0
333 end do
334 do g=1,n
335 big=a(g,g)
336 do h=g,n
337 if (a(h,g).gt.big)then
338 big=a(h,g)
339 gRow=h
340 end if
341 end do
342 if (big.gt.a(g,g))then
343 do k = 1,n
344 dummy=a(g,k)
345 a(g,k)=a(gRow,k)
346 a(gRow,k)=dummy
347 dummy=b(g,k)
348 b(g,k)=b(gRow,k)
6.2 One-Dimensional Finite Element Models 67

349 b(gRow,k)=dummy
350 end do
351 end if
352 dummy=a(g,g)
353 do h=1,n
354 a(g,h)=a(g,h)/dummy
355 b(g,h)=b(g,h)/dummy
356 end do
357 do h=g+1,n
358 dummy=a(h,g)
359 do k=1,n
360 a(h,k)=a(h,k)-dummy*a(g,k)
361 b(h,k)=b(h,k)-dummy*b(g,k)
362 end do
363 end do
364 end do
365 do g=1,n-1
366 do h=g+1,n
367 dummy=a(g,h)
368 do l=1,n
369 a(g,l)=a(g,l)-dummy*a(h,l)
370 b(g,l)=b(g,l)-dummy*b(h,l)
371 end do
372 end do
373 end do
374 end
375
376 subroutine CloseOutputFile(z,output)
377 implicit none
378 integer z,output
379 write(unit=output,fmt=’(a,i5.1)’)
380 & "iteration count:",z
381 close(output)
382 end

In the input file ‘_input100.txt’, an option is to define equivalent elements by


setting the flag ‘equi’ to 1 (true) and assigning the desired total number of elements
‘ele’.
Conversely, the other option is to define each element individually by setting
‘equi’ to 0 (false). In this case, the values of each element are defined manually,
one line each. The number of elements m = ele is defined by the number of input
Young‘s modulus values E m . The algorithm expects the same number of values for
the plastic modulus E pl,m , the area Am , the length L m and the initial yield strength
k init,m .

_input100.txt
1 ele[-]
2 1
3 EqEle==
4 T
5 i[-]
6 10
68 6 FORTRAN Source Codes

7 F0[N]
8 60000.
9 u0[m]
10 0.008
11 A[m^2]
12 0.0001
13 L[m]
14 0.4
15 E[MPa]
16 70000.
17 kinit[MPa]
18 350.
19 Epl[MPa]
20 7000.
21 TolCPP[-]
22 0.000000001
23 TolILoop[-]
24 0.000000001
25 LinCPP==
26 F
27 FControlled==
28 T

6.3 One-Dimensional CPP Algorithm

The file ‘CPPSubroutines1D.f’ with CPP subroutines is used for all 1D models.
CPPSubroutines1D.f
1 subroutine CPP(deps,E,kinit,Epl,eps,epsinc,sinc,
2 & s,epspl,Etil,z,linCPP,tolCPP)
3 implicit none
4 real*8 deps,E,kinit,Epl,eps,epsinc,sinc,st,
5 & funF,s,epspl,Etil,tolCPP,funK,epsplt
6 integer z
7 logical linCPP
8 st=s+E*deps
9 epsplt=epspl
10 if(funF(st,funK(epspl,kinit,Epl,linCPP))
11 & .le.0.D0)then
12 s=st
13 z=z+1
14 else
15 if(linCPP)then
16 call CPPpllin(st,kinit,Epl,E,epspl,s,z,
17 & epsplt)
18 else
19 call CPPplnonlin(st,s,epspl,kinit,E,z,
20 & tolCPP,epsplt)
6.3 One-Dimensional CPP Algorithm 69

21 end if
22 end if
23 Etil=(s-sinc)/(eps-epsinc)
24 end
25
26 subroutine CPPpllin(st,kinit,Epl,E,epspl,s,z,
27 & epsplt)
28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29 !apply linear CPP-algorithm in plastic regime !
30 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31 implicit none
32 real*8 kinit,Epl,E,epspl,s,dl,funF,st,
33 & funK,spl,epsplt
34 integer z
35 dl=funF(st,funK(epsplt,kinit,Epl,.true.))/
36 & (E+Epl)
37 epspl=epsplt+dl*dsign(1.D0,st)
38 s=st-dl*E*dsign(1.D0,st)
39 z=z+1
40 end
41
42 subroutine CPPplnonlin(st,s,epspl,kinit,E,z,
43 & tolCPP,epsplt)
44 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45 !apply non-linear CPP-algorithm in plastic regime!
46 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47 implicit none
48 real*8 v(100,100),dl,Eelpl,m(100),Epl,tol,s,
49 & mtilinv(100,100),funF,funK,E,st,epsplt,
50 & kinit,epspl,tolCPP,junk
51 integer j,q,p,z
52 logical CPPtolexceeded
53 z=z+1
54 j=0
55 v(1,1)=st
56 v(2,1)=epsplt
57 v(3,1)=0.D0
58 s=st
59 epspl=epsplt
60 dl=0.D0
61 CPPtolexceeded=.true.
62 do while(CPPtolexceeded)
63 j=j+1
64 10 format(t1,a,i2.1,t85,f12.8,t99,f12.7)
65 write(unit=2,fmt=10)"cpp:",j,epspl*1.D3,s
66 Eelpl=E*Epl(epspl)/(E+Epl(epspl))
67 m(1)=(s-st)/E+dl*dsign(1.D0,s)
68 m(2)=epsplt-epspl+dl
69 m(3)=funF(s,funK(epspl,kinit,junk,.false.))
70 mtilinv(1,1)=Epl(epspl)
71 mtilinv(1,2)=-dsign(1.D0,s)*Epl(epspl)
72 mtilinv(1,3)=dsign(1.D0,s)
73 mtilinv(2,1)=dsign(1.D0,s)
70 6 FORTRAN Source Codes

74 mtilinv(2,2)=-1.D0
75 mtilinv(2,3)=-1.D0/E
76 mtilinv(3,1)=dsign(1.D0,s)
77 mtilinv(3,2)=Epl(epspl)/E
78 mtilinv(3,3)=-1.D0/E
79 do q=1,3
80 do p=1,3
81 v(q,j+1)=v(q,j)-E/(E+Epl(epspl))*
82 & mtilinv(q,p)*m(p)
83 end do
84 end do
85 s=v(1,j+1)
86 epspl=v(2,j+1)
87 dl=v(3,j+1)
88 tol=0
89 do q=1,3
90 tol=tol+(v(q,j+1)-v(q,j))**2
91 end do
92 tol=sqrt(tol)
93 if(tol.lt.tolCPP)then
94 CPPtolexceeded=.false.
95 end if
96 end do
97 end
98

99 function funF(s,funK)
100 implicit none
101 real*8 funF,s,funK
102 funF=abs(s)-funK
103 end
104

105 function funK(epspl,kinit,Epl,linCPP)


106 implicit none
107 real*8 funK,epspl,kinit,Epl
108 logical linCPP
109 if(linCPP)then
110 funK=kinit+Epl*epspl
111 else
112 funK=kinit+1.29D4*epspl-1.25D5*epspl**2
113 end if
114 end
115
116 function Epl(epspl)
117 implicit none
118 real*8 Epl,epspl
119 Epl=1.29D4-2.5D5*epspl
120 end
6.4 Three-Dimensional Finite Element Model 71

6.4 Three-Dimensional Finite Element Model

TestFile3D.f (main file)


1 program TestFile3D
2 implicit none
3 real*8 E,nu,deps(100),eps(100),ds(100),s(100),
4 & depl(100),epl(100),dl,kappa
5 integer i,inc
6 E=7.3D4
7 nu=0.3D0
8 inc=0
9 kappa=0.D0
10 dl=0.D0
11 do i=1,6
12 s(i)=0.D0
13 epl(i)=0D0
14 ds(i)=0.D0
15 depl(i)=0.D0
16 end do
17 open(unit=1,file=’_Out.txt’)
18 do inc=1,10
19 deps(1)=5.35898D-5
20 deps(2)=-6.66667D-4
21 deps(3)=2.00000D-3
22 deps(4)=-1.05897D-4
23 deps(5)=3.33333D-4
24 deps(6)=9.834192D-4
25 do i=1,6
26 eps(i)=deps(i)*(inc-1)
27 end do
28 if(inc.eq.1)then
29 write(unit=1,fmt=’(a,t4,f10.2)’)’E=’,E,
30 & ’nu=’,nu
31 10 format (t08,a,t25,a,t40,a,t54,a,t68,a)
32 write(unit=1,fmt=’(/)’)
33 write(unit=1,fmt=’(t10,a)’)"input:"
34 write(unit=1,fmt=’(/)’)
35 write(unit=1,fmt=’(t10,a)’)"deps"
36 do i=1,6
37 write(unit=1,fmt=’(f23.20)’) deps(i)
38 end do
39 20 format (f15.10,f15.10,f15.10,f15.10,f15.10)
40 30 format (f20.10,f20.10)
41 write(unit=1,fmt=’(/)’)
42 write(unit=1,fmt=10)"eps","ds","s","depl",
43 & "epl"
44 write(unit=1,fmt=’(/)’)
45 do i=1,6
46 write(unit=1,fmt=20)eps(i),ds(i),s(i),
47 & depl(i),epl(i)
48 end do
72 6 FORTRAN Source Codes

49 write(unit=1,fmt=’(/)’)
50 write(unit=1,fmt=10)"dl","kappa"
51 write(unit=1,fmt=30)dl,kappa
52 end if
53 write(unit=1,fmt=’(a)’),’!!!!!!!!!!!!!!!!!!!!’
54 write(unit=1,fmt=’(t30,a,i3.2)’) ’inc=’,inc
55 call CPP3D(E,nu,deps,eps,ds,s,depl,epl,
56 & dl,kappa)
57 write(unit=1,fmt=’(/)’)
58 write(unit=1,fmt=’(a)’)"output:"
59 write(unit=1,fmt=’(t10,a)’)"deps"
60 do i=1,6
61 write(unit=1,fmt=’(f20.10)’)deps(i)
62 end do
63 write(unit=1,fmt=’(/)’)
64 write(unit=1,fmt=10)"eps","ds","s","depl","epl"
65 do i=1,6
66 write(unit=1,fmt=20)eps(i),ds(i),s(i),depl(i),
67 & epl(i)
68 end do
69 write(unit=1,fmt=’(/)’)
70 write(unit=1,fmt=10)"dl","kappa"
71 write(unit=1,fmt=30)dl,kappa
72 end do
73 close(unit=1)
74 end
75 include ’UserSubroutines3D.f’
76 include ’CommonSubroutines3D.f’

The file ‘UserSubroutines3D.f’ contains subroutines that the user may varify.
Unlike before, there is no input file. Therefore, the code must be modified within the
respective subroutine.

UserSubroutines3D.f
1 subroutine CPP3D(E,nu,deps,eps,ds,s,
2 & depl,epl,dl,kappa)
3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4 !E - (const.) YOUNG’s modulus [MPa] !
5 !nu - (const.) POISSON’s number [-] !
6 !deps - (const.) strain increment vector[-] !
7 !ds - stress increment vector [MPa] !
8 !s - stress vector [MPa] !
9 !depl - plastic strain increment vector [-] !
10 !epl - plastic strain vector [-] !
11 !dl - effective plastic strain increment [-] !
12 !kappa - effective plastic strain [-] !
13 !eps - total strain vector [-] !
14 !st - trial stress vector (predictor) [MPa] !
15 !v0 - solution vector at beginning of inc. !
16 !vt - solution vector at trial stress state !
17 !v - solution vector at current iteration !
18 !vold - solution vector at previous iteration !
6.4 Three-Dimensional Finite Element Model 73

19 ! ->units [v(1-6)]=MPa,[v(7-8)]=[-] !
20 !tol - user prescribed tolerance [-] !
21 !F - yield function [MPa] !
22 !tolex - true if tolerance is exceeded !
23 !i - increment counter !
24 !it - iteration counter !
25 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26 implicit none
27 real*8 E,nu,deps(100),ds(100),s(100),depl(100),
28 & epl(100),dl,kappa,eps(100),st(100),v0(100),
29 & vt(100),v(100),vold(100),tol,F
30 logical tolex
31 integer i,it
32 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 !set tolerance here: !
34 tol=1.D-8
35 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
36 it=0
37 call getv(v0,s,kappa,0.D0)
38 call geteps(eps,deps)
39 40 format (a,i2.2,a,f15.5)
40 write(unit=1,fmt=’(/)’)
41 do i=1,8
42 write(unit=1,fmt=40) "v0(",i,")=",v0(i)
43 end do
44 call getst(st,deps,s,nu,E)
45 write(unit=1,fmt=’(/)’)
46 do i=1,6
47 write(unit=1,fmt=40) "st(",i,")=",st(i)
48 end do
49 call getv(vt,st,kappa,0.D0)
50 write(unit=1,fmt=’(/)’)
51 do i=1,8
52 write(unit=1,fmt=40) "vt(",i,")=",vt(i)
53 end do
54 call getv(v,st,kappa,0.D0)
55 write(unit=1,fmt=’(/)’)
56 do i=1,8
57 write(unit=1,fmt=40) "v(",i,")=",v(i)
58 end do
59 call getF(F,vt)
60 if (F.le.0.D0) then
61 call getuk(v,v0,ds,s,depl,epl,dl,kappa,
62 & deps,eps)
63 it=it+1
64 else
65 30 format (a,f20.16)
66 write(unit=1,fmt=30) "F=",F
67 tolex=.true.
68 do while (tolex)
69 it=it+1
70 write(unit=1,fmt=’(/)’)
71 write(unit=1,fmt=’(a,i5.3)’)"iteration:",it
74 6 FORTRAN Source Codes

72 write(unit=1,fmt=’(/)’)
73 call getvold(vold,v)
74 call iteratev(v,nu,E,vt,v0)
75 call checktol(tol,tolex,v,vold,it)
76 call getuk(v,v0,ds,s,depl,epl,dl,kappa,deps,
77 & eps)
78 end do
79 call getepl(epl,depl,v)
80 end if
81 end
82
83 subroutine geth(h,v0)
84 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
85 !evaluate hardening function h !
86 !seff - effective stress !
87 !r - function of flow direction !
88 !sinc - stress at beginning of increment !
89 !kappainc - eff. pl. strain at beginning of incr.!
90 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
91 implicit none
92 real*8 h,seff,r(100),sinc(100),kappainc,v0(100)
93 integer i
94 do i=1,6
95 sinc(i)=v0(i)
96 end do
97 kappainc=v0(7)
98 call getseff(seff,v0)
99 call getr(r,v0)
100 h=0.D0
101 do i=1,6
102 h=h+sinc(i)*r(i)/seff
103 end do
104 end
105
106 subroutine getdhds(dhds,v)
107 implicit none
108 real*8 dhds(100),v(100)
109 integer i
110 do i=1,6
111 dhds(i)=0.D0
112 end do
113 end
114
115 subroutine getdFdJ2dev(dFdJ2dev,v)
116 implicit none
117 real*8 v(100),dFdJ2dev,J2dev
118 call getJ2dev(J2dev,v)
119 dFdJ2dev=sqrt(3.D0)/(2.D0*sqrt(J2dev))
120 end
121
122 subroutine getd2FdJ2dev2(d2FdJ2dev2,v)
123 implicit none
124 real*8 d2FdJ2dev2,J2dev,v(100)
6.4 Three-Dimensional Finite Element Model 75

125 call getJ2dev(J2dev,v)


126 d2FdJ2dev2=-sqrt(3.D0)/(4.D0*(sqrt(J2dev))**3)
127 end
128

129 subroutine getk(k,kappa)


130 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
131 !evaluate yield stress k !
132 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
133 implicit none
134 real*8 kappa,k
135 k=3.010611D2+2.4554436D3*kappa-1.33040486D4
136 & *kappa**2+4.95572343D4*kappa**3-1.1584D5
137 & *kappa**4+1.5482D5*kappa**5-8.86898587D4
138 & *kappa**6
139 end
140
141 subroutine getdFdkappa(dFdkappa,kappa)
142 implicit none
143 real*8 dFdkappa,kappa,k
144 call getk(k,kappa)
145 dFdkappa=2.4554436D3-2.66080972D4*kappa
146 & +1.486717029D5*kappa**2-4.63360D5*kappa**3
147 & +7.741D5*kappa**4-5.321391522D5*kappa**5
148 end
149

150 subroutine getr(r,v0)


151 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
152 !evaluate function of flow direction r !
153 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
154 implicit none
155 real*8 r(100),v0(100),dFds(100),sinc(100)
156 integer i
157 call getdFds(dFds,v0)
158 do i=1,6
159 r(i)=dFds(i)
160 end do
161 end
162

163 subroutine getseff(seff,v)


164 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
165 !evaluate effective stress seff !
166 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
167 implicit none
168 real*8 seff,v(100),F,k,J2dev
169 call getJ2dev(J2dev,v)
170 seff=sqrt(3*J2dev)
171 end
172

173 subroutine getdrds(drds,v)


174 implicit none
175 real*8 drds(100,100),v(100)
176 integer i,j
177 do i=1,6
76 6 FORTRAN Source Codes

178 do j=1,6
179 drds(i,j)=0.D0
180 end do
181 end do
182 end

The file ‘CommonSubroutines3D.f’ contains subroutines that do not require mod-


ification by the user, as they are independent of user input.

CommonSubroutines3D.f
1 subroutine getF(F,v)
2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3 !evaluate yield function F !
4 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5 implicit none
6 real*8 F,k,seff,v(100)
7 call getk(k,v(7))
8 call getseff(seff,v)
9 F=seff-k
10 end
11

12 subroutine getepl(epl,depl,v)
13 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14 !evaluate accumulated plastic strain vector epl !
15 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 implicit none
17 real*8 v(100),epl(100),depl(100),dFds(100)
18 integer i
19 call getdFds(dFds,v)
20 do i=1,6
21 depl(i)=dFds(i)*v(8)
22 epl(i)=epl(i)+depl(i)
23 end do
24 end
25
26 subroutine geteps(eps,deps)
27 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28 !evaluate accumulated total strain vector eps !
29 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
30 implicit none
31 real*8 deps(100),eps(100)
32 integer i
33 do i=1,6
34 eps(i)=eps(i)+deps(i)
35 end do
36 end
37
38 subroutine getuk(v,v0,ds,s,depl,epl,dl,kappa,
39 & deps,eps)
40 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41 !read unknowns from solution vector v !
42 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6.4 Three-Dimensional Finite Element Model 77

43 implicit none
44 real*8 v(100),v0(100),deps(100),ds(100),s(100),
45 & dl,kappa,eps(100),depl(100),epl(100),dFds(100)
46 integer i
47 do i=1,6
48 ds(i)=v(i)-v0(i)
49 s(i)=v(i)
50 end do
51 kappa=v(7)
52 dl=v(8)
53 end
54
55 subroutine getidty(idty,n)
56 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57 !create identity matrix of rank nxn !
58 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59 implicit none
60 real*8 idty(100,100)
61 integer n,i,j
62 do i=1,n
63 do j=1,n
64 if (i.eq.j)then
65 idty(i,j)=1.D0
66 else
67 idty(i,j)=0.D0
68 end if
69 end do
70 end do
71 end
72
73 subroutine getC(C,nu,E)
74 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 !create elasticity matrix of rank 6x6 !
76 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
77 implicit none
78 real*8 C(100,100),nu,E,L(100,100),Linv(100,100),
79 & aux1(100)
80 integer i,j
81 call getaux1(aux1)
82 call getL(L)
83 call matrixinv(L,Linv,6)
84 do i=1,6
85 do j=1,6
86 C(i,j)=0.D0
87 end do
88 end do
89 do i=1,6
90 do j=1,6
91 C(i,j)=C(i,j)+E/(1.D0+nu)*(nu/(1.D0-2.D0*nu)
92 & *aux1(i)*aux1(j)+Linv(i,j))
93 end do
94 end do
95 end
78 6 FORTRAN Source Codes

96
97 subroutine getL(L)
98 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
99 !create diagonal matrix L={1,1,1,2,2,2} !
100 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
101 implicit none
102 real*8 L(100,100)
103 integer i,j
104 do i=1,6
105 do j=1,6
106 if (i.eq.j) then
107 if (i.lt.4) then
108 L(i,j)=1.D0
109 else
110 L(i,j)=2.D0
111 end if
112 else
113 L(i,j)=0.D0
114 end if
115 end do
116 end do
117 end
118
119 subroutine getaux1(aux1)
120 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
121 !create vector aux1=[1,1,1,0,0,0]^T !
122 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
123 implicit none
124 real*8 aux1(100)
125 integer i
126 do i=1,3
127 aux1(i)=1.D0
128 end do
129 do i=4,6
130 aux1(i)=0.D0
131 end do
132 end
133

134 subroutine getaux2(aux2)


135 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
136 !create vector aux2=[1,1,1,2,2,2]^T !
137 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
138 implicit none
139 real*8 aux2(100)
140 integer i
141 do i=1,3
142 aux2(i)=1.D0
143 end do
144 do i=4,6
145 aux2(i)=2.D0
146 end do
147 end
148
6.4 Three-Dimensional Finite Element Model 79

149 subroutine getst(st,deps,s,nu,E)


150 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
151 !evaluate trial stress st (elastic predictor) !
152 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
153 implicit none
154 real*8 st(100),deps(100),s(100),nu,E,C(100,100)
155 integer i,j
156 call getC(C,nu,E)
157 do i=1,6
158 st(i)=s(i)
159 end do
160 do i=1,6
161 do j=1,6
162 st(i)=st(i)+C(i,j)*deps(j)
163 end do
164 end do
165 end
166
167 subroutine getv(v,s,kappa,dl)
168 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
169 !update current solution vector v !
170 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
171 implicit none
172 real*8 kappa,dl,s(100),v(100)
173 integer i
174 do i=1,6
175 v(i)=s(i)
176 end do
177 v(7)=kappa
178 v(8)=dl
179 end
180

181 subroutine getvold(vold,v)


182 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
183 !update solution vector vold of prev. increment !
184 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
185 implicit none
186 real*8 v(100),vold(100)
187 integer i
188 do i=1,8
189 vold(i)=v(i)
190 end do
191 end
192

193 subroutine getm(m,v,nu,E,vt,v0)


194 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
195 !evaluate residual vector m !
196 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
197 implicit none
198 real*8 v(100),nu,E,vt(100),v0(100),C(100,100),
199 & Cinv(100,100),r(100),st(100),h,F,m(100)
200 integer i,j
201 call getC(C,nu,E)
80 6 FORTRAN Source Codes

202 call matrixinv(C,Cinv,6)


203 call getr(r,v0)
204 !call getr(r,v) !semi-implicit backwards Euler
205 do i=1,6
206 m(i)=0.D0
207 end do
208 do i=1,6
209 do j=1,6
210 m(i)=m(i)+Cinv(i,j)*(v(j)-vt(j))
211 end do
212 end do
213 do i=1,6
214 m(i)=m(i)+v(8)*r(i)
215 end do
216 call geth(h,v0)
217 !call geth(h,v) !semi-implicit backwards Euler
218 m(7)=-v(7)+vt(7)+v(8)*h
219 call getF(F,v)
220 m(8)=F
221 end
222
223 subroutine getdmdv(dmdv,v,nu,E,v0)
224 implicit none
225 real*8 dmdv(100,100),C(100,100),Cinv(100,100),
226 & drds(100,100),i6(100,100),dhds(100),h,dFds(100),
227 & r(100),dFdkappa,v(100),nu,E,v0(100)
228 integer i,j
229 call getC(C,nu,E)
230 call matrixinv(C,Cinv,6)
231 call geth(h,v0)
232 !call geth(h,v) !semi-implicit backwards Euler
233 30 format (a,f20.5)
234 write(unit=1,fmt=30)"h=",h
235 call getdrds(drds,v0)
236 !call getdrds(drds,v) !semi-impl. backwards Euler
237 call getr(r,v0)
238 !call getr(r,v) !semi-implicit backwards Euler
239 write(unit=1,fmt=’(/)’)
240 do i=1,6
241 40 format (a,i2.2,a,f17.5)
242 write(unit=1,fmt=40)"r(",i,")=",r(i)
243 end do
244 call getdFds(dFds,v)
245 write(unit=1,fmt=’(/)’)
246 do i=1,6
247 write(unit=1,fmt=40)"dFds(",i,")=",dFds(i)
248 end do
249 call getdFdkappa(dFdkappa,v(7))
250 write(unit=1,fmt=30)"dFdkappa=",dFdkappa
251 call getdhds(dhds,v)
252 write(unit=1,fmt=’(/)’)
253 do i=1,6
254 write(unit=1,fmt=40)"dhds(",i,")=",dhds(i)
6.4 Three-Dimensional Finite Element Model 81

255 end do
256 do i=1,6
257 do j=1,6
258 dmdv(i,j)=Cinv(i,j)+v(8)*drds(i,j)
259 end do
260 end do
261 do j=1,6
262 dmdv(7,j)=v(8)*dhds(j)
263 dmdv(8,j)=dFds(j)
264 end do
265 do i=1,6
266 dmdv(i,7)=0.D0
267 dmdv(i,8)=r(i)
268 end do
269 dmdv(7,7)=-1.D0
270 dmdv(7,8)=h
271 dmdv(8,7)=dFdkappa
272 dmdv(8,8)=0.D0
273 end
274
275 subroutine getJ2dev(J2dev,v)
276 implicit none
277 real*8 J2dev,sdev(100),v(100)
278 integer i,j
279 call getsdev(sdev,v)
280 J2dev=0.D0
281 do i=1,3
282 J2dev=J2dev+0.5D0*sdev(i)**2
283 end do
284 do i=4,6
285 J2dev=J2dev+sdev(i)**2
286 end do
287 end
288
289 subroutine getsdev(sdev,v)
290 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
291 !evaluate deviator of a vector, e.g. stress !
292 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
293 implicit none
294 real*8 v(100),sdev(100),J1
295 integer i
296 J1=v(1)+v(2)+v(3)
297 do i=1,3
298 sdev(i)=v(i)-J1/3.D0
299 end do
300 do i=4,6
301 sdev(i)=v(i)
302 end do
303 end
304
305 subroutine getdJ2devds(dJ2devds,v)
306 implicit none
307 real*8 v(100),dJ2devds(100),L(100,100),sdev(100)
82 6 FORTRAN Source Codes

308 integer i,j


309 call getL(L)
310 call getsdev(sdev,v)
311 do i=1,6
312 do j=1,6
313 dJ2devds(i)=0.D0
314 end do
315 end do
316 do i=1,6
317 do j=1,6
318 dJ2devds(i)=dJ2devds(i)+L(i,j)*sdev(j)
319 end do
320 end do
321 end
322
323 subroutine getd2J2devds2(d2J2devds2,v)
324 implicit none
325 real*8 d2J2devds2(100,100),v(100),L(100,100),
326 & i6(100,100),aux1(100)
327 integer i,j
328 call getL(L)
329 call getidty(i6,6)
330 call getaux1(aux1)
331 do i=1,6
332 do j=1,6
333 d2J2devds2(i,j)=0.D0
334 end do
335 end do
336 do i=1,6
337 do j=1,6
338 d2J2devds2(i,j)=L(i,j)*(i6(i,j)
339 & -aux1(i)*aux1(j)/3.D0)
340 end do
341 end do
342 end
343
344 subroutine checktol(tol,tolex,v,vold,it)
345 implicit none
346 real*8 tol,v(100),vold(100),tolit
347 integer i,it
348 logical tolex
349 tolit=0.D0
350 do i=1,8
351 tolit=tolit+(v(i)-vold(i))**2
352 end do
353 if (sqrt(tolit).lt.tol)tolex=.false.
354 write(unit=1,fmt=’(a,f40.32)’)"tolit=",tolit
355 end
356

357 subroutine iteratev(v,nu,E,vt,v0)


358 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
359 !iterate current solution vector v !
360 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6.4 Three-Dimensional Finite Element Model 83

361 implicit none


362 real*8 v(100),nu,E,vt(100),v0(100),dmdv(100,100),
363 & m(100),dmdvinv(100,100)
364 integer i,j
365 call getdmdv(dmdv,v,nu,E,v0)
366 call matrixinv(dmdv,dmdvinv,8)
367 call getm(m,v,nu,E,vt,v0)
368 do i=1,8
369 do j=1,8
370 v(i)=v(i)-dmdvinv(i,j)*m(j)
371 end do
372 end do
373 write(unit=1,fmt=’(/)’)
374 write(unit=1,fmt=’(t20,a,t45,a)’)"v","m"
375 do i=1,8
376 write(unit=1,fmt=’(f25.5,f25.5)’)v(i),m(i)
377 end do
378 end
379
380 subroutine getdFds(dFds,v)
381 implicit none
382 real*8 dFds(100),v(100),dJ2devds(100),dFdJ2dev
383 integer i
384 call getdJ2devds(dJ2devds,v)
385 call getdFdJ2dev(dFdJ2dev,v)
386 do i=1,6
387 dFds(i)=dFdJ2dev*dJ2devds(i)
388 end do
389 end
390
391 subroutine getd2Fds2(d2Fds2,v)
392 implicit none
393 real*8 v(100),d2Fds2(100,100),
394 & d2J2devds2(100,100),dJ2devds(100),
395 & d2FdJ2dev2,dFdJ2dev
396 integer i,j
397 call getdFdJ2dev(dFdJ2dev,v)
398 call getdJ2devds(dJ2devds,v)
399 call getd2FdJ2dev2(d2FdJ2dev2,v)
400 call getd2J2devds2(d2J2devds2,v)
401 do i=1,6
402 do j=1,6
403 d2Fds2(i,j)=d2FdJ2dev2*dJ2devds(i)
404 & *dJ2devds(j)+dFdJ2dev*d2J2devds2(i,j)
405 end do
406 end do
407 end
408

409 subroutine matrixinv(a,b,n)


410 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
411 !Author: Potirniche GP, P.E.,Ph.D. !
412 !University of Idaho !
413 !11 September, 2008 !
84 6 FORTRAN Source Codes

414 !subroutine evaluates inverse of nxn matrix !


415 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
416 implicit none
417 integer i,j,k,l,m,n,irow
418 real*8 big,a(100,100),b(100,100),dum
419 do i=1,n
420 do j=1,n
421 b(i,j)=0.0D0
422 end do
423 b(i,i)=1.0D0
424 end do
425 do i=1,n
426 big=a(i,i)
427 do j=i,n
428 if(a(j,i).gt.big)then
429 big=a(j,i)
430 irow=j
431 end if
432 end do
433 if (big.gt.a(i,i))then
434 do k=1,n
435 dum=a(i,k)
436 a(i,k)=a(irow,k)
437 a(irow,k)=dum
438 dum=b(i,k)
439 b(i,k)=b(irow,k)
440 b(irow,k)=dum
441 end do
442 end if
443 dum=a(i,i)
444 do j=1,n
445 a(i,j)=a(i,j)/dum
446 b(i,j)=b(i,j)/dum
447 end do
448 do j=i+1,n
449 dum=a(j,i)
450 do k=1,n
451 a(j,k)=a(j,k)-dum*a(i,k)
452 b(j,k)=b(j,k)-dum*b(i,k)
453 end do
454 end do
455 end do
456 do i=1,n-1
457 do j=i+1,n
458 dum=a(i,j)
459 do l=1,n
460 a(i,l)=a(i,l)-dum*a(j,l)
461 b(i,l)=b(i,l)-dum*b(j,l)
462 end do
463 end do
464 end do
465 end
Appendix A
FORTRAN Variables

The following Tables A.1–A.5 contains a list of all variables used in the Fortran
codes:

Table A.1 List of deformation related variables used in the Fortran codes
Deformation
Type Variable Symbol Unit Description
j+1
Real*8 eps εn+1 [−] Strain at current increment and
iteration
Real*8 epsinc εn [−] Strain at previous increment
j
Real*8 epsit εn+1 [−] Strain at current increment and
previous iteration
j+1
Real*8 deps εn [−] Strain increment at current iteration
j+1
Real*8 epspl κn+1 [−] Effective plastic strain at current
increment and iteration
Real*8 epsplinc κn [−] Effective plastic strain at previous
increment
Real*8 epsplt κn+1
t [−] Trial effective plastic strain at current
increment
Real*8 dl λ [−] Consistency parameter
Real*8 utot u tot [−] Total user prescribed displacement
j+1
Real*8 du u n [−] Displacement increment at current
iteration
j+1
Real*8 u u n+1 [−] Displacement at current increment and
iteration
Real*8 uinc un [−] Displacement at previous increment
j
Real*8 uit u n+1 [−] Displacement at current increment and
previous iteration

The Author(s) 2018 85


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6
86 Appendix A: FORTRAN Variables

Table A.2 List of stress and force related variables used in the Fortran codes
Stress and force
Type Variable Symbol Unit Description
j+1
Real*8 ds σn [MPa] Stress increment at current
iteration
j+1
Real*8 s σn+1 [MPa] Stress at current increment and
iteration
 j+1
Real*8 sdev σ n+1 [MPa] Deviatoric stress at current
increment and iteration
Real*8 sinc σn [MPa] Stress at previous iteration
Real*8 st σn+1
t
[MPa] Trial stress at current increment
Real*8 funF F(σ, k(κ)) [MPa] Yield function
∂F
Real*8 dFds ∂σ [−] Derivative of the yield function
with respect to the stress
∂F
 1

Real*8 dFdJ2dev  MPa Derivative of the yield function
∂ J2
∂2 F
 1

Real*8 d2Fds2 ∂σ 2 MPa Second derivative of the yield
function
 
∂2 F 1
Real*8 d2FdJ2dev2  2 Second derivative of the yield
∂ J2
 MPa2
function
Real*8 r r [−] Function of flow direction
Real*8 seff σeff [−] Effective stress

Real*8 J2dev J2 [−] Second deviatoric invariant
j+1
Real*8 v vn+1 [MPa, −] Solution vector at current
increment and iteration
j=0
Real*8 v0 vn+1 [MPa, −] Solution vector at the beginning of
the increment
Real*8 vt vtn+1 [MPa, −] Solution vector at the trial state
j
Real*8 vold vn+1 [MPa, −] Solution vector at previous
iteration
j+1
Real*8 m mn+1 [MPa, −] Residual vector at current
increment and iteration
 ∂m j+1  
MPa , −
1
Real*8 dmdv ∂v n+1 Residual matrix of derivatives with
respect to the solution vector
 −1
∂m j+1
Real*8 dmdvinv ∂v n+1 [MPa, −] Residual matrix inverse (3D)
 j+1 −1
∂m
Real*8 mtilinv ∂v n+1 [MPa, −] Residual matrix inverse (1D)
Real*8 Ftot Ftot [N] Total user prescribed force
j+1
Real*8 F Fn+1 [N] Force at current increment and
iteration
j+1
Real*8 dF Fn [N] Force increment at current iteration
j+1
Real*8 r rn+1 [N] Force residual at the current
increment and iteration
Appendix A: FORTRAN Variables 87

Table A.3 List of geometry parameters used in the Fortran codes


Geometry parameters
Type Variable Symbol Unit Description
 2
Real*8 A A m Cross-sectional area of specimen
Real*8 L L [m] Length of specimen
Integer ele ele [−] Total number of elements
Integer m m [−] Element counter
Integer nod nod [−] Total number of nodes
Integer i i [−] Node counter

Table A.4 List of material parameters used in the Fortran codes


Material parameters
Type Variable Symbol Unit Description
Real*8 nu ν [−] Poisson ratio
j+1
Real*8 Etil Ẽ n [MPa] (Approximated) tangent modulus
at current iteration
Real*8 E E [MPa] Young’s modulus
Real*8 Epl E pl [MPa] Plastic modulus
Real*8 kinit k init [MPa] Initial yield stress
Real*8 Eelpl E elpl [MPa] Elasto-plastic modulus
 
j+1 kg
Real*8 K Kn s2
(Approximated) tangent stiffness at
current iteration
 
j+1 kg
Real*8 Km Kn s2
Tangent stiffness matrix at current
iteration
 
j+1 kg
Real*8 Kmred Kred,n s2
Reduced tangent stiffness matrix
(to enable matrix inversion)
   
j+1 −1 kg
Real*8 Kminv Kn 2 Tangent stiffness matrix inverse

m s 
kg
Real*8 Kserial (K ) s2
Sum of elemental stiffness inverses
m
Real*8 funK k(κ) [MPa] Yield stress
Real*8 h h [−] Hardening function
 
Real*8 dhds dh
dσ (MPa)−1 Derivative of the hardening
function with respect to the stress
88 Appendix A: FORTRAN Variables

Table A.5 List of miscellaneous parameters used in the Fortran codes


Miscellaneous
Type Variable Symbol Unit Description
Real*8 tolILoop tol [−] Tolerance of the
Newton- Raphson algorithm
j+1
which iterates εn
Real*8 junk − [−] Placeholder variable
Real*8 tol tol [−] Tolerance at current iteration
Real*8 tolCPP tol [−] Tolerance of the CPP algorithm
Integer inc inc [−] Total number of increments
Integer n n [−] Increment counter
Integer j j [−] Iteration counter (reset)
Integer z z [−] Iteration counter (not reset)
Integer it j [−] Iteration counter, used when j is
already assigned
Integer g − [−] Row counter
Integer p − [−] Row counter
Integer h − [−] Column counter
Integer q − [−] Column counter
Integer Input − [−] Input file label
Integer Output − [−] Output file label
Logical tolexceeded − [−] Boolean for tolerance check
Logical CPPtolexceeded − [−] Boolean for tolerance check
Logical tolex − [−] Boolean for tolerance check
Logical linCPP − [−] Flag, T: linear hardening function,
F: non-linear hardening function
Logical Fconrolled − [−] Flag, T: force-controlled setup, F:
displacement-controlled setup
Logical EqEle − [−] Flag, T: element parameters are
equal, F: individual parameters
References

1. Anandarajah A (2010) Computational methods in elasticity and plasticity: solids and porous
media. Springer, New York
2. Bathe K-J (1996) Finite element procedures. Prentice-Hall, Upper Saddle River
3. Beer FP, Johnston ER Jr, DeWolf JT, Mazurek DF (2009) Mechanics of materials. McGraw-
Hill, New York
4. Belytschko T, Liu WK, Moran B (2000) Nonlinear finite elements for continua and structures.
Wiley, Chichester
5. Betten J (2001) Kontinuumsmechanik. Springer, Berlin
6. Boresi AP, Schmidt RJ (2003) Advanced mechanics of materials. Wiley, New York
7. Borja RI (2013) Plasticity: modeling and computation. Springer, Berlin
8. Budynas RG (1999) Advanced strength and applied stress analysis. McGraw-Hill Book, Sin-
gapore
9. Chakrabarty J (2006) Theory of plasticity. Elsevier Butterworth-Heinemann, Oxford
10. Chakrabarty J (2010) Applied plasticity. Springer, New York
11. Chen WF, Saleeb AF (1982) Constitutive equations for engineering materials: elasticity and
modelling, vol 1. Wiley, New York
12. Cook RD, Malkus DS, Plesha ME, Witt RJ (2002) Concepts and applications of finite element
analysis. Wiley, New York
13. Courtney TH (1990) Mechanical behavior of materials. Waveland Press, Waveland
14. Crisfield MA (2000) Non-linear finite element analysis of solids and structures: advanced
topics, vol 2. Wiley, Chichester
15. Crisfield MA (2001) Non-linear finite element analysis of solids and structures: essentials, vol
1. Wiley, Chichester
16. de Neto EA, Souza Peric D, Owen DRJ (2008) Computational methods for plasticity: theory
and applications. Wiley, Chichester
17. Doltsinis I (2000) Elements of plasticity: theory and computation. WIT Press, Southampton
18. Dunne F, Petrinic N (2005) Introduction to computational plasticity. Oxford University Press,
Oxford
19. Eschenauer H, Olhoff N, Schnell W (1997) Applied structural mechanics: fundamentals of
elasticity, load-bearing structures, structural optimization. Springer, Berlin
20. Gere JM, Timoshenko SP (1991) Mechanics of materials. PWS-KENT Publishing Company,
Boston

The Author(s) 2018 89


M. Trapp and A. Öchsner, Computational Plasticity for Finite Elements,
SpringerBriefs in Computational Mechanics,
https://doi.org/10.1007/978-3-319-77206-6
90 References

21. Gosz M (2006) Finite element method: applications in solids, structures, and heat transfer.
Taylor & Francis Group, Boca Raton
22. Gross D, Hauger W, Schröder J, Wall WA (2009) Technische Mechanik 2: Elastostatik.
Springer, Berlin
23. Hartmann F, Katz C (2007) Structural analysis with finite elements. Springer, Berlin
24. Henninger C (2001) Studienarbeit am Lehrstuhl für Technische Mechanik: Implementierung
des Return-Mapping-Algorithmus ‘Closest-Point-Projection’ in das FE-System MSC.Marc.
Universität Erlangen, Nürnberg
25. Javanbakht Z, Öchsner A (2017) Advanced finite element simulation with MSC Marc: appli-
cation of user subroutines. Springer, Cham
26. Kim N (2015) Introduction to nonlinear finite element analysis. Springer, New York
27. MacNeal RH (1994) Finite elements: their design and performance. Marcel Dekker, New York
28. Mitchell AR, Griffiths DF (1980) The finite difference method in partial differential equations.
Wiley, New York
29. Moran B, Ortiz M, Shih CF (1990) Formulation of implicit finite element methods for multi-
plicative finite deformation plasticity. Int J Num Meth Eng 29:483–514
30. Öchsner A (2003) Experimentelle und numerische Untersuchung des elasto-plastischen Ver-
haltens zellularer Modellwerkstoffe. Universität Erlangen-Nürnberg, Erlangen
31. Öchsner A (2014) Elasto-plasticity of frame structure elements: modelling and simulation of
rods and beams. Springer, Berlin
32. Öchsner A, Merkel M (2013) One-dimensional finite elements: an introduction to the FE
method. Springer, Berlin
33. Öchsner A, Öchsner M (2018) A first introduction to the finite element analysis program MSC
Marc/Mentat. Springer, Cham
34. Owen DRJ, Hinton E (1980) Finite elements in plasticity: theory and practice. Pineridge Press
Limited, Swansea
35. Press WH, Teukolsky SA, Vetterling WT, Flannery BP (1997) Numerical recipies in Fortran
77. Cambridge University Press, Cambridge
36. Reddy JN (2004) An introduction to nonlinear finite element analysis. Oxford University Press,
Oxford
37. Reddy JN (2006) An introduction to the finite element method. McGraw Hill, Singapore
38. Rees DWA (2016) Mechanics of solids and structures. Imperial College Press, London
39. Simo JC, Hughes TJR (1998) Computational inelasticity. Springer, New York
40. Steinke P (2010) Finite-Elemente-Methode: Rechnergestützte Einführung. Springer, Berlin
41. Szabó I (2003) Einführung in die Technische Mechanik: Nach Vorlesungen István Szabó.
Springer, Berlin
42. Timoshenko SP, Goodier JN (1970) Theory of elasticity. McGraw-Hill, New York
43. Weimin H, Reddy BD (1999) Plasticity: mathematical theory and numerical analysis. Springer,
New York
44. Wriggers P (2008) Nonlinear finite element methods. Springer, Berlin

Das könnte Ihnen auch gefallen