CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   why are finite difference not necessarily conserva (https://www.cfd-online.com/Forums/main/14570-why-finite-difference-not-necessarily-conserva.html)

 philipp December 31, 2007 12:48

why are finite difference not necessarily conserva

Hi,

can anybody help me mathematically? I am searching a proof why finite difference methods are not necessarily conservative but finite volume methods are. This is for me the main advantage of FV-schemes....

Thanks a lot

 pc December 31, 2007 13:34

Re: why are finite difference not necessarily cons

In a finite volume scheme, the governing equations are posed as integral equations. Thus conservation is enforced for each cell in the mesh.

In a finite difference scheme, the governing equations are cast as differential equations, and the mathematical statement is only satisfied in the limit of grid spacing going to zero.

 philipp January 1, 2008 01:22

Re: why are finite difference not necessarily cons

but the finite volume scheme works with averaged values - so, it is not necessarily more accurate than a fd-scheme.

could you post a mathematical example, please.I think this will help me to understand the difference...

 sudhakar January 1, 2008 03:06

Re: why are finite difference not necessarily cons

dear philip,

what exactly do you mean by 'finite volume scheme works with averaged values?'

 Praveen. C January 1, 2008 07:52

Re: why are finite difference not necessarily cons

Some finite difference methods can also be re-written as a finite volume method. See Godlweski and Raviart, "Hyperbolic systems of conservation laws" for a mathematical condition which makes a scheme "finite volume".

 philipp January 1, 2008 11:39

Re: why are finite difference not necessarily cons

the value in a cell does mot necessarily satisfies the differential equation. the value is an average in the control volume.

so, what is the difference between fd and fv if you look on the steady mass-equation:

d(rho*c)/dx = 0

or

int(rho*c)*dA

((rho*c)_E - (rho*c)_W)/Dx = 0

* The Index E represents the value in the EAST-node....

or FV-scheme:

(rho*c)_e - (rho*c)_w = 0

** The index e = is the averaged value on the east-side of the control volume....

But why is the FDS not necessarily conservative and what exactly does that

 philipp January 1, 2008 13:38

I frgot to say

So, for the finite volume scheme I could say that

(rho*c)_e = 0.5*((rho*c)_E + (rho*c)_P))*dA (1.1) and (rho*c)_w = 0.5*((rho*c)_W + (rho*c)_P))*dA (1.2)

If you put this into the finite volume formulation, it leads to the same results as for finite differences. -->

((rho*c)_E -(rho*c)_W)*dA = 0 (1.3)

So, where are the mathematical differences. Why is the fv-formulation conservative?

P.S.: if you divide equation (1.3) with the contol-volume dV, it leads to:

((rho*c)_E -(rho*c)_W)*dA/dV = ((rho*c)_E -(rho*c)_W)/dx = 0 (1.4)

That's why FV-schemes look like FD on "structured grids"!!!

 pc January 2, 2008 09:29

Re: why are finite difference not necessarily cons

I think you misunderstand my point. Plus, conservation and accuracy are in this discussion separate issues.

A FV scheme is written in integral form. Thus for every single cell, the sum of the fluxes across the cell faces equals the time rate of change for the cell state. Always. In this manner, the mathematical statement of conservation is strictly enforced, irrespective of cell size or averaging.

Yes, accuracy depends on cell size and extrapolation from the cell center to the faces to evaluate higher order fluxes, but that is a separate matter.

In a FD scheme, the mathematical statement of conservation is weakly enforced, and only holds in the limit of grid spacing going to zero.

 philipp January 2, 2008 10:55

Re: why are finite difference not necessarily cons

"A FV scheme is written in integral form. Thus for every single cell, the sum of the fluxes across the cell faces equals the time rate of change for the cell state. Always. In this manner, the mathematical statement of conservation is strictly enforced, irrespective of cell size or averaging."

>> Ok, I think to understand what you mean.

"In a FD scheme, the mathematical statement of conservation is weakly enforced, and only holds in the limit of grid spacing going to zero."

>> So, can you imagine a concrete problem where FD-formulation would lead to a problem (=oscillation or divergence) where FV scheme still produces a senseful result??? It would help me a lot to see that with a concrete mathematical problem....

 pc January 2, 2008 12:41

Re: why are finite difference not necessarily cons

Sorry, I can't think of a specific example off the top of my head.

 Joe January 2, 2008 15:38

Re: why are finite difference not necessarily cons

It is not really a matter of oscillation or divergence, those are typically stability issues.

