<!DOCTYPE html>
Begin with the mass conservation equation:
(4.1) |
Because the curl of the gradient of any scalar function has to be zero, if the vorticity vector defined as
(4.2) |
the velocity can be defined as the gradient of a scalar potential function:
(4.3) |
then the governing equation for comes directly from continuity:
(4.4) |
This is the simplest possible elliptic pde: Laplace’s equation. Since there can be no flow through a boundary, the required boundary conditions are that the normal component of vanish at the boundary. These are neumann conditions.
For a two dimensional flow (can be extended to axisymmetric) flow, a streamfunction can be defined as:
(4.5) |
In general, the streamfunction is related to the vorticity by:
(4.6) |
The condition that the vorticity be zero then gives:
(4.7) |
so that both the stream and potential functions satisfy Laplace’s equation. This is very surprising. Usually the combined NS and mass conservation equations have to be solved for the velocities and pressure. Now a single (very simple) equation has to be solved for a single dependent variable: the potential function, or the streamfunction.. Part of the mystery is wrapped up in the condition that the vorticity has to be zero. For completeness, consider how to evaluate the pressure field given the potential ..
Once the streamfunction or the potential function is know, the velocities are given by either equation 4.3, or equation 4.5. The pressure is then given by Bernouilli’s equation. The momentum equation (now called the Euler equation) can be written as:
(4.8) |
Noting that
(4.9) |
and with , for a constant density fluid, the momentum equation is
(4.10) |
This is Bernouilli’s equation. The component parallel to a streamline (or to ) is:
(4.11) |
where represents distance along a streamline. This is because is perpendicular to . The component normal to the streamline is:
(4.12) |
which shows that for a flow to change direction, the pressure must vary in the direction normal to the streamline.
For steady flow, the inviscid momentum equation can be integrated between any points on a streamline with the result that
(4.13) |
in words, the expression on the left hand side is a constant along the streamline. This is Bernouilli’s equation for steady, inviscid, rotational flow. The finite element method is ideally suited for such problems in two dimensions, particularly when the domain is irregular.
Read Strang pp 305-316
Mesh regularity is a desirable property for Finite Elements. By
regularity we don’t mean size, what we are looking for are grids where
there are no long, skinny triangles. Ideally the grid would consist
only of equlqteral triangles. Persson wrote DistMesh with this goal
in mind. Three grids produced by DistMesh are illustrated in
figure 4.1.
Each mesh consists of nodes. The gridding procedure determines coordinates for each node as well as a connection table consisting of a list of the three nodes at the vertex of each element.
The script to produce these plots is listed in 4.5.1
Just as in the one-dimensional case, the test function is defined as having unit value at one particular node, and zero at all other nodes. A test function is illustrated in figure 4.2.
It is teepee shaped, the central node is directly connected to six peripheral nodes: the functions has six sides, or elements.
As in the one-dimensional case, there are several choices for the polynomial representing the test (or trial) function in an element. The FEM procedure (Galerkin’s method) consists of representing the dependent variable (e.g. ) as an expansion over a set of test functions , in such a way that the governing equation and BC provide estimates of the solution at each node. The test functions are always chosen to be polynomials:
(4.14) |
The constant is the value of the solution at node .
The simplest representation uses linear polynomials. The most general form for a two dimensional test function is . This conforms to equation 4.14 with , and related as in table 4.1.
k | 1 | 2 | 3 |
---|---|---|---|
p(k) | 0 | 1 | 0 |
q(k) | 0 | 0 | 1 |
Each triangular element requires three TF, corresponding to the maximum value occuring at each of the three vertices.
The general approach to finding the coefficients in equation 4.14 is to write a system of equations that satisfies the constraint that each TF is unity at a vertex and zero at the three other vertices. A reference element, known as the canonical triangle, with coordinates ; ; and is illustrated in the left frame of figure 4.3.
For this example, the three equations for are:
(4.15) | |||||
The solution is: , and
This approach may be extended to all three test functions in one step by writing:
(4.16) |
is made up of the values at each of the three nodes. Then is the matrix of coefficients. In this case
(4.17) |
For the canonical triangle, the three test functions are therefore:
(4.18) |
These 3 functions are illustrated in figure 4.4.
Other choices of test functions include quadratic and cubic Legendre polynomials and quintic Hermite polynomials.
For the general triangle illustrated on the right of figure 4.3. The coordinates of each vertex are given in table 4.2.
Vertex | ||
---|---|---|
The matrices and are:
(4.19) |
If the velocity is solenoidal (meaning the velocity satisifies ), the velocity can be written as the gradient of a potential function 11 1 please do not confuse the potential function with the test functions . For two dimensional flow, a streamfunction may also be defined. The streamfunction is related to the velocities through:
(4.20) |
Both potential and streamfunctions satisfy Laplace’s equation, but with boundary conditions expressed differently in each case. For uniform streaming flow, the boundary conditions specify a non-zero velocity at two ends of the domain, and zero velocity along two bounding walls. If the streamwise velocity is constant, equal to one, the problem for the streamfunction is:
(4.21) |
Note that both potential and streamfunctions need only be defined to within an arbitrary constant.
To get the weak form multiply equation 4.21 by a test functions and integrate over the whole domain:
(4.22) |
Integrate by parts and use the divergence theorem to get:
(4.23) |
Because the boundary conditions are Dirichlet and the solution along the boundaries is known a priory, the term on the left of equation 4.23. The solution is expanded in terms of test/trial functions, take to be linear polynomials:
(4.24) |
where the represent the solution at each node. Introducing this expansion into equation 4.23 gives
(4.25) |
The right hand side of equation 4.25 represents forcing along the boundaries by nonhomogeneous Neumann boundary conditions. To remain consistent with the Divergence theorem, the integral must be evaluated in the clockwise direction around the domain. The polynomial order of the testfunctions used along the edges, , must be consistent with the order of the interior TF: if linear TF are used in the interior then one-dimensional linear TF are used to evaluate the forcing along the boundary.
Because the boundary conditions for the streamfunction problem are Dirichlet, the right hand side of equation 4.25 is zero. Then then matrix form of equation 4.25is
(4.26) |
This is a system of equations, but there are only variables, where is the number of Dirichlet nodes. Denote the known part of the streamfunction values as , and the interior values as . If the order of the sequence of nodes is arranged such that all the boundary nodes come before the interior nodes, schematically equation 4.26 looks like:
(4.27) |
The elements of above the double horizontal line are of no use, since the solution at the correponding (boundary) nodes is known. The matrix 4.25 multiplies a know quantity. Keeping the known and unknown parts of equation 4.27 on the right and left side gives:
(4.28) |
Consider the grid illustrated in figure 4.5.
There are nodes, of which are at the boundaries We shall need the stiffness matrix . Following
The one-dimensional stiffness matrix is defined in equation 1.23. In two dimensions we use Maxima to find the elements of are:
(4.29) |
where is the area of the test function.
The assembly of after the contributions from elements 1 and 2 is as follows:
(4.30) |
It is useful to notice that after contribution from the second element have been added in, the bottom line of is no longer zero. This is because element includes element as one ot the vertices, corresponding to the last row of . After adding in the six other elements, becomes:
(4.31) |
The top 8 rows of are to be ignored. The last row shows that the value at the unknown node is equal to the average of the values at nodes , , and . This is the classic five-point Laplacian. The solution is .
To evaluate the streamlines for fluid flowing over a cylinder, we use grid illustrated in the center of figure LABEL:Fi:C4S3figure1. We need to specify the streamfunction on all boundaries, including the cylinder, where we take the streamfunction to be zero. The solution, obtained with script LABEL:sec:OctaveC4S4figure6 is illustrated in figure 4.6.
The potential function still solves Laplace’s equation but the boundary conditions are Neumann conditions on the normal gradient at a boundary:
(4.32) |
The weak form is still given by equation 4.25, however the right hand side of that equations can no longer be neglected along all the boundaries. At solid boundaries (top and bottom of channel and cylinder), the normal gradient is zero, so there is no contribution. Along the right and left boundaries, the right hand term must be taken into account.
The matrix form for the potential flow problem is
(4.33) |
Contribution to the boundary forcing are due to the nonhomogeneous Neumann boundary conditions along the right and left boundaries. Because linear TF are used in the interior, the test functions along the edge are straight lines, and their average height is always . Along the edge, these TFs are the same as illustrated in figure 1.4. The base of the test function for the first and last nodes is half that of the other boundary TF. The boundary contributions are therefore:
(4.34) |
where are the ordinates of all nodes along the right (East, ) boundary. The boundary forcing term for the left side of the grid is minus the right side boundary forcing, since along the left boundary.
Attempts to solve the system 4.33 run into the further difficulty that there is no information about the mean value of . Because of this the matrix is singular. The way around this is to augment the system 4.32 by adding a constraint that the mean value of is some known value, equal to zero. This leads to an augmented matrix system:
(4.35) |
The potemtial function derived by solving the linear system 4.35 is illustrated in figure 4.7. The grid is the same as the used to produce figure LABEL:Fi:C4S4figure6.
Reproduce figure 4.6 for an ellipse at some non-zero angle of attack, and the NACA airfoil described in Persson’s website.