Questions tagged [diffusion]

The tag has no usage guidance.

62 questions
Filter by
Sorted by
Tagged with
56 views

795 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 ...
246 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 ...
65 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 ...
93 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 ...
4k views

Is Crank-Nicolson a stable discretization scheme for Reaction-Diffusion-Advection (convection) equation?

I am not very familiar with the common discretization schemes for PDEs. I know that Crank-Nicolson is popular scheme for discretizing the diffusion equation. Is also a good choice for the advection ...
374 views

2D simulation of a particle with different diffusion coefficient in different directions of the particle

How can one simulate diffusion of a particle which has a natural axis and diffusion coefficient of the particle in the direction of the axis is D_1 and in perpendicular to the axis is D_2? Could ...
24 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 ...
38 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 ...
39 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 ...
144 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 ...
In the following staggered grid setting, I want to solve diffusion equation as a linear system. $$\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2}... 2answers 192 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 ... 0answers 99 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 ... 2answers 184 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 ... 1answer 257 views Adding Non-Linear source term to 2d Implicit MATLAB code I'm running out of time for this code so any help would be greatly appreciated. I am currently coding the 2D heat/diffusion equation in matlab but i'm having trouble adding in the source term. my ... 1answer 114 views Diffusion properties of hard spheres in Monte Carlo simulation In standard Monte Carlo simulations, say for hard sphere systems, how should one compute the mean-squared displacement of the spheres in order to extract dynamical properties such as the diffusion ... 0answers 104 views Hello word in FEniCS? [closed] I am trying to start using FEniCS, but have a problem with the simple hello world examples given in the books. Could you please give me the simplest hello world ... 2answers 137 views Computational Physics: Finding the Diffusion Coefficient from the Discretized Diffusion Equation I'm pretty new to translating simulation to reality so please forgive the perhaps naive approach I'm taking here. If we have a (quasi-2D) experimental video of a certain concentration changing with ... 1answer 3k views How to simulate 3D diffusion in python? I want to simulate a simple 3D diffusion (e.g., an ink released from one side of a vessel) using SciPy. There are some tutorials for one-dimensional diffusion. ... 1answer 5k views Conservation of a physical quantity when using Neumann boundary conditions applied to the advection-diffusion equation I don't understand the different behaviour of the advection-diffusion equation when I apply different boundary conditions. My motivation is the simulation of a real physical quantity (particle density)... 0answers 45 views How is the Gastner-Newman equation implemented to create value-by-area cartograms? There is a paper called "Density-equalizing map projections: Diffusion-based algorithm and applications" by Michael T. Gastner and M. E. J. Newman, which explains their algorithm (which is based in ... 0answers 57 views elliptic equation with exponential coefficient I'm trying to solve the following equation$$\dfrac{\partial}{\partial x}\left(e^{au}\dfrac{\partial u}{\partial x}\right) = 0$$Of course, this equation can be solved analytically. I am trying to ... 0answers 177 views Spurious oscillations in diffusion-reaction problems with finite volume I have successfully solved the multi-species diffusion-reaction equation $$\frac{\partial c_i}{\partial t} = \nabla \cdot (d_i(x)\nabla c_i) + s_i(x,t), \quad \quad (1)$$ ... 2answers 301 views Stable implicit method to solve convection-heat diffusion in 3D The last couple of hours I have been looking for an unconditionally stable method to solve the convection-diffusion equation within a 3D inhomogeneous material. Here's the well known diffusion-... 1answer 66 views Transforming a 1D cartesian variable-coefficient diffusion code into a 1D adially symmetric one So I have a code that I use which solves a 1D variable coefficient diffusion problem in cartesian coordinates: \frac{\partial u}{\partial t}=\frac{\partial}{\partial x}\left(D(x)\frac{\partial u}{\... 0answers 194 views Reaction-diffusion equations I'm simulating a biological phenomena with reaction diffusion equations. There are multiple diffusing materials and there are some complex relations about consumption and production of such materials. ... 2answers 172 views Is this system of diffusion equations well-posed? I’m using a standard Crank-Nicholson algorithm to solve this system of two coupled diffusion equations: \dot{u} - \dot{v} = \frac{\partial}{\partial x} \left( \alpha(x) \frac{\partial u}{\partial x} ... 2answers 776 views Molecular Dynamics: Diffusion with PBC How can I implement the computation of the diffusion coefficient D using periodic boundary conditions (PBC)? I use molecular dynamics of a set of nboby particles with positions pos(3,nbody) in ... 1answer 258 views Unfolding folded trajectories for Diffusivity calculation - MD I have just started using dl_poly classic to work in Molecular Dynamics simulations. It produces a HISTORY file which records the trajectory after applying boundary conditions. Now, here I don't ... 1answer 127 views Problem with Richardson extrapolation method for weak convergence in SDE I have implemented the Richardson extrapolation of the Euler-Maruyama method to 4th order, to estimate the moments of SDE. The Euler-Maruyama works, and I would expect the Richardson extrapolation to ... 0answers 283 views 3D Diffusion Equation in Fourier space I'm solving the 3D Diffusion equation$$u_t=k(u_{xx}+u_{yy}+u_{zz})$$in MATLAB using Fourier techniques. I assume a 3D Fourier expansion (e^{-ipx},e^{-imy},e^{-imz})of the solution. Physical ... 2answers 560 views Diffusion coefficient when simulating in 2D Suppose I want to simulate the well-known diffusion partial differential equation in 2D, for example with finite elements or finite differences. Can I directly take physical diffusion coefficients ... 0answers 128 views Discontinuity at Interface The equation at the left of the interface is $$\displaystyle\frac{\partial C_i}{\partial t} = D_i \nabla^2 C_i - z_i \frac{D_i}{RT}F \nabla \cdot (C_i \nabla \phi_2)$$ ... 2answers 1k views 9-point stencil finite difference Laplacian with variable diffusion coefficients So I'm trying to implement a 9-point stencil discretization to the 2D difussion equation. The stencil is here. However, most of the literature deals with a Laplacian that has a constant diffusion ... 0answers 107 views Reducing oscillations a 3D Alternating direction explicit scheme for the diffusion equation? Hi I have made a 3D alternating direction explicit scheme for solving the diffusion equation, which will eventually replace a FTCS scheme in model of bubble dynamics in tissue. I have been testing it ... 2answers 679 views Determining if samples fit a 3D Gaussian distribution I have a collection of sample particles, with (x,y,z) coordinates generated by a simplified Monte Carlo-like code. I expect that these particles will follow an anisotropic diffusion process, which ... 1answer 174 views Not getting correct numerical solution for Advection-Diffusion-Reaction eqn Objective: I am trying to numerically solve C(x,y,t) from the following advection-diffusion-reaction equation in 2D space (x,y) and time. I will be testing my numerical solution with an approximate ... 0answers 216 views 1 D Diffusion equation FDM with different layers I'm trying to solve this particular equation \frac{\partial u}{\partial t} = \frac{\partial}{\partial x} \big[D_{i}(x)\frac{\partial u}{\partial x} \big] + S(x,t) where the i index denotes ... 1answer 74 views Reaction-Diffusion problem A->B, solving for B I need to solve a Reaction-Diffusion using Finite Elements, piecewise linear elements. In this problem, a reaction A \rightarrow B, with rate law  r_A = - k_A \cdot u_A , takes part, where u_i ... 2answers 229 views Model of heat sink problem with fan I am trying to solve this problem using advection-diffusion model and finite element method for the solution, due to the complex geometry. Basically the problem i'm trying to solve using OpenFOAM is ... 1answer 122 views Modified diffusion equation and unstabilities I am trying to simulate the phase separation of a binary mixture. If the free energy F is known as a function of the concentration c, the dynamical equation is:  \frac{\partial c(x,t)}{\partial t}=... 1answer 251 views Numerical Solution of non-linear diffusion equation using Finite Differencing I'm trying to solve the following non-linear diffusion equation:$$ \frac{\partial}{\partial t} u(x,t)= \frac{\partial^{2}}{\partial x^{2}}u(x,t)^{3} -1\leq x \leq1, t \geq 0  with the boundary ...
I want to numerically solve the diffusion equation $\partial_t u = D \partial_x^2 u$ in Fourier space, and can think of multiple ways to do it. Setup Option 1 Differentiating $u$ twice in Fourier ...