• No se han encontrado resultados

RETOS EN LA GESTIÓN DEL AGUA PARA AFRONTAR EL CAMBIO CLIMÁTICO

WbRd= 0, b = 1, 2, . . . , n (41)

Note that this is the term multiplying the arbitrary parameter ˜vb. As noted previously, integration by parts is used to avoid higher-order derivatives (i.e. those greater than or equal to two) and therefore reduce the constraints on choosing the basis functions to permit integration over individual elements using equation (39).

In the present case, for instance, the weighted residual after integration by parts and introducing the natural boundary condition becomes:

&



∂Wb

∂xi

 k

a

∂Na

∂xi ˜φ

 d+

&



WbQd+

&

q

Wbqnd= 0 (42)

4.2.3 The Galerkin, finite element, method

In the Galerkin method we simply take Wb= Nb, which gives the assembled system of equations:

n a=1

Kba˜φa+ fb= 0, b = 1, 2, . . . , n − r (43)

where r is the number of nodes appearing in the approximation to the Dirich-let boundary condition (i.e., equation (30)) and Kba is assembled from element contributions Kbae with:

Kbae =

&

e

∂Nb

∂xik∂Na

∂xid (44)

Similarly, fbis computed from the element as:

fbe=

&

e

NbQd+

&

eq

Nbqnd (45)

To impose the Dirichlet boundary condition we replace ˜φa by φa for the r boundary nodes.

It is evident in this example that the Galerkin method results in a symmetric set of algebraic equations (e.g. Kba= Kab). However, this only happens if the differential equations are self-adjoint. Indeed the existence of symmetry provides a test for self-adjointness and also for existence of a variational principle whose stationarity is sought.

It is necessary to remark here that if we were considering a pure convection equation:

ui∂φ

∂xi + Q = 0 (46)

symmetry would not exist and such equations can often become unstable if the Galerkin method is used.

4.2.4 Characteristic Galerkin scheme for convection–diffusion equation Unlike a simple conduction equation (as the Laplace equation), a numerical solution for the convection equation has to deal with the convection part of the governing equation in addition to diffusion. For most conduction equations, the finite element solution is straightforward. However, if a Galerkin type approximation was used in the solution of convection equations, the results will be marked with spurious oscillations in space if certain parameters exceed a critical value (element Peclet number). This problem is not unique to finite elements as all other spatial dis-cretization techniques have the same difficulties. A very well-known method used in finite elements approximation to reduce these oscillations is the Characteristic Galerkin (CG) scheme (Lewis et al. [19], Zienkiewicz et al. [20]). Here, we follow the Characteristic Galerkin (CG) approach to deal with spatial oscillations due to the discretization of the convection transport terms.

In order to demonstrate the CG method, let us consider the simple convection–

diffusion equation in one dimension, namely:

∂φ

∂t + u1

∂φ

∂x1

∂x1

 k∂φ

∂x1



= 0 (47)

Let us consider a characteristic of the flow as shown in Figure 4.26 in the time–

space domain. The incremental time period covered by the flow is t from the nth time level to the n+ 1th time level and the incremental distance covered during this

Characteristic

Figure 4.26. Characteristic in a space–time domain.

time period is x1, that is, from (x1− x1) to x1. If a moving coordinate is assumed along the path of the characteristic wave with a speed of u1, the convection terms of equation (47) disappear (as in a Lagrangian fluid dynamics approach). Although this approach eliminates the convection term responsible for spatial oscillation when discretized in space, the complication of a moving coordinate system x1 is introduced, that is, equation (47) becomes:

∂φ

The semi-discrete form of the above equation can be written as:

φn|x+1

Note that the diffusion term is treated explicitly. It is possible to solve the above equation by adapting a moving coordinate strategy. However, a simple spatial Taylor series expansion in space avoids such a moving coordinate approach. With reference to Figure 4.26, we can write using a Taylor series expansion:

φ|xn

Similarly, the diffusion term is expanded as:

j i

l

Figure 4.27. One-dimensional linear element.

On substituting equations (50) and (51) into equation (49), we obtain (higher-order terms being neglected) the following expression:

φn+1− φn

