# Diffusion without mass conservation?

I'm looking for the physical description of a certain diffusion process, but I don't know how to precisely express it, making the search fruitless. I'd like to have some help formulating, or rather enunciating the problem, whose solution is probably very simple; though, obviously a complete solution is also welcome.

The problem: suppose one starts with a source of some gas, coming out from a hole, which can be approximated by a point, at a constant rate, while its concentration elsewhere starts at zero. How can the concentration at a given point, distinct from the source, be computed after a given amount of time? It can be assumed that this happens within Euclidean 3-dimensional space.

Edit: (10.13.2023) Thanks to everyone who answered, this helped me envisage better where my original concern, which gave rise to this question, fits in the theory. If I understood correctly, all the presented solutions share a common feature: the concentration $$c(t,\vec r)$$, which is zero everywhere, except at the origin, at $$t=0$$, becomes nonzero everywhere instantly after the play button is pressed. Thus, it turns out this doesn't completely solve my original concern, which was: after I open my hermetically closed window, how long does it take for a mosquito flying nearby to realise I'm willing to feed it? (Of course, I'm trying to think about this in an abstract way.)

Assuming this happens after the first molecule of gas arrives at the mosquito nose, is it enough to compute the time when, at a given point in space, the concentration attains a value somehow corresponding to a molecule of gas? Or does it take more complicated considerations about quantum phenomena and randomness?

• You need a diffusion-advection (or just diffusion, it depends on the details of your problem) with a source term (called $R$ in the Wikipedia page en.wikipedia.org/wiki/Convection%E2%80%93diffusion_equation). The source (the "point-like hole" in your case) is a Dirac delta source term. Closely related: physics.stackexchange.com/q/669041/226902 Oct 11, 2023 at 5:42
• @HiddenBabel There is a source, so there is no mass conservation (globally). I mean, the problem is clearly given in the question... Oct 11, 2023 at 7:32
• My fault, I'm using the term wrong. I was thinking of convection-diffusion-reaction equations where mass is created/destroyed inside the domain. Oct 11, 2023 at 7:33
• is the velocity field known? is the the concentration "sufficiently low"? If so, you need a diffusion-advection-reaction equation for the concentration. If needed, I'll add an answer and a 2D implementation Oct 11, 2023 at 7:53
• That should probably be a different question. 1) not even a fly would feel one gas molecule. But 2) air inside your room is mostly the same as outside. You want to frame that question in terms of pressure instead. Oct 15, 2023 at 23:32

I agree with Krichelli and believe that the correct equation for this problem is: $$\frac{\partial}{\partial t} c(t,\vec{r}) = D\Delta c(t,\vec{r}) + a\delta(\vec{r}),\tag{1}$$ where $$\vec{r}$$ is a vector of Cartesian coordinates in three-dimensional Euclidean space, $$D$$ is diffusion constant and $$a$$ is a constant parameter associated with the intensity of gas injection. I just want to add about solving this PDE and discuss some properties of the solution. It is convenient to look for a solution in the form of a Fourier integral: $$c(t,\vec{r}) = \frac1{(2\pi)^3}\int d\vec{k}\ n(t,\vec{k}) e^{i\vec{k}\vec{r}}.\tag{2}$$ Substituting (2) into (1) leads to the following ODE for $$n(t,\vec{k})$$: $$\frac{\partial}{\partial t}n(t,\vec{k}) = -D\vec{k}^2 n(t,\vec{k}) + a.\tag{3}$$ If at $$t=0$$ there was no gas in space, then the initial conditions $$c(t,\vec{r}) = 0$$ and $$n(t,\vec{k}) = 0$$. In this case, the solution to equation (3) is $$n(t,\vec{k}) = \frac{a}{D\vec{k}^2}\left(1 - e^{-D\vec{k}^2t}\right).\tag{4}$$ and, therefore, the solution to the equation (1) is $$c(t,\vec{r}) = \frac1{(2\pi)^3}\int d\vec{k}\ \frac{a}{D\vec{k}^2}\left(1 - e^{-D\vec{k}^2t}\right) e^{i\vec{k}\vec{r}}.\tag{5}$$ Function (5) has properties worth mentioning. Firstly, it has a self-similar form $$c(t,\vec{r}) = \frac1{\sqrt{t}}f\left(\frac{\vec{r}}{\sqrt{t}}\right),$$ which is a general property of diffusion problems in which the spatial scale is not specified. Secondly, according to this solution, the amount of gas in space increases in direct proportion to time: $$\int d\vec{r}\ c(t,\vec{r}) = at.$$

• You can use \tag{x} to get equation numbers without using qquad (or, worse, a series of quad). Oct 11, 2023 at 11:06
• Can you explain how you get from (5) to the self-similar form below it? Oct 11, 2023 at 20:28
• @WaterMolecule Technically, you only need to eliminate t from the first exponential function. So it is enough to change the integration variable $\vec{\xi} = \sqrt{t}\ \vec{k}$ in the integral on the right side of equality (5) to see that this expression has a self-similar form.
– Gec
Oct 12, 2023 at 7:51

You can go with the comment by Quillo. Just to elaborate on that, in the equation you find in Wikipedia, in your problem you have isotropic diffusion (i.e. $$D$$ is a constant) and no convection ($$v=0$$), plus: the source term concentrated at the coordinate origin would be a Dirac-delta term $$R(x) = a \delta(x)$$ with $$a=$$const.

I.e. you need to solve the equation $$\partial_t c = D \Delta c + a \delta$$ for the concentration function $$c$$, which at $$t=0$$ is zero, and with $$a=$$const, $$D=$$const.

For approaching the solution of this equation, if you need an introduction, I'd recommend the book "Partial Differential Equations: An Introduction" by Walter A. Straus, a good introduction to PDEs and he tackles this particular equation (albeit in one dimension only) in chapter 3.3.

You need to solve the diffusion equation $$\partial_t n - D \nabla^2n=0$$ in flat semi-infinite space. Let's limit it to the case where all the gas goes into this half of the space. Therefore, we do not need to place the source term on the right side of the above equation.

The gas entry point can be used as the coordinates center. Due to symmetry, we rewrite the equation in spherical coordinates: $$\partial_t n - D \frac{1}{r^2}\frac{\partial}{\partial r}\big(r^2 \frac{\partial}{\partial r}\big)n=0$$ Now let us search for a solution of the form $$n\sim e^{- i \omega t + i k_r r}$$. Substituting this into the last equation, we get $$\omega = - i D k_r^2 -\frac{2D k_r}{r}$$ this gives $$n(t,r)\sim\int \frac{d^3 k}{(2\pi)^3} e^{-D k_r^2 t} e^{i k_r\big(r+\frac{2 D}{r}t\big)}= \frac{2\pi \times 1}{(2\pi)^3}\sqrt{\frac{\pi}{D t}}e^{-\frac {1}{4 \,D \,t }\big(r+ \frac{2D}{r}t\big)^2}$$

I hope it helps.

Gas leaking out of a pinhole is called effusion, if that helps.

As for the actual diffusion problem, you need to know at least the diffusion constant, $$D$$, for your gas. Since this is a physics problem, the details of your setup are important, but here's a basic equation assuming there's no turbulence and the speed of the gas flow out of the point is small compared to the distance of the point you're measuring.

You could model the concentration, $$C(x,y,z,t)$$, over time as

$$\frac{\partial C}{\partial t} = D\,\nabla^2C$$

on the domain: $$0\leq x<\infty; -\infty < y < \infty; -\infty < z < \infty$$.

If you specify that a constant mass flux, $$\phi$$, is entering the domain, then you have a Neumann boundary condition. So you have the initial condition and boundary condition:

\begin{aligned} C(x,y,z,0) &= 0\\[1em] D\frac{\partial C}{\partial x}(0,y,z,t)&= \delta(y)\delta(z)\,\phi \end{aligned}

Where $$\delta(y)\delta(z)$$ are Dirac deltas specifying a point source at $$(x=)\ y=z=0$$. Then the solution is adapted from pg. 207 of [1]. Given a point and time, $$t$$, then the concentration there is:

$$C(x,y,z,t) = \frac{\phi}{4}\int_0^t \left[\frac{1}{(\pi D\,\tau)^{3/2}}\; \exp\left(-\frac{x^2+y^2+z^2}{4D\,\tau}\right)\right]\,d\tau$$

This is only solved numerically.

[1] Polyanin's Handbook of Linear Partial Differential Equations for Engineers and Scientists. 1st ed.

• I did one check that I got the mass conservation correct: for $\phi=D=t=1$, which implies 1 unit of mass enters per 1 unit of time, I got $4$ when integrating over a large box around the source. Combined with the $1/4$ out in front, this means 1 unit of mass entered as expected. Oct 11, 2023 at 7:24
• The boundary condition you applied differentiates between (y,z) and x, but, in the end result, all three of them appear on the same foot! Is there something wrong with my understanding? Oct 11, 2023 at 7:52
• @Navid This appears because the problem is radially symmetric, as you pointed out. The original form was $\exp(-(x^2+(y-\eta)^2+(z-\zeta)^2)/4Dt)$ with integrals over $\eta$ and $\zeta$, but the point-like source kills those terms. Oct 11, 2023 at 7:59