# 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$ ? Apr 15, 2014 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, 2014 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.
• 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. Apr 16, 2014 at 8:48