Skip to content

Repository files navigation

Final Year Project — Nonlinear Finite Element Analysis of Solids

LaTeX Fortran MATLAB Python Julia Jupyter

last commit repo size top language

Implementation, verification, and documentation of a large-strain finite element solver for hyperelastic solids, with an Abaqus user element (UEL) in Fortran and reference implementations in MATLAB, Python, and Julia.


1. Contents

This repository contains the source code, the models, the report, and the reference material for the project. The table that follows gives the primary directories.

Directory Contents
402report/ The project report in LaTeX (report.tex), the figures, the bibliography, and the Fortran source of the user element.
F/ The Abaqus models and the job directories for the user element.
P&N/ The presentation, the Bonet–Wood Chapter 8 derivations, and the related notes.
CODE_ACTUAL/ The primary implementation: the MATLAB solver (FLagSHyP) and the Python port (pyimp).
CODES_TRY/ Experimental implementations: the arc-length method, the Chapter 3 codes, and the tutorial codes.
books_codes/ The reference codes that accompany the textbooks (FLagSHyP MATLAB, FLagSHyP F90, and others).
A/, A2/, AV/ The LaTeX derivations of the kinematics chapters (polar decomposition, distortional decomposition).
SMA_UM_User_Material_Subroutine_for_Thermomechanic/ The user material (UMAT) for shape memory alloys and the related jobs.
books/, fortran_books/ The reference documents.

2. Theory

The solver obeys the theory of nonlinear continuum mechanics. The primary steps are as follows:

  1. Kinematics — The deformation gradient, the strain measures, and the polar decomposition.
  2. Stress measures — The Cauchy stress, the first and the second Piola–Kirchhoff stress.
  3. Constitutive laws — Isotropic hyperelasticity, and specifically the compressible neo-Hookean model. The derivations include the stress expression and the spatial material tangent.
  4. Virtual work — The integral form of the balance equation, and its linearization.
  5. Discretization — The element formulation and the Newton–Raphson solution algorithm.
  6. Verification — The case studies that compare the results of the user element with the results of the standard Abaqus element.

The report in 402report/report.pdf gives the full theory and the results.


3. The Abaqus user element

The Fortran source is in 402report/F/src/:

src/
├── main.for            # The UEL entry point
├── brick_element.for   # The 8-node hexahedral element
├── material_laws.for   # The constitutive models
└── UVARM.for           # The output variables

The models are in 402report/F/:

  • modelUEL.inp — The model that uses the user element.
  • modelABQ.inp — The equivalent model that uses the standard C3D8 element.
  • includes/ — The node data and the element data.

3.1 How to run the analysis

Compilation and analysis in one step:

abaqus job=modelUEL user=src/main.for interactive

The reference analysis:

abaqus job=modelABQ interactive

CAUTION: BEFORE YOU START THE ANALYSIS, MAKE SURE THAT THE FORTRAN COMPILER IS COMPATIBLE WITH THE ABAQUS VERSION. IF THE VERSIONS ARE NOT COMPATIBLE, THE COMPILATION WILL STOP AND THE JOB WILL FAIL.


4. The MATLAB implementation

The solver is in CODE_ACTUAL/code/. The entry point is FLagSHyP.m. The modules are as follows:

Module Function
input_reading/ Reads the input file and the mesh.
initialisation/ Prepares the data structures and the boundary conditions.
FEM_shape_functions/ Gives the shape functions and their derivatives.
kinematics/ Calculates the deformation gradient and the strain measures.
constitutive laws/ Calculates the stress and the tangent modulus.
element_calculations/ Calculates the element residual and the element stiffness.
global_assembly/ Assembles the global system.
solution_equations/ Solves the linear system.
solution_update/ Updates the displacements and the internal variables.
convergence_check/ Makes sure that the solution converged.
solution_write/ Writes the results.

4.1 How to run the solver

cd CODE_ACTUAL/code
FLagSHyP

Then, give the name of the job when the program asks for it.


5. The Python implementation

The Python port is in CODE_ACTUAL/pyimp/. It gives the same results as the MATLAB solver, but it is easier to read and to modify.

cd CODE_ACTUAL/pyimp
python -m pip install -r requirements.txt   # If the file is available
python main.py <job_name>

For more information, refer to CODE_ACTUAL/pyimp/DOCUMENTATION.md and to CODE_ACTUAL/pyimp/README.md. For the plots, refer to README_plotting.md.


6. The report

The report is written in LaTeX. To make the PDF, do the steps that follow:

cd 402report
latexmk -pdf report.tex

The output is report.pdf. The bibliography is in references.bib. The figures are in figures/.


7. The shape memory alloy material

The directory SMA_UM_User_Material_Subroutine_for_Thermomechanic/ contains a user material subroutine (UMAT) for the thermomechanical behavior of shape memory alloys. The subroutine uses the Lagoudas model. The job directories contain the test cases:

  • The shape memory effect (SME).
  • The isothermal and the non-isothermal tension.
  • The multi-load cases.

8. Excluded files

The solver output binaries are not in this repository. The .gitignore file excludes:

  • The Abaqus databases (*.odb) and the status files (*.stt).
  • The compiled artefacts (*.so, *.pyc, *.o, *.mod).
  • The bundled Julia installation in CODES_TRY/CH3_CODE/julia/.
  • The LaTeX intermediate files.

These files are large and you can make them again from the sources.


9. Software that is necessary

Software Use
Abaqus 2021 or later The user element and the user material.
A Fortran compiler (Intel oneAPI) The compilation of the subroutines.
MATLAB R2020a or later The primary solver.
Python 3.9 or later (NumPy, SciPy, Matplotlib) The Python port and the plots.
A LaTeX distribution (TeX Live or MiKTeX) The report and the presentation.
Julia 1.12 Some of the experimental codes in CODES_TRY/.

10. References

The primary references for the theory are:

  1. Bonet, J. and Wood, R.D. — Nonlinear Continuum Mechanics for Finite Element Analysis, 2nd edition.
  2. Crisfield, M.A. — Non-linear Finite Element Analysis of Solids and Structures, Volumes 1 and 2.
  3. Lagoudas, D.C. — Shape Memory Alloys: Modeling and Engineering Applications.

The full list is in 402report/references.bib.

About

Nonlinear finite element analysis of solids: large-strain hyperelastic solver with an Abaqus UEL in Fortran and reference implementations in MATLAB, Python and Julia

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages