1

Here is the system: $\rho_t+(\rho v)_x=0$ and $v=f*\rho$(convolution).

$\rho(x,t)$ is the density function and $f(x)$ is a function of $x$. The domain for $x$ is $[0,\infty]$. What I'm doing is to find the numerical solution for $\rho$ by a given initial $\rho(x,0)$.

In addition, I also want see the mass is conserved. For this purpose, I set $v=0$ at boundary which $v(0,t)=0$ and $v(N,t)=0$. Theoretically, the mass should be conserved if I'm correct.

But my simulation shows the mass loss. I use a simple upwind discretization since I couldn't find a good method which is second order accuracy for finite difference method.

the scheme is $\rho_j^{n+1}=-((\rho v)_{j+1}^n-(\rho v)_j^n)*\lambda+\rho_j^n$. Here $\lambda=\frac{\tau}{\sigma}$

Does anyone know why the mass is not conserved or know other better scheme?

Thank you very much

Zzz
  • 11

1 Answers1

0

To my knowledge, the only way to have mass conservation with an advection equation is by setting toric boundary conditions. This can be done with finite difference, and if you also set Neumann BC on your diffusion, you will observe mass conservation.