Numerical methods in fluid mechanics: Difference between revisions

Content deleted Content added
removed Category:Applied mathematics using HotCat Applied math already implied by Numerical analysis cat
m Finite difference method: clean up spacing around commas and other punctuation fixes, replaced: ,i → , i
 
(18 intermediate revisions by 16 users not shown)
Line 1:
[[File:Car CFD.jpg|frameless|right|CFD analysis]]
 
[[Fluid motion]] is governed by the [[Navier–Stokes equations]], a set of coupled and nonlinear
partial differential equations derived from the basic laws of conservation of [[mass]], [[momentum]]
and [[energy]]. The unknowns are usually the [[flow velocity]], the [[pressure]] and [[density]] and [[temperature]]. The [[analytical solution]] of this equation is impossible hence scientists resort to laboratory experiments in such situations. The answers delivered are, however, usually qualitatively different since dynamical and geometric similitude are difficult to enforce simultaneously between the lab experiment and the [[prototype]]. Furthermore, the design and construction of these experiments can be difficult (and costly), particularly for stratified rotating flows. [[Computational fluid dynamics]] (CFD) is an additional tool in the arsenal of scientists. In its early days CFD was often controversial, as it involved additional approximation to the governing equations and raised additional (legitimate) issues. Nowadays CFD is an established discipline alongside theoretical and experimental methods. This position is in large part due to the exponential growth of computer power which has allowed us to tackle ever larger and more complex problems.
 
==Discretization==
The central process in CFD is the process of [[discretization]], i.e. the process of taking differential equations with an infinite number of [[degrees of freedom]], and reducing it to a system of finite degrees of freedom. Hence, instead of determining the solution everywhere and for all times, we will be satisfied with its calculation at a finite number of locations and at specified time intervals. The [[partial differential equations]] are then reduced to a system of algebraic equations that can be solved on a computer. Errors creep in during the discretization process. The nature and characteristics of the errors must be controlled in order to ensure that:
<ul><li>* we are solving the correct equations (consistency property)</li>
<li>* that the error can be decreased as we increase the number of degrees of freedom (stability and convergence). </li></ul>
Once these two criteria are established, the power of computing machines can be leveraged to solve the problem in a numerically reliable fashion. Various discretization schemes have been developed to cope with a variety of issues. The most notable for our purposes are: [[finite difference methods]], finite volume methods, [[finite element methods]], and [[spectral methods]].
 
==Finite difference method==
Finite difference replace the infinitesimal limiting process of derivative calculation:
:<math> \lim_{\Delta x \to 0}f'(nx) = \frac {f(x+\Delta x)-f(x)}{\Delta x} </math>
 
with a finite limiting process, i.e.
 
:<math> f'(x) =\frac {f(x+\Delta x) - f(x)}{\Delta x} + O(\Delta x) </math>
 
The term <math>O(_x\Delta x)</math> gives an indication of the magnitude of the error as a function of the mesh spacing. In this instance, the error is halfedhalved if the grid spacing, _x is halved, and we say that this is a first order method. Most FDM used in practice are at least second order accurate except in very special circumstances. Finite Difference method is still the most popular numerical method for solution of PDEs because of their simplicity, efficiency and low computational cost. Their major drawback is in their geometric inflexibility which complicates their applications to general complex domains. These can be alleviated by the use of either mapping techniques and/or masking to fit the computational mesh to the computational ___domain.
 
==Finite element method==
The finite element method was designed to deal with problem with complicated computational regions. The PDE is first recast into a variational form which essentially forces the mean error to be small everywhere. The discretization step proceeds by dividing the computational ___domain into elements of triangular or rectangular shape. The solution within each element is interpolated with a polynomial of usually low order. Again, the unknowns are the solution at the collocation points. The CFD community adopted the FEM in the 1980’s1980s when reliable methods for dealing with advection dominated problems were devised.
 
==Spectral method==
Both finite element and finite difference methods are low order methods, usually of 2<sup>nd</sup>2nd&nbsp;&minus;&nbsp;4<sup>th</sup>4th order, and have local approximation property. By local we mean that a particular collocation point is affected by a limited number of points around it. In contrast, spectral method have global approximation property. The interpolation functions, either polynomials or trigonomic functions are global in nature. Their main benefits is in the rate of convergence which depends on the smoothness of the solution (i.e. how many continuous derivatives does it admit). For infinitely smooth solution, the error decreases exponentially, i.e. faster than algebraic. Spectral methods are mostly used in the computations of homogeneous turbulence, and require relatively simple geometries. Atmospheric model have also adopted spectral methods because of their convergence properties and the regular spherical shape of their computational ___domain.
 
==Finite volume method==
Line 31 ⟶ 29:
 
==Computational cost==
The [[CPU]] time to solve the system of equations differs substantially from method to method. Finite differences are usually the cheapest on a per grid point basis followed by the finite element method and spectral method. However, a per grid point basis comparison is a little like comparing apple and oranges. Spectral methods deliver more accuracy on a per grid point basis than either [[Finite element method|FEM]] or [[Finite difference method|FDM]]. The comparison is more meaningful if the question is recast as ”what is the computational cost to achieve a given error tolerance?”. The problem becomes one of defining the error measure which is a complicated task in general situations.
 
