All messages from thread Message 1 in thread From: Chris Rehmann (crehmann@whoi.edu) Subject: Oscillations in leapfrog solution of Euler equations Newsgroups: sci.physics.computational.fluid-dynamics, sci.math.num-analysis Date: 1997/07/21 I am studying internal gravity wave propagation by solving the equations for the vorticity and density fluctuation without diffusive terms.* The finite-difference scheme uses a leapfrog method (centered time and space derivatives) started with a forward Euler step. The streamfunction is computed from the vorticity with a Poisson solver. When the initial conditions have relatively steep gradients, spurious oscillations with a wavelength on the order of a few grid meshes develop and eventually become unstable. The Courant number is less than one everywhere throughout the simulation. Reducing the time step by a factor of 10 does not change the solution appreciably. Increasing the spatial resolution delays the appearances of the oscillations. I have heard and read that since the solutions at consecutive time levels are decoupled in the leapfrog method, they eventually diverge. One recommended solution is to take an Euler step at regular intervals; however, this did not seem to help. Are there other ways to avoid these spurious oscillations? Should I use another numerical method? Thank you. Chris Rehmann crehmann@whoi.edu * The equations are dZ/dt = J(Psi,Z) - c1 drho/dx drho/dt = J(Psi,rho) + c2 dPsi/dx lap(Psi) = Z where Z = vorticity, Psi = streamfunction, rho = density perturbation, c1, c2 are constants, and lap(F) = d^2F/dx^2 + d^2F/dz^2 J(a,b) = da/dx db/dz - da/dz db/dx Message 2 in thread From: Tony Roberts (aroberts@usq.edu.au) Subject: Re: Oscillations in leapfrog solution of Euler equations Newsgroups: sci.physics.computational.fluid-dynamics, sci.math.num-analysis Date: 1997/07/25 > When the initial > conditions have relatively steep gradients, spurious oscillations > with a wavelength on the order of a few grid meshes develop and > eventually become unstable. This is a big problem to start with. If you initial conditions have steep gradients in a wave-like system, then you are likely to retain steep gradients forever. However, you do say they become unstable and so I interpret that to mean they do actually grow in time. If so I suggest that the following might work. Stagger your grids for (Z,Psi) and rho in TIME. That is (Z,Psi) are at integer time-steps whereas rho is at half-time steps. Then approximate your dZ/dt equation by time differencing centred on the half-times, and your drho/dt by centered on integral times. This sort of trick works very well for a wide range of physical systems---it may do the trick for you. > are decoupled in the leapfrog method, they eventually diverge. One > recommended solution is to take an Euler step at regular intervals; > however, > this did not seem to help. Pathetic solution this, dont use it. --------------------------------------------------------------------- Professor A.J. Roberts Dept of Mathematics & Computing E-mail: aroberts@usq.edu.au University of Southern Queensland Phone: (076) 312943 Toowoomba, Queensland 4350 Fax: (076) 312721 AUSTRALIA WWW: http://www.sci.usq.edu.au /pub/MC/staff/robertsa/home.html --------------------------------------------------------------------- Message 3 in thread From: Bruce Scott TOK (bds@ipp-garching.mpg.de) Subject: Re: Oscillations in leapfrog solution of Euler equations Newsgroups: sci.physics.computational.fluid-dynamics, sci.math.num-analysis Date: 1997/07/25 : When the initial : conditions have relatively steep gradients, spurious oscillations : with a wavelength on the order of a few grid meshes develop and : eventually become unstable. : The Courant number is less than one everywhere throughout the : simulation. Reducing the time step by a factor of 10 does not change : the solution appreciably. Increasing the spatial resolution delays the : appearances of the oscillations. This is your key information. What you are discovering is that hyperbolic wave systems are always unstable if you discretise them with centered differencing. Quite a large body of literature appeared circa 1960-1990 to treat this situation, which leads to the many flavors of upwinded and flux-limited numerical schemes. The problem with centered differencing is that on a system with uni-directional characteristics you are always using information from both directions away from a given point to compute derivatives at that point in space, and this is unphysical. The growth rate of the instability scales as the grid spacing times the velocity of the characteristic, which is why it is insensitive to the time step. : I have heard and read that since the solutions at consecutive time : levels : are decoupled in the leapfrog method, they eventually diverge. One way to describe the above problem. : One : recommended solution is to take an Euler step at regular intervals; : however, : this did not seem to help. No solution. The Euler step you use here is probably even worse than the leapfrog scheme -- the problem is the use of centered differences in space. : Are there other ways to avoid these spurious oscillations? Should I use : another numerical method? Yes. A staggered grid may help some, but the growth rate becomes marginal (ie, zero, not negative), and if you are studying turbulence that won't be enough. What you want are things that are as accurate as possible right down to the mesh scale, and then dissipative at the mesh scale. A few references: basic text: R. D. Richtmeyer and K. W. Morton, {\it Difference Methods for Initial-Value Problems}, 2nd Ed (Wiley, New York, 1967). the references to the methods I use; the first two are incompressible methods, and the third describes the discretisation of v.del terms: J. B. Bell, P. Colella, and H. M. Glaz, A Second Order Projection Method for Two-dimensional Incompressible Flow J. Comput. Phys. 85 (1989) 257-283. J. B. Bell and D. L. Marcus, A Second Order Projection Method for Variable Density Flows J. Comput. Phys. 101 (1992) 334-348. P. Colella, Multidimensional Upwind Methods for Hyperbolic Conservation Laws. J. Comput. Phys. 87 (1990) 171-200. the method the astrophysics people like for shocky flows: P. Colella and P. R. Woodward The Piecewise Parabolic Method (PPM) for Gas-Dynamical Simulations J. Comput. Phys. 54 (1984) 174-201. -- Mach's gut! Bruce Scott "Don't mourn. Organise!" -- Joe Hill Judi Bari, 1949-1997 bds@ipp.mpg.de --> http://www.oro.net/~dscanlan/bari.html ©2001 Google