CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Solving non-conservative equations (https://www.cfd-online.com/Forums/main/78154-solving-non-conservative-equations.html)

lost.identity July 14, 2010 06:15

Solving non-conservative equations
 
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.


All times are GMT -4. The time now is 01:02.