Questions tagged [diffusion]
The diffusion tag has no usage guidance.
76
questions
3
votes
1answer
314 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 ...
2
votes
0answers
51 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 ...
0
votes
0answers
54 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
1answer
76 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:...
1
vote
0answers
45 views
How to achieve (approx) unit scaling of a non-linear diffusion (heat) equation with a wildly varying diffusion coefficient?
I have numerical issues with a poorly scaled one-dimensional non-linear diffusion equation in physical co-ordinates
$$ \frac{\partial{u}}{\partial{t}}(x,t) = \frac{\partial}{\partial{x}}\left(D(u) \...
-1
votes
1answer
132 views
Simulating 1D diffusion
I'm trying to understand the influence of Neumann boundary condition while simulating 1D diffusion equation
$$
\frac{\partial C}{\partial t} = \nabla \cdot (D \nabla C).
$$
The initial value is set ...
1
vote
0answers
45 views
Unsteady diffusion equation with spatial finite elements and Forward Euler in time
I have solved the unsteady diffusion equation using piece-wise linear Finite elements(triangles) for spatial discretisation and Forward Euler for temporal discretisation. I have the following mesh ...
0
votes
0answers
70 views
Comparison of diffusion time - theoretical value vs computed
This is a follow up to my previous post
I've been trying to compare the diffusion time obtained from theoretical
derivation(answered in my previous post) and what is obtained computationally, for a ...
4
votes
1answer
296 views
Computation of diffusion time
While simulating the diffusion of a substance in 1D,
$$
\frac{\partial C}{\partial t} = \nabla \cdot (D \nabla C).
$$
I'd like to compute the diffusion time
In this link, the diffusion time is given ...
1
vote
1answer
125 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 ...
5
votes
2answers
179 views
Is the diffusion equation with Neumann and Dirichlet BCs well-posed?
I am considering the following diffusion equation:
$$\frac{\partial f}{\partial t} = \frac{\partial}{\partial x}[D(x,t)\frac{\partial f}{\partial x}]$$
over a grid ...
2
votes
0answers
67 views
Solving diffusion equation using finite difference method
I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
1
vote
0answers
35 views
Setting up diffusion with integral B.C. in Fenics
I'm trying to model diffusion through a cylindrical domain $D = \{ (x,y,z) : x^2 + y^2 \leq 1, \;\; 0 \leq z \leq 1\}$.
The is an initial concentration of the diffusant at the upper flat surface, ...
1
vote
1answer
81 views
Numerical methods for non-linear diffusion
I have the following non-linear diffusion equation, for $\ z(x,t)$:
$\ z_t = -C(\sin(\omega t))^m x^{hm}(hm x^{-1}(z_x)^n + n z_{xx} (z_x)^{n-1}) $
Any advice for numerical (or analytical) solutions?...
1
vote
1answer
56 views
What is the right way to set up two random tensor fields which have an identical average diffusivity
I want to compare some properties of traveling waves through two randomly diffusive media. The traveling waves follow the fisher equation:
$$\frac{du}{dt} = \nabla(\mathbf{D}_{\gamma} \nabla u) + u(1-...
0
votes
1answer
201 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 ...
0
votes
1answer
84 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 ...
3
votes
0answers
82 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/...
1
vote
1answer
73 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:
...
0
votes
1answer
74 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 ...
0
votes
1answer
2k 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 ...
2
votes
0answers
86 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
vote
1answer
145 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 ...
8
votes
1answer
373 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 ...
0
votes
1answer
26 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
0answers
41 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 ...
0
votes
1answer
42 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
0answers
200 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 ...
4
votes
2answers
279 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 ...
3
votes
0answers
108 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 ...
1
vote
2answers
343 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 ...
2
votes
2answers
514 views
Neumann boundary conditions diffusion equations methods of lines
I want to solve the diffusion equation using the method of lines with Neumann boundary conditions
$$
\frac{\partial p}{\partial t}=\frac{\partial^2p}{\partial x^2}\\
\frac{\partial p}{\partial x}(x=0)=...
-2
votes
1answer
300 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 ...
3
votes
1answer
126 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 ...
2
votes
0answers
120 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 ...
2
votes
2answers
162 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 ...
1
vote
1answer
5k 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. ...
1
vote
3answers
436 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 ...
1
vote
0answers
48 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 ...
3
votes
0answers
202 views
Spurious oscillations in diffusion-reaction problems with finite volume
I have successfully solved the multi-species diffusion-reaction equation
\begin{equation}
\frac{\partial c_i}{\partial t} = \nabla \cdot (d_i(x)\nabla c_i) + s_i(x,t), \quad \quad (1)
\end{equation}
...
1
vote
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 ...
0
votes
1answer
268 views
The system matrix and the right hand side for diffusion equation with staggered grid
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}$...
0
votes
2answers
392 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-...
1
vote
1answer
86 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}{\...
1
vote
0answers
228 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. ...
6
votes
2answers
225 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}...
2
votes
1answer
165 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 ...
1
vote
0answers
315 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 ...
4
votes
2answers
695 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 ...
1
vote
1answer
318 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 ...