For an internal flow, just think of flow through a pipe. The old finite difference based codes had trouble making the massflow at the end of the pipe equal the massflow at the beginning of the pipe. The conservation of mass was only weakly enforced. If you threw enough grid at it you could reduce the mass error. The more modern FV codes have a much easier time conserving mass.

 philipp January 3, 2008 10:13

Re: why are finite difference not necessarily cons

Hi Joe,

do you have any paper which describes this problem/case more in details? I want to understand why FD had problems with the correct massflow. Not only phenomenologically!

 philipp January 3, 2008 10:31

Re: why are finite difference not necessarily cons

Let's have a look at d(rho*c)/dx = 0 (finite differences) and int (rho*c)*dA (finite volumes) - (structured grids).

FV: -------------------- (rho*c*A)_2 - (rho*c*A)_1 = 0 lim (A_2/A_1 -> 1) --> (rho*c)_2*(A_2/A_1) = (rho*c)_1

FD: -------------------- ((rho*c)_(i+1) - (rho*c)_(i-1))/Dx = 0

+ So, first of all we can conclude that FD have no "natural" algorithm to proove conservation - in contrast to FV.

The case which was announced by Joe means that with FD (rho*c)_(i+1) is different than (rho*c)_(i-1) - when we use a big Dx; like three nodes....But in this case (rho*c)_(i-1) is kind of a boundary condition. So we know that exact solution and with an explicit scheme we can directly compute the next value (rho*c)_(i+1). Where is the source for the error? Why does it only happen with the FD-formulation??????

 ag January 3, 2008 17:41

Re: why are finite difference not necessarily cons

If the area is changing, why do you not include that in the finite difference approximation as well? What you are looking for is termed the "telescoping" property of finite difference schemes, and the classic text by P. Roache contains a good description. A finite difference scheme can be just as conservative as a finite volume scheme, but requires attention to the construction of the terms. Marcel Vinokur wrote a good treatise on this a number of years ago - unfortunately the title of the paper escapes me at the moment. Try googling for Vinokur. As noted by Praveen, it is possible to construct a conservative scheme using finite differences within finite volume framework.

 philipp January 4, 2008 04:12

Re: why are finite difference not necessarily cons

Hi,

1) If you remember the name of the paper from Marcel Vinokur I would be glad, if you could post it to the forum. I found a lot googling for him....

2) Looking for the paper of Vinokur I found this: http://www.springerlink.com/content/...2/fulltext.pdf Looking on the first page gives you the 3d-Euler equation in a conservative divergence formulation.

d(q)/dt + de/dx + df/dy + dg/dx = 0 (1)

In the next line the author transforms the pde into a curvilinear coordinate systems

d(Q)/dt + dE/d(xi) + dF/d(eta) + dG/d(zeta) = 0 (2)

And now he is talking of a finite volume formulation although equation (2) has only differentials but now integrals. That confuses me ..... where is the integration?

In the book of Joel H. Ferziger - computational methods for fluid dynamics - the author integrates every equation when is talking about finite volume schemes.

example:

int(d(rho*c*c)/dx)dx*dy = (rho*c*c)_e*dy - (rho*c*c)_w*dy

 ag January 4, 2008 10:03

Re: why are finite difference not necessarily cons

Marcel Vinokur, "An Analysis of Finite-Difference and Finite-Volume Formulations of Conservation Laws", Journal of Computational Physics 81, pp. 1-52 (1989).

The integral form is not required to generate your eq. 2. The PDE is differenced in a finite-volume sense by writing the flux derivative (e.g. dE/d(xi)) as a difference of fluxes at the differential cell faces, E(i+1/2) - E(i-1/2). This is a finite difference formulation that possesses a flux telescoping property as long as certain rules are followed in constructing the face fluxes. Thus, it can represent a conservative finite difference formulation.

 philipp January 10, 2008 12:45

Re: why are finite difference not necessarily cons

So, could you give me an argument why the two formulations are equivalent?

It confuses me a little because I thought that discontinous problems must be handled by the integral formulation. Since there is no divergence term....

 ag January 10, 2008 13:45

Re: why are finite difference not necessarily cons

In general discontinuous problems do need to be handled using the integral (weak) formulations. Fortunately, by applying certain entropy conditions we can also handle discontinuous flow fields using the differential form of the equations - the entropy conditions ensure that we get the correct weak solution. I suggest that you grab a copy of Leveque's "Numerical Methods for Conservation Laws".

The differential equations can be written in a divergence form that allows us to generate the correct solution by discretizing the equations using finite difference approximations. I'm not sure what you mean by "no divergence term". The ability to cast the equations into a divergence form is what allows us to move from an integral form to a differential form.

 All times are GMT -4. The time now is 06:34.