# Questions tagged [diffusion]

For questions about modeling movement from high to low concentrations, where concentration could, for example, refer to number of particles or amount of thermal energy in a region. Problems will often involve solving a diffusion (differential) equation.

84 questions
Filter by
Sorted by
Tagged with
1 vote
29 views

### Calculating the species mass consumption from implicit reaction-term in diffusion-reaction equation

The 1D diffusion equation with a chemical source term has the following form: $$\frac{\partial Y}{\partial t} = D \frac{\partial^2 Y}{\partial x^2} - k Y,$$ where $Y$ is the molar concentration of the ...
79 views

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

I'm dealing with the numerical resolution of advection-diffusion-reaction equations. I've encountered references on CFL conditions for conservation laws as well as advection-diffusion equations. I'm ...
• 61
66 views

### Finite volume method for 1D heat equation in 1D

I wish to solve the following using the finite volume method: $$\frac{\partial u}{\partial t}=\frac{D}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u}{\partial r}\right)+Q(t,r)$$ with the ...
• 101
650 views

### How to solve a second order differential equation (diffusion) with boundary conditions using Python

I am having trouble implementing a model from a publication. Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625 scihub link: https://sci-hub.se/10.1021/ie030109q I ...
91 views

• 1
866 views

### Solving the heat diffusion equation with source term

I am trying to solve the 1-D heat equation numerically with a variable source term. The system is basically a tank containing styrene in which it polymerizes to liberate heat. I have assumed that the ...
92 views

### Modelling of Stefan Maxwell equation

I am trying to solve Maxwell Stefan's equation over a membrane to get the transient mole fraction distribution over the membrane thickness 'z'. But somehow I am not able to code it using ODE45, more ...
254 views

### 2D diffusion equation using Finite Volume Method

i am working on an assignment problem: Consider a two-dimensional rectangular plate of dimension L = 1 m in the x direction and H = 2 m in the y direction. The plate material has constant thermal ...
1 vote
85 views

### FEM diffusion: inaccurate results small time steps

I wrote some FEM code and found some strange results when using a very small time step. So, I decided to analyze the discrete equations. Consider the following linear diffusion problem in 1 dimension:...
• 172
1 vote
58 views

• 1,976
293 views

### Numerically solving a non-linear PDE

I have this non-linear partial differential equation. $$\frac{\partial C}{\partial t}=\left(\frac{\partial C}{\partial x}\right)^2+C\frac{\partial^2 C}{\partial x^2}$$ I want to use the finite ...
• 33
99 views

### Stability of PDEs

I am currently trying to solve some PDEs with FiPy. At page 56, the manual mentions (https://www.ctcms.nist.gov/fipy/download/fipy-3.0.pdf). The largest stable timestep that can be taken for this ...
• 101
100 views

### Numerical solution to N-dimensional diffusion on simplex?

Assume I have a system of at least (but generally only) $N+1$ points in an $N$-dimensional space ($N > 3$ is possible). At each of these points $x_i, i=1,...,N+1$ I know an initial potential/...
• 203
1 vote
81 views

### Minimizing the used memory in diffusion simulation using Python

I am recently dealing with a diffusion simulation project and I have come up with the following code: ...
132 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
4k views

### Applying neumann boundary conditions to diffusion equation solution in python [duplicate]

For the diffusion equation $$\frac{\partial u(x,t)}{\partial t} = D \frac{\partial ^2 u(x,t)}{\partial x^2} + Cu(x,t)$$ with the boundary conditions $u(-\frac{L}{2},t)=u(\frac{L}{2},t)=0$ I've ...
• 1
118 views

### Harmonic average of Diffusion Tensors in Finite Volume Method

I want to implement a Bilinear Finite Volume discretisation of the anisotropic diffusion problem: $$\frac{du}{dt} = \nabla \cdot (\textbf{D} \nabla u)$$ Both my degrees of freedom as well as the ...
• 1,976
1 vote
329 views

### Analytical testcase for 2D/3D anisotropic Diffusion (Heat Kernel)

I want to verify and compare different Discretizations of the anisotropic diffusion equation in 2D / 3D. In order to both test the timestepping and the spatial discretisations I had a look at using ...
• 11
464 views

### Computing geodesic distances with diffusion

I am trying to solve an APSP (All-Pair Shortest Path) problem on a weighted graph. This graph is actually a 1, 2 or 3 dimensional grid, and the weights on each edge represent the distance between its ...
• 131
32 views

### Calculating volume of a discretised diffuse interface object

Suppose I have a spherical object projected onto a discrete square mesh. The dicretised circle can be represented by filling a logical matrix such that voxels in the interior of the sphere are filled ...
1 vote
45 views

### Limit to volume change in a discretized mathematical model?

I have set up a mathematical model describing the diffusion of ozone out of a gas bubble. The bubble is surrounded by a thin gas film. So actually, the model describes the diffusion of ozone through ...
• 91
51 views

### Solving the diffusion/heat equation for a randomly distributed set of points in 3D

In this problem I am trying to solve, I have a messy set of points distributed in 3D space, each with a defined temperature. If I would want to calculate the heat transfer scenario in this system, how ...
1 vote
244 views

### Neumann boundary condition FD implementation for instationnary diffusion equation

I am trying to solve this diffusion equation : $\dfrac{\partial D\dfrac{\partial f}{\partial x}}{\partial x}+S = \dfrac{\partial f}{\partial t}$ ($D$ is not constant and varies according to $x$) with ...
335 views

### Mean-squared displacement in Monte Carlo studies

Is measuring mean-squared-displacement in Monte Carlo simulations uncommon? I'm very interested to find out if this has actually ever been tried. For instance, in the context of spheres, or ...
• 179
109 views

### How to account for the interface between two different phases in a discretized diffusion model?

I have tried to set up a model for the diffusion of a gas into a liquid. The two media are next to each other and the geometry is spherical because the system should simulate the diffusion out of a ...
• 91
509 views

### Conservation violation in axisymmetric Diffusion Equation

1d diffusion equation Integrating the diffusion equation, $$\frac{\partial u}{\partial t} = D \frac{\partial^2 u}{\partial x^2},$$ with a constant diffusion coefficient D using forward Euler for ...
• 131