DegreeTutors/Finite Element Analysis of Continuum Structures in Python

  • $97

Finite Element Analysis of Continuum Structures in Python

Use the Isoparametric Finite Element Method to build an analysis tool for 2D structures in Python.

Table of contents

1. Welcome and Preliminaries

Welcome to the course! By the time you finish this course you’ll have your own finite element solver for 2D solid structures and a workflow that allows you to model and analyse plane stress and plane strain structures.  

In this short introduction section I'll give you a brief roadmap for the course and give you a sense of what to expect and when. 

I'll also briefly comment on assumed prerequisite knowledge - in other words what you should have covered before taking this course, and also what you don't necessarily need to know. 
1. Introduction and course overview
Preview
2. What you should cover before this course
Preview
Support and Lecture Q&A (Please read!)

2. The Isoparametric Finite Element Method

In this section we’re going to cover the fundamentals theory that the course is built on. We’ll start by introducing some fundamental concepts like shape functions and see how we can apply them when deriving the stiffness matrix for a simple bar element. 

We’ll build on this and introduce the 4 node quad element and discuss how shape functions relate to this element. The middle of this section focuses on the strain-displacement matrix which is a key part of determining the element stiffness matrix. 

We’ll finish up by explaining how to determine the equivalent nodal loads for self-weight and surface forces. We’ll nail down the basic approach and implement a simple example in this section. 

Take your time with this section in particular - extra time spent here will pay off down the road. 
3. Section overview
Preview
4. Bar stiffness using generalised coordinates
5. Bar stiffness using shape functions
6. Quad elements and shape functions
7. The strain-displacement matrix, B
8. The Jacobian Matrix, J
9. Calculating the strain-displacement matrix
9.1 Jupyter Notebook - (lecture 9)
10. Accounting for plane-stress/strain
11. The equivalent surface force vector
12. The equivalent body force vector
12.1 Jupyter Notebook - (lectures 11-12)

3. Gauss-Legendre Numerical Integration

In this section we’re going to introduce the Gauss-Legendre numerical integration scheme.  This is a hugely valuable tool for complex integration and reduced the process down to a simple summation of terms. 

Like any numerical method, we’ll need to be mindful of how the accuracy of the technique is affected. So as well as demonstrating how to implement the scheme, we’re going spend some time understanding convergence and how to ensure accurate results. 

Once this section is complete - we’ve covered the bulk of the theory necessary to build our solver. 
13. Section overview
Preview
14. Gauss numerical integration scheme
15. Numerical integration in 2D
15.1 Jupyter Notebook - (lecture 15)
16. Calculating the element stiffness matrix
17. Stiffness matrix convergence
17.1 Jupyter Notebook - (lectures 16-17)

4. Generating Structure and Mesh Data

To really leverage the power of the finite element analysis technique, we need an efficient way of building a structural mesh to analyse. For this task we’re going to use Blender which can be downloaded for free from Blender.org. There are a number of ways we could go about this, but very few options provide us with the convenience and flexibility of Blender. 

After modelling a simply supported beam we’ll generate a mesh across that structure and then write some code to capture the mesh definition and export it to a csv. We’ll also write codes that allow us to define load locations and support conditions. All of this data will be exported to csv files. 

The next step is to bring this data into our Jupyter Notebook - so in the final lecture in this section we’ll write code that imports this data into our Notebook ready for processing in the next section. 
18. Section overview
Preview
19. Generating a simple quad mesh in Blender
20. Exporting mesh data from Blender
21. Exporting support and point load data
21.1 Blender File (lectures 19-21)
22. Importing support, loading and mesh data
22.1 Jupyter Notebook - (lecture 22)

5. Implementing the Isoparametric Finite Element Method

This is the section where it all comes together - all of earlier theory and the mesh data we generated in the previous section. In this section we’re going to  build the core of our solver. This means we’ll build the structure stiffness matrix and solve the system of equations that is the mathematical representation of our structure. 

We’ll round out the section with a validation exercise and compare the deflections from our finite element analysis with those from a simple Euler-Bernoulli deflection calculation. 

Completing this section is a key milestone in our development as we’ll have implemented the core solver. After this our job is to squeeze as much additional information from our model as possible….and generate those nice stress distribution plots!
23. Section overview
Preview
24. Analysis parameters and plotting the structure
25. Building the global force vector
26. Defining the element stiffness matrix
27. Assigning element stiffness coefficients
28. Building the structure stiffness matrix
29. Solving the structure
30. Visualising the deformed structure
31. Generating detailed text output
32. Euler-Bernoulli deflection validation
32.1 Jupyter Notebook - (lectures 24-32)
Mid-course check-in

6. Visualising the Strain and Stress Fields

This section is about mining for the additional information embedded within our model. We’re going to focus on building stress contour maps that show us how the different stresses vary throughout the structure. 

