You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nafems4.md 18KB

7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
7 jaren geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. # Background and introduction
  2. First of all, please take this text as a written chat between you an me, i.e. an average engineer that have already taken the journey from college to performing actual engineering using finite element analysis and has something to say about it. Picture yourself in a coffee bar, talking and discussing concepts and ideas with me. Maybe needing to go to a blackboard (or notepad?). Even using a tablet to illustrate some three-dimensional results. But always as a chat between colleagues.
  3. Please also note that I am not a mechanical engineer, although I shared many undergraduate courses with some of them. I am a nuclear engineer with a strong background on mathematics and computer programming. I went to college between 2002 and 2008. Probably a lot of things have changed since then---at least that is what these millenials guys and girls seem to be bragging about---but chances are we all studied solid mechanics and heat transfer with a teacher using a piece of chalk on a blackboard and students writing down notes with pencils on paper sheets. And there is really not much that one can do with pencil and paper regarding mechanical analysis. Any actual case worth the time of an engineer need to be more complex than an ideal canonical case with analytical solution.
  4. We will be swinging back and forth between a case study about fatigue analysis in piping systems of a nuclear power plant and more generic and even romantic topics related to finite elements and computational mechanics. These latter regressions will not remain just as abstract theoretical ideas. Not only will they be directly applicable to the development of the main case, but they will also apply to a great deal of other engineering problems tackled with the finite element method.
  5. Finite elements are like magic to me. I mean, I can follow the whole derivation of the equations, from the strong, weak and variational formulations of the equilibrium equations for the mechanical problem (or the energy conservation for heat transfer) down to the algebraic multigrid preconditioner for the inversion of the stiffness matrix passing through Sobolev spaces and the grid generation. Then I can sit down and program all these steps into a computer, including the shape functions and its derivatives, the assembly of the discretised stiffness matrix assembly, the numerical solution of the system of equations and the computation of the gradient of the solution. Yet, the fact that all these a-priori unconnected steps once gets a pretty picture that resembles reality is still astonishing to me.
  6. Again, take all this information as coming from a fellow that has already taken such a journey from college’s pencil and paper to real engineering cases involving complex numerical calculations. And developing, in the meantime, both an actual working finite-element [back-end](https://www.seamplex.com/fino) and [front-end](https://www.caeplex.com) from scratch.
  7. ## Tips and tricks
  8. There are some useful tricks that come handy when trying to solve a mechanical problem. Throughout this text, I will try to tell you some of them.
  9. One of the most important ones is using your _imagination_. You will need a lot of imagination to “see“ what it is actually going on when analysing an engineering problem. How the loads “press” one element with the other, how the material reacts depending on its properties, how the nodal displacements generate stresses (both normal and shear), how results converge, etc. And what these results actually mean besides the pretty-coloured figures.^[A former boss once told me “I need the CFD” when I handed in some results. I replied that I did not do computational fluid-dynamics but computed the neutron flux kinetics within a nuclear reactor core. He joked “I know, what I need are the _Colors For Directors_, those pretty coloured figures along with your actual results.”]
  10. This journey will definitely need your imagination. We will see equations, numbers, plots, schematics, 3D geometries, interactive 3D views, etc. Still, when the theory says “thermal expansion produces linear stresses” you have to picture in your head three little arrows pulling away from the same point in three directions, or whatever mental picture you have about what you understand are thermally-induced stresses. What comes to your mind when someone says that out of the nine elements of the stress tensors there are only six that are independent? Whatever it is, try to practice that kind of graphical thoughts with every concept.
  11. Another heads up is that we will dig into some math. Probably it would be be simple and you would deal with it very easily. But probably you do not like equations. No problem! Just ignore them for now. Read the text skipping them, it should work. It is fine to ignore math (for now). But, eventually, a time will come in which it cannot (or should not) be avoided. Here comes another experience tip: do not fear math. Even more, keep exercising. You have used differences of squares in high school. You know (or at least knew) how to integrate by parts. Once in a while, perform a division of polynomials using [Ruffini’s rule](https://en.wikipedia.org/wiki/Ruffini's_rule). Or compute the second derivative of the quotient of two functions. Whatever. It should be like doing crosswords on the newspaper. Grab those old physics college books and read the exercises at the end of each chapter. It will pay off later on.
  12. # Nuclear reactors, pressurised pipes and fatigue
  13. Piping systems in sensitive industries like nuclear or oil & gas should be designed and analysed following the recommendations of an appropriate set of codes and norms, such as the ASME\ Boiler and Pressure Vessel Code.
  14. This code of practice (book) was born during the late\ XIX century, before finite-element methods for solving partial differential equations were even developed. And much longer before they were available for the general engineering community. Therefore, much of the code assumes design and verification is not necessarily performed numerically but with paper and pencil (yes, like in college). However, it still provides genuine guidance in order to ensure pressurised systems behave safely and properly without needing to resort to computational tools. Combining finite-element analysis with the ASME code gives the cognisant engineer a unique combination of tools to tackle the problem of designing and/or verifying pressurised piping systems.
  15. In the years following Enrico Fermi’s demonstration that a self-sustainable fission reaction chain was possible (actually, in fact after WWII was over), people started to build plants in order to transform the energy stored within the atoms nuclei into usable electrical power. They quickly reached the conclusion that high-pressure heat exchangers and turbines were needed. So they started to follow the ASME\ Boiler and Pressure Vessel Code. They also realised that some requirements did not fit the needs of the nuclear industry. But instead of writing a new code from scratch, they added a new chapter to the existing body of knowledge: the celebrated ASME Section\ III.
  16. After further years passed by, engineers (probably the same people that forked section\ III) noticed that fatigue in nuclear power plants was not exactly the same as in other piping systems. There were some environmental factors directly associated to the power plant that was not taken into account by the regular ASME code. Again, instead of writing a new code from scratch, people decided to add correction factors to the previously amended body of knowledge. This is how knowledge evolves, and it is this kind of complexities that engineers are faced with during their professional lives. We have to face it, it would be a very hard work to re-write everything from scratch every time something changes.
  17. **figure of a CAD pipe system**
  18. # Solid mechanics, or what we are taught at college
  19. So, let us start our journey. Our starting place: undergraduate solid mechanics courses. Our goal: to obtain the internal state of a solid subject to a set of movement restrictions and loads (i.e. to solve the solid mechanics problem). Our first step: Newton’s laws of motion. For each of them, all we need to recall here is that
  20. 1. a solid is in equilibrium if it is not moving in at least one inertial coordinate system,
  21. 2. in order for a solid not to move, the sum of all the forces ought to be equal to zero, and
  22. 3. for every external load there exists an internal reaction with the same magnitude but opposite direction.
  23. We have to accept that there is certain intellectual beauty when complex stuff can be expressed in simple term. Yet, from now on, everything can be complicated at will. We can take the mathematical path like D’Alembert and his virtual displacements ideas (in his mechanical treatise, D’Alembert boasts that he does not need to use a single figure throughout the book). Or we can go graphical following Cullman. Or whatever other logic reasoning to end up with a set of actual equations which we need to solve in order to obtain engineering results.
  24. ## The stress tensor
  25. In any case, what we should understand (and imagine) is that external forces lead to internal stresses. And in any three-dimensional body subject to such external loads, the best way to represent internal stresses is through a $3 \times 3$ _stress tensor_. This is the first point in which we should not fear math. Trust me, it will pay back later on.
  26. Does the term _tensor_ scare you? It should not. A tensor is just a slightly more complex vector, and I assume you are not afraid of vectors. If you recall, a vector somehow generalises the idea of a scalar in the following sense: a given vector $\vec{v}$ can be projected into any direction $\vec{n}$ to obtain a scalar $p$. We call this scalar $p$ the “projection” of the vector $\vec{v}$ in the direction $\vec{n}$. Well, a tensor can be also projected into any direction $\vec{n}$. The difference is that instead of a scalar, a vector is now obtained.
  27. Let me introduce then the three-dimensional stress tensor:
  28. $$
  29. \begin{bmatrix}
  30. \sigma_x & \tau_{xy} & \tau_{xz} \\
  31. \tau_{yx} & \sigma_{y} & \tau_{yz} \\
  32. \tau_{zx} & \tau_{zy} & \sigma_{z} \\
  33. \end{bmatrix}
  34. $$
  35. It looks (and works) like a regular $3 \times 3$ matrix. Some brief comments about it:
  36. * The $\sigma$s are normal stresses, i.e. they try to stretch or tighten the material.
  37. * The $\tau$s are shear stresses, i.e. they try to twist the material.
  38. * It is symmetric (so there are only six independent elements) because
  39. - $\tau_{xy} = \tau_{yx}$,
  40. - $\tau_{yz} = \tau_{zy}$, and
  41. - $\tau_{zx} = \tau_{xz}$.
  42. * The elements of the tensor depends on the orientation of the coordinate system.
  43. * There exists a particular coordinate system in which the stress tensor is diagonal, i.e. all the shear stresses are zero. In this case, the three diagonal elements are called the principal stresses.
  44. What does this all have to do with mechanical engineering? Well, once we know what the stress tensor is for every point of a solid, in order to obtain the internal forces per unit area acting in a plane passing through that point and with a normal given by the direction $\vec{n}$, all we have to do is “project” the stress tensor through $\vec{n}$. In plain simple words:
  45. * If you can compute the stress tensor at each point of our geometry, then congratulations: you have solved the solid mechanics problem.
  46. ## An infinitely-long pressurised pipe
  47. Let us proceed to a our second step, and consider an infinite pipe subject to uniform internal pressure. Actually, we are going to solve the mechanical problem on an infinite hollow cylinder, which looks like pipe. This case is usually tackled in college courses, and chances are you already solved it. Actually, the first (and simpler) problem is the “thin cylinder problem.” Then, the “thick cylinder problem” is introduced, which is slightly more complex. Nevertheless, it has an analytical solution.
  48. dnl google thin walled pressure vessel strain
  49. **equilibrium equation**
  50. **stresses solution**
  51. # Finite elements, or solving an actual engineering problem
  52. Besides infinite pipes (both thin and thick), spheres and a couple of other geometries, there are not other cases for which we can obtain analytical expressions for the elements of the stress tensor. To get results for a solid with real engineering interest, we need to use numerical methods to solve the equilibrium equations. It is not that the equations are hard _per se_. It is that the part we engineers like to design (which are of course better than cylinders and spheres) are so intrincate that render the simple equations into monster which are unsolvable with pencil and paper. Hence, finite elements enter into the scene.
  53. ## The name of the game
  54. But before turning our attention into finite elements (and leaving college, at least undergraduate) it is worth some time to think about other alternatives. Are we sure we are tackling your problems in the best possible way? I mean, not just engineering problems. Do we take a break, step back for a while and see the whole picture looking at all the alternatives so we can choose the best cost-effective one?
  55. There are literally dozens of ways to numerically solve the equilibrium equations, but for the sake of brevity let us take a look at the three most famous ones. Coincidentally, they all contain the word “finite” in their names. We will not dig into them, but it is nice to know they exist. We might use
  56. 1. Finite differences
  57. 2. Finite volumes
  58. 3. Finite elements
  59. Each of these methods (also called schemes) have of course their own features, pros and cons. They all exploit the fact that the equations are easy to solve in simple geometries (say a cube). Then the actual geometry is divided into a yuxtaposition of these cubes, the equations are solved in each one and then a global solution is obtained by sewing the little simple solutions one to another. The process of dividing the original domain into simple geometries is called _discretization_, and the resulting collection of these simple geometries is called a mesh or grid. They are composed of volumes, called cells (or elements) and vertices called nodes.
  60. The first of the three methods is based on approximating derivative (i.e. differentials) by incremental quotients (i.e. differences). The second one heavily relies on geometrical ideas rather than on pure mathematical grounds. Finally, our beloved finite elements are the most “mathematical” ones. Actually, a complete derivation of the finite element method can be written in a textbook without requiring a single figure, just like D’Alembert did more than two centuries ago. In any case, it is important to note that finite differences and elements compute results at the _nodes_ of a mesh, whilst finite volumes compute results at the _cells_ of a mesh.
  61. There are technical reasons that justify why the finite element method is the kings for mechanical analysis. But that does not mean that other methods may be employed. For instance, fluid mechanics are better solved using finite volumes. And further other combinations may be found in the literature.
  62. Before proceeding, I would like to make two comments about common nomenclature. The first one is that if we exchanged the words “volumes” and “elements” in all the written books and articles, nobody would note the difference. There is nothing particular in both theories that can justify why finite volumes use volumes and finite elements use elements. Actually volumes and elements are the same geometric constructions. The names were randomly assigned.
  63. The second one is more philosophical and refers to the word “simulation” which is often used to refer to solving a problem using a numerical scheme such as the finite element method. [I am against at using this word for this endeavour](https://www.seamplex.com/blog/say-modeling-not-simulation.html). The term simulation has a connotation of both “pretending” and “faking” something, that is definitely not what we are doing when solving an engineering problem with finite elements. Sure there are some cases in which we simulate, such as using the Monte Carlo method (originally used by Fermi as an attempt to understand how neutrons behave in the core of nuclear reactors). But when solving deterministic mechanical engineering problems I would rather say “modelling” than “simulation.”
  64. ## So, why do you want to do FEA?
  65. solid mechanics, because we ant to have a degree.
  66. five whys
  67. ## Computers, those little magic boxes
  68. https://www.springfieldspringfield.co.uk/view_episode_scripts.php?tv-show=the-simpsons&episode=s05e03
  69. ENIAC
  70. ### A brief review of history
  71. FEM, Computers
  72. graphics cards
  73. ### Hardware
  74. ### Software
  75. FOSS
  76. Avoid black boxes
  77. Reflections on trusting trust
  78. UNIX, scriptability, make programs to make programs (here a program is a calculation)
  79. front and back
  80. avoid monolithic
  81. # Nuclear-grade piping and ASME
  82. ## The infinite pipe revisited
  83. 3D full
  84. Quarter
  85. 2 grados
  86. 2D axysimmetric
  87. 1D collocation
  88. struct vs unstruct
  89. 1st vs 2nd
  90. complete vs incomplete (hexa)
  91. ## Linearity of displacements and stresses
  92. cantilever beam, principal stresses, linearity of von mises
  93. ### ASME stress linearization
  94. ### The relativity of wrong
  95. citar a asimov y al report de convergencia
  96. errors and uncertainties: model parameters (is E what we think? is the material linear?), geometry (does the CAD represent the reality?) equations (any effect we did not have take account), discretization (how well does the mesh describe the geometry?)
  97. ## Two (or more) materials
  98. ### Young and Poisson
  99. two cubes
  100. ## A parametric tee
  101. ## Temperature
  102. # Fatigue
  103. ## In air
  104. ## In water
  105. # Conclusions
  106. Back in College, we all learned how to solve engineering problems. But there is a real gap between the equations written in chalk on a blackboard (now probably in the form of beamer slide presentations) and actual real-life engineering problems. This chapter introduces a real case from the nuclear industry and starts by idealising the structure such that it has a known analytical solution that can be found in textbooks. Additional realism is added in stages allowing the engineer to develop an understanding of the more complex physics and a faith in the veracity of the FE results where theoretical solutions are not available. Even more, a brief insight into the world of evaluation of low-cycle fatigue using such results further illustrates the complexities of real-life engineering analysis.
  107. * use your imagination
  108. * practise math