Choice of trial functions So far, we have dealt with general, global trial functions.. CONSTANT TRIAL FUNCTIONS IN ONE DIMENSION Consider the piecewise constant function, shown in Figure
Trang 1But this is the same as the Galerkin WRM! This implies that, of all possible choices for W i,
the Galerkin choice W i = N i yields the best results for the least-squares norm I ls For other
norms, other choices of W i will be optimal However, for the approximation problem, the
norm given by Ilsseems the natural one (try to produce a counterexample)
4.2 Choice of trial functions
So far, we have dealt with general, global trial functions Examples of this type of functionfamily, or expansions, were the Fourier (sin-, cos-) and Legendre polynomials For generalgeometries and applications, however, these functions suffer from the following drawbacks.(a) Determining an appropriate set of trial functions is difficult for all but the simplestgeometries in two and three dimensions
(b) The resulting matrix K is full.
(c) The matrix K can become ill-conditioned, even for simple problems A way around this
problem is the use of strongly orthogonal polynomials As a matter of fact, most of theglobal expansions used in engineering practice (Fourier, Legendre, etc.) are stronglyorthogonal
(d) The resulting coefficients a jhave no physical significance
The way to circumvent all of these difficulties is to go from global trial functions to local
el called elements The approximation function u his thendefined in each sub-domain separately The situation is shown in Figure 4.3
In what follows, we consider several possible choices for local trial functions
4.2.1 CONSTANT TRIAL FUNCTIONS IN ONE DIMENSION
Consider the piecewise constant function, shown in Figure 4.4:
Trang 28888888 8888888 8888888 8888888 8888888
node
element
Figure 4.3 Subdivision of a domain into elements
Then, globally, we have
P
e
Figure 4.4 Piecewise constant trial function in one dimension
4.2.2 LINEAR TRIAL FUNCTIONS IN ONE DIMENSION
A better approximation is obtained by letting u h vary linearly in each element This isaccomplished by placing nodes at the beginning and end of each element, and defining a
Trang 3piecewise linear trial function:
N j=
1 at node j ,
and N j is non-zero only on elements associated with node j Then, globally, we have
u ≈ u h = N j (x)u(x j ) = N j (x) ˆu j , (4.22)
and locally over element el with nodes 1 and 2
u ≈ u h = N1ˆu1+ N2ˆu2, (4.23)where
1
1 x
xj Figure 4.5 Piecewise linear trial function in one dimension
4.2.3 QUADRATIC TRIAL FUNCTIONS IN ONE DIMENSION
An even better approximation is obtained by letting u h vary quadratically in each element.This may be achieved by placing nodes at the beginning and end of each element, as well asthe middle, as shown in Figure 4.6
Trang 4[
1 0.5 0
N 1
N 3
N 2
Figure 4.6 Piecewise constant trial function in one dimension
The resulting shape functions are of the form
N1= (1 − ξ)(1 − 2ξ), N2= 4ξ(1 − ξ), N3= −ξ(1 − 2ξ), (4.26)
where ξ is given by (4.24).
4.2.4 LINEAR TRIAL FUNCTIONS IN TWO DIMENSIONS
A general linear function in two dimensions is given by the form
We therefore have three unknowns (a, b, c), requiring three nodes for a general
representa-tion The natural geometric object with three nodes is the triangle
The shape functions may be derived by observing from Figure 4.7 the map from Cartesian
to local coordinates:
x = xA + (x B− xA )ξ + (x C− xA )η, (4.28)or
Trang 51 2
3
] = Area Total Area
Figure 4.8 Area coordinates
The shape function derivatives, which are constant over the element, can be derivedanalytically by making use of the chain rule and the derivatives with respect to the localcoordinates,
Trang 6i
h s
n
i i
i
i
N
Figure 4.9 Geometrical properties of linear triangles
(no summation over i) The basic integrals amount to
4.2.5 QUADRATIC TRIAL FUNCTIONS IN TWO DIMENSIONS
A general quadratic function in two dimensions is given by the form
f (x, y) = a + bx + cy + dx2+ exy + fy2. (4.41)
We therefore have six unknowns (a, b, c, d, e, f ), requiring six nodes for a general
represen-tation One possibility to represent these degrees of freedom is the six-noded triangle Threenodes are positioned at the vertices and three along the faces (see Figure 4.10)
3
4
56
Figure 4.10 Quadratic triangle
Trang 7The shape functions for this type of element are given by
4.3 General properties of shape functions
All commonly used shape functions satisfy the following general properties:
(a) Interpolation property Given that u h = N i (x) ˆu i, we must have
u h (x j ) = N i (x j ) ˆu i = ˆu j ⇒ N i (x j ) = δ i
In more general terms, this is just a re-expression of the definition of local trial functions
(b) Constant sum property At the very least, any given set of trial functions must be able to represent a constant, e.g c= 1 Therefore
Thus, the sum of all shape functions at any given location equals unity
(c) Conservation property Given the constant sum property, it is easy to infer that
4.4 Weighted residual methods with local functions
After this small excursion to define commonly used local trial functions and some of theirproperties, we return to the basic approximation problem The WRM can be restated withlocal trial functions as follows:
Trang 8
The basic idea is to split any integral that appears into a sum over the sub-domains or
- gather information from global point arrays to local element arrays;
- build integrals on the element level;
- scatter-add resulting integrands to global right-hand side (rhs)/matrix locations.This may be expressed mathematically as follows:
It is this basic paradigm that makes simple finite element or finite volume codes based
on unstructured grids possible As all the information that is required is that of the nodesbelonging to an element, a drastic simplification of data structures and logic is achieved.Granted, the appearance of so many integrals can frighten away many an engineer However,compared to the Bessel, Hankel and Riemann expansions used routinely by engineers only aquarter of a century ago, they are very simple
4.5 Accuracy and effort
Consider the interesting question: What is the minimum order of approximation required for
the trial functions in order to achieve vanishing errors without an infinite amount of work?
In order to find an answer, let us assume that the present mesh already allows for a uniform(optimal) distribution of the error Let us suppose further that we have a way to solve for theunknown coefficients ˆu in linear time complexity, i.e it takes O(N) time to solve for the N unknowns (certainly a lower bound) Then the effort Eff will be given by
where d is the dimensionality of the problem and h a characteristic element length On the
other hand, the error is given by
h = u − u h = c2h p+1|u| p+1, (4.51)
where p is the order of approximation for the elements We desire to attain u − u h → 0
faster than E ff → ∞ Thus, we desire
lim
h→0E ff · u − u h = lim
h→0c3h
p +1−d |u| p+1→ 0. (4.52)
Trang 9Table 4.1 Accuracy and effort
Dimension E ff · h Decrease with h→ 0
Table 4.1 indicates that one should strive for schemes of higher order as the dimensionality
of the problem increases Given that most current CFD codes are of second-order accuracy,
we have to ask why they are still being used for 3-D problems
(a) The first and immediate answer is, of course, that most code writers simply transplantedtheir 1-D schemes to two and three dimensions without further thought
(b) A second answer is that the analysis performed above only holds for very high-accuracycalculations In practice, we do not know turbulence viscosities to better than 10%locally, and in most cases even laminar viscosity or other material properties to betterthan 1%, so it is not necessary to be more accurate
(c) A third possible answer is that in many flow problems the required resolution is notthe same in all dimensions Most flows have lower-dimensional features, like boundarylayers, shocks or contact discontinuities, embedded in 3-D space It is for this reasonthat second-order schemes still perform reasonably well for engineering simulations.(d) A fourth answer is that high-order approximation functions also carry an intrinsic,and very often overlooked, additional cost For a classic finite difference stencil on
a Cartesian grid the number of neighbour points required increases linearly with theorder of the approximation (three-point stencils for second order, five-point stencils forfourth order, seven-point stencils for sixth order, etc.), i.e the number of off-diagonal
matrix coefficients will increase as w FDdof= pd (as before, d denotes the dimensionality
of the problem and p the order of the approximation) On the other hand, for general
high-order approximation functions all entries of the mass matrix K in (4.9) have
to be considered at the element level Consider for the sake of simplicity Lagrange
polynomials of order p in tensor-product form for 1-D, 2-D (quadrilateral) and
3-D (hexahedral) elements The number of degrees of freedom in these elements will
increase according to ndof= (1 + p) d , implying n k = (1 + p) 2d matrix entries Thematrix–vector product, which is at the core of any efficient linear equation solver (e.g
multigrid) therefore requires O(1 + p) 2d floating point operations, i.e the work per
degree of freedom is of wdof= O(1 + p) d The resulting cost per degree of freedom, as
well as the relative cost C r as compared to linear elements, is summarized in Table 4.2for 3-D Lagrange elements and Finite Differences (FD3D) Note the marked increase
in cost with the order of approximation These estimates assume that the system matrix
K only needs to be built once, something that will not be the case for nonlinear
operators (one can circumvent this restriction if one approximates the fluxes as well, seeAtkins and Shu (1996)) As the matrix entries can no longer be evaluated analytically,
Trang 10an additional cost factor proportional to the number of Gauss points ng = O(1 + p) d will be incurred The work per degree of freedom thus becomes wdofnl = O(1 + p) 2d.
Table 4.2 Effort per degree of freedom as a function of the approximation
w 3-Ddof C r 3-D w nl3-Ddof C r nl3-D w FD3-Ddof C FD3-D r
hydro-Re=ρ|v∞|l
where ρ, v, µ and l denote the density, free stream velocity and viscosity of the fluid, as
well as a characteristic object length, respectively, we have the following estimates for theboundary-layer thickness and gradient at the wall for flat plates from boundary-layer theory(Schlichting (1979)):
(a) Laminar flow:
This implies that the minimum element size required to capture the main vortices of the
boundary layer (via a large-eddy simulation (LES)) will be h ≈ Re −1/2 and h ≈ Re −1/5for
the laminar and turbulent cases In order to capture the laminar sublayer (i.e the wall gradient,and hence the friction) properly, the first point off the wall must have a (resolved) velocitythat is only a fraction of the free-stream velocity:
Trang 11Table 4.3 Estimate of grid and timestep requirements
Simulation type npoin ntimeLaminar 104Re 102Re 1/2
VLES 104Re 2/5 102Re 1/5
LES 106Re 2/5 103Re 1/5
DNS 104Re 8/5 102Re 4/5
Table 4.4 Estimate of grid and timestep requirements
Re n pVLES n tVLES n pLES n tLES n pDNS n tDNS
106 106.4 103.2 108.4 104.2 1013.6 106.8
107 106.8 103.4 108.8 104.4 1015.2 107.6
108 107.2 103.6 109.2 104.6 1016.8 108.4
109 107.6 103.8 109.6 104.8 1018.4 109.2
implying that the element size close to the wall must be inversely proportional to the gradient
This leads to element size requirements of h ≈ Re −1/2 and h ≈ Re −4/5, i.e considerablyhigher for the turbulent case Let us consider in some more detail a wing of aspect ratio .
As is usual in aerodynamics, we will base the Reynolds number on the root chord length ofthe wing We suppose that the element size required near the wall of the wing will be of theform (see above)
h≈ 1
and that, at a minimum, β layers of this element size will be required in the direction
normal to the wall If we assume, conservatively, that most of the points will be in the(adaptively/optimally gridded) near-wall region, the total number of points will be given by
Assuming we desire an accurate description of the vortices in the flowfield, the (significant)advective time scales will have to be resolved with an explicit time-marching scheme Thenumber of timesteps required will then be at least proportional to the number of points in thechord direction, i.e of the form
n t =γ
Consider now the best-case scenario: α = β = γ = = 10 In the following, we will label
this case the ‘Very Large Eddy Simulation’ (VLES) A more realistic set of numbers for
typical LES simulations would be: α = 100, β = γ = = 10 The number of points required
for simulations based on these estimates are summarized in Tables 4.3 and 4.4 Recall that
the Reynolds number for cars and trucks lies in the range Re= 106–107, for aeroplanes Re=
107–108, and for naval vessels Re= 108–109 At present, any direct simulation of Navier–Stokes (DNS) is out of the question for the Reynolds numbers encountered in aerodynamicand hydrodynamic engineering applications
Trang 125 APPROXIMATION OF
OPERATORS
While approximation theory dealt with the problem
Given u, approximate u − u h → min,the numerical solution of differential or integral equations deals with the following problem:
Given L(u) = 0, approximate L(u) − L(u h ) → min ⇒ L(u h ) → min
Here L(u) denotes an operator, e.g the Laplace operator L(u)= ∇2u The aim is to minimizethe error of the operator using known functions
The choice of trial and test functions N i , W i defines the method Since a large amount
of work has been devoted to some of the more successful combinations of N i , W i, aclassification is necessary
5.1.1 FINITE DIFFERENCE METHODS
Finite difference methods (FDMs) are obtained by taking N i polynomial, W i = δ(x i ) This
implies that for such methods L h = L(u h )= 0 is enforced at a finite number of locations in
space The choices of polynomials for N i determine the accuracy or order of the resulting
discrete approximation to L(u) (Collatz (1966)) This discrete approximation is referred to as
a stencil FDMs are commonly used in CFD for problems that exhibit a moderate degree of
geometrical complexity, or within multiblock solvers The resulting stencils are most easily
derived for structured grids with uniform element size h For this reason, in most codes based
on FDMs, the physical domain, as well as the PDE to be solved (i.e L(u)), are transformed
to a square (2-D) or cube (3-D) that is subsequently discretized by uniform elements
Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition.
Trang 135.1.2 FINITE VOLUME METHODS
Finite volume methods (FVMs) are obtained by taking N i polynomial, W i el,
0 otherwise As W i is constant in each of the respective elements, any integrations by partreduce to element boundary integrals For first-order operators of the form
el
n· F(u) d el (5.4)
This implies that only the normal fluxes through the element faces n· F(u) appear in
the discretization FVMs are commonly used in CFD in conjunction with structured andunstructured grids For operators with second-order derivatives, the integration is no longerobvious, and a number of strategies have been devised to circumvent this limitation One ofthe more popular ones is to evaluate the first derivatives in a first pass over the mesh, and toobtain the second derivatives in a subsequent pass
5.1.3 GALERKIN FINITE ELEMENT METHODS
In Galerkin FEMs (GFEMs), N i is chosen as a polynomial, and W i = N i This specialchoice is best suited for operators that may be derived from a minimization principle It
is widely used for thermal problems, structural dynamics, potential flows and electrostatics(Zienkiewicz and Morgan (1983), Zienkiewicz and Taylor (1988))
5.1.4 PETROV–GALERKIN FINITE ELEMENT METHODS
Petrov–Galerkin FEMs (PGFEMs) represent a generalization of GFEMs Both N i , W i are taken as polynomials, but W i i For operators that exhibit first-order derivatives,PGFEMs may be superior to GFEMs On the other hand, once GFEMs are enhanced byadding artificial viscosities and background damping, the superiority is lost
5.1.5 SPECTRAL ELEMENT METHODS
Spectral element methods (SEMs) represent a special class of FEMs They are distinguishedfrom all previous ones in that they employ, locally, special polynomials or trigonometric
functions for N i in order to avoid the badly conditioned matrices that would arise for
higher-order Lagrange polynomials The weighting functions can be either W i = δ(x i )(so-called
collocation), or W i = N i Special integration or collocation rules further set this class ofmethods apart from GFEMs
5.2 The Poisson operator
Let us now exemplify the use of the GFEM on a simple operator The operator chosen is thePoisson operator Given
...10 6< /sup> 10 6. 4 10 3.2 10 8.4 10 4.2 10 13 .6< /sup> 10 6. 8
10 7 10 6. 8... 10 3 .6< /sup> 10 9.2 10 4 .6< /sup> 10 16 .8 10 8.4
10 9 10 7 .6< /sup> 10 3.8 10 9 .6< /sup>... 10 6. 8 10 3.4 10 8.8 10 4.4 10 15 .2 10 7 .6< /sup>
10 8 10 7.2 10 3 .6< /sup>