Before working through this section, you might find it helpful to review the stress analysis lectures in the appendix. Particularly if you’re not familiar with the concept of normal and shear strains and stresses at a point and the purpose of stress transformation equations. 

We’ll finish this section with another validation exercise and compare the stress distributions from our FE analysis with normal and shear stress distributions from fundamental beam theory. 
33. Section overview
Preview
34. Generating the stress calculation grid
35. Visualising the stress calculation grid
36. Calculating the strain and stress fields
37. Visualising the normal stress distribution
38. Building normal strain/stress contour plots
39. Building shear stress/strain contour plots
40. Building a stress/strain interpolation query function
41. Visualising stress distributions at a vertical section
42. Euler-Bernoulli stress comparison
42.2 Jupyter Notebook - (lectures 34-42)

7. Implementing Area and Volume Forces

In this section we’re going to implement the ability for our code to simulate the influence of area and body forces. We’ve already implemented both of these calculations for a single element in section 2 - here we’ll just scale this up for our entire structure.

We’ll start with body forces or self-weight. After this we’ll move on to surface forces. For surface forces we’ll start off in Blender by identifying the location and magnitude of our surface forces. Once these are defined in Blender, we’ll export this information into our notebook and set about building the functionality.

Once this section is complete we’re about 75-80% complete and have a capable solver on our hands. 
43. Section overview
Preview
44. Implementing self-weight in our analysis
45. Correcting reactions for self-weight
46. Distributed loading - Interpolation limits
47. Distributed loading - Data export from Blender
48. Importing distributed loading data
49. Surface force vector - Setup
50. Surface force vector - Integration
51. Updating the global force vector and validating
52. Orthogonal surface forces
52.1 Jupyter Notebook - (lectures 44-52)

8. Principal Stresses and von Mises stress

This section is really about adding bells and whistles or polish to our solver in the form of Principal Stress and von Mises stress distribution plots. We’ll start off with a brief review of principal stresses. If you want to dig a little deeper on the topic before taking on this section - jump down to the appendix where I cover Principal Stresses in more detail. 

After reviewing principal stresses in theory - we’ll use our existing stress field data to calculate the principal stresses and orientation of the principal planes. We’ll then visualise both the magnitude and orientation information. 

After this we’ll take a break from coding and discuss the von Mises failure theory. Once we have the concepts and key equations in hand, we’ll use our principal stress fields to calculate the von Mises stress field. 

This basically concludes our hard-core solver development. We’ll have some tweaks to make in the next section but once this section is complete you can congratulate yourself on building a very nice piece of analysis software. 
53. Section overview
Preview
54. A recap of principal stresses
55. Calculating principal angles and stresses
56. Sorting principal stresses
57. Identifying max ten/comp principal stresses
58. Visualising the principal stress magnitude field
59. Visualising the principal stress vector field
60. Combining the magnitude and vector fields
60.1 Jupyter Notebook - (lectures 55-60)
61. The von Mises failure theory
62. Visualising the von Mises stress field
62.1 Jupyter Notebook - (lecture 62)
63. Perimeter stresses and updating plot edges - Planning
64. Perimeter stresses and updating plot edges - Coding
64.1 Jupyter Notebook - (lecture 64)

9. Generating and Analysing Complex Meshes

The power of the finite element method is its ability to accommodate non-standard structural shapes. But this requires us to mesh complex 2D geometries and the methods we’ve used to generate our mesh way back in section 4 are not going to cut it for long. 

We need a more robust way of generating the finite element mesh for our structures. We’ll discuss two tools to achieve this in this section and make some amendments to our export code to work with our new more complex meshes. 

We’re going to base this section around an arched-viaduct structure. This will give us enough complexity to stress test our code and highlight areas that require attention before we can apply our code to complex geometries.
65. Section overview
Preview
66. Generating 2D geometry in Blender
67. Meshing complex geometries
68. Exporting an irregular mesh
68.1 Blender File (lectures 66-68)
69. Generalising our solver
70. Stress distribution masks
70.1 Jupyter Notebook - (lecture 69-70)
71. Course wrap up and Certificate of Completion
72. [BONUS] Cantilever model and analysis walkthrough
Preview
72.1 Blender File (lecture 72)
72.2 Jupyter Notebook - (lecture 72)

Appendix 1: Fundamentals of 2D Stress Analysis and Mohr's Circle

This appendix is provided for anyone who feels like they would benefit from a review of the fundamentals of 2D stress analysis. This will be particularly helpful before tackling sections 6 and 8 on visualising stresses and strains and principal stresses respectively. 
A1. The 2D stress element
A2. The stress transformation equations
A3. Visualising the transformation equations
A4. Principal stresses and principal planes
A5. Maximum shear stress
A6. Stress analysis worked example
A7. Stress analysis worked example - coded solution
A8. Mohr's circle of stress
A9. Mohr's circle example solution
Jupyter Notebook - 2D stress analysis and Mohr's circle