User Subroutines in ABAQUS Saeid Poorasadion Ph.D. Candidate Mechanical Engineering Department Sharif University of Technology Email:
[email protected],
[email protected] Winter 2015
Contents
Introduction User Subroutines UMAT Writing UMAT Examples • 1D Elastic • Isotropic Hardening Plasticity • Neo-Hookean Hyperelasticity
VUMAT S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
2
Introduction
3
Introduction Finite Element Software Packages ANSYS Which Software?? ABAQUS LS-DYNA
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
4
Introduction Understanding the fundamental concepts of nonlinear finite element analysis: Selecting the best solution procedure and good strategy for developing a reasonable model • Selecting appropriate element and BCs
Developing a new solution procedure • New constitutive model for material • New element Textbook for Nonlinear FEM: Nonlinear finite elements for continua and structures (Belytschko, et al.) S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
5
Introduction Finite Element Method
Initial Displacements
Implicit method
Calculate Strain
If change of one or more sections in these solution is required, we should write a new code in a programming language!!?
Using Constitutive Model
< Tol
Calculate Stress Calculate Internal Force & Compare with External Force Using Constitutive Model
Solution Complete
Modify Displacements (Newton method)
Calculate Tangent Matrix
Calculate Tangent Stiffness Matrix S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
6
Introduction Main Problem Creating a software to simulate a specific application: – Simulating shape memory alloys – Creating a new element (B- spline element)
• Developing a finite element code in program languages – Limitation in BCs and geometry
• Adding an appropriate code to Finite Element Software Packages User Subroutines S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
7
User Subroutines
8
User Subroutines ABAQUS/Standard 6.10: 51 subroutines ABAQUS/Explicit 6.10: 20 subroutines FORTRAN code (.for) Some popular user subroutines in ABAQUS/Standard DLOAD VDLOAD UMAT VUMAT UEL VUEL UHYPER
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
9
User Subroutines Where User Subroutines Fit into ABAQUS/Standard
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
10
User Subroutines Where User Subroutines Fit into ABAQUS/Standard
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
11
User Subroutines Where User Subroutines Fit into ABAQUS/Standard
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
12
User Subroutines Where User Subroutines Fit into ABAQUS/Standard
User Subroutines & Scripting Interface??
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
13
Programming To include user subroutines in an analysis: Through ABAQUS execution command • abaqus job=my_analysis user=my_subroutine
Through ABAQUS/CAE • Job Module > General Tab>Address to User Subroutine file
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
14
Programming To include user subroutines in an analysis: Through ABAQUS execution command • abaqus job=my_analysis user=my_subroutine
Through ABAQUS/CAE • Job Module > General Tab>Address to User Subroutine file
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
15
Programming Compiling and Linking User Subroutines A correct compile and link commands should be used automatically • Microsoft Visual Studio • Intel Visual Fortran Compiler
IMPORTANT: Consistency among the above software
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
16
Programming Subroutine Argument Lists Variables to be defined Variables that can be defined Variables passed in for information
Naming Conventions Subroutines or COMMON blocks should begin with the letter K
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
17
UMAT User-defined Material
18
UMAT FEM 1.Initial Displacements For increment i
Pre-Processing (Boundary Condition Geometry, Mesh External Nodal Force)
2.Calculate Internal Nodal Force for element 3.Calculate tangent Stiffness Matrix for element 1.Assembly Internal Nodal Force Stress, DS/De 2.Assembly tangent Stiffness Matrix 3.Apply Boundary Condition 4.Check Convergence if yes GOTO 1
Define B matrix
UMAT Calculate Stress Calculate Tangent Moduli
5.Modify Displacements GOTO 2
Define Internal Nodal Force Define Tangent Stiffness Matrix S.Poorasadion
User Subroutines in ABAQUS
Post-Processing (Stress Displacement Internal Nodal Force) Winter 2015
19
UMAT
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
20
UMAT
Called at all material calculation points of elements (Gauss points)
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
21
UMAT Allows you to implement general constitutive equation Define any constitutive model of arbitrary complexity User-defined material models can be used with any ABAQUS structural element type Multiple user materials can be implemented in a single UMAT routine and can be used together
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
22
UMAT Interface
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
23
UMAT Interface
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
24
Storage of Stress and Strain Components Stresses and strains are stored as vectors For plane stress elements: σ_xx, σ_yy, σ_xy For plane strain and axisymmetric elements: σ_xx, σ_yy, σ_zz, σ_xy The shear strain is stored as engineering shear strain
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
25
UMAT Variables Variables to be defined DDSDDE(NTENS,NTENS) STRESS(NTENS)
1 J C J
• “true” (Cauchy) stress.
STATEV(NSTATV) SSE, SPD and SCD • Elastic strain energy, plastic dissipation, and “creep” dissipation. • No effect on the solution and using for energy output
Only in a fully coupled thermal-stress analysis • RPL (Volumetric heat generation per unit time) • DDSDDT(NTENS), DRPLDE(NTENS), DRPLDT S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
26
UMAT Variables Variables that can be defined PNEWDT • Ratio of suggested new time increment to the time increment being used
Variables passed in for information STRAN(NTENS), DSTRAN(NTENS) • The mechanical strains • In finite-strain problems, approximations to logarithmic strain.
TIME, DTIME TEMP, DTEMP PREDEF, DPRED S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
27
UMAT Variables Variables passed in for information (continued) CMNAME NDI, NSHR, NTENS • Number of direct, shear, total stress components
NSTATV PROPS(NPROPS), NPROPS COORDS DROT(3,3) • Rotation increment matrix
CELENT • Characteristic element length S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
28
UMAT Variables Variables passed in for information (continued) DFGRD0(3,3), DFGRD1(3,3) NOEL, NPT • Element, integration point numbers
LAYER, KSPT • Layer, section point numbers
KSTEP, KINC • Step, increment numbers
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
29
Running UMAT
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
30
Running UMAT
Variable: PROPS
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
31
Running UMAT
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
32
Running UMAT
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
33
Running UMAT
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
34
Writing UMAT
35
Writing UMAT Write a code in MATLAB (Debugging in MATLAB is fast and easy) Check MATLAB code with benchmark problems (for example uniaxial test)
Strain, Information
MATLAB Code
Stress, DS/De
Transfer MATLAB code to FORTRAN code S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
36
Transfer MATLAB Code to FORTRAN Code
MATLAB FORTRAN
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
37
Debugging When assigning a value to a double precision variable, D-scientific notation should be used. Output
Fortran Code
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
38
Debugging Which is correct?
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
39
Debugging Error: Problem during compilation
Go to file job_name.log in work directory (temp) S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
40
Debugging Divide by zero 5/0.d0 a/b when b is zero in first time (STRAN and DSTRAN are zero in first time)
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
41
Debugging Write or print a parameter in Data File tab write (6,*) 'tt‘ , KINC, …
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
42
Example 1: 1D Elastic
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
43
Small Strain, Large Rotation Turn on Nlgeom in Steps STRAN, DSTRAN and STRESS have been rotated to account for rigid body motion in the increment before UMAT the basis system for the material point rotates with the material DROT: Rigid body rotation Use this variable to rotate internal variable in constitutive model. • Plastic strain S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
44
Large Strain, Large Rotation Turn on Nlgeom in Steps STRESS is Cauchy stress and have been rotated to account for rigid body motion in the increment before UMAT. Use DFGRD0 and DFGRD1 The deformation gradient is available for solid (continuum) elements, membranes, and finitestrain shells. It is not available for beams or smallstrain shells DROT: Rigid body rotation S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
45
Large Strain, Large Rotation The consistent Jacobian should be used to ensure rapid convergence. The exact consistent Jacobian C W C W Ii
W I i
J
C I i C W S 2 4 C CC CE Fim Fjn Fkp FlqC mnpq
C
S2 CCE C ijkl
c
W
2
K S.Poorasadion
B T C BdV
User Subroutines in ABAQUS
c JC : D 1 J
J
D
T dV Winter 2015
46
Examples
47
Example 2: Neo-Hookean Hyperelasticity Neo-Hookean Free energy relationship I 2 1 1 U C 10 3 J 1 2 D1 J 3
The Cauchy and PK2 stress tensor U I 1 U U J S 2 2 C J C I 1 C I 1 1 2 2 2/3 1 C 10J I C J J 1 C D J 3 1
2 1 2 C 10 B tr B I J 1 I D1 J 3 S.Poorasadion
User Subroutines in ABAQUS
C 10 2 K D1 2
I 1
ij
C J J C 1 C B Winter 2015
1 J
2/ 3
B 48
Example 2: Neo-Hookean Hyperelasticity The material Jacobian derives from the variation in Kirchhoff stress JC : D The material Jacobian
CSE C ijkl
2U S 4 2 CC C SE Fim Fjn Fkp FlqC mnpq
Relations 5.4.43 and 5.4.50 in Textbook
1 2 C ijkl C 10 ij B jl Bik jl il B jk Bil jk 2 J 2 2 2 2 ij Bkl Bij kl ij kl Bmm 2J 1 ij kl 3 3 9 D1 S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
49
Example 2: Neo-Hookean Hyperelasticity
Main Box
Define Array and Constant
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
50
Example 2: Neo-Hookean Hyperelasticity
Calculate Material Parameter
Calculate J and Distortion Tensor
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
51
Example 2: Neo-Hookean Hyperelasticity Calculate deviatoric left Cauchy-Green deformation tensor
B FFT Calculate Cauchy Stress 2 1 C 10 B tr B I J 3 2 J 1 I D1 S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
52
Example 2: Neo-Hookean Hyperelasticity
Calculate material Jacobian
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
53
Hyperelastic Materials Derivation of consistent Jacobian is difficult CSE C ijkl
S.Poorasadion
2U S 4 2 CC C SE Fim Fjn Fkp FlqC mnpq
User Subroutines in ABAQUS
Winter 2015
54
Hyperelastic Materials Derivation of consistent Jacobian is difficult CSE C ijkl
2U S 4 2 CC C SE Fim Fjn Fkp FlqC mnpq
Hyperelastic materials are often implemented more easily in user Subroutine UHYPER
Because of requiring the values of the derivatives of the strain energy density function respect to the strain invariants S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
55
Example 3: Isotropic Hardening Plasticity Elasticity:
el ij ij kk 2 ijel
Yield function: 3 S ij S ij Y pl 2
0
S ij
1 ij ij kk 3
Equivalent plastic strain t
Plastic flow law ijpl S.Poorasadion
pl
0
pl dt , pl
2 pl pl ij ij 3
3 S ij pl 2 Y User Subroutines in ABAQUS
Winter 2015
56
Example 3: Isotropic Hardening Plasticity We first calculate the von Mises stress based on purely elastic behavior (elastic predictor). If the elastic predictor is larger than the current yield stress, plastic flow occurs. The radial return method is used to integrate the equations. The consistent Jacobian: *
ij ij kk
ij S.Poorasadion
S ijpr
pr
h * 2 ij 3 ij kl kl 1 h / 3 *
*
,
Y pr
d Y 2 * , k , h 3 d pl *
User Subroutines in ABAQUS
Winter 2015
57
Example 3: Isotropic Hardening Plasticity We first calculate the von Mises stress based on purely elastic behavior (elastic predictor). If the elastic predictor is larger than the current yield This result also true for large-strain stress, plastic flow isoccurs. The radial returncalculations. method is used to integrate the equations. The consistent Jacobian: *
ij ij kk
ij S.Poorasadion
S ijpr
pr
h * 2 ij 3 ij kl kl 1 h / 3 *
*
,
Y pr
d Y 2 * , k , h 3 d pl *
User Subroutines in ABAQUS
Winter 2015
58
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
59
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
60
ijpl
3 pl S ij 2 ijpl Y Rotate Forward
ijpl n 1
ijpl n
S.Poorasadion
3 S ij pl 2 Y
User Subroutines in ABAQUS
n
Winter 2015
61
F > Tol No F > 0
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
62
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
63
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
64
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
65
VUMAT In ABAQUS/Explicit the user-defined material model is implemented in user subroutine VUMAT The material Jacobian does not need to be defined in VUMAT
UMAT or VUMAT???
S.Poorasadion
User Subroutines in ABAQUS
Winter 2015
66
اﻻ ﯾﺎ ا ﮫﺎ ا ﺴﺎ ﯽ ا ﮐﺎﺳﺎ و و ﮫﺎ
ﻖ آﺳﺎن ﻮد اول و ﯽ ا ﺘﺎد
Ho! O Saki, pass around and offer the bowl For love at first appeared easy, but difficulties have occurred