homework # 4: finite element methods for twofaculty.uml.edu/dwillis/mech5200/pset_4_fem.pdf ·...

6
HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 DUE: LAST DAY OF SEMESTER (ABSOLUTE LATEST: 5/7/2018) 1. Two-Dimensional, Potential Flow Equation In this homework you will use finite element methods to examine the linear potential flow around NACA 4-digit airfoils and elliptical shapes. A series of (semi-complete) skeleton codes has been provided to you to help with this assignment: FEMAirfoilSolver_Skeleton.m getDiscreteGeometry.m calculateArea.m getNACA.m You will need to modify the following code to get this the solver to a working state: FEMAirfoilSolver_Skeleton.m An example two-dimensional geometry for a NACA 0045 is shown below: Figure 1. (left) The complete discrete geometry (right) zoom of the ge- ometry in question) 1

Upload: others

Post on 25-Sep-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO

DIMENSIONAL PROBLEMS, V1.0

DUE: LAST DAY OF SEMESTER (ABSOLUTE LATEST: 5/7/2018)

1. Two-Dimensional, Potential Flow Equation

In this homework you will use finite element methods to examine the linear potential flowaround NACA 4-digit airfoils and elliptical shapes. A series of (semi-complete) skeletoncodes has been provided to you to help with this assignment:

FEMAirfoilSolver_Skeleton.m

getDiscreteGeometry.m

calculateArea.m

getNACA.m

You will need to modify the following code to get this the solver to a working state:

FEMAirfoilSolver_Skeleton.m

An example two-dimensional geometry for a NACA 0045 is shown below:

Figure 1. (left) The complete discrete geometry (right) zoom of the ge-ometry in question)

1

Page 2: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

2 DUE: LAST DAY OF SEMESTER (ABSOLUTE LATEST: 5/7/2018)

Figure 2. (left) The mirrored domain (middle) the scalar potential (right)the flow velocity)

2. Theory

You will use potential flow theory to explore the flow around the various objects inquestion. Consider the PDE that describes the conservation of mass for an incompressiblefluid:

(1) ∇ · ~u = 0.

We can introduce a scalar potential function, φ, such that:

(2) ∇φ = ~u

Page 3: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 3

By definition the resulting flow is irrorational (∇ × ~u = 0). The conservation of massequation (equation 1) can be combined with the scalar potential definition (equation 2) toyield:

∇ · ~u(x, y) = ∇ · (∇φ(x, y))

= ∇2φ(x, y)

= 0

The potential flow equation (∇2φ = 0), will be solved using FEM in this homework project.Once solved on the half two-dimensional domain, the full domain solution will be recon-structed by mirroring the domain as shown in figure 2. The geometry discretization andskeleton code is provided for you in the download packet.

2.1. Boundary Conditions. The upper and lower boundaries (top and bottom bound-aries) have a prescribed no-normal flow boundary condition. This includes the airfoil or theellipsoidal shape being examined. This corresponds to the following boundary conditionexpression:

(3) ~u · n̂ =∂φ

∂n= 0.

At the left and right hand sides, we will apply a prescribed potential value. Based onpotential flow theory, we can set the value at these boundaries equal to the value of thex-coordinate at those locations. This effectively sets up a uniform freestream flow enteringand exiting the domain:

(4) φ(x = XLHS , y) = XLHS

(5) φ(x = XRHS , y) = XRHS

These boundary conditions should be easy to apply in your implementation. The ge-ometry routine infact only hands back the locations where the Dirichlet condition will beapplied (BIG hint).

Page 4: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

4 DUE: LAST DAY OF SEMESTER (ABSOLUTE LATEST: 5/7/2018)

3. Sample Solutions

Below are some sample solutions:

Figure 3. (upper-left) The grid (upper right) the scalar potential value,(lower left) zoom in of the scalar potential and the velocity vectors (lowerright) The velocity in the domain. )

Page 5: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5

4. Tasks and Deliverables

(1) Starting from the strong form of the partial differential equation, derive the relevantweak form that will be used as the basis of the finite element method.

(2) Show how the weak form that you have derived represents the minimization of thekinetic energy in the potential flow representation (See Video).

(3) What are the benefits/negatives/differences between the weak and strong form ofthe equations?

(4) In your own words, describe how the FEM (and FVM) is different than finitedifference methods when it comes to how these methods represent the solution.

(5) You will use linear-hat nodal basis functions to represent the solution and the testfunctions in your solver. Describe/draw how these linear hat basis functions lookin both one and two dimensions for:(a) For a node i in the triangulation, show the ”tent/hat” basis function (nodal

hat basis function)(b) For an element k, show the two/three linear basis functions on a line/triangular

element.(6) For 1D and 2D domains write the discrete form of the weak form of the equation

for a weighting function/node i in the domain.(7) For 1D and 2D domains write the discrete form of the weak form of the equation

for a node i on the boundary of the domain where you have Dirichlet BCs.(8) For 1D and 2D domains write the discrete form of the weak form of the equation

for a node i on the boundary of the domain where you have Neumann BCs.(9) For 1D and 2D domains derive the elemental matrices (each element or triangle has

its own matrix) that will be used to build the overall A-matrix (stiffness matrix).Also derive the elemental load vectors that will be used to construct the RHS. Besure to illustrate how you will calculate the gradient of the basis function valuesusing the equation for a plane surface.

(10) Describe the Stamping procedure that will be used to construct the global matrixusing the elemental matrices. You may use both words and example matrices.

(11) For each boundary condition, describe the implementation in your FEM code.(12) Write pseudo code describing the finite element method implementation that you

will use.(13) Add the elemental matrices and boundary conditions to the provided pseudo code

and complete the FEM solver so that it works (currently the solver has some incor-rect numbers in it to allow it to ”work” when you press run). You may optionallydevelop your own two-dimensional FEM solver. If you choose to use the Matlabversion provided, please read through and understand the comments and structure.If you choose to develop your own solver, please use the geometry definition toolprovided to generate base grids.

(14) Solve the potential flow problem and plot the scalar potential using a minimumgrid refinement value of 3.

Page 6: HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWOfaculty.uml.edu/dwillis/mech5200/PSET_4_FEM.pdf · HOMEWORK # 4: FINITE ELEMENT METHODS FOR TWO DIMENSIONAL PROBLEMS, V1.0 5 4. Tasks and

6 DUE: LAST DAY OF SEMESTER (ABSOLUTE LATEST: 5/7/2018)

(15) Show how the value of your scalar potential solution at the front of the object(location 0,0) converges with grid refinement.