In this case, all the terms are evaluated at position x1, and not at two positions as in equation (49). If the flow velocity is u1, we can write x= u1t. Substituting into equation (52), we obtain the semi-discrete form as:

φn+1− φn

By carrying out a Taylor series expansion (Figure 4.26), the convection term reappears in the equation along with an additional order term. This second-order term acts as a smoothing operator that reduces the oscillations arising from the spatial discretization of the convection terms. The equation is now ready for spatial approximation.

The following linear spatial approximation of the scalar variable ϕ in space is used to approximate equation (53):

φ= Niφi+ Njφj = [N]{ϕ} (54) where [N] are the shape functions and subscripts i and j indicate the nodes of a linear element as shown in Figure 4.27.

On employing the Galerkin weighting to equation (53), we obtain:

&

The above equation is equal to zero only if all the element contributions are assembled. For a domain with only one element, we can substitute:

[N]T =

Ni Nj



(56)

On substituting a linear spatial approximation for the variable φ, over elements as typified in Figure 4.27, into equation (55), we get:

&

Before utilizing the linear integration formulae, we apply Green’s lemma to the second-order terms of equation (57), we obtain:

&

where n1and n2are the direction cosines of the outward normal n,  is the domain and  is the domain boundary. The first-order convection term can be integrated either directly or via Green’s lemma. Here, the convection term is integrated directly without applying Green’s lemma. However, integration of the first derivatives by parts is useful for problems in which the traction is prescribed. Using the integration formulae (Lewis et al. [19]), it is possible to derive the element matrices for all the terms in equation (58). The term on the left-hand side for a single element is:

&

where [Me] is the mass matrix for a single element. The above mass matrix for a single element will have to be utilized in an assembly procedure for a fluid domain containing many elements.

In a similar fashion, all other terms can be integrated; for example, the convection term is given by:

u1

where [Ce] is the elemental convection matrix. The values of the derivatives of the shape functions are substituted in order to derive the above matrix.

The diffusion term within the domain is integrated as:

where [Ke] is the elemental diffusion matrix. The characteristic Galerkin term within the domain is integrated as:

t

where [Kse] is the elemental stabilization matrix.

The boundary term from the diffusion operator is integrated by assuming that i is a boundary node, as follows:

&

where {fe} is the forcing vector due to the diffusion term.

The boundary integral from the characteristic Galerkin term is integrated, again by assuming that i is a boundary node, as:

t

where {fse} is the forcing vector due to the stabilization term.

For a one-dimensional domain with more than one element, all the matrices and vectors need to be assembled in order to obtain the global matrices. Once assembled, the discretized one-dimensional equation becomes:

[M]{ϕ}

t = −[C]{φ}n− [K]{φ}n− [Ks]{φ}n+ {f}n+ {fs}n (65) Let us now consider a simple one-dimensional convection problem, as given in Figure 4.28, to demonstrate the effect of a discretization with and without the CG scheme.

The scalar variable value at the inlet is ϕ= 0, and at the exit its value is 1. This scalar variable is transported in the direction of the velocity as shown in Figure 4.28. Note that the convection velocity u1is constant. The element Peclet number for this problem is defined as:

Pe=u1h

2k (66)

where h is the element size in the flow direction, which, in one dimension is the local element length. Figure 4.29 shows the comparison between a solution with

L φ= 0

Inlet

u1= constant φ= 1

Exit

Figure 4.28. One-dimensional convection–diffusion problems.

0.8

Figure 4.29. Spatial variation of a function, φ, in one-dimensional space for different element Peclet numbers.

the CG discretization scheme and one without it. Only two Peclet numbers are shown in these diagrams to demonstrate the spatial oscillations without the CG discretization. As seen, both discretizations give no spatial oscillations at a Pe value of unity. However, at a Pe value of 1.5, the CG discretization is accurate and stable, while the discretization without the CG term becomes oscillatory. The exact solution to this problem is given as follows (Brooks and Hughes [21]):

φ= 1− eu1x1k

1− eu1Lk (67)

In this equation, L is the total length of the domain and x1is the local length of the domain.

The extension of the characteristic Galerkin scheme to a multi-dimensional scalar convection–diffusion equation is straightforward and follows the previous procedure as discussed for a one-dimensional case.