<!DOCTYPE html>
The equilibrium tide (for a good discussion, read Lamb 6th Ed., 1932, pg .318) describes the perturbation of the surface in response to the gravitational attraction of the moon, for example, if the earth was entirely covered by water. In this case the equilibrium tide would appear as a wave travelling from east to west, with two bulges, one beneath the moon and the other on the opposite side of the earth. On the real earth, the response of the surface is modified by the presence of continents. The equilibrium tide appears as a forcing term in the framework of the linear shallow water (LSW) wave theory. For a one-dimensional basin the mass and momentum conservation equations are:
(1.1) |
where variables marked with an asterisk are dimensional. The boundary condition states that there is no velocity at certain locations in the domain (here ). The equilibrium tide models the forcing resulting from the gravitational attraction between the moon and the earth as a westward (from toward ) traveling wave:
(1.2) |
The minus sign in the exponent in equation 1.2 is chosen so that increasing phase corresponds to a lag: if the phase difference between high tide at San Francisco and San Diego is positive, then high tide occurs first at San Diego. The height of the equilibrium tide is illustrated in figure 1.1 a a function of time and location. As time increases this wave travels toward .
After suitable nondimensionalization, with the depth taken to be constant equal to one, and after eliminating the velocity, the sea level is found to obey the wave equation:
(1.3) |
where the new parameter is a measure of the basin length relative to the shallow water wavelength at frequency . The governing equation is simplified by introducing the new dependent variable . The governing equation for the new variable is:
(1.4) |
Since there can be no flow through a closed boundary, the second of equations 1.1 implies the gradient of must be zero at such a boundary.
Equation 1.4 is a partial differential equation with two independent variables: time () and position (). If the forcing and resulting solution are purely periodic, then the solution can be written as:
(1.5) |
and the governing equation for the new dependent variable is
(1.6) |
The partial differential equation has been transformed into a two point boundary value ordinary differential equation. This can be solved exactly by Maxima. The solution for is:
(1.7) |
So that the complex amplitude and phase of the sea level is:
(1.8) |
Knowing , the solution for is given by equation 1.5. The solution is illustrated in figure 1.2. Even though the forcing (figure 1.1) propagates from right to left, the response appears to consist principally of a standing wave.
It should be noted that the sea level response 1.8 is resonant if the tidal wave number is equal to , or if either or are zero. These are the resonances of the basin.
In a much smaller basin, where the equilibrium tide changes little, tides can still occur, forced by the tidal wave propagating in the adjacent ocean vasin. This is called a co-oscillating tide. Examples include tides in marginal seas, estuaries and rivers. These system are governed by equation 1.3, with the tide prescribed (Dirichlet BC) at the end where the estaury opens to the ocean; at the other there is no flux, and the boundary condition is homogeneous Neumann. Looking again for periodic solution, we look for solutions of the form
(1.9) |
The governing equation for is:
(1.10) |
The solution is:
(1.11) |
The solution is illustrated in figure 1.3. The sea level disturbance is always maximum at the closed end. The co-oscillating tide can be resonant if .
Reading: Strang pg 247, Whiteley Chap 2
The central concept is to replace an equation such as 1.1 with a system of algebraic equations that, once solved, provides estimates of the solution at a number of points within the domain of interest. While this is basically the same idea as finite differences, the advantage of FEM is that the grid can be unorganized, so that it is ideally suted to finding solutions in real domains. How the differential equation is transformed into a system of algebraic equations is explained in the following.
Given an ODE such as equation 1.6, the first step in the finite element method is to express the equation in the so-called weak form, meaning that al the terms in the equation are multiplied by a test function and integrated over the entire field (here ).
(1.12) |
The first term can be integrated by parts:
(1.13) |
In this case,the divergence theorem states:
(1.14) |
as long as is a continuous function Equation 1.12 becomes:
(1.15) |
If the boundary conditions happen to be homogeneous Newmann conditions, as in the equilbrium tide problem, the term on the right side of equation 1.13 contributes nothing, and, after multiplying by the weak form is:
(1.16) |
For a one dimensional problem, the simplest grid consists of equispaced nodes along the -axis, as illustrated in figure 1.4. In this case, the axis extends between . There are nodes equispaced along the -axis and segments between the nodes are called elements.
Once the grid is established, the next step is to pick suitable test functions. These same functions will be used in a series expansion of the solution:
(1.17) |
The test/trial functions are allways chosen to be polynomials, where is the degree of the polynomial TF, and is the value of the solution at node . Each takes on the value unity at a node, say , and are zero everywhere else: .
The central point is that equation 1.13 has to hold for each of these test functions:
(1.18) |
This is a system of equations in unknowns. Introduce the expansion 1.17 into the system of equations 1.18:
(1.19) |
Each of the integrals on the left side of equation 1.19 is a matrix element: if, for instance (the mass matrix) is a matrix with elements
(1.20) |
(1.21) |
where is a column vector consisting of the solution at each node. In matrix notation the system of equations 1.18 is written.
(1.22) |
where the stiffness matrix elements are
(1.23) |
and the load vector elements are
(1.24) |
In FEM, the process of determining the values of each element of each matrix is called an assembly. Linear test functions, illustrated in figure 1.4 are written as:
(1.25) | |||||
Considering node , figure 1.4 makes clear that the only place where the integrand of equation 1.20 is non-zero is the interval between nodes and . We conclude that most elements of (and ) are zero. These matrices are sparse. In this example there are just three entries to row of matrix :
(1.26) |
Entries for each row of each matrix can be found in the same way, with aprticular care exercised for the boundary nodes.
An alternative method, the method that is almost always used in FEM is to assemble each matrix element by element. Consider again element located between nodes and (figure 1.5). There are two pieces of test functions in that element; one sloping down, belongs to the TF associated with the node on the left (); the other, rising, associated with the node on the right (). Element therefore contributes to , and to , . These four contributions define an Element Matrix.
(1.27) |
The numerical values are obtained by evaluating the integrals in equation 1.20. A stiffness element matrix can be defined and eveluated in the same way:
(1.28) |
The next step is to combine the element matrices to form the global matrices. For the five node, four element grid illustrated in figure 1.4, there are four steps. The constitution of after each step is shown in equation 1.29:
(1.29) |
In the first step, matrix is added to the upper left corner of . During the second step matrix is added to the second and third rows, as well as second and third columns of , with the result that reaches the value . After the elemnt matrix for the last element () has been added, is complete.
Following the same procedure, the stiffness matrix assembles as:
(1.30) |
There are several ways to assemble the forcing vector . The simplest is to assume that the forcing, in this case , does not change much over an element. This is surely a poor approximation with a five element matrix, and alternative methods are discussed in detail in section 1.3. For now write the element vector:
(1.31) |
If the forcing function was constant, each element would contribute to the global forcing vector. In this case, the global forcing vector is:
(1.32) |
Once the matrices and the forcing vector have been assembled. the solution is found by solving the linear system 1.22. Make sure to use a sparse method. It is always a bad idea to attempt to solve the system by inverting the global matrix, because the inverse of a sparse matrix is not necessarily sparse.
The solution is found with script 1. The FEM solution agrees well with the analytic solution 1.7. The error, defined as the maximum value of the absolute value of the difference between the exact solution and the FEM solution is listed in table 1.1 as a function of the number of nodes .
M | 11 | 21 | 51 | 101 | 201 | 501 | 1001 |
---|---|---|---|---|---|---|---|
Linear TF | |||||||
Quadratic TF | |||||||
Quad TF+Quadrature |
Table 1.1 leads to the conclusion that with linear TF, the error decreases as the square of the number of nodes.
In principle there are an infinite number of polynomials that can be used as test functions. For example the linear TF given in equation 1.25 can be relaced by quadratic functions (or cubics, etc…). Since three constants are needed to define a second order polynomial, an extra node is added to each element. If, as in the case of linear test functions (figue 1.6) the axis extends from with four elements, there will be nodes. The grid and quadratic test functions are illustrated in figure
Consider element which extends between nodes and . The canonical variable is:
(1.33) |
The ends of the element ends are located at , and the midpoint is located at . The three TF that are non-zero in this element are given by:
(1.34) | |||||
The quadratic test functions are illustrated in figure 1.6.
The mass, stiffness and load contribution made by each element to the global matrices are:
(1.35) |
Assembly still proceeds element by element. The condition of the mass matrix after the contributions from elements 1 and 2 is
(1.36) |
The norm of the difference between the FEM solution with quadratic TF and the analytic solution is shown in table 1.1. The errors is found to be slightly larger than the error associated with linear TF
Thi last result is surprising, since errors associated with higher order polynomiala ought to be smaller. This motivates evaluatinng the forcing function more carefully. One way to improve the solution given above is to use quadrature to evaluate the integral in equation 1.24. For quadrature, the integrand is evaluated at a number of points in the interval . The integral is then approximated by a weighted sum of the three values. In this case a three point quadrature scheme for the one-dimensional integral over an element of length is:
(1.37) |
where and represent the quadrature weights and quadrature points for any given scheme.
Table 1.1 shows marked reduction in the error between the FEM solution and the analytical solution, when both quadratic TF are used and the load integral is estimated using quadrature. In that case, the error decreases as the fourth power of the number of nodes.
In the cooscillating tide problem there is no forcing term on the right side of the governing equation 1.6. Instead the problem is forced by the Dirichlet condition at the boundary between estaury and ocean. Using matrix notation the weak form is:
(1.38) |
where . If the full domain consists of nodes, only of these are unknown since the value is given. For example in the case where the -axis is divided into four elements with nodes, if , equation 1.38 is:
(1.39) |
The first row of equation 1.39 is irrelevant since is already known. In the remaing rows the contributions from known elements is separated from the unknown part:
(1.40) |
where is a column vector, and is a matrix:
(1.41) |
Equation 1.42 can now be written:
(1.42) |
where the known terms appear on the right. The number of simultaneous equations is reduced by the number of Dirichlet points.
Errors using linear and quadratic test functions for different grid sizes are compared in table 1.2. This shows that errors associated with quadratic TF are much smaller than those with linear TF. As the order of the polynomial used as a test function increases, the accuracy of the solution increases.
nx | 11 | 21 | 51 | 101 | 201 | 501 | 1001 |
---|---|---|---|---|---|---|---|
Linear TF | |||||||
Quadratic TF |
Write a script that solves the same problem as script 1 from scratch (no need to worry about quadrature for this).
Solve Helmholtz’ equation for different values of and . When does the code not work?
Modify the script so that it handles steep changes in depth. For example .
Modify this new script to work with quadratic TF.