Full text
STUDY OF THE VIBRATION BEHAVIOUR OF ROTATORY BLADES USING THE FINITE ELEMENT METHOD FINAL DEGREE THESIS AEROSPACE TECHNOLOGIES ENGINEERING by Pere Frontera Pericàs Director: Hernández Ortega, Joaquín A. Co-Director: Cante Teran, Juan Carlos Project duration: February 13 – June 10, 2019 — Report attachment —
Contents List of Figures 3 A Theoretical frame 5 A.1 Introduction to elasticity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 A.1.1 Theelasticproblem ................................. 5 A.1.2 Generalised Hooke’s law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 A.2 Classical analysis methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 A.2.1 Energymethods ................................... 9 A.2.2 Graphicalmethods.................................. 11 A.2.3 Matrixmethods.................................... 12 B Elemental matrix computation 13 B.1 The static stiffness matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 B.2 Theforcevector ....................................... 14 B.2.1 Bodyforces...................................... 14 B.2.2 Tractionforces.................................... 14 B.3 Themassmatrix....................................... 16 B.4 The static damping matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 B.5 Therotationmatrices.................................... 16 C Example of vectorised assembly 17 C.1 Mass matrix vectorised assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 C.2 Generalisation to rotation matrices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 D Raw simulation results 21 D.1 Two-dimensional cantilever beam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 D.1.1 Natural modes and frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 D.1.2 Constant angular velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 D.1.3 Constant angular acceleration. . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 D.2 Three-dimensional cantilever beam . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 D.2.1 Natural modes and frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 D.2.2 Constant angular velocity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 D.3 Starting of a rotor blade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 E Developed code 43 E.1 One-dimensional stationary solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 E.2 Modal analysis: free undamped vibrations. . . . . . . . . . . . . . . . . . . . . . . . . 48 E.3 Numeric integration: Newmark β.............................. 49 E.4 SVDimplementation..................................... 57 E.5 Auxiliaryfiles......................................... 59 E.6 Others............................................. 61 Bibliography 64 2
List of Figures A.1 General stress state for a 3D deformable body . . . . . . . . . . . . . . . . . . . . . . . . 6 A.2 Simplified equation for long rotating beams . . . . . . . . . . . . . . . . . . . . . . . . . 11 C.1 2D mesh composed by two quadrilateral elements. . . . . . . . . . . . . . . . . . . . . . 17 D.1 Natural modes associated to the eight lowest natural frequencies of a rectangular cantilever beam. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 D.2 Left side vectors (predominant modes) associated to the eight higher singular values. 22 D.3 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 D.4 Left side vectors (predominant modes) associated to the eight higher singular values. 23 D.5 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 D.6 Left side vectors (predominant modes) associated to the eight higher singular values. 24 D.7 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 D.8 Mode intensities for increasing values of Ω. . . . . . . . . . . . . . . . . . . . . . . . . . 25 D.9 Reaction torque for increasing values of Ω. . . . . . . . . . . . . . . . . . . . . . . . . . 25 D.10 Local transverse displacements at the tip of the beam for different values of Ω. Numeric results and its SVD approximation are compared. . . . . . . . . . . . . . . . . . . 25 D.11 Power spectral density estimation of the sum of the right side vectors obtained for different rotation speeds: 50 (a), 100 (b) and 200 (c) rad/s. . . . . . . . . . . . . . . . . . 26 D.12 Local horizontal displacements at the tip of the beam for different values of Ω: 50 (a), 100 (b) and 200 (c) rad/s. Numeric results and its SVD approximation are compared. 26 D.13 Deformed shape (×500) and σςς distribution (colour map, in KPa) at 50 rad/s. Time from 0 to 14 ms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 D.14 Left side vectors (predominant modes) associated to the eight higher singular values. 29 D.15 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 D.16 Left side vectors (predominant modes) associated to the eight higher singular values. 30 D.17 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 D.18 Mode intensities for increasing values of α. . . . . . . . . . . . . . . . . . . . . . . . . . 31 D.19 Temporal evolution of vertical displacements at the tip of a cantilever beam under constant angular acceleration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 D.20 Reaction torque for increasing values of α. . . . . . . . . . . . . . . . . . . . . . . . . . . 31 D.21 Deformed shape (×200) and σςς distribution (colour map, in KPa) at α= 50 rad/s2and Ω0= 50 rad/s. Time from 0 to 25 ms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 D.22 Natural modes associated to the eight lowest natural frequencies of a 3D cantilever beam. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 D.23 Left side vectors (predominant modes) associated to the eight higher singular values. 35 D.24 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 3
4 List of Figures D.25 Left side vectors (predominant modes) associated to the eight higher singular values. 36 D.26 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 D.27 Left side vectors (predominant modes) associated to the eight higher singular values. 37 D.28 Right side vectors (predominant oscillations) associated to the eight higher singular values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 D.29 Campbell diagram: comparison between modal prediction and SVD predominant frequencies. Subscripts aand brefer to pairs of equal modes that activate either on %or z. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 D.30 Temporal evolution of %displacements at the tip of a cantilever beam under constant angular velocity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 D.31 Temporal evolution of zdisplacements at the tip of a cantilever beam under constant angular velocity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 D.32 Reaction torque for increasing values of Ω. . . . . . . . . . . . . . . . . . . . . . . . . . . 39 D.33 Deformed shape (×500) and σςς distribution (colour map, in KPa) at Ω0= 50 rad/s. Time from 0 to 17 ms (up-down, left-right). . . . . . . . . . . . . . . . . . . . . . . . . . 40 D.34 Temporal evolution of the angular speed and the local axial displacements at the tip. . 41 D.35 Temporal evolution of the angular acceleration and elastic reaction torque. . . . . . . 41 D.36 Temporal evolution of the maximum values of stress. . . . . . . . . . . . . . . . . . . . . 42 D.37 Right side vectors of the four most predominant oscillations. . . . . . . . . . . . . . . . 42
A Theoretical frame A.1. Introduction to elasticity A.1.1. The elastic problem Fundamentals of Theory of Elasticity date from the seventeenth century, back when Robert Hooke posed the law of elasticity, which states that the stretching of a solid is proportional to the force applied to it. This law was latter generalised to three dimensional bodies by Cauchy, introducing six components of stress σ, linearly related to six components of strain ε. Cauchy was the first to introduce the notion of stress at a point, given by the tractions per unit area across all plane elements trough the point. This linear behaviour of deformable bodies is governed by 15 coupled partial differential equations, first derived by Navier. Even today, no closed form of the solution exists, even for simple structures. Elasticians have used energy principles to tackle this problem, which have become a fundamental tool to study elastic bodies, including those problems involving vibrations (see A.2). The Navier-Cauchy equations are [1]: Equilibrium equations : ∂σxx ∂x+∂σyx ∂y+∂σzx ∂z+bx=0 ∂σx y ∂x+∂σyy ∂y+∂σzy ∂z+by=0 ∂σxz ∂x+∂σyz ∂y+∂σzz ∂z+bz=0 (A.1) 5
6 A. Theoretical frame Strain displacement relations: εxx =∂u ∂x,εyz =1 2µ∂w ∂y+∂v ∂z¶=εzy εyy =∂v ∂y,εzx =1 2µ∂u ∂z+∂w ∂x¶=εxz εzz =∂w ∂z,εxy =1 2µ∂v ∂x+∂u ∂y¶=εyx (A.2) Compatibility relations : ∂2εxx ∂y2+∂2εyy ∂x2=2∂2εxy ∂x∂y,∂2εxx ∂y∂z=∂ ∂xµ−∂εyz ∂x+∂εzx ∂y+∂εxy ∂z¶ ∂2εyy ∂z2+∂2εzz ∂y2=2∂2εyz ∂y∂z,∂2εyy ∂z∂x=∂ ∂yµ∂εyz ∂x−∂εzx ∂y+∂εxy ∂z¶ ∂2εzz ∂x2+∂2εxx ∂z2=2∂2εzx ∂z∂x,∂2εzz ∂x∂y=∂ ∂zµ∂εyz ∂x+∂εzx ∂y−∂εxy ∂z¶ (A.3) Equilibrium equations are obtained considering a general state of stress at an arbitrary point in the deformable body through an infinitesimal approach (see figure below). Note that shear stresses are represented with a τ. If one approximates the spatial variations of the stresses in terms of firstorder Taylor series, the resulting equilibrium equations are the ones posed in equation A.1. The strain-displacement equations link both strain and displacement field, defining the second as the derivative of the first. However, this is not enough, as another condition needs to be met: the body is still continuous after the deformation. The latter is ensured by the compatibility relations, which involve second derivatives. Figure A.1: General stress state for a 3D deformable body [2]
A.1. Introduction to elasticity 7 A.1.2. Generalised Hooke’s law Robert Hooke was one of the first scientists to notice elastic behaviour of materials. He studied springs under traction and compression, and tried to pose an equation linking both the applied force and the elongation of the spring. He discovered that, for small deformations x, the required force was F=kx, where kis a constant characteristic of the spring. This law was later generalised to describe elastic objects in general, posing that the strain ε(that is, nondimensional deformation) is proportional to the stress σ(that is, force per unit area) applied to it. Remembering the equations from the previous section, one can realise that general stresses and strains have multiple independent components, and thus the proportionally factor is no longer a single value, but a tensor. The tensorial form of Hooke’s law introduces a concept that might not be intuitive: some elastic bodies deform in one direction when subjected to a force with a different direction. In such cases, proportionality will hold: if the directions are not changed, the deformation will increase proportional to the applied force. For that cases, the formulation in three dimensions has the following vectorial form: F1 F2 F3 = k11 k12 k13 k21 k22 k23 k31 k32 k33 x1 x2 x3 (A.4) When moving from a discrete spring to continuous media, the formulation changes a little as the strain and stress state around a point cannot longer be described by a vector as all pushing, pulling and shearing effects have to be taken into account. This complexity is captured using a second order tensor, and in the tensorial formulation, forces and displacements are replaced by stresses and strains, respectively. In a Cartesian base, stresses and strains are represented with a first order tensor each: ε= εxx εxy εxz εyx εy y εyz εzx εzy εzz ;σ= σxx τxy τxz τyx σy y τyz τzx τzy σzz (A.5) Stress and strain tensors vary from a point to another inside continuum materials: εgives information about the displacements in the neighbourhood of the point, while σstands for the forces per unit area that neighbouring parcels exert on each other. The tensor linking εand σis known as the elasticity tensor C, represented by a matrix of 81 real numbers Ci jkl : σi j = 3 X k=1 3 X l=1 Ci jkl εkl (A.6) Due to inherent symmetries of the model, the elasticity tensor Ccan be reduced to 21 independent coefficients, while εand σare found to be symmetrical matrices (σi j =σji and εkl =εlk ), having thus only 6 independent values. In this context, the Voigt notation is introduced: strain and stress tensors are substituted by vectors including only independent coefficients. For the case of shear strains, they are substituted by engineering strains γin Voigt notation (2εkl =γkl ) : σ⇒ σx σy σz τyz τxz τxy ;ε= ∇su⇒ εx εy εz γyz γxz γxy = ∂ux ∂x ∂uy ∂y ∂uz ∂z ∂uy ∂z+∂uz ∂y ∂ux ∂z+∂ux ∂y ∂uy ∂x+∂ux ∂y (A.7)
8 A. Theoretical frame In the above equation, ∇sustands for the symmetric gradient operator, which in 3D Cartesian coordinates adopts the following form: ∇s:= ∂ ∂x0 0 0∂ ∂y0 0 0 ∂ ∂z 0∂ ∂z ∂ ∂y ∂ ∂z0∂ ∂x ∂ ∂y ∂ ∂x0 (A.8) For the case of isotropic materials —that is, uniform properties in all directions—, it can be found that the elasticity matrix depends only on two coefficients, the Young’s Modulus E(standing for the material stiffness or resistance to be elastically deformed) and the Poisson’s coefficient ν. The latter is the negative of the ratio of transverse strain (unit lateral contraction) to axial strain, and the responsible for the Possion effect: the phenomenon in which a given material tends to expand in directions perpendicular to the direction of compression, and to contract in the directions transverse to the direction of stretching [2]. The Young’s Modulus has units of pressure, while the Poisson’s coefficient is dimensionless, and theoretically limited to the interval −1<ν<0,5, although in reality only positive values of νare found. However, Cis commonly expressed as a function of the Lame parameters λand µ. In indicial form: Ci jkl =λδi j δkl +µ¡δik δjl +δil δjk¢,λ=νE (1+ν)(1−2ν),µ=E 2(1+ν)(A.9) In Voigt notation and for isotropic materials, Hooke’s law adopts the form σx σy σz τyz τxz τxy = 2µ+λ λ λ 000 λ2µ+λ λ 000 λ λ 2µ+λ000 0 0 0 µ0 0 0 0 0 0 µ0 0 0 0 0 0 µ εx εy εz γyz γxz γxy (A.10) The same can be deduced analogously for orthotropic and even anisotropic materials, with the difference that the constants Eand νare no longer unique, but have a different value for each set of directions. Even thermal effects and other phenomena can be added into the equations describing the model. However, although Hooke’s law is widely used, it presents great limitations as nonlinearities emerge when the deformations are big enough to be no longer considered small. Thus, nonlinear models have to be used, and the phenomena of plasticity has to be taken into account.
B.2. The force vector 15 The study of distributed loads requires from a more meticulous approach, and a new formulation regarding boundary elements is to be posed. To start with, let’s define Ei bas the set of elements lying on the Neumann boundary Γi σ, with i=1, ··· ,nd: Ei b:=ne∈{1,2...nel }|Γe,i σ=Γe∩Γi σ6= ∅o(B.10) Being ne bthe number of nodes per boundary element, and assuming for simplicity it is the same for all elements, one can define CNbias the boundary connectivity matrix, a nb,i el ×ne bmatrix containing, in each row, the global indices of the boundary nodes of each patch Γe,i σ¡e∈Ei b¢. For each boundary element Γe,i σ, a matrix of boundary shape functions is defined: Ne:=hNe 1Ne 2··· Ne ne bi(B.11) Notice that the boundary shape functions are different from the ones used to interpolate the displacements, as the dimension of the boundary is always smaller than the dimension of the elements, Ne a:Γe,i σ→R. Recall the definition of the global vector of prescribed boundary tractions (equation 4.1 ), whose decomposition into elemental integrals reads as: Fdis = nd X i=1ZΓi σ NT itidΓ= nd X i=1X e∈Ei b³Le,i´TZΓe,i σ NT itidΓ(B.12) Where Le,iis the Boolean operator linking the global ¡c∈Rndne b¢and local ³ce,i∈Rne b´vectors of test coefficients. The above expression can be expressed as: Fdis = nd X i=1 Fi dis = nd X i=1X e∈Ei b³Le,i´TFe,i di s = nd X i=1X e∈Ei b³Le,i´TZΓe,i σ NT itidΓ(B.13) Where Fe,i dis ∈Rne bis the elemental traction vector due to distributed loads along direction i,Fi dis ∈ Rndnpt is the global vector due to distributed loads along direction iand Fdis ∈Rndnpt is the global vector due to distributed loads. As for the case of body forces, the input function tiis commonly replaced by an approximation constructed by interpolation of its nodal values te,iusing the shape functions employed for interpolating the boundary test functions: ti¯¯¯x∈Γe,i σ ≈Nete,i, with t e,i= ti¡xe 1¢ ti¡xe 2¢ . . . ti³xe ne b´ (B.14) Using this interpolation, and taking advantage of the assembly operator, the global vector due to distributed loads along direction iresults in: Fi dis =A e∈Ei b Fe,i dis =A e∈Ei bZΓe,i σ NeT³Nete,i´dΓ(B.15) If mapped into the parent domain, the computation of the elemental traction vector due to distributed loads along direction ican be approximated using the Gauss Quadrature method: Fe,i dis =ZΓe,i σ NeT³Nete,i´dΓ=ZΓσξ J e,i bNeT³Nete,i´dΓξ= mb X g=1 wgµ J e,i bNeT³Nete,i´¶ξ=ξg (B.16)
16 B. Elemental matrix computation As it has already been stressed out, Γe,i σ⊂Rnd−1and thus the shape functions and weights appearing in the above expressions are different from those computed when assessing the stiffness matrix and the body forces vector. For 3D problems, the boundary elements are 2D, and therefore a different Gauss rule is applied. B.3. The mass matrix It is found from equation 3.13 that the mass matrix can be expressed in terms of the FEM as: M=Zf NTρNdf(B.17) The process of splitting the above integral into elemental ones, and approximating the latter using the Gauss Quadrature method is identical as for the static stiffness matrix case. Using the assembly operator: M= nel A e=1Me,Me=Zf NeTρNedfe(B.18) The elemental matrices are then mapped into the parent domain and approximated using Gauss Quadrature: Me=Zf NeTρNedfe=Zf J eNeTρNedfξ= m X g=1 wg³ J eNeTρNe´ξ=ξg (B.19) B.4. The static damping matrix It is found from equation 3.13 that the static damping matrix can be expressed in terms of the FEM as: Dstatic =Zf NTµNdf+Zf BTD B df(B.20) Using the approximation presented in equation 3.15, the above integral is transformed into: Dstatic =αM+βKstatic (B.21) Where Mand Kstatic are known matrices, while αand βare constant parameters. B.5. The rotation matrices Recall that the rotation of the structure induces new matrices to appear in equation 3.13: Krot =Zf NTρ(e Ω2+e α)Ndf,Drot =2Zf NTρe ΩNdf(B.22) Its computation method is not so different from the mass matrix case: Krot = nel A e=1Ke rot ⇒Ke rot =Zf NeTρ(e Ω2+e α)Nedfe(B.23) Drot = nel A e=1De rot ⇒De rot =2Zf NeTρe ΩNedfe(B.24) Using the Gauss Quadrature method to approximate the elemental integrals: Ke rot =Zf J eNeTρ(e Ω2+e α)Nedfξ= m X g=1 wg³ J eNeTρ(e Ω2+e α)Ne´ξ=ξg (B.25) De rot =2Zf J eNeTρe ΩNedfξ=2 m X g=1 wg³ J eNeTρe ΩNe´ξ=ξg (B.26)
C Example of vectorised assembly The FEM is able to solve boundary value problems along very complex geometries because it splits the domain into a finite number of smaller partitions called elements. In numerical terms, this implies that global matrices are not computed all at once, but element by element. Then, all the elemental matrices need to be assembled, but traditional assembly algorithms can be very slow. For this reason a vectorised assembly algorithm has been used in the present project. The code was provided by prof. J. Hernández and adapted to the case of rotating structures. The goal of the present chapter is to illustrate how vectorised assembly works by developing, step by step, the assembly of the mass matrix for two linear quadrilateral elements. C.1. Mass matrix vectorised assembly To start with, recall the definition of the mass matrix and its decomposition into elemental components from the previous chapter: M=RfNTρNdf M= nel A e=1Me,Me=RfNeTρNedfe Me=RfNeTρNedfe=Rf J eNeTρNedfξ=Pm g=1wg³ J eNeTρNe´ξ=ξg (C.1) To keep the example as simple as possible, let’s consider the following geometry made from two linear quadrilateral elements: Figure C.1: 2D mesh composed by two quadrilateral elements. 17
18 C. Example of vectorised assembly Remember that for 2D elements, the numeration order is not important as well as it follows counter-clockwise direction. In the above figure, numbers inside a circle represent local numeration. When the geometric domain is not as trivial as the presented one, keeping track of the global numeration is not an easy task. On the other hand, local numeration is always performed in the same way. Hence, one may suspect that some properties remain undisturbed in the local frame. Following the previous idea, the vectorised assembly takes advantage of the fact that in the parent domain, all the elements are geometrically identical and so are their shape functions. Hence, it is only necessary to compute the elemental matrix of one element and use it to construct a matrix including all the elemental shape functions matrices. The latter matrix, referred as Nelem, is actually a (ngndnel ×nend) matrix. Remember that, for vector fields, the elemental matrix of shape functions Newas defined as: Ne={N1IN2I··· NneI}(C.2) Where Iis the nd×ndidentity matrix and NAis the scalar-valued shape function of node A. Let’s define now NE,a(ngnd×nend) matrix that incorporates the value of Neat every Gauss Point: NE= N1 ξ1N2 ξ1··· Nne ξ1 N1 ξ2N2 ξ2··· Nne ξ2 . . .. . ..... . . N1 ξngN2 ξng ··· Nne ξng = N1 N2 . . . Nnpt (C.3) Where Nis a ngnd×ndmatrix. Taking advantage of the fact that NEis the same for all elements, Nelem can be easily constructed by repeating NEa number of nel times: Nelem =[NENE··· NE |{z }]T ngndnel (C.4) The next step is to built Nst , a (ngndnel ×npt nd) matrix that takes into account the global formulation and is constructed from Nelem by using the connectivity matrix. For instance, for the presented geometry and with ne=4 and ng=4, Nst adopts the following form: Nst =·N1N20 0 N3N4 0N1N2N3N40¸e1 e2 n1n2n3n4n5n6 (C.5) The grace of this approach is that once NEis computed, the transformations that follow are performed using optimised in-built functions such as sparse,reshape and repmat : 1m = ndim*nelem*ngaus ; % Number of rows 2n = nnode*ndim ; % Number of columns 3nzmaxLOC = m*nnodeE*ndim ; % Maximum number of zeros 4Nst = sparse([],[],[],m,n,nzmaxLOC); % Allocating memory for Bst 5 6for inode = 1:nnodeE % Loop over number of nodes at each element 7 8setnodes = CONNECT(:,inode) ; % Global numbering of the 9%inode−th node of each element
C.1. Mass matrix vectorised assembly 19 10 for idime = 1:ndim % loop over spatial dimensions 11 DOFloc = (inode−1)*ndim+idime ; % Corresponding indices 12 s = Nelems(:,DOFloc) ;% Corresponding column 13 i = [1:m]' ; % All rows 14 DOFglo = (setnodes−1)*ndim+idime ; % b) Columns 15 j = repmat(DOFglo', ndim*ngaus,1) ; 16 j = reshape(j,length(i),1) ; 17 % Assembly process (as sum of matrix with sparse representation) 18 Nst = Nst + sparse(i,j,s,m,n,m) ; 19 end 20 end Until now, the Gauss weights and Jacobians were not considered. So let’s define WSTs, a nel ×ng vector containing the product of weights and Jacobians at all Gauss points: WSTs = s1 s2 . . . snel ,se= w1·Je ξ1 w2·Je ξ2 . . . wng·Je ξng (C.6) The previous matrix is to be transformed into diagonal. To do so, let’s first define the following auxiliary matrices: we i=³wi·Je ξi´I,We d= we 1[0] [0] [0] [0] we 2[0] [0] . . .. . ..... . . [0] ··· ··· we ng (C.7) And now the diagonalised version of WSTs reads as: Wdi ag = W1 d[0] ··· [0] [0] W2 d··· [0] . . .. . ..... . . [0] [0] ··· Wnel d (C.8) To close down the section, let’s take density into consideration. Recall that density is given as a vector input, having a value for each element: density =©ρ1ρ2··· ρnel ªT(C.9) The next step is to transform the previous expression into a global matrix, accounting for each dimension and Gauss point. To do so, let’s consider the following matrices: dense=ρeI, densGe= (ndndng) z }| { dense[0] ··· [0] [0] dense··· [0] . . .. . ..... . . [0] [0] ··· dense 1 2 . . . ng (C.10)
20 C. Example of vectorised assembly And finally, the global density matrix is defined as: densglo = densG1[0] ··· [0] [0] densG2··· [0] . . .. . ..... . . [0] [0] ··· densGnel (C.11) After all this abstract formulation, the mass matrix can be simply assembled with no nested loops at all: M=Nst T·densglo ·Wdi ag ·Nst (C.12) C.2. Generalisation to rotation matrices During the development of the FEM method for rotating structures, it was found that new matrices emerged by the effect of rotation. These matrices have the form: P=Zf NTρA N df(C.13) Where Ais a nd×ndmatrix accounting for the rotation effect, mostly Coriolis, centrifugal and tangential forces. The vectorised assembly of Pis almost straightforward, as most of the process is done exactly as in the case of the mass matrix. The only difference has to do with A, which has to be globally defined: AGe= (ndndng) z }| { Ae[0] ··· [0] [0] Ae··· [0] . . .. . ..... . . [0] [0] ··· Ae 1 2 . . . ng ,Aglo = AG1[0] ··· [0] [0] AG2··· [0] . . .. . ..... . . [0] [0] ··· AGnel (C.14) Finally, the global matrix is assembled as: P=Nst T·densglo ·Aglo ·Wdi ag ·Nst (C.15)
D Raw simulation results In this chapter, results obtained from the developed simulations will be displayed. The discussion and analysis of the present results has already been addressed in the report (sections 6 and 7). D.1. Two-dimensional cantilever beam D.1.1. Natural modes and frequencies Figure D.1: Natural modes associated to the eight lowest natural frequencies of a rectangular cantilever beam. Table D.1: The twenty lowest natural frequencies of a rectangular cantilever beam. 21
22 D. Raw simulation results D.1.2. Constant angular velocity Case 1: Ω= 50 rad/s Figure D.2: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.05 0.1 0.15 0.2 Time (s) -0.01 0 0.01 V1 0 0.05 0.1 0.15 0.2 Time (s) 4.95 5 5.05 V2 10-3 0 0.01 0.02 0.03 Time (s) -0.01 0 0.01 V3 0 0.002 0.004 0.006 0.008 0.01 Time (s) -0.01 0 0.01 V4 0 2 4 6 Time (s) 10-3 -0.01 0 0.01 V5 0 1 2 3 4 Time (s) 10-3 -0.01 0 0.01 V6 0 1 2 3 Time (s) 10-3 -0.01 0 0.01 V7 0 0.01 0.02 0.03 Time (s) -0.01 0 0.01 V8 Figure D.3: Right side vectors (predominant oscillations) associated to the eight higher singular values.
D.1. Two-dimensional cantilever beam 23 Case 2: Ω= 100 rad/s Figure D.4: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.02 0.04 0.06 0.08 0.1 Time (s) -5.02 -5 -4.98 V1 10-3 0 0.05 0.1 0.15 0.2 Time (s) -0.01 0 0.01 V2 0 0.005 0.01 0.015 0.02 0.025 Time (s) -0.01 0 0.01 V3 0 0.002 0.004 0.006 0.008 0.01 Time (s) -0.01 0 0.01 V4 0 2 4 6 Time (s) 10-3 -0.01 0 0.01 V5 01234 Time (s) 10-3 -0.01 0 0.01 V6 0 0.02 0.04 0.06 Time (s) -0.01 0 0.01 V7 0 1 2 3 Time (s) 10-3 -0.01 0 0.01 V8 Figure D.5: Right side vectors (predominant oscillations) associated to the eight higher singular values.
24 D. Raw simulation results Case 3: Ω= 200 rad/s Figure D.6: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.05 0.1 0.15 0.2 Time (s) -5 -4.98 V1 10-3 0 0.05 0.1 0.15 0.2 Time (s) -0.01 0 0.01 V2 0 0.005 0.01 0.015 0.02 Time (s) -0.01 0 0.01 V3 0 0.002 0.004 0.006 0.008 0.01 Time (s) -0.01 0 0.01 V4 012345 Time (s) 10-3 -0.01 0 0.01 V5 0 0.02 0.04 0.06 Time (s) -0.01 0 0.01 V6 0 1 2 3 Time (s) 10-3 -0.01 0 0.01 V7 0 0.5 1 1.5 2 Time (s) 10-3 -0.01 0 0.01 V8 Figure D.7: Right side vectors (predominant oscillations) associated to the eight higher singular values.
D.1. Two-dimensional cantilever beam 31 Comparative figures 0 5 10 15 20 25 30 35 40 45 50 Angular acceleration (rad/s2) 10-4 10-3 10-2 10-1 100 Mode intensity (normalised singular value) 1 2 3 4 5 6 7 8 Figure D.18: Mode intensities for increasing values of α. 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 Time (s) -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 Local transverse displacement (m) 10-3 = 5 rad/s2 = 50 rad/s2 Figure D.19: Temporal evolution of vertical displacements at the tip of a cantilever beam under constant angular acceleration. 0 0.02 0.04 0.06 0.08 0.1 Time (s) -40 -20 0 20 40 60 80 100 120 Reaction torque (kN · m) = 5 rad/s2 = 50 rad/s2 Figure D.20: Reaction torque for increasing values of α.
32 D. Raw simulation results Table D.3: Predominant frequencies and normalised singular values of the presented left side vectors. Deformed shapes and stress distribution for α= 50 rad/s2
D.1. Two-dimensional cantilever beam 33 Figure D.21: Deformed shape (×200) and σςς distribution (colour map, in KPa) at α= 50 rad/s2and Ω0= 50 rad/s. Time from 0 to 25 ms.
34 D. Raw simulation results D.2. Three-dimensional cantilever beam D.2.1. Natural modes and frequencies Figure D.22: Natural modes associated to the eight lowest natural frequencies of a 3D cantilever beam. Table D.4: Fifty lowest natural frequencies of a 3D cantilever beam.
D.2. Three-dimensional cantilever beam 35 D.2.2. Constant angular velocity Case 1: Ω= 25 rad/s Figure D.23: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.005 0.01 0.015 Time (s) -0.039 -0.038 V1 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V2 02468 Time (s) 10-3 -0.05 0 0.05 V3 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V4 02468 Time (s) 10-3 -0.05 0 0.05 V5 01234 Time (s) 10-3 -0.05 0 0.05 V6 0123 Time (s) 10-3 -0.05 0 0.05 V7 0 0.005 0.01 0.015 Time (s) -0.1 -0.05 0 0.05 V8 Figure D.24: Right side vectors (predominant oscillations) associated to the eight higher singular values.
36 D. Raw simulation results Case 2: Ω= 50 rad/s Figure D.25: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.005 0.01 0.015 Time (s) -0.03835 -0.0383 V1 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V2 02468 Time (s) 10-3 -0.05 0 0.05 V3 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V4 02468 Time (s) 10-3 -0.05 0 0.05 V5 01234 Time (s) 10-3 -0.05 0 0.05 V6 01234 Time (s) 10-3 -0.05 0 0.05 V7 0 0.005 0.01 0.015 Time (s) -0.1 -0.05 0 0.05 V8 Figure D.26: Right side vectors (predominant oscillations) associated to the eight higher singular values.
D.2. Three-dimensional cantilever beam 37 Case 3: Ω= 100 rad/s Figure D.27: Left side vectors (predominant modes) associated to the eight higher singular values. 0 0.005 0.01 0.015 Time (s) -0.03835 -0.0383 V1 0 0.005 0.01 0.015 0.02 Time (s) -0.05 0 0.05 V2 02468 Time (s) 10-3 -0.05 0 0.05 V3 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V4 02468 Time (s) 10-3 -0.05 0 0.05 V5 012345 Time (s) 10-3 -0.05 0 0.05 V6 0 0.005 0.01 0.015 Time (s) -0.05 0 0.05 V7 01234 Time (s) 10-3 -0.05 0 0.05 V8 Figure D.28: Right side vectors (predominant oscillations) associated to the eight higher singular values.
38 D. Raw simulation results Campbell diagram 0 200 400 600 800 (rpm) 57 58 59 (Hz) 4 5 6 1 (a) 0 200 400 600 800 (rpm) 59.15 59.16 59.17 (Hz) 0 0.05 0.1 2 (b) Modal SVD Relative error 0 200 400 600 800 (rpm) 329.2 329.4 (Hz) 0.22 0.24 3 (a) 0 200 400 600 800 (rpm) 329.57 329.575 329.58 329.585 (Hz) 0 0.005 0.01 4 (b) 0 200 400 600 800 (rpm) 359.6 359.8 (Hz) 0 0.2 0.4 5 0 200 400 600 800 (rpm) 638 638.5 639 (Hz) 0.5 1 6 0 200 400 600 800 (rpm) 805.4 805.5 805.6 (Hz) 0 0.05 7 (a) 0 200 400 600 800 (rpm) 805.54 805.545 805.55 (Hz) 0 5 10-3 8 (b) 0 200 400 600 800 (rpm) 1365.3 1365.35 1365.4 (Hz) 0 0.05 10 (a) 0 200 400 600 800 (rpm) 1365.42 1365.425 1365.43 (Hz) 2 3 10-3 11 (b) 0 200 400 600 800 (rpm) 1966.55 1966.6 1966.65 (Hz) 0 0.02 14 (a) 0 200 400 600 800 (rpm) 1966.62 1966.63 1966.64 (Hz) 0 2 410-3 15 (b) Figure D.29: Campbell diagram: comparison between modal prediction and SVD predominant frequencies. Subscripts aand brefer to pairs of equal modes that activate either on %or z.
D.2. Three-dimensional cantilever beam 39 Comparative figures 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 Time (s) -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 Local transverse displacement (mm) 25 rad/s 50 rad/s 100 rad/s Figure D.30: Temporal evolution of %displacements at the tip of a cantilever beam under constant angular velocity. 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 Time (s) -0.1102 -0.11 -0.1098 -0.1096 -0.1094 -0.1092 -0.109 -0.1088 -0.1086 -0.1084 Z displacement (mm) 25 rad/s 50 rad/s 100 rad/s 0 0.005 0.01 0.015 -0.110062 -0.110061 -0.11006 0 0.005 0.01 0.015 -0.1087435 -0.108743 -0.1087425 0 0.005 0.01 0.015 -0.1084138 -0.1084136 -0.1084134 Figure D.31: Temporal evolution of zdisplacements at the tip of a cantilever beam under constant angular velocity. 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 Time (s) 0 5 10 15 20 Reaction torque (kN · m) 25 rad/s 50 rad/s 100 rad/s Figure D.32: Reaction torque for increasing values of Ω.
40 D. Raw simulation results Deformed shapes and stress distribution for Ω= 50 rad/s Figure D.33: Deformed shape (×500) and σςς distribution (colour map, in KPa) at Ω0= 50 rad/s. Time from 0 to 17 ms (up-down, left-right).
E.1. One-dimensional stationary solver 47 11 xi(1)=0; 12 xi(2)=sqrt(3/5); 13 xi(3)=−sqrt(3/5); 14 15 %% Error computation 16 for e=1:n_el 17 x=[coor(e);coor(e+1)]; %Physical cordinates of element e 18 d=[uapprox(e);uapprox(e+1)]; %Nodal value of u 19 h_el=x(2)−x(1); %Element size 20 sum=0; %u error 21 sum_diff=0; %u' error 22 23 for i=1:3 %For each Gauss point 24 25 N=0.5*[1−xi(i), 1+xi(i)]; %Shape function 26 B=(1/h_el)*[−1,1]; %Derivative of the shape function 27 x_pos=N*x; %Change of variable in the cordinates of element e 28 29 30 uap=N*d; %Nodal u value (FEM) 31 uapdiff=B*d; %Nodal u' value (FEM) 32 33 uex=double(subs(uexact,x_pos)); %Exact u value 34 uexdiff=double(subs(diff(uexact),x_pos)); %Exact u' value 35 36 q=(uex −uap)^2; %Squared difference of the functions 37 q_diff=(uexdiff−uapdiff)^2; 38 39 sum=sum+w(i)*q; %Values at each Gauss point are added 40 sum_diff=sum_diff+w(i)*q_diff; 41 end 42 GQ= GQ + ((h_el/2)*sum);%Computation of the associated error 43 GQ_diff= GQ_diff +((h_el/2)*sum_diff); 44 end 45 GQ=sqrt(GQ); %Error in u 46 GQ_diff=sqrt(GQ_diff); %Error in u' 47 end
48 E. Developed code E.2. Modal analysis: free undamped vibrations 1%% Program to compute dynamic system response using modal analysis 2clc 3clear all 4if exist('ElemBnd')==0 5addpath('ROUTINES_AUX') ; 6end 7%% Load the data from the FEM program 8load('Inputs','M','K','dL','COOR','CN','TypeElement','posgp',... 9'NameFileMesh','DATA','DOFl'); 10 11 %% Initial assignments 12 M=M(DOFl, DOFl); % M −> M(LL) 13 K=K(DOFl, DOFl); % K −> K(LL) 14 n_nodes=size(COOR,1); 15 n_dim=size(COOR,2); 16 n_dofs=n_dim*n_nodes; 17 n_eig=8; %Number of modes to compute 18 19 %% Natural modes and frequencies 20 [MODES, FREQ] = UndampedFREQ(M,K,n_eig); %Eigenvalue problem 21 FREQ_HZ=FREQ./(2*pi); % Convert rad/s to Hz 22 23 %% Initial conditions 24 v_0=zeros(length(DOFl),1); %Initial velocities = 0 25 d_0=dL; %Initial displacements 26 27 q0 = MODES'*M*d_0; 28 q0_2 = MODES'*M*v_0; 29 fact=abs( q0./(norm(q0))); %Initial amplitude normalized 30 31 32 %% Plot normalised initial displacements 33 figure 34 subplot(2,1,1); 35 bar(fact); 36 title('Normalized initial amplitude vs Number of mode') 37 ylabel('Normalized initial amplitude') 38 39 %% Solver 40 TF = 0.2; % Final time of simulation 41 m=10000; % Number of divisions of the timespan 42 AT = TF/m; % Timestep 43 Fs = 1/AT; % Sampling frequency 44 time=linspace(0,TF,m); %Time vector 45 DYN_DIS=zeros(length(DOFl),length(time)); %Matrix of displacement vectors 46 47 for i=1:length(time) 48 t=time(i);
E.3. Numeric integration: Newmark β49 49 DIS=0; 50 for j=1:n_eig %Sum the effect of all the eigenvectors 51 harmonic = q0(j)*cos(FREQ(j)*t) ... 52 + (q0_2(j)/FREQ(j)) *sin(FREQ(j)*t); 53 DIS= DIS + MODES(:,j)*harmonic; 54 end 55 DYN_DIS(:,i)=DIS; 56 end 57 d_dyn=zeros(n_dofs,length(time)); 58 d_dyn(DOFl,:)=DYN_DIS; 59 60 %% GiD postprocessing 61 GidPostProcessModes(COOR,CN,TypeElement,... 62 MODES,posgp,NameFileMesh,n_eig,DOFl); 63 64 GidPostProcessDynamic(COOR,CN,TypeElement,d_dyn,'DYN_SOL',posgp,... 65 NameFileMesh,time); E.3. Numeric integration: Newmark β Main file 1%% Elastodynamic solver using the Newman−beta mehtod 2clc 3clear all 4 5addpath('ROUTINES_AUX','DATA','FEM','INPUTS','K_VECT','M_K_D_STANDARD',... 6'M_VECT','MODAL','ROTATION_STUFF') ; 7 8 9%% Inputs 10 % Extracts information from the mesh file 11 NAME_INPUT_DATA = 'BEAM2D' ; 12 13 [COOR,CN,TypeElement,TypeElementB, celasglo, DOFr,dR,... 14 Tnod,CNb,fNOD,Fpnt,NameFileMesh,typePROBLEM,... 15 celasgloINV,densglo,DATA] = ReadInputDataFile(NAME_INPUT_DATA) ; 16 17 %% Numeric data 18 tf = 5; %Final time 19 AT = 0.000005; %timestep 20 beta = 1/4; %Newmark beta 21 gamma = 1/2; %Numerical damping 22 TIME = linspace(0,tf,(tf/AT)+1); %Vector containing time values 23 24 %% MISCELLANEOUS data 25 %Rayleigh damping 26 aa=0.25; 27 bb=0.000025;
50 E. Developed code 28 29 timeElapsed = 0; %Time spent during the integration process 30 n_div=40; %Compute dynamic variables 1/40 of the time 31 32 %% Aeronautics−related case data 33 T0=0; % Initial torque generated by the device in kN m 34 TMAX = 25; % Nominal value of the torque in kN m 35 P_MAX = 50; % Nominal value of power in kW 36 rho_air=1.225e−3; % Air density in kKg/m^3 37 cd=0.008; % Drag coefficient 38 tA = 0.025; %Time at which torque generated stabilises 39 tB = 0.05; %Time at which engine turns on 40 tC = 0.12; %Time at which power generated stabilises 41 42 %% Initial rotation conditions 43 theta0 = 0; % Initial angular position 44 vel0 = 0; % Initial angular speed 45 alpha0=0; % Initial guess, used to approximate rotation matrices 46 47 %% PREPROCESS and initial matrix computation 48 % To be executed once 49 nnode = size(COOR,1); ndim = size(COOR,2); 50 nelem = size(CN,1); nnodeE = size(CN,2) ; 51 DOFl = 1:nnode*ndim ; 52 DOFl(DOFr) = [] ; 53 54 rnod = zeros(length(DOFr),2); %This vector contains the node number 55 %at which pertains each restricted degree of freedom, and the degree of 56 %freedom which is restricted (whether is X, Y or Z) 57 58 for i=1:length(rnod) 59 rnod(i,1) = ceil(DOFr(i)/ndim); 60 for n=1:ndim 61 if rem(DOFr(i),n) == 0 62 rnod(i,2) = n; 63 end 64 end 65 end 66 67 %Transform COOR into a vector 68 COOR_VECT = zeros(nnode*ndim,1); 69 for n=1:nnode 70 for d=1:ndim 71 COOR_VECT(ndim*(n−1)+d)= COOR(n,d); 72 end 73 end 74 75 %Constant matrices 76 disp('Computing M Matrix');
E.3. Numeric integration: Newmark β51 77 M= MassMatrix(densglo,COOR,CN,TypeElement); 78 M_dyn = M(DOFl,DOFl); 79 80 disp('Computing K Matrix'); 81 K2 = StiffnessMatrixGlobal(COOR,CN,TypeElement,celasglo,[],[]); %Vectorised! 82 Ftrac = FtracCOMP(COOR,CNb,... 83 TypeElementB,Fpnt,Tnod); %Traction forces (constant) 84 85 %Rigid body modes (2D) 86 RIGIDMODES = RBMODES(COOR_VECT, nnode); 87 P = RIGIDMODES'*M*RIGIDMODES; 88 inertia = P(3,3); 89 90 %Gauss Points Positions 91 TypeIntegrand = 'K'; 92 [~,posgp,~,~] = ComputeElementShapeFun(TypeElement,nnodeE,TypeIntegrand) ; 93 [Nst,NstW,ngaus]= VECTORISED_DATA(COOR,CN,TypeElement); 94 95 %% Initial conditions 96 97 %Displacement, velocity and acceleration at t=0 (FREE NODES) 98 load('Static_d','d'); % Load initial displacements from static FEM code 99 d0 = d(DOFl); % Initial local displacements 100 v0 = zeros(length(DOFl),1); % Initial local velocities 101 102 % Kinematic variables at constarined nodes 103 vR = zeros(length(DOFr),1); 104 aR = zeros(length(DOFr),1); 105 106 for j=1:2 % Iteration to guess initial angular velocity 107 108 if ndim==3 109 VEL0 = [0 −vel0 0; vel0 0 0; 0 0 0]; 110 ALPHA0 = [0 −alpha0 0; alpha0 0 0; 0 0 0]; 111 else 112 VEL0 = [0 −vel0; vel0 0]; 113 ALPHA0 = [0 −alpha0; alpha0 0]; 114 end 115 116 % Compute initial local acceleration 117 [K_rot0,D_rot0,Fb0 Mass_Rotation(densglo,COOR,COOR_VECT,CN,... 118 TypeElement,ALPHA0,VEL0,0); 119 120 K0 = K2 + K_rot0; % Initial rotation matrix 121 D0 = D_rot0 + aa*M + bb*K2; % Initial damping matrix 122 123 F0 = Fb0 + Ftrac; % Initial force vector 124 125 a0 = M_dyn\(F0(DOFl)−D0(DOFl,DOFl)*...
52 E. Developed code 126 v0−K0(DOFl,DOFl)*d0); % Initial local acceleration 127 128 % Initial reactions 129 R0 = DYN_REACT(d0, v0, a0, dR, vR, ... 130 aR, M, K0 , D0, F0,DOFl,DOFr); %Initial elastic reactions 131 Total_R0 = Total_Reactions(R0,COOR,rnod); %Total reactions in each axis 132 W0 = Total_R0(6); %Initial elastic reaction torque in Z 133 alpha0 = (1/inertia)*(T0−W0); %Initial angular acceleration 134 end 135 136 137 % Fist step corresponds to initial conditions 138 d_n = d0; 139 v_n = v0; 140 a_n = a0; 141 142 acc = alpha0; 143 vel = vel0; 144 145 %% Matrix definition 146 % Vector to store local displacements at a specific t 147 d = zeros(nnode*ndim,1); 148 % Vector to store local velocities at a specific t 149 v = zeros(nnode*ndim,1); 150 % Vector to store local accelerations at a specific t 151 a = zeros(nnode*ndim,1); 152 153 %Matrix to store inertial variables for each t 154 DYN_DIS=zeros(nnode*ndim,floor(length(TIME)/n_div)); 155 DYN_VEL=zeros(nnode*ndim,floor(length(TIME)/n_div)); 156 DYN_ACC=zeros(nnode*ndim,floor(length(TIME)/n_div)); 157 158 % Matrix to store local displacements for each t 159 DYN_DIS_LOCAL = zeros(nnode*ndim,floor(length(TIME)/n_div)); 160 161 % Matrix to store local reactions for each t 162 R_all = zeros(length(DOFr),floor(length(TIME)/n_div)); 163 164 %Matrix to store nodal contribution of the forces at a specific t 165 F = zeros(nnode*ndim,1) ; 166 167 % Vector to store rotation variables for each t 168 angular_vel = zeros(1,floor(length(TIME)/n_div)); 169 angular_acc = zeros(1,floor(length(TIME)/n_div)); 170 torque = zeros(1,floor(length(TIME)/n_div)); 171 power = zeros(1,floor(length(TIME)/n_div)); 172 drag = zeros(1,floor(length(TIME)/n_div)); 173 174 %% SOLVER
E.3. Numeric integration: Newmark β53 175 j=1; %Counter for saving dynamic results (1) 176 177 for i=1:length(TIME) 178 tic; 179 t = TIME(i); % Actual time 180 181 % Vector of local displacements at tn 182 d(DOFl)= d_n; 183 d(DOFr) = dR ; 184 % Vector of local velocities at tn 185 v(DOFl)= v_n; 186 v(DOFr) = vR ; 187 % Vector of local accelerations at tn 188 a(DOFl)= a_n; 189 a(DOFr) = aR ; 190 191 192 %Rotation matrices 193 194 if ndim==3 195 Q = [cos(theta) −sin(theta) 0; ... 196 sin(theta) cos(theta) 0; ... 197 0 0 1]; %Rotation matrix 198 VEL = [0 −vel 0; vel 0 0; 0 0 0]; 199 ACC = [0 −acc 0; acc 0 0; 0 0 0]; 200 VEL2 = [0 −(vel^2) 0; vel^2 0 0; 0 0 0]; 201 else 202 Q = [cos(theta) −sin(theta); ... 203 sin(theta) cos(theta)]; %Rotation matrix 204 VEL = [0 −vel; vel 0]; 205 ACC = [0 −acc; acc 0]; 206 VEL2 = [0 −(vel^2); vel^2 0]; 207 end 208 209 % Compute matrices that depend on angular variables 210 [K_rot,D_rot,Fb,Fdrag]= Mass_Rotation(densglo,COOR,COOR_VECT,... 211 CN,ACC,VEL,VEL2,rho_air,cd,Nst,NstW,ngaus); 212 213 F = Fb+Ftrac+Fdrag; 214 K =K2 + K_rot; 215 D = D_rot + aa*M + bb*K2; 216 217 % Compute matrices for dynamic solving 218 K_dyn = K(DOFl,DOFl); 219 D_dyn = D(DOFl,DOFl); 220 F_dyn = F(DOFl)−(M(DOFl,DOFr)*aR + D(DOFl,DOFr)*vR + K(DOFl,DOFr)*dR); 221 222 %Compute bar (~) vectors and matrices 223 dn_bar = d_n+ AT*v_n + AT^2 *0.5*(1−2*beta)*a_n;
54 E. Developed code 224 vn_bar = v_n + (1−gamma)*AT*a_n; 225 M_bar = (M_dyn + gamma*AT*D_dyn)/(beta*AT^2); 226 227 %Solve the system 228 d_n1 = (M_bar + K_dyn)\(F_dyn −D_dyn*vn_bar + M_bar*dn_bar); 229 a_n1 = (1/(beta*AT^2))*(d_n1 −dn_bar); 230 v_n1 = vn_bar + gamma*AT*a_n1; 231 232 %Next time−step 233 d_n = d_n1; 234 v_n = v_n1; 235 a_n = a_n1; 236 237 %Elastic reactions at tn due to local displacements 238 R = DYN_REACT(d_n1, v_n1, a_n1, dR, vR, aR, M, K , D, F,DOFl,DOFr); 239 Total_R = Total_Reactions(R,COOR,rnod); 240 W_n=Total_R(6); %Elastic reaction torque in Z 241 242 % Power and torque injected by the engine 243 if t<tA 244 T = T0+TMAX*sin(t*pi/(2*tA)); 245 POWER = T*vel; 246 elseif t<tB && t>tA 247 T = TMAX; 248 POWER = T*vel; 249 P_INI=T*vel; 250 elseif t<tC && t>tB 251 CONST1=pi/(tC−tB); 252 CONST2=pi*(0.5−tC/(tC−tB)); 253 POWER = 0.5*(P_INI+P_MAX)+0.5*(P_MAX−P_INI)*sin(CONST1*t+CONST2); 254 T=POWER/vel; 255 else 256 T=P_MAX/vel; 257 POWER = T*vel; 258 end 259 260 %Implicit scheme for angular acceleration 261 velbar = vel+(1−gamma)*AT*acc; 262 acc = (1/inertia)*(T−W_n); 263 vel = velbar+gamma*AT*acc; 264 265 %Variables to post−process 266 if rem(i,n_div)==0 %Save 1/n_div of the timesteps 267 268 % Inertial variables 269 [DYN_DIS(:,j),DYN_VEL(:,j),DYN_ACC(:,j)] = ROTATED_VECT... 270 (d,v,a,Q,COOR_VECT,ndim,nnode, vel,acc); 271 272 % Local displacements
E.3. Numeric integration: Newmark β55 273 DYN_DIS_LOCAL(:,j)=d; 274 275 % Local reactions 276 R_all(:,j) = R; 277 278 % Stresses and strains 279 d(DOFl)= d_n; 280 d(DOFr) = dR ; 281 282 v(DOFl)= v_n; 283 v(DOFr) = vR ; 284 285 [~, stressGLO(4*j−3:4*j,:), ~ ]= ... 286 StressStrainsTest(COOR,CN,TypeElement,celasglo,d,... 287 typePROBLEM,celasgloINV,bb,DATA,v) ; 288 289 % Maximum value of stress 290 stress_x_max(j) = max(abs(stressGLO(4*j−3,:))); 291 stress_y_max(j) = max(abs(stressGLO(4*j−2,:))); 292 stress_xy_max(j) = max(abs(stressGLO(4*j−1,:))); 293 294 %Angular variables 295 angular_vel(j) = vel; 296 angular_acc(j) = acc; 297 torque(j) = T; 298 power(j) = POWER; 299 drag(j) = sum(Fdrag); 300 301 newT(j) = t; 302 j=j+1; 303 end 304 305 %Display integration status 306 timeElapsed = timeElapsed + toc; 307 PERC = 100*(i/length(TIME)); %Completion percentage 308 timeRemaining =(100−PERC)*timeElapsed/(PERC); 309 if mod(i−1,1+round(5*length(TIME)/1000))==0 310 clc 311 disp(['%%%%%%%%%%%%%%%%%%%%%%%%%']); 312 disp(['INTEGRATION IN PROCESS']); 313 disp(['beta = ',num2str(beta), ' , gamma =', num2str(gamma)]); 314 disp(['%%%%%%%%%%%%%%%%%%%%%%%%%']); 315 disp([num2str(PERC), ' % completed']); 316 if timeElapsed<60 317 disp([num2str(timeElapsed), ' seconds elapsed']); 318 else 319 disp([num2str(timeElapsed/60), ' minutes elapsed']); 320 end 321 if timeRemaining<60
56 E. Developed code 322 disp([num2str(timeRemaining), ' seconds remaining']); 323 else 324 disp([num2str(timeRemaining/60), ' minutes remaining']); 325 end 326 327 end 328 329 end 330 331 clc 332 disp(['%%%%%%%%%%%%%%%%%%%%%%%%%']); 333 disp(['SAVING RESULTS']); 334 disp(['%%%%%%%%%%%%%%%%%%%%%%%%%']); 335 336 %% Postprocess 337 GidPostProcessDynamic2(COOR,CN,TypeElement,Post_dis,'DYN_SOL',posgp,... 338 NameFileMesh,newT,stressGLO,[]); 339 340 %% Save for the SVD 341 save('Results','M','COOR','CN','TypeElement','posgp',... 342 'NameFileMesh','DOFl','newT','Post_dis'); 343 344 disp(['DONE!']); Vectorised assembly 1%% Computes rotation vectors and matrices 2 3function [K_rot,D_rot,Fb,Fdrag]= Mass_Rotation(DENSGLO,COOR,COOR_VECT,... 4CN,ACC,VEL,VEL2,rho_air,cd,Nst,NstW,ngaus) 5 6if nargin == 0 7load('tmp.mat') 8end 9%% Constants 10 nnode = size(COOR,1); ndim = size(COOR,2); 11 nelem = size(CN,1); nnodeE = size(CN,2) ; 12 13 MATK = VEL*VEL+ACC; %For computing rotation stiffness 14 MATD = 2*VEL; %Coriolis 15 16 %% Vectorised computation 17 % Gyroscopic 18 matkglo = repmat(MATK,ngaus*nelem,1); 19 MATKGLO=ConvertBlockDiag(matkglo); 20 % Coriolis 21 matdglo = repmat(MATD,ngaus*nelem,1); 22 MATDGLO=ConvertBlockDiag(matdglo); 23 % Nodal forces 24 matfglo = repmat(MATK,nnode,1);
E.6. Others 63 64 legend('show','Location','best') 65 xlabel('\xi'); 66 67 figure 68 dershape2=diff(dershape); 69 fplot(dershape2,[−1 1]); 70 title('d^{2}N / d\xi^{2}'); 71 legend('show','Location','best') 72 xlabel('\xi'); Rotation tensor computation 1%% Function to compute the rotation tensor T 2clc 3clear all 4 5%% Definitions 6syms xx xy xz yy yz zz o; %Corotational coordinates 7syms XX XY XZ YY YZ ZZ; %Inertial coordinates 8Q = [cos(o) −sin(o) 0; sin(o) cos(o) 0; 0 0 1]; % Rotation matrix 9 10 sigma = [xx xy xz; xy yy yz; xz yz zz]; % Stress tensor in local frame 11 sigma_voigt=[xx yy zz yz xz xy].'; %Voigt stress vector in local frame 12 13 %% Computation 14 sigma2=Q*sigma*Q.'; % Rotation tensor in the inertial frame 15 XX= sigma2(1,1); 16 YY= sigma2(2,2); 17 ZZ= sigma2(3,3); 18 XY= sigma2(1,2); 19 XZ= sigma2(1,3); 20 YZ= sigma2(2,3); 21 sigma2_voigt=[XX YY ZZ YZ XZ XY].'; %Voigt stress vector in global frame 22 23 T = [ cos(o)^2 sin(o)^2 0 0 0 −2*sin(o)*cos(o); 24 sin(o)^2 cos(o)^2 0 0 0 2*sin(o)*cos(o); 25 001000; 26 0 0 0 cos(o) sin(o) 0; 27 000−sin(o) cos(o) 0; 28 sin(o)*cos(o) −sin(o)*cos(o) 0 0 0 (cos(o)^2−sin(o)^2)];
Bibliography [1] J. S. Rao, History of rotating machinery dynamics. Springer, 2011. [2] D. V. Hutton, Fundamentals of Finite Element Analysis. Mc Graw Hill, 2004. 64