==Application of finite differences to [[ordinary differential equation]]s==
Let us consider the problem of solving the following [[partial differential equation]]:
 
: <math> u_t + cu_x = \nu u_{xx},\qquad 0\le x\le L </math>
 
The two independent variables are ''t'' for time and ''x'' for space. Because of the periodicity, it is sensible to expand the unknown function in a Fourier series:
 
:<math> u= \sum_{k=-\infty}^{\infty} \hat u_n (t) e^{ik_n x} </math>
 
The Fourier functions form what is called an orthonormal basis. The Fourier series can be differentiated term by term to get an expression for the derivatives of u.
The governing equation for the Fourier amplitude is
 
:<math> \frac { d \hat u}{dt}=-(ick + vk^2)\hat u </math>
The solution to this simple ODE is:
 
:<math> u= \hat u_0 e ^{kt} </math>
 
==Forward Euler approximation==
:<math> \frac {u^{n+1} -u^n}{\Delta t } \approx \kappa u^n </math>
 
Equation is an explicit approximation to the original differential equation since no information about the unknown function at the future time (''n''&nbsp;+&nbsp;1)<sub>''t''</sub> has been used on the right hand side of the equation. In order to derive the error committed in the approximation we rely again on [[Taylor series]].
 
==Backward difference==
Line 59 ⟶ 40:
 
==References==
'''Sources'''
<ol>
<li># Zalesak, S. T., 2005. The design of flux-corrected transport algorithms for structured grids. In: Kuzmin, D., Löhner, R., Turek, S. (Eds.), Flux-Corrected Transport. Springer
<li># Zalesak, S. T., 1979. Fully multidimensional flux-corrected transport algorithms for fluids. Journal of Computational Physics.
grids. In: Kuzmin, D., L¨ohner, R., Turek, S. (Eds.), Flux-Corrected Transport.
<li># Leonard, B. P., MacVean, M. K., Lock, A. P., 1995. The flux integral method fofor [[Convection–diffusion equation|multi-dimensional convection]] and diffusion. Applied Mathematical Modelling.</li>
Springer</li>
<li># Shchepetkin, A. F., McWilliams, J. C., 1998. Quasi-monotone advection schemes based on explicit locally adaptive [[dissipation]]. Monthly Weather Review
<li>Zalesak, S. T., 1979. Fully multidimensional flux-corrected transport algorithms for fluids.
# Jiang, C.-S., Shu, C.-W., 1996. Efficient implementation of weighed eno schemes. Journal of Computational Physics.</li>
<li># Finlayson, B. A., 1972. The Method of Weighed Residuals and Variational Principles. Academic Press.
<li>Leonard, B. P., MacVean, M. K., Lock, A. P., 1995. The flux integral method fo [[Convection–diffusion equation|multi-dimensional convection]] and diffusion. Applied Mathematical Modelling.</li>
<li># Durran, D. R., 1999. Numerical Methods for [[Wave function|Wave Equations]] in Geophysical Fluid Dynamics. Springer, New York.
<li>Shchepetkin, A. F., McWilliams, J. C., 1998. Quasi-monotone advection schemes based
<li># Dukowicz, J. K., 1995. Mesh effects for rossby waves. Journal of Computational Physics</li>
on explicit locally adaptive [[dissipation]]. Montlhy Weather Review</li>
<li># Canuto, C., Hussaini, M. Y., Quarteroni, A., Zang, T. A., 1988. Spectral Methods in Fluid Dynamics. Springer Series in Computational Physics. Springer-Verlag, New York.
<li>Jiang, C.-S., Shu, C.-W., 1996. Efficient implementation of weighed eno schemes. Journal
<li># Butcher, J. C., 1987. The Numerical Analysis of [[Ordinary Differential Equations]]. John Wiley and Sons Inc., NY.
of Computational Physics</li>
<li># Boris, J. P., Book, D. L., 1973. Flux corrected transport, i: Shasta, a fluid transport algorithm that works. Journal of Computational Physics
<li>Finlayson, B. A., 1972. The Method of Weighed Residuals and Variational Principles.
 
Academic Press.</li>
'''Citations'''
<li>Durran, D. R., 1999. Numerical Methods for [[Wave function|Wave Equations]] in Geophysical Fluid Dynamics.
{{Reflist}}
Springer, New York.</li>
<li>Dukowicz, J. K., 1995. Mesh effects for rossby waves. Journal of Computational Physics</li>
<li>Canuto, C., Hussaini, M. Y., Quarteroni, A., Zang, T. A., 1988. Spectral Methods in
Fluid Dynamics. Springer Series in Computational Physics. Springer-Verlag, New York.</li>
<li>Butcher, J. C., 1987. The Numerical Analysis of [[Ordinary Differential Equations]]. John
Wiley and Sons Inc., NY.</li>
<li>Boris, J. P., Book, D. L., 1973. Flux corrected transport, i: Shasta, a fluid transport
algorithm that works. Journal of Computational Physics</li>
</ol>
 
[[Category:Fluid mechanics]]
[[Category:Computational fluid dynamics]]
[[Category:Numerical analysis]]