0
$\begingroup$

I am having a problem understanding when I should use the conservation form of equation of continuity and the non-conservation form of the continuity equation. I understand how to derive the two forms. Also, I understand that in the non conservation form, the control volume is assumed to be moving, while in the conservation form, the control volume is fixed.

$$\frac{\mathrm{d}\rho}{\mathrm{d}t}+\rho(\nabla\cdot\mathbf{u})=0\qquad\text{(non-conservation form)}\\\frac{\partial\rho}{\partial t}+\nabla\cdot(\rho\mathbf{u})=0\qquad\text{(conservation form)}$$

My confusion is on the applications of the two forms, how do we distinguish which form to use depending on the situation. For example, in this post Conservation Vs Non-conservation Forms of conservation Equations was mentioned if you have shocks, or chemical reactions, or any other sharp interfaces, then we would want to use the conservative form. But I am still confused on why sharp interfaces would intel to use conservative form.

$\endgroup$
4
  • $\begingroup$ Hi August -- Welcome! I wrote up an answer on a very similar (maybe duplicate) question here: physics.stackexchange.com/q/70496 Take a look at that and let me know if your question is a duplicate of that one and whether or not it answers your question. If you still have questions after reading through that other post, revise this post to make those points clear and I might be able to take a stab at answering it. $\endgroup$
    – tpg2114
    Commented May 11, 2021 at 18:52
  • $\begingroup$ It appears you might be more interested in when to use the Lagrangian form (D/Dt) vs. the Eulerian form ($\partial/\partial t$), which is a distinct issue from the conservative/non-conservative question... Is that the case? $\endgroup$
    – tpg2114
    Commented May 11, 2021 at 18:57
  • $\begingroup$ Thank you for your answer, I took a look at your explanation, it was very useful and informative. I edited my post accordingly. You mentioned if you have shocks, or chemical reactions, or any other sharp interfaces, then we would want to use the conservative form. But I am still confused on why sharp interfaces would intel to use conservative form. $\endgroup$
    – August
    Commented May 11, 2021 at 19:58
  • $\begingroup$ Hello! I have edited your question using MathJax (LaTeX) math typesetting. For future questions, you can refer to MathJax basic tutorial and quick reference. Thanks! $\endgroup$
    – jng224
    Commented May 11, 2021 at 20:05

1 Answer 1

0
$\begingroup$

To understand why a conservative form is preferred when numerically solving problems with sharp gradients, let's recall a few facts:

  1. Derivatives across discontinuities do not exist for analytical derivatives, and generate very strong oscillations for discrete derivatives;
  2. In all flows, including shocks and flames and so on, the only thing that is guaranteed to be conserved is mass, total energy, and momentum.

So with those reminders, let's look at the convective term of the mass equation written two ways.

Conservative form: $\partial (\rho u_j) / \partial x_j$

Non-conservative form: $\rho \partial u_j / \partial x_j + u_j \partial \rho / \partial x_j $

We know that momentum, $(\rho u_j)$, is the same on both sides of the shock wave due to conservation of mass: $(\rho u)_1 = (\rho u)_2$ (if you aren't convinced of that, do the control volume analysis). If it is the same on both sides of the shock, then its derivative is identically zero -- which of course, exists and is smooth. So analytically and numerically, $\partial (\rho u_j) / \partial x_j$ is nicely behaved.

But, we know that density jumps discontinuously across a shock, and so does velocity. This means $\partial u_j / \partial x_j$ and $\partial \rho / \partial x_j$ are trying to take derivatives of a discontinuous function! That does not exist analytically, and will blow up your simulation with discrete derivatives!

Flames will have a similar property, as will other reacting problems with interfaces in them.

Of course, all of this is based on practical resolutions of things. In reality, shocks are not discontinuous -- viscosity makes it continuous at extremely small length scales. So if you were to put enough grid points to resolve the viscous effects within the shock (or, if you put enough cells within a flame front such that it is smooth), then you don't need to worry quite so much about conservation or non-conservation forms of the equations beyond the concerns I noted in my answer to the other question you linked to. However, for all practical simulations of things other than inner-structure of shocks and flames, that's far too expensive and so using the non-conservation form will create derivatives across discontinuous variables and blow things up.


It's worth a bit of an addendum here... If you know your problem will have sharp gradients and you can choose which form to solve, it's always a good idea to pick the conservation form. But even with the conservation form, some terms will still be discontinuous -- derivatives of pressure in the momentum equation, for example. And maybe you don't have a choice and you're stuck with non-conservative form because you have a legacy code or something else.

In these cases, if you do nothing, your numerical derivatives across those discontinuous variables will blow up your simulation. Bad Things (TM) will happen.

So, you have to do something. And the way to generally do something is to add enough of something to regularize the problem again. You need to add enough of something to make the variables continuous, or add enough of something to make sure you don't take the derivatives across the discontinuity.

There are a few ways to do this. I won't list them all. But the most common regularization approach is to add damping through artificial viscosity. You add enough fake viscosity to the problem so the derivative becomes smooth enough to calculate. As you can imagine, that has some other effects that might not be desirable... but, you get a solution! Nothing blew up!

The other general category is to avoid the discontinuity. This can be done by detecting the discontinuity in the variable and changing how you calculate the derivative. For example, you could refuse to include points in your stencil that cross the discontinuity. So on one side of a shock, you'd only use points in one direction, and on the other side, you'd only use points in the opposite direction. That's the simplest example, much more sophisticated ways exist.

This all gets into monotonicity preservation, limiters, sensors, switches, oh my! All kinds of numerical hacks to allow you to take a derivative of a discontinuous function that you shouldn't really be taking a derivative of. All of them change your solution away from the real, physical solution.

So -- when you can, pick conservation form because then you only need to numerically-hack your problem for a few terms instead of all of them. The fewer places you can add non-physical things, the better the end result will be!

$\endgroup$
1
  • $\begingroup$ Thank you so much for your thorough explanation, it helped clear up the confusion. Trying to understand the physical meaning of these equations with the examples you provided are helpful! $\endgroup$
    – August
    Commented May 12, 2021 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.