<!DOCTYPE html>
It is often the case that the partial differential equations that govern flows are stated in term of multiple dependent variables. A two-layer hydrostatic fluid, where displacements of both the free surface and the inteface are sought, provides an example of how the FEM procedure can be adapted to determine the solutions.
The one-dimesional basin described in the previous chapter is now filled with two fluids of different density: the top layer, of constant thickness , sits on top of a heavier layer of variable height (figure 2.1). The maximum depth beneath the surface is taken to be one.
As before the free surface displacement from the mean sea level is ; the displacement of the interface from is . The velocity in the upper layer is . In the lower layer the velocity is . the density anomaly between the two layers is .
After suitable non-dimensionalization, conserving mass in each layer gives the two equations:
(2.1) |
and the momentum equations for each layer are:
(2.2) |
Look for periodic solutions of the form:
(2.3) | |||
(2.4) |
Momentum conservation in each layer determines the transport in terms of pressure gradient:
(2.5) |
where is the departure of the sea level from the forcing, taken to be an equilibrium tide. The mass conservation relations in each layer are:
(2.6) |
Substituting relations 2.5 into equations 2.6 yields a system of nonhomogeneous ordinary differential equations for the dependent variables and :
(2.7) | |||
The boundary conditions require that the transports ( and ) be zero at each extremity:
(2.8) |
Solve the first of equations 2.7 for :
(2.9) |
Introduce this expression into the second of equations 2.7:
(2.10) |
or, after gathering terms:
(2.11) |
The boundary conditions are:
(2.12) |
and the forcing is taken as a wave travelling from right to left:
(2.13) |
The solution to equation 2.11 can be written as the sum of a particular solution and a homogeneous solution:
(2.14) |
The equation governing the particular solution is:
(2.15) |
For the particular solution, try , plug into 2.15:
(2.16) |
This can be solved for :
(2.17) |
Note that if , , usually less than one (since ).
For the homogeneous part, is the solution of:
(2.18) |
If solutions are sought with wavenumber , equation 2.18 gives a fourth order algebraic equation for :
(2.19) |
with solutions:
(2.20) |
A general solution to equation 2.18 is:
(2.21) |
where the four constants , , , are evaluated by enforcing the boundary conditions on equation 2.18:
(2.22) |
The constants are found to be:
(2.23) |
Any Computer Algebra System (CAS) can really help solving systems of equations such as above. I use Maxima, but Mathematica and Maple are quite popular. The solutions are resonant if either or are equal to for . Otherwise the constants and are usually small, as they depend on . The solution is:
(2.24) |
with given by equation 2.17.
The solution for the surface, , and the interface, , displacements are illustrated in figure 2.2. The sea level behaves consistently with the single layer solution (figure 1.2), exceptd for a high wavenumber modulation that is the surface signature of the interfacial motion. Conversely, the high wavenumber oscillation of the interface carry the signature of the surface displacement. The two modes are coupled.
The weak form of the system 2.7 is:
(2.25) | |||||
If it is assumed that the depth varies little over an element, this becomes:
(2.26) | |||||
Following chapter 1, the integrals that involve second derivatives can be integrated by parts. Combining the result with the divergence theorem gives:
(2.27) | |||||
The boundary condition 2.8 forces the terms on the right side of equation 2.27 to zero, so the sytem can be written:
(2.28) | |||||
Following equation 1.17, both dependent variables and are expanded in terms of the trial functions :
(2.29) |
where and represent the solution at each node, and is the total number of grid points.
(2.30) |
is the solution vector consists of values of followed by values of . The matrix on the left of equation 2.30 is on side. Just as only the first of equations 2.7 is forced, there is only a load associated with the first set of equations. The load elements are given by
(2.31) |
Note the similarity between equation 1.22 and the system 2.30. In each case, , and are complex.
Experience shows that when this problem is soleved as a system of two equations in two unknowns, quadratic TF are sufficient high polynomials to obtain an accurate solution. Once the global matrices and the load vector have been assembled, the solution is obtained by solving the usual linear system. The FEM solution is compared with the analytic solution 2.24 in figure 2.3.
Figure 2.3 is drawn with script C2S2figure3.m.
The starting point is equation 2.11 subject to conditions 2.12. With the exception of the fourth order derivative, each term has been considere in chapter 1. For a constant depth basin, with , the extra term can be dealt with as follows:
(2.32) |
after an integration by parts followed by application of the Divergence theorem (see section 1.2.1). The Divergence theorem can be used since is continuous. The second term on the right is zero because of the boundary condition. This process can be repeated a second time:
(2.33) |
In order to use the Divergence theorem, the derivative of needs to be continuous, so test functions other that the linear and quadratic polynomials described in chapter 1 are required. These will be one-dimensional Hermite cubics, described in the following section. With the dependent variable expressed as an expansion over these functions, the weak form of equation 2.11 is:
(2.34) |
where . The last term on the right side of equation 2.34 represents the contribution from the boundary condition on . See lines 54 and 55 of NI2by2vs4.m
The test functions encountered in chapter 1 have all been continuous functions, but their derivatives (figure 1.4) are discontinuous. With hermite polynomial two (or more) functions test functions are defined at each node. In the case of Hermite cubic functions these are defined as:
(2.35) |
These are illustrated in figure 2.4. One function represent the height of the test function (equal to one at ) and the other accounts for the slope, and has a slope equal to one at .
In this way both the function and its derivative are continuous. If there are nodes, then there are test functions, and the global matrices are on side.
For these cubic elements, the element mass matrix is:
(2.36) |
The stiffness is
(2.37) |
and the fourth order stiffness matrix, defined as
(2.38) |
The elements of are:
(2.39) |
Assembly proceeds as in the previous chapter, on an element by element basis. The matrix equation to be solved for a single fourth order equation is:
(2.40) |
wher the solution vector is made up of pairs at each node. The load vector is evaluated following equation 2.31, with additional contributions for the first and last nodes, corresponding to the last term on the right side of equation 2.34:
(2.41) |
FEM solutions obtained with the system of two second order equations and with the single fourth order equation are compared with the analytic solution if figure 2.5. The upper two panels show the real and imaginar parts of the three solutions. Because they are nearly indistiguishable, the lower two panels illustrates differences between the analytic solution and the system of two second order equations solution (in green) and the single fourth order equation solution (blue line). These results suggest the system of two second order equations is preferable.