Skip to main content
Share Your Experience: Take the 2024 Developer Survey
10 votes

Why not use the convolution theorem for explicit timestepping?

This is a linear PDE, and so while this technique works here, it would not work for any nonlinear PDE. Often times when people are solving these equations it is to get experience with common solution ...
EMP's user avatar
  • 2,089
9 votes

What is the advantage of using a particular RK Scheme?

You're looking only at the errors themselves and not other properties of the solution. There are sometimes good cases to consider lower-order schemes because they better preserve important ...
Daniel Shapero's user avatar
8 votes
Accepted

Numerically computing the advection equation

I see several issues: The DFT computed with fft puts the zero mode at the beginning of the array, and if you want to compute the derivative, it is necessary to ...
Kirill's user avatar
  • 11.4k
8 votes
Accepted

What is the advantage of using a particular RK Scheme?

There are lots of different properties which can be found in different time stepping schemes of the same order of accuracy: Different stability properties. While it may not appear that way with the ...
helloworld922's user avatar
7 votes

Why do we have to resort to Higher order schemes for solving the 1-D advection equation/ continuity equation?

There is a difference between the requirements for a hyperbolic pde like $$ u_t + a u_x = 0 $$ and for a purely parabolic pde like $$ u_t = u_{xx} $$ Suppose the solutions are smooth and you ...
cfdlab's user avatar
  • 3,028
7 votes

Advection equation with finite difference: importance of forward, backward or centered difference formula for the first derivative

Okay. Let's begin with the first situation. Your equation is: $$ \frac{\partial f}{\partial t}+v\frac{\partial f}{\partial x}=0\tag{1}$$ $\textbf{Previous comments}$ There are plenty of webs that ...
HBR's user avatar
  • 1,648
7 votes
Accepted

More Smearing with decreasing timestep in advection problems

You solve the 1D-advection equation with $c$ a constant velocity: $$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x}=0~~~~~~~~(1)$$ When you discretize this equation (with an explicit ...
Coriolis's user avatar
  • 629
6 votes
Accepted

When is it safe to ignore the diffusion term in an advection-diffusion equation?

The stationary equation you show transports information from the right to the left via the advection term; it also diffuses slightly. If you switch off the diffusion term altogether, then you only ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Crank-Nicolson method for inhomogeneous advection equation

Your equation can be written in the following fashion (any spatial derivative approximation is valid), once space is discretised: $$\frac{1}{c}\frac{du_i}{dt}=-\left(\frac{\partial u}{\partial x}\...
HBR's user avatar
  • 1,648
5 votes

Advection equation with finite difference: importance of forward, backward or centered difference formula for the first derivative

You stumbled across something very fundamental that is important to understand. For any PDE we can define for each point its "domain of dependence" This is the region of space/time that is able to ...
Philip Roe's user avatar
  • 1,154
5 votes

WENO Scheme for 1D linear advection equation

As @SpencerBryngelson has pointed out, the scheme doesn't work, because of the Euler time integration method. One should rather use RK-3 (or maybe RK-2) (see for instance these excellent notes: https:/...
prickly's user avatar
  • 71
5 votes

Why not use the convolution theorem for explicit timestepping?

For the linear, constant coefficient advection equation on a torus, one can simply use the exact solution. So there are no "popular" numerical methods for this problem.
David Ketcheson's user avatar
4 votes
Accepted

Implementing structured grid boundary conditions using NumPy arrays?

The Numpy function $roll$ performs periodic shift of an array. Using it, the explicit time step for your PDE in a periodic domain can be simply implemented like this: ...
Maxim Umansky's user avatar
4 votes

Why the numerical solution of advection-dominant problem is challenging

The difficulty is relative to something, in this case it is relative to diffusion dominated problems. Diffusion dominated aren't "easy" either, they have their own set of problems. I'll start with ...
Reid.Atcheson's user avatar
4 votes

Should reaction be taken into account in the CFL condition when solving advection-diffusion-reaction equations numerically?

CFL is a necessary requirement for stability in transport-dominated systems, but in practice, is an intuitive way to interpret linear stability. A 1D advection-diffusion (or somewhat upwinded ...
Jed Brown's user avatar
  • 25.7k
4 votes
Accepted

Numerical solution of an advection equation, $\frac{\partial P}{\partial t}+\frac{\partial}{\partial x}\left(P^{5/3}\right)=0$, with finite volume

Your discretization with the upwind scheme looks correct. One reason why you get oscillations might be that you are choosing an incorrect time step. Another one is if you have some complicated and not ...
Rigel's user avatar
  • 419
4 votes
Accepted

Numerical scheme for the level set equation that solves inverse mean curvature flow problems

This is rather a general answer, since it is not clear what stability issues your are facing: First of all, is well known that a linear transport equation with non-constant velocity field admits non-...
ConvexHull's user avatar
  • 1,335
3 votes

When is it safe to ignore the diffusion term in an advection-diffusion equation?

In the time-dependent nonlinear case, if you drop the diffusive term then you have a nonlinear hyperbolic problem. Solutions will naturally generate singularities (discontinuities) in finite time. ...
David Ketcheson's user avatar
3 votes
Accepted

Finite Difference for Advection Equation With Source

The choice of $k$ is restricted also by the discretization of the source term. To see it, rewrite your scheme to \begin{equation} u_m^{n+1} = \left(1 - \frac{k(1-x_m)}{h} - k(1-x_m)\right) u_m^n + \...
Peter Frolkovič's user avatar
3 votes
Accepted

Finite difference method not working for advection PDE with negative coefficient

and it works just fine for c>0 with the exact same boundary conditions, though. That's your issue. Look up the method of characteristics: https://web.stanford.edu/class/math220a/handouts/firstorder....
Chris Rackauckas's user avatar
3 votes

How to discretize the advection equation using the Crank-Nicolson method?

User 03161 asserts that the Crank Nicolson method is not appropriate for advection problems, but boyfarrell provides a working code with results visualized in a movie. In fact they are both correct, ...
Philip Roe's user avatar
  • 1,154
3 votes

Why not use the convolution theorem for explicit timestepping?

Reharding the question in the comment: After discretization you get a system of the form $ \partial_t C = (M_x + M_y) C $ where $M_x$ and $M_y$ are commuting matrices obtained by discretizing the time-...
davidhigh's user avatar
  • 3,147
2 votes

Discretization method for advection equation without numerical diffusion

If your aim is to solve one-dimensional advection equation with variable velocity having minimal numerical diffusion and no unphysical oscillations and you have no other requirements (mass ...
Peter Frolkovič's user avatar
2 votes
Accepted

Deposition model in laminar flow

I will try to answer as best as I can your three questions. 1) Your approach is quite classical in that you are considering the particles to be an active scalar. What most people would usually do is ...
BlaB's user avatar
  • 1,157
2 votes

Advection equation in 2D using finite differences - the scheme works, but the pulse loses "energy"

To answer your question, I will for the sake of simplicity let $v=1$ and consider the one-dimensional case \begin{equation} g_t + g_x = 0 \tag{1} \end{equation} where subscripts denote partial ...
ekkilop's user avatar
  • 221
2 votes
Accepted

Is there a general analytic solution to 1D advection of velocity, $u_t=-uu_x$?

Your solution for linear case is not correct. For the equation $$ u_t + c u_x = 0 $$ the solution is $$ u(x,t) = u(x-ct,0) = u_0(x-ct) $$ For Burger's eqn, as long as the solution is smooth it can be ...
cfdlab's user avatar
  • 3,028
2 votes

Upwind finite difference: Matrix Implementation

Your idea of taking matrix powers is not a good one. You should code it for step by step updating $$ u_0 = \textrm{initial condition} $$ $$ u_0 \rightarrow u_1 \rightarrow u_2 \rightarrow $$ so at ...
cfdlab's user avatar
  • 3,028
2 votes
Accepted

What is wrong in the code for this upwind method?

I've identified a few "problems": Your analytical solution isn't quite correct. The correct analytical solution to the "infinite domain" advection equation is supposed to be $u(t,...
helloworld922's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible