/5/ FEM Method We will explore: D linear & higher order elements D triangular & rectangular elements Powerful method developed originally to solve structural mechanics problems (e.g. bridges, buildings, etc..) Can be applied to flow, solute, and heat transport problems FEM Method Has underlying theorejcal basis in branch of mathemajcs called calculus of variajon Within each element, the unknown variable is approximated using polynomials that depend only on the spajal coordinates (i.e. h = a + bx + cy +...). The verjces of the elements are referred to as nodes. Triangular Element Originally developed for solid mechanics problems Tri FEM Mesh of Baseball and Bat FEM Mesh of Dam
/5/ Finite Element Method & Calculus of VariaJons Involves minimizing residual errors using integrajon Conceptually similar to the cannon ball trajectory problem solved using the calculus of variajons method (see Feynman s lecture notes) t t Action = S = m dx t [ KE PE]dt = mgx t dt = t [ F(x,t) ]dt dt t x(t) = x (t) + η(t) m dx t + mg dx t η(t)dt = t [ F(x,t)]η(t)dt = dt dt t η(t) x(t) x (t) x(t) x (t) η(t) - one possible path - true path - deviation feynman_vc.pdf True path is the path of minimum energy! FD method using Taylor s Series Expansion FE method uses IntegraJon by Parts Example: Solve the following Integral. The integrand is the product of two functions udv = uv xe x dx vdu let e x dx = dv v =e x let u = x du =dx xe x dx = xe x e x dx = xe x e x
/5/ Steps in FEM Method, D Example Formulate Diff. Eq. T transmisivity (m /day) H head (m) Q recharge (m/day) h(,t) = specified head q(l,t) = specifed flux DiscreJze SoluJon Domain x T h x = Q x T h x Q = L Define Local Coordinate System x = x x Steps in FEM Method, D Example Construct (linear) Trial SoluJon for each element ˆ h = a + bx h = a h = a + b b = h h h ˆ = h + h h x h ˆ = h x + h x = φ nh n φ = x φ = x φ Shape funcjons
/5/ Steps in FEM Method, D Example Construct (linear) Trial SoluJon for each element ˆ h = a + bx h = a h = a + b b = h h h ˆ = h + h h x h ˆ = h x + h x = φ n h n φ = x φ = x φ Shape funcjons Shape FuncJon ProperJes Linear variajon across element from to DerivaJves of linear shape funcjons are constant h ˆ x = φ n x h n φ x = φ x =
/5/ D FEM SubsJtute Trial SoluJon into Diff. Eq. x T h ˆ Q x MulJply trial solujon by a weighjng funcjon and require the weighted residual errors integrate to zero across the element v weighjng FuncJon x T h ˆ Q x vdx = v = Φ m φ m ( x) = D FEM Steps Use IntegraJon by parts to lower the order of the PDE x T h ˆ Q x vdx = T v h ˆ x x dx Qvdx+ o vt h ˆ x = SubsJtute Trial SoluJon and weighjng funcjon into weak form of PDE v weighjng FuncJon h ˆ = Φ N= N (x )h N v = Φ M (x) M = 5
/5/ D FEM Steps This results in a system of algebraic EquaJons T φ m x φ n x h dx h Qφ m dx = A mn h n = B m A mn= T φ m x B m = Qφ m dx = φ n x dx D FEM Steps Evaluate Integrals:, A = A = T φ φ x x dx = Evaluate Integrals: m=, T dx = T B = Qφ dx = Q x dx = Q x x = Q A = A = T φ φ x x dx = T dx = T B = Qφ dx = Q x dx = Q x = Q 6
/5/ ProperJes of Shape FuncJons: (x ) = Φ + Φ = Φ N= N Φ ( x = x ) = Φ ( x = x ) = ; or Φ i ( x j ) = δ ij This is true for any point along the element (i.e. x ) ProperJes of Shape FuncJons: h ˆ x = Φ N h N= N = Φ x x h + Φ x h ˆ h x = h + h D-FEM 7
/5/ FEM D Steps A mn = T B m = Q T T = Q h h h = Q h h h element element Assemble Global Matrix: T = Q h h h Global Steps D FEM Impose specified Head Boundary CondiJon @ x= h(x = ) = h o T Impose specified Flux Boundary CondiJon @ x=l h h h h o T = Q + h o Q Generalized Tridiagonal Matrix.look familiar?? q(x = L) = q o T h h h h o T = Q + h o Q + q o 8
/5/ D FEM Steps Let: T = T = m day =m = m Q = Q = 6 m day q o = h o = Global Matrix Becomes: T.5.5.5.5 h h h = 9 7 SoluJon (Gaussian EliminaJon): h h h = 6 AnalyJcal SoluJon Comparison h = h o Q x T xl + q x o T Unlike the finite difference method, the finite element method provides us with an estimate of the hydraulic heads everywhere within the solution domain. 9
/5/ DeterminaJon of Elemental Fluxes FEM: Analytical: q = T h ˆ x = Φ N h N= N = T Φ x x h + Φ x h q = T h + h [ ] q o q = +Q x L Higher Order Elements h h h x= x=/ x= h ˆ = a + bx + cx h = a h = a + b + c h ˆ = n = φ n h n Φ = x + x Φ = x x Φ = x x h = a + b + c
/5/ Lagrange Family of Shape FuncJons φ i = Π N j =(x x j ) Π N j = (x i x j ) i j Example : N= (linear element) φ = (x x ) (x ) = (x x ) ( ) = x Example : N= (quadatric element) φ = (x x )(x x ) (x )(x ) x + x (x x )(x x ) = = φ = x + x Lagrange Family Shape Functions: Quadratic Elements Properties of Lagrange Shape Functions N φ i = i= φ i (x j ) = φ i (x i ) = i j
/5/ DerivaJves of Shape FuncJons h ˆ x = φ n x h n Φ = x + x Φ = x x Φ = x x Φ x = + x Φ x = 8x Φ x = + x D FEM QuadraJc SubsJtute Trial SoluJon into Diff. Eq. x T h ˆ Q x MulJply trial solujon by a weighjng funcjon and require the weighted residual errors integrate to zero across the element v weighjng FuncJon x T h ˆ Q x vdx = v = Φ m φ m ( x) =
/5/ D FEM QuadraJc Steps This results in a system of algebraic EquaJons T φ m x φ n x h dx h Qφ m dx = A mn h n = B m A mn= T φ m x B m = Qφ m dx = φ n x dx Evaluate QuadraJc A mn Evaluate Integrals:, A = T φ φ x x dx = T + x dx = T A = T 9 + 6 A = 7T Evaluate Integrals: m=, A = A = T φ φ x x dx = T + x 8x dx A = T + 6x + x x dx A = T + 8 + = 8T 9 x + 6x dx You can do the rest.
/5/ Load Vector B = QΦ dx = Q x + x dx = Q + = Q 6 B = QΦ dx = Q x x dx = Q x x dx = Q = Q You can do B Final A mn Matrix Quad. Element A mn = T 7 8 8 6 8 8 7 Linear Element T Final B m Vector B m = Q 6 Q
/5/ Assemble Global Matrix 7 8 h 8 6 8 T h 8 7 h = Q h 6 h 5 h T h 7 8 h = Q 8 6 8 h 6 8 7 h 5 7 8 h 8 6 8 T h 8 8 h = Q 8 6 8 h 6 8 7 h 5 Element Element Global h o h Q T + 8h o 6 8 T h Q 8 8 h = 8 6 8 h Q 8 7 h 5 Q 6 + q o Enforce B.C. Note A mn Matrix is no longer tridiagonal Solve System of EquaJons Let: T(element-) = T(element-) = = q o = h o = Q(element-) = 6 Q(element-) = 6 h = h =.9 h =. h =.5 h 5 =.667 5
/5/ Solve System of EquaJons (use local coordinate system For elemental flux calc. (<x<) Transient FEM Problems x T h x = S h s t The finite element solution to this time dependent problem is very similar to the approach taken to solve Poisson's Equation. We use the same trial solutions: h ˆ = φ n h n φ = x φ = x 6
/5/ Transient FEM Problems h vs s dx + T v h dx = t x x Since h n is not a function of t, we get the following integrand For the time dependent derivative: vss h h dx = S n s t t φ n k h + k φ m dx = P n h n mn Δt P mn = S s φ n φ m dx Transient FEM Problems So our governing equation can be recast in matrix form as: A MN h n k + + P mn h n k + h n k Δt = Recall we already know what A mn is A mn = T So now we need to solve for P mn : P mn = S s φ n φ m dx 7
/5/ Transient FEM Problems Evaluate the matrix: P = S s x dx = S s x + x dx P = S s x x + x = S s P = P = S s x x dx x = S s x dx P = S s x x = S s 6 Transient FEM Problems Evaluate the matrix: x P = S s dx P mn = S s 6 P = S s x = S s Putting it all Together: Recall: A mn = T B m = Q S s 6 h k + k + n h n + T k h + Δt n = 8
/5/ Fully Implicit FormulaJon A mn + P mn Δt h k + k n = P mn h n Writing out the equations for element, nodes and : A + P Δt A + P Δt A + P Δt A + P Δt h k + h k + h k + [ P Δt]h k k + [ P Δt]h = [ P Δt]h k k + [ P Δt]h element 9