Você está na página 1de 3

Discretization Approaches

Model problem: r(u) = 0 u(x) is an unknown scalar eld (in one spatial dimension for now) r(u) is a continuous residual operator For example, r(u) = Lu f for a dierential operator L and a known function f (x). The Finite Dierence Method Idea: Solve for point values of u at a large number of points xj x u j N U : : : : : j th spatial node, 1 j N spacing between nodes (assumed same for all intervals) approximate solution at node xj number of nodes = number of unknowns N 1 vector of unknowns, {u j }

u u(x) u j
j

= error

x x j 1 xj xj +1 x

N equations result from replacing derivative operators with dierence approximations at each node xi . For example, a typical second-derivative dierence is uxx (xi ) = u i 1 2 u i + u i+1 + O(x2 ) 2 x (can verify/derive via Taylor expansion) (1)

Let Ri (U) = 0 be the resulting nite-dierence approximation of r(u) = 0 at node xi . Putting these equations together yields the discrete system R(U) = 0 , where R(U) = {Ri (U)}, and 1 i N
2

N equations for N unknowns

Example: Consider the linear dierential operator L = x 2 so that r (u) = uxx f . Using (1) on a set of N uniformly-spaced points gives

R(U) = AU F = 0 where for homogeneous Dirichlet boundary conditions ( u0 = u N +1 = 0), 1 A= (x)2 2 1 0 0 . . . 1 . . . .. . 0 1 .. .. . . 1 0 1 2 and F= f (x1 ) f (x2 ) f (x3 ) . . . f (xN ) .

1 2 0 1 . . . . .. 0

This system is solved by moving all knowns to the right-hand side and directly or iteratively inverting A to obtain the unknown vector U = A1 F. If the system were not linear, a Newton-Raphson approach would be required. Boundary conditions (BCs): Dirichlet BCs can be enforced by not including nodes on Dirichlet boundaries as unknowns and instead using the known values in the dierence formulas (the values will end up on the right-hand side). Neumann BCs can be enforced by writing one-sided dierence formulas for the given derivatives on the boundaries to express the boundary node values in terms of interior unknowns.

Discretization Approaches

AE 623, Winter 2012

The Finite Element Method Idea: Solve for a function with piecewise local support that approximates u u(x) is approximated by a series of weighted basis functions,
N

u(x) uh (x)
j =1

Uj j (x)
u Uj u(x) j (x) h x uh (x)

j (x) h Uj N U

: : : : :

spatial basis function, 1 j N characteristic element (here an interval) size coecient on j th basis function in approximation series 1 number of basis functions = number of unknowns N 1 vector of unknowns, {Uj }

j th

x j 1

xj

xj +1

Simplicity of the discrete equations relies on j (x) having local support each 1D hat basis function shown above has support on only two elements. Other functions, not necessarily nodal, could also be used (e.g. a high-order basis). Discontinuous basis functions can also be used as long as any integrations by parts are performed carefully. N equations can be obtained using: Collocation: enforce the strong-form of the equations at N selected points, xi , 1 i N , r(uh )|xi = 0. Derivatives in r(uh ) are computed directly from the basis function series expansion. This requires basis functions to be of sucient order to accommodate these derivatives. Weighted residuals: Set weighted integrals over the domain of r(u) to zero for N weight (test) functions, wi (x), 1 i N , Ri

wi (x)r(uh (x)) dx = 0.

(2)

In a Galerkin FEM, the N basis functions i (x) are used as the weight functions. The above integrals become restricted to only over a few elements at a time when the weight functions have local support. Combined with a locally-supported basis, the result is a sparsely-coupled system of equations. Integration by parts is typically used in (2) to transfer some derivatives o r(uh ) to wi . This allows the basis/weight functions to be of lower regularity than required to accommodate derivatives in r(u) e.g. piecewise linear j (x) can be used when r(u) contains second derivatives.
Example: Consider the linear dierential operator L = x 2 so that r (u) = uxx f . Using a Galerkin FEM (weighted residuals), one integration by parts gives
2

Ri =

uh i uh dx i x x x

xR

xL

i f dx,

where = [xL , xR ].

(3)

Expanding uh via (2) then gives a linear N N system of equations. Boundary conditions (BCs): Dirichlet BCs can be enforced by not associating unknowns to basis functions that are nonzero on the boundary. Neumann BCs are enforced through the second term in (3). Note that this term is not active for Dirichlet BCs because all i are zero on Dirichlet boundaries. In the Neumann case, boundary basis functions need to be included (boundary values are unknown).

Discretization Approaches

AE 623, Winter 2012

The Finite Volume Method Idea: Solve for cell averages that approximate the solution to a conservation law xj 1/2 xj Uj N U : : : : : coordinates of left/right endpoints of cell j size of j th cell (here an interval) approximated average of u in cell j number of cells = number of unknowns N 1 vector of unknowns, {Uj }
u u(x) Uj

The approximated average of u in cell j is given by 1 xj u(x) dx Uj


cell j

xj 1/2 cell j

xj +1/2

N equations are obtained by requiring the integral of r(u) to vanish for each cell. The FVM is geared for conservation laws, for which r(u) = f x for some ux f (u). The N residuals that must be driven to zero are then, after an integration by parts, Ri =
cell i

f dx = fi+1/2 fi1/2 , x

fi1/2 = uxes on cell interfaces

The method is completed by dening numerical uxes, f i1/2 , that express the interface uxes in terms of the unknowns Uj here is where the approximation comes in, as we do not know the value of u on the interfaces (we just have two cell averages on either side). These numerical uxes are typically obtained from (approximate) solutions to the Riemann problem on cell interfaces.
Example: Consider the linear dierential operator L = a x , where a is constant, so that r(u) = (au)x i.e. f (u) = au. An upwind (identical to Roe) ux in this case is

1 1 f i+1/2 = (fi + fi+1 ) |a|(Ui+1 Ui ) 2 2 The method as described will be rst-order accurate. High-order accuracy can be obtained by reconstructing the state at the interfaces using a wider stencil of neighboring cells. Shock capturing then requires non-linear limiting of these reconstructions to prevent oscillations/instabilities. Boundary conditions are imposed through uxes on the domain boundaries. In some cases it is convenient to dene ghost cells, with known states, just outside the domain to simplify the calculation of these boundary uxes. For hyperbolic systems of equations, a characteristic analysis is required to determine the amount of information that should be specied on each boundary (e.g. inow versus outow). Other Methods Cartesian method: typically nite volume on a Cartesian (structured) grid. Often combined with a cut-cell treatment of boundaries in which a geometry is cut out of the regular background grid leaving irregularly-shaped cells adjacent to the geometry. Meshless methods: typically nite dierence on a cloud of points (unstructured). Immersed boundary: typically nite dierence treatment of one or more uids with an embedded interface that aects the uid via a momentum source/forcing term.

Discretization Approaches

AE 623, Winter 2012

Você também pode gostar