Solving non-conservative equations

1. Jul 14, 2010

lostidentity

I'm trying to analytically solve a simple diffusion problem (written in non-conservative form) with that of numerical simulation that essentially solves the equations in conservative form.

The transport equation which I'm solving numerically is

$$\frac{\partial\rho{c}}{\partial{t}} + \nabla\cdot\rho\boldsymbol{u}c = \nabla\cdot(D\nabla{c})$$ ---(1)

where c is the scalar variable I'm interested in looking at, D is the diffusivity (a constant), $$\rho$$ is the density and $$\boldsymbol{u}$$ is the velocity vector. Since it's a diffusion problem I set the velocities to zero, i.e. the second (convection) term on the LHS of the above equation becomes zero. So essentially I'm solving the equation

$$\frac{\partial\rho{c}}{\partial{t}} = \nabla\cdot(D\nabla{c})$$

When I solve the above equation analytically assume that density is constant (which is also a constant in my numerical calculations), and then I obtain the following equation

$$\frac{\partial{c}}{\partial{t}} = \frac{D}{\rho}\nabla^2{c}$$ --------------(2)

which is just the diffusion equation. The problem is my solutions are a bit different (i.e. numerical and analytic solutions. This might well be a problem in my discretisation etc. But first of all I just wanted to see if what I'm doing make sense, i.e comparing the numerical results from equation (1) with the analytical result of equation (2). Note that in solving equation (1) in my code even though I set velocities to zero, I still solve the momentum equations.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted