Questions tagged [advection-diffusion]

Questions related to solving the advection-diffusion equation using numerical methods, including derivation and implementation of boundary conditions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Finite volume method using Chebyshev polynomials

I want to solve the following set of coupled advection-diffusion equations: $$ \frac{\partial f}{\partial t}=\nabla\cdot(\kappa\nabla f)+\nabla\cdot(\boldsymbol{u}f)+s_f(g), $$ $$ \frac{\partial g}{\...
3 votes
2 answers
139 views

Non-conservative advective term in a finite volume scheme

I am interested in solving this set of nonlinear couples advection-diffusion equations using a finite volume scheme: $$ \frac{\partial f(x,y)}{\partial t}=-(\boldsymbol{u}+\nabla\eta)\cdot\nabla f +\...
0 votes
1 answer
69 views

Choice of grid generation for FDM discretisation methods

I'm currently revisiting some FDM schemes for convection-diffusion equations in 1D, 2D and 3D and getting up to speed with the industry-standard methods again. The application is derivatives pricing, ...
1 vote
0 answers
99 views

Solving PDE on a non-uniform grid with Crank-Nicolson scheme

I am solving a 1D diffusion-type equation with the finite-difference Crank-Nicolson (CN) scheme, and I need to densify the spatial grid around the central point. One could change the spatial variable ...
1 vote
0 answers
150 views

Closed (Robin) boundaries in advection-diffusion equation with FDM

I am solving the equation $$ \frac{\partial \phi}{\partial t} = \frac{\partial}{\partial x} \left( D \frac{\partial \phi}{\partial x} + v\phi \right) $$ using finite differences. I want to include ...
2 votes
1 answer
123 views

Solving a set of mixed conservative/non-conservative equations with the finite volume method

I want to solve this set of 2D advection-diffusion equations of this form in spherical coordinates: $$ \frac{\partial f}{\partial t}=-\mathbf{u}\cdot\nabla f+\eta\nabla^2f+\eta_1(\mathbf{e}_1\cdot\...
2 votes
1 answer
397 views

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

I am trying to numerically solve the advection equation $y_t + y_x = 0$ using a the "classical" Runge-Kutta 4 explicit timestepping method, along with a left-hand finite difference ...
  • 23
3 votes
1 answer
132 views

Mineral dissolution and solute transport around a solid

I am trying to simulate solute transport of acid (HCl) and consequent mineral dissolution around a grain (calcite). The governing equation for transport is the advection-diffusion equation, given as: ...
  • 55
2 votes
0 answers
74 views

Advection diffusion equation using Crank-Nicolson with total flux and Diriclet BCs

I am trying to model the 1D advection-diffusion equation: $${\partial c \over \partial t} = D_c{\partial^2 c \over \partial x^2} -u{\partial c \over \partial x}.$$ With Robin boundary conditions that ...
  • 81
2 votes
0 answers
105 views

Solute transport around a solid obstacle

I am a newbie in CFD and single/multiphase flow and transport in general. As part of my quest to learn, I am trying to model solute transport around a solid object in the center of a 2D domain. The ...
  • 55
3 votes
1 answer
76 views

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

I want to simulate the hyperbolic partial differential equation $$W_{tt} + V W_{tx} + k_E V W_x + k W_t = 0,$$ but I am having trouble finding a discrete analog of this equation which is numerically ...
0 votes
1 answer
80 views

Manufactured solution to 2d convection-diffusion with homogeneous Robin boundary conditions

I am looking for a manufactured (or analytical if it exists) solution to the 2d boundary-value problem $$\frac{\partial u}{\partial t} = \mathbf{a} \cdot \nabla u + D \nabla^2 u \quad \quad \mbox{in } ...
  • 61
2 votes
0 answers
267 views

2d advection-diffusion: cell Péclet number and numerical stability

I am studying the numerical resolution of 2d advection-diffusion problems with finite element methods. $$\frac{\partial u}{\partial t} + \beta\cdot\nabla u = \nabla\cdot(\nabla u) \, .$$ It is said in ...
  • 61
2 votes
0 answers
82 views

Does the time-dependent 1D advection-diffusion with point sources have an analytical solution?

I am looking for the analytical solution of 1-dimensional advection-diffusion equation with several point sources, Q, along the axial length of a cylinder through which the fluid flow occurs. Neumann ...
  • 459
2 votes
2 answers
552 views

How to implement point source or volume source in finite element implementations

I'm trying to do a simple implementation to study the advection-diffusion-reaction dynamics in a straight pipe. I have points positioned along the length of the pipe (blue dots in the image above). I ...
  • 459
1 vote
0 answers
56 views

Why is this Advection-convection model with insulating boundary losing mass?

I am trying to model a 1-d advection-convection numerically, using an upwind scheme. I'm using the following equation to calculate the value of internal cells: $$C_x^{t+1} = C_x^{t} + D\frac{\Delta t}{...
  • 119
2 votes
0 answers
32 views

Semi-analytical/empirical modelling of wall boundary conditions in advection-diffusion-reaction equation with distributed source

Let's suppose I need to numerically solve a 3D steady-state transport equation of the form $$ \nabla \cdot (\mathbf{u} c) = \nabla \cdot (D \nabla c) - \lambda c + S $$ where $c$ is the transported ...
2 votes
0 answers
77 views

Linearising Nonlinear Coupled Partial Differential Equations - Alfvénic Diffusion

I am trying to solve the following coupled partial differential equations with a finite difference scheme: $$\partial_tf+v\partial_zf+\partial_z\frac{1}{W}\partial_zf=0$$ $$\partial_tW+v\partial_zW-\...
0 votes
1 answer
279 views

Implementing Dirichlet BC for the Advection-Diffusion equation using a second-order Upwind Scheme finite difference discretization

i am implementing a Matlab code to solve the following equation numerically : $$ (\frac{\partial c}{\partial t} =-D_{e} \frac{\partial^2 c}{\partial z^2} +U_{z}\frac{\partial c}{\partial z}) $$ with ...
  • 1
-1 votes
1 answer
165 views

Numerical solution of the advection equation with Crank–Nicolson finite difference method

I need to implement a numerical scheme for the solution of the one-dimensional advection equation $$\\\frac{\partial u}{\partial t} + C(x, t) \frac{\partial u}{\partial x} = 0 \\\\$$ $$ \\ C(x,t) = \...
2 votes
1 answer
222 views

Finite element (1D) for steady state non-linear problem

I need to solve with linear finite elements the equation $$\frac{\partial }{\partial x}\Bigl(\text{sgn}(x) u \Big) +\frac{\partial}{\partial x} \Bigl[ \sqrt{u} \frac{\partial u}{\partial x} \Bigr] =0$...
  • 289
2 votes
1 answer
686 views

Weak formulation for advection diffusion reaction

I need a check on the following exercise about weak formulations and finite elements. Consider the advection diffusion system $$ \begin{cases} -(\mu u')' + \beta u' + \gamma u = f \\ u(a)=0 \\ u(b) = ...
  • 153
1 vote
0 answers
50 views

Effect of reducing flux consistency order at boundary on convergence order

Consider the 1D nonstationary convection-diffusion PDE $$ \begin{alignat}{2} \partial_t u &= -a \partial_x u + D \partial_{xx}u, &\qquad x \in (0,1), t \in (0,T), \\ f(t) &= \left.\left( a ...
  • 411
4 votes
1 answer
2k views

Finite difference methods in cylindrical and spherical co-ordinate systems

I am quite familiar with finite difference schemes in cartesian coordinates. The key point here is that every point in the cartesian grid is treated equally as the spacing between consecutive points ...
  • 195
1 vote
0 answers
47 views

Comparison of convection time - theoretical value vs computed

This is a follow up to my previous post here, I'm solving for convection in 1D $$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$ The discretization of the above equation is ...
  • 459
0 votes
1 answer
184 views

Question on comparing the accuracy of numerical schemes

This is a follow up to my previous post here I'm solving the following 1D transport equation . $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$...
  • 459
1 vote
1 answer
238 views

Crank-Nicholson for diffusion-advection vs diffusion equation

Let's consider the following 1D diffusion equation: $\frac{\partial u}{\partial t} = xk \frac{\partial}{\partial x}(\frac{1}{x}\frac{\partial u}{\partial x})$ where we assume that the diffusion ...
  • 172
1 vote
1 answer
181 views

Simulating advection - diffusion problem in a network of 1D pipe

I'm interested in solving the following advection-diffusion system in a 1D network of pipes. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$ ...
  • 459
1 vote
1 answer
930 views

Implementing Robin Boundary condition (finite difference)

I'm interested in applying Robin boundary condition to a convection-diffusion problem in 1D. In the following system, $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\...
  • 459
0 votes
1 answer
1k views

Imposing periodic boundary condition for linear advection equation - Node problem

I've spent the whole day trying to figure out what is the correct way to impose (and implement) periodic boundary conditions $u(0,t)=u(1,t)$ for all $t>0$ for the simple advection equation $u_t + v ...
  • 211
2 votes
1 answer
523 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
2 votes
1 answer
348 views

1-D boundary value problem: How implement mixed boundary conditions using a FD method?

I have been given a convection-diffusion ODE modeling the steady state temperature of a pipe (through which flows a fluid) as $$-\frac{d}{dz}\left(\kappa \frac{dT}{dz} \right)+v\rho C\frac{dT}{dz}=Q(...
1 vote
0 answers
37 views

Finite difference/element method : time step and spatial resolution close to a finite singularity

I'm using the finite element method (FEM), but my question is quite a global question. It's related to this question but it is not the same. Let's assume we have this equation : $$\partial_t c - u\...
  • 171
1 vote
0 answers
170 views

FDM discretization of equation on the boundary

In order to simulate the following equation using FDM $$u_t(t,x)-u_{xx}(t,x)=0, \quad (t,x) \in (0,1)\times (0,1)$$ $$(u_t(t,x)-u_{x}(t,x))\rvert_{x=0}=0, \quad t \in (0,1)$$ $$(u_t(t,x)+u_{x}(t,x))\...
  • 111
1 vote
1 answer
154 views

Error for the finite differences scheme -- Advection equation

Consider the advection equation (1D in space) $$ \frac{\partial u}{\partial t} + V\, \frac{\partial u}{\partial x}=0 $$ and we solve it numerically on $[0,1]\times [0,1]\ni (t,x)$ using a forward ...
  • 269
1 vote
3 answers
1k views

How to make a less diffusive code to solve 2D advection equation?

I would like to solve the following differential equation numerically in 2D, $$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0,$$ see Wikipedia if you are curious about what the ...
  • 219
2 votes
1 answer
650 views

Analytical Solution of Transport Equation

I'm looking at the analytical solution of the convection-diffusion equation $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$ with initial ...
  • 459
0 votes
1 answer
146 views

Simulating Brownian motion in 3-D for first hitting time?

I want to simulate Brownian motion in 3-D for the following conditions: $$p(x=0,y=0,z=0,t=0)=1$$ $$p(x,y,z=c,t)=0$$ where $p$ is the probability of finding molecules in the 3-D environment. I want to ...
  • 151
0 votes
1 answer
2k views

Analytical solution of 1D advection -diffusion equation

I am looking for the analytical solution of 1-dimensional advection-diffusion equation with Neumann boundary condition at both the inlet and outlet of a cylinder through which the fluid flow occurs. $$...
  • 459
2 votes
1 answer
1k views

Impose Neumann Boundary Condition in advection-diffusion equation 1D

when solving the advection equation in 1D that is: $$ \frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x} = 0 $$ with $ u'(t,0) = 0$ and $u(t,L) = 0$ , $u(0,x) = u_{0} $ one numerical ...
  • 253
1 vote
0 answers
478 views

Inflow and outflow boundary conditions for advection-diffusion equation

I'm trying to solve this advection-diffusion equation (ADE): $$\frac{\partial \phi}{\partial t} + \nabla \cdot (-D \nabla \phi + \mathbf{u} \phi) = 0$$ In fact, this ADE framework is coupled to a ...
  • 173
1 vote
1 answer
611 views

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

I want to resolve numerically this equation using of difference finite method with Leapfrog Scheme $$\frac{\partial{u}}{\partial t}+ v \frac{\partial{u}}{\partial x}= 0 $$ I'm trying to write a code ...
  • 11
5 votes
1 answer
628 views

Finite Differencing schemes for Convection-Diffusion equation

I'm using the Convection(/advection)-Diffusion(-Reaction) equation to calculate the temperature over time in different hydraulic parts like a pipe or a heat exchanger. The flow/convection is always 1D,...
  • 255
2 votes
0 answers
62 views

Finite difference Neumann boundary conditions: uneven weighting of edge nodes?

Originally asked this on math.stackexchange, but I figure it's also appropriate here. I'm reading through some finite difference code for a diffusion equation and came across something odd for the ...
1 vote
0 answers
60 views

Jacobian Elements for Coupled Drift-Diffusion System using Vertex-Centered Finite Volume

I'm trying to solve the fully coupled drift-diffusion system using Newton's Method. Although I eventually plan to potentially use a Jacobian-Free Newton-Krylov approach, this is still something that I ...
  • 311
2 votes
1 answer
410 views

Closed boundary conditions in finite difference method for diffusive-advective equation

I am implementing a finite difference method in solving the diffusive-advective equation: $$ u_t + v \cdot u_x = D\cdot u_{xx} $$ (v, D are constants). Planning to use the operator splitting method (...
  • 173
3 votes
0 answers
234 views

Finite Element Stabilization for Drift-Diffusion/Advection-Diffusion Equations

I've tried my best to look through the relevant suggested similar questions when posting this, and hopefully this contains enough new material to not be considered a duplicate. I'm currently trying ...
  • 311
1 vote
1 answer
130 views

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

I used pretty much all my expertise with finite differences to solve an advection-diffusion equation with space-dependent coefficient with a grid in the $x$,$z$ domain with regular spacings. Something ...
  • 157
1 vote
5 answers
1k views

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

In the context of the solution of advection-diffusion equations by finite volume method, many numerical schemes, papers and book chapters are dedicated to address the numerical diffusion and/or ...
  • 145
2 votes
1 answer
2k views

CFL condition in Stokes equation

Does the CFL condition play any role in a pure Stokes flow, i.e. convective term is neglibile, or vanishing? If not, what is the "equivalent" condition for stability? I have read something about the ...
  • 45