CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Mass error in finite difference codes (

Kalyan August 25, 2000 16:47

Mass error in finite difference codes
Can anyone give me an estimate (percentage) of the overall mass conservation error in finite-difference codes when using a non-conservative formulation. I need the error estimates for research codes and commercial codes (if they use finite-differences).

Thank you.

John C. Chien August 25, 2000 22:51

Re: Mass error in finite difference codes
(1). This is the first time some one ask such question. (2). If there is such thing as the overall mass conservation error, then you also have overall momentum, energy,..conservation error. (3). How do you estimate such errors in a code? A code is just a group of libraries, functions. (4). I guess, if the mesh independent solution does not conserve mass, momentum, and energy, then the solution is not the solution. (5). But if you are talking about the coarse mesh solution, then we usually use the overall mass, momentum and energy balances to judge the quality of the solution, whether it is acceptable or not. (if not, then we need to refine the mesh.) (6). If mesh refinement can not systematically reduce the errors, then there is something wrong. (meaning that the equations being solved is not consistent with the original partial differential eqautions)

frederic felten August 26, 2000 18:40

Re: Mass error in finite difference codes
Hi there,

Take a look at these following publications: [1]: Y. Morinishi, T.S. Lund, O.V. Vasilyev and P. Moin

"Fully conservative higher order finite difference

schemes for incompressible flow".

Journal of Comput. Phys., vol 125, p 187, 1996.

[2]: O. Vasilyev

"Higher order Difference Schemes on Non-uniform

meshes with good conservation properties."

Journal of Comput. Phys.,vol 157, p 746-761, 2000.

An analysis of the conservative properties is made regarding which numerical scheme you wanna use (collocated or staggered...) A scheme is normally design to be both mass an momentum conservative. Without these features, it is most likely that the code would be unstable Now when it comes to the energy conservation, it is usually a function of the mesh spacing and the time step (dt^n) where n can be 1,2, or 3 depend of the grid arrangement you chose. Check ref.[1]. The non-uniformity of the mesh can also become a factor for the conservative properties.Check ref.[2]


Frederic Felten

John C. Chien August 27, 2000 23:48

Re: Mass error in finite difference codes
(1). Thank you very much for the information. (2). I'll have to get the library to get me a copy first. (3). It just come to my mind that, if one is using 2-D stream function-vorticity formulation with finite-difference, is there still a mass conservation issue? No one seemed to have studied this in old days.

Kalyan August 28, 2000 12:24

Re: Mass error in finite difference codes
Grid refinement should indeed reduce the conservation errors systematically. Except in cases where the momentum and/or energy conservation are built into the construction of the scheme (like in Vasilyev, Morinishi et al.), the conservation energy never go to zero however fine the grid may be.

Though the development of conservation schemes is significant, it would be hard to extend them to variable density or compressible flows. In variable density, incompressible flows, density and temperature are related and hence only one is obtained using a conservation law (other is obtained from it algebraically). Hence, it is not possible to have conservation scheme for variable density flows. Unlike in incompressible flows (as in the paper by Vasilyev et al.), the energy equation in compressible flow can not obtained using the momentum equation. So the conservation analysis has to be performed separately for compressible solvers along the lines proposed by Vasilyev et al.

My question was actually about what is considered acceptable. If you had a steady state constant density flow, mass flux at the inflow should equal the mass outflux at the flow. In a numerical code, how different can they be. You can always compute the error as a percentage of the total mass flux (ro*u*area). This non-dimensional error is obviously a function of grid resolution. For a second order scheme, is it OK to assume that the percentage error is proportional to the square ratio of grid spacing to the characteristic domain length (non-dimensional grid spacing) ?

%error ~ (dx/L)^2

dx/L = 1/N , where N is the number of grid points along each direction. If the percentage error is less than 1/(N*N), is that an acceptable solution.

Thank You.

John C. Chien August 28, 2000 15:04

Re: Mass error in finite difference codes
(1). I would deal with each calculation separately. (2). In some cases, the mass conservation ,between the inlet and the outlet, is very important. But in most cases, you are looking for the trend or non-dimensionalized parameters. (3). In engineering applications, sometimes a couple of percent difference is acceptable, because you are not interested in the mass flow difference. (4). For reacting flows, this may not be the case. (5). I would say that in non-reacting flows, the mass conservation is normally not an issue. (that is, in most cases, the flow parameters of interest are not a function of the mass flow difference. ) So, whether the results are acceptable or not depends on the actual case being computed. This is especially the case, when you have a long duct and need to maintain the mass flow accuracy. It will be more difficult to maintain the accuracy for a long duct.( a problem dependent)

Bill August 29, 2000 16:50

Re: Mass error in finite difference codes
I am modeling one reacting flow. 3 species are involved. The general mass balance deviationa for three species are about 50% respectively. It seems the deviation is related to the magnitute of mass diffusion coefficient. I wonder if the result is acceptable or is it possible to reach a prefect mass balance result?Thanks!

John C. Chien August 29, 2000 17:41

Re: Mass error in finite difference codes
(1). I am not sure about the nature of your problem, so it is hard to say how it's going to affect your results and conclusion. (2). Yes, the conclusion. If 50% mass balance problem is going to change your conclusion of the calculation, then it is not acceptable. Otherwise, it is not going to be a problem, as long as you are comfortable with the results.

Abhijit Tilak August 30, 2000 05:16

Re: Mass error in finite difference codes
First of all what vector norm are u using to calculate the residue of p' equation ? for staggered grids the source of mass for developing flow between two parallel plates is order of 1e-9 for indivudial cells. the overall source in this problem i solved comes to 1e-8. If u use L2 norm to calculate the error it will be order of 1e-5. obivously truncation and roundoff will have an effect on the error, although difficult to say in what way and how much. regards abhijit

All times are GMT -4. The time now is 03:24.