CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problem with Harmonic Interpolation (https://www.cfd-online.com/Forums/main/124987-problem-harmonic-interpolation.html)

suhas jain October 16, 2013 22:52

Problem with Harmonic Interpolation
 
Hi everyone!!

I am solving 3d navier stokes equations, in which I am using first order upwind scheme for interpolation of convective terms. But to interpolate the non-linear part of convective term I am using Harmonic Interpolation. This method of interpolation is not converging the solution. It is converging only when I used arithmetic interpolation to non-linear terms..


So what might be the reason?


http://upload.wikimedia.org/math/4/8...f09ee668b2.png


Thanks in advance..

sbaffini October 17, 2013 03:57

It's probably me, but:

- what do you mean by non-linear part of the convective term? Is there a linear one too?

- first order upwind is already an interpolation (first order, upwind). Why you need an additional interpolation?

suhas jain October 18, 2013 07:41

Hi,

When we discretize navier stokes equation, we have two velocity terms in convective term. One of which goes to coefficients and other is considered as unknown. The value of velocity term which goes to coefficients is taken from the previous iteration. This term is what I am referring as non-linear velocity term. This non-linear velocity term is again in terms of facial value. Hence to find its value from previous iteration, it has to be interpolated to cell center values. This interpolation is what I am referring to, and not the interpolation of unknown velocity terms for which I have used first order upwind.


Rho * u * v = If this is the convective term, u represents non-linear velocity term who's value is taken from previous iteration and v represents unknown velocity term which is to be found from present iteration.


Thanks..

sbaffini October 18, 2013 09:15

Hi suhas,

now it is clear. However, consider the following:

- usually it is not just the velocity which is used from the previous iteration, but the overall mass flux rho * u_n, with u_n the component of the velocity normal to a face (as i understand you are talking about the finite volume method)

- according to the specific formulation (compressible/incompressible) you might or might not need a specific interpolation. For example, this flux always has to satisfy the continuity constraint. In some cases, this would require the use of a pressure term too in the interpolation, according to the specific pressure-velocity coupling method.

- in any case, i don't know of any approach using the harmonic interpolation for such term

- finally, you don't usually interpolate from faces to cell centers but quite the opposite. Indeed, in FV methods every cell centered variable is updated only in terms of facial fluxes. Of course, i'm talking about the standard FV method. I don't know if there is some specific approach that doesn't need that.

suhas jain October 18, 2013 15:35

1 Attachment(s)
Hi Paolo,

Thank you for the reply.

But I still have a doubt. Lets say, this is the FV discretized, V momentum equation on staggered Cartesian grid.

https://www.dropbox.com/s/1rbaj260a9hz5pq/Untitled.png
" A_n*V_n = A_nE*V_nE + A_nW*V_nW + A_nn*V_nn + A_s*V_s + A_nT*V_nT + A_nB*V_nB + (P_P - P_N)*dx*dz + constant. "



If P, N, E, W, T, B, S are pressure cell centers. V velocities are solved at n, nn, nE, nW, nT, nB, s because V velocity is staggered along y coordinate.


Here let's take one of the coefficients "A_nn" as an example from equation , where


" A_nn = D_N + [[ -F_N , 0 ]]. " (This term appears due to upwind scheme )


Here "D_N" is diffusion coefficient at N and "F_N" is convective flux at N.

and

" F_N = rho*V_N*dx*dz. "

Here the value of V velocity at N is from previous iteration. But value of V at N is not known directly as it is staggered to nn position. Hence "V_N" has to be interpolated from values at "n" and "nn" which are the staggered cell centers of V velocities. So the interpolation used here is what I was actually referring to.


Thanks.

sbaffini October 18, 2013 16:28

Dear Suhas,

my bad, i should have understood that you were talking about a staggered approach. I used it for FD only and never for the FV (as it is very cumbersome indeed). Hence, i know nothing about the interpolation for the convective flux. Now i understand the reason for the harmonic interpolation.
The only thing i can think of is, does your code work for a uniform grid?

suhas jain October 18, 2013 16:59

Hi Paolo,


My code works fine when I use arithmetic Interpolation everywhere as I mentioned above. But crashes when I use harmonic Interpolation. But H.I was supposed to improve results according to Patankar.

I have tried only staggered grid.. What do you mean by uniform grid ? Is it colloquial one? If it is this, then I have not tried colloquial grid which requires Rhie Chow interpolation..

sbaffini October 19, 2013 06:01

I meant a grid with uniform spacing in all the directions.

However, could you explain how is harmonic interpolation performed for the following two cases (let's take figure 6.8 on page 122 of Patankar's book as a reference):

- V_N for the V equation

- U_ne for the V equation

suhas jain October 19, 2013 08:57

The code is not working for both uniform and non uniform grids with H.I.


We know the values of V_n, V_nn, U_e, U_Ne (Staggered Cell centers) from previous iteration.

So,
harmonic Interpolation
V_N = 2 * (V_n * V_nn)/(V_n + V_nn).
U_ne = 2 * (U_e * U_Ne)/(U_e + U_Ne).

Arithmetic interpolation
V_N = (V_n + V_nn)/2.
U_ne = (U_e + U_Ne)/2.

sbaffini October 19, 2013 09:29

I have to admit that this is the first time i see this kind of interpolation (Harmonic). I don't know if it is specific for staggered FV methods, but it looks weird to me. Do you have a reference for this? Which page in the Patankar book?

It is common for diffusion coefficients (in colocated arrangement, at least) but i've never seen it for the velocity (or mass flux).

suhas jain October 19, 2013 12:47

I got it now..actually I was wrong.

In patankar, Harmonic Interpolation is explained only for diffusion coefficients and I think it mostly applies only to that. I had assumed that it works for velocity also. So was stuck in above problem.

Now I understand that applying Harmonic interpolation to velocity is actually absurd.


All times are GMT -4. The time now is 04:35.