Share Your Experience: Take the 2024 Developer Survey

# Tag Info

Accepted

### BDF vs implicit Runge Kutta time stepping

Yes, there aren't too many resources on this for some reason. For a very long time, the standard goto was "just use BDF methods". This mantra was set in stone for few historical reasons: for ...
• 12.3k
Accepted

### Don't we care about the numerical diffusion in the diffusion term?

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$ The function $u$ may represent ...
• 1,648
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 ...
• 55.7k
Accepted

### Finite difference methods in cylindrical and spherical co-ordinate systems

There are basically two methods: You can disrectize the angular part via grid points, or you can discretize it via basis expansion. I will focus on spherical symmetry here, the cylindrical case is ...
Accepted

• 16.5k

### Choice of grid generation for FDM discretisation methods

Your question mentions both space and time discretization and the problems that can arise due to different choices of one or the other. I think that you might be conflating problems that come from the ...
• 10.3k
Accepted

### finite differences on a slanted grid --- advection diffusion equation

In case you can easily implement the roated grid, this is possibly the easist fix, so let me answer your question about the invariance of the convection diffusion equation under rotation of the ...
• 558
Accepted

### CFL condition in Stokes equation

Essentially, the time dependent Stokes equation looks like the heat equation: $$\frac{\partial u}{\partial t} - \nu\Delta u = f-\nabla p,$$ plus the incompressibility condition $\nabla \cdot u=0$ ...
• 55.7k
Accepted

### How to simulate 3D diffusion in python?

You just add the diffusion along the other dimensions. This superposition from orthogonal directions makes some sense, as they are independent. So, going by wikipedia for Fick's second law of ...
• 364

### 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. ...
• 16.5k

### Should particles in Smoothed Particle Hydrodynamics (SPH) always move during a simulation?

Particles in SPH simulations mimic the motion of material points by simply updating their positions due to their velocities. In situations like heat conduction you don't need to move them, in fact, ...
• 430
Accepted

### Why is my Runge-Kutta 4 solution to the 1-D advection equation decaying so quickly?

The cause of the decay is the highly-diffusive, first order, finite difference method used for the spatial discretization Let's ignore the time discretization, as that does not appear to be the ...
• 1,114

### Non-conservative advective term in a finite volume scheme

There is a methology for non-conservative products called path-conservative schemes, which might useful for you. The method can be applied to systems of the form \begin{align} \frac{\partial \mathbf{Q}...
• 1,335

### Modeling contamination diffusion in a draining container, part 2

In case this helps anyone in the future, I wanted to finish off the problem by showing how I actually implemented it numerically. Forget Newton's method; I just solved the matrix equation for ...
• 197

### Enforcing bounds and equality constraints for convex optimization

This is just a standard convex Quadratic Programming (QP) problem, which quadprog, or any number of other QP solvers, can solve. There are a variety of algorithms for solving QPs, and I think you ...
• 2,232

### Numerical approximation for a known exact solution of advection-dispersion equation

A couple of points: Let me start by clearing up a persistent mistake relating to the stability condition of the FTCS method you are using. The correct stability condition, derived using the von ...

### Can this nonlinear advection-diffusion equation be discretized as to only have to solve SPD systems?

One strategy may be to use a semi-implicit temporal discretion, treating the diffusive term implicitly and the advective term explicitly. Doing so alleviates the extreme timestep restriction typically ...
• 1,512

### How write a integration loop in fortran, leapfrog scheme to solvind PDE (advection)?

There are a number of ways to check if a code is correct. The best way in this instance is to perform a convergence check on your code. This requires that you perform the same computation with ...
• 556

• 86

### Instability at the boundary of a finite difference simulation of a hyperbolic PDE

I've got a two comments that hope can be of help. In my experience, trying to impose boundary conditions analytically and come up with the corresponding matrices for the interior nodes as you have ...
Accepted

### Mineral dissolution and solute transport around a solid

Firstly, there are some mistakes in your discretized formulation and the approach you employ to solve this problem: The flow velocity in the advection diffusion Eq. (1) is to be computed from the ...

### Solving systems of advection-diffusion-reaction equations with finite element methods

To answer your questions: Yes, multiply the equations by test functions to get a weak form. This should give you a set of ordinary differential equations (ODEs) in time. For each variable, there ...
• 760