# Boundary conditions for the heat equation when solving a mass density gradient

I'm working with a mass density gradient with length $L$ and I'm trying to solve the heat equation in 1-D (mass diffusion equation, $\partial_t\rho(t,x)=D\Delta\rho(t,x)$), but I'm not sure which boundary conditions should I use and what would they physically mean.

The starting mass density profile ($\rho(0,x)=f(x)$) is a step-function, where the lower half has density $\rho_1$ and the upper half has $\rho_2$.

$f(x)=\begin{array}{ll} \rho_1 & 0<x<L/2 \\ \rho_2 & L/2<x<L \\ \end{array}$

Considering the boundary conditions, I find more difficult to interpret them. The mass inside the sample's volume is kept constant during the experiment as the sample is isolated from surroundings.

For this purpose, would Neumann Boundary Conditions be appropriate?

$$\partial_x \rho(t,0)=0=\partial_x \rho(t,L)$$

I'm unsure because all the examples I found do not treat the heat equation/diffusion equation as function of mass density ($\rho$). Would Neumann BC suggest No Mass Transfer between the sample's volume and the surroundings?

• You should give more detail on your equations. The heat equation will not govern the evolution of the density. What is $h$ ?
– Joce
Apr 15 '14 at 8:58
• The heat equation is second order in space, your equation seems to be first order. Choosing BC largely depends on what it is you are modeling. Apr 15 '14 at 11:16

From a physics point of view, you have some kind of mass-diffusion problem. It is true that a mathematician will name it "heat equation" because the classical problem with the operator $\partial_t - \Delta$ is the heat equation.

Homogeneous Neumann BC is indeed appropriate to model a "no flux" condition at the boundaries, be it a flux of heat or of mass. A Dirichlet BC here would mean that your domain is in contact with a large (infinite) reservoir of fixed density there.

• Thank you very much. That was exactly what I was looking for. When formulating the mass-diffusion equation, normally it is used the concentration c but I'm using the density. Doing this I'm considering that density and concentration are linearly proportional. Is this a problem in reality? Apr 16 '14 at 8:37
• "Only" in terms of physical meaning.
– Joce
Apr 16 '14 at 8:38
• Is it physically valid at any approximation? Or should I start worrying about chemical potentials and non-linear relations between concentration and density? Apr 16 '14 at 8:42
• It all depends on the problem you want to solve! But maybe what you meant is that you consider not proportionality, but affine relation: $\rho = \rho_0 + \lambda c$. This makes sense in may cases, and your DE is unchanged.
– Joce
Apr 16 '14 at 8:48
• Thanks for the discussion. I have in mind calculating the diffusion of the sucrose concentration in water (although I can just measure the physical density). It is not a saturated solution, therefore I was thinking using an affine relation, although I'm not sure about it. Apr 16 '14 at 8:57