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 in coding QUICK scheme for convection term (https://www.cfd-online.com/Forums/main/129832-problem-coding-quick-scheme-convection-term.html)

mahdi_kh8 February 13, 2014 20:29

Problem in coding QUICK scheme for convection term
 
Hi everybody,
I am a beginner in CFD and writing my own code in C#. The problem I faced is in defining QUICK scheme for convection term.
I am not sure about it. The following note is my approach to code this scheme.
Is this correct ?

Quote:


If U[i,j,0]>0 & U[i-1,j,0]>0


du2/dx = 1/dx [U2e - U2w] =

Ue = ( -1/8 U[i - 1, j, 0] + 6/8 U[i, j, 0] + 3/8 U[i + 1, j, 0] )
Uw = (-1/8 U[i - 2, j, 0] + 6/8 U[i-1, j, 0] + 3/8 U[i, j, 0] )

duv/dy = 1/dy [(uv)n-(uv)s] =

Un = (- 1/8 U[i , j-1, 0] + 6/8 U[i, j, 0] + 3/8 U[i , j+1, 0] )
Vn = (-1/8 V[i-1 , j, 0] + 6/8 V[i, j, 0] + 3/8 V[i+1 , j, 0] )
Us = (-1/8 U[i , j-2, 0] + 6/8 U[i, j-1, 0] + 3/8 U[i , j, 0] )
Vs = (- 1/8 V[i-1 , j-1, 0] + 6/8 V[i, j-1, 0] + 3/8 V[i+1 , j-1, 0] )


If U[i,j,0]<0 & U[i-1,j,0]<0
du2/dx = 1/dx [U2e - U2w] =

Ue = ( -1/8 U[i + 2, j, 0] + 6/8 U[i+1, j, 0] + 3/8 U[i, j, 0] )
Uw = (- 1/8U[i + 1, j, 0] + 6/8 U[i, j, 0] + 3/8 U[i-1, j, 0] )

duv/dy = 1/dy [(uv)n-(uv)s] =

Un = (-1/8 U[i , j+2, 0] + 6/8 U[i, j+1, 0] + 3/8 U[i , j, 0] )
Vn = (- 1/8V[i+2 , j, 0] + 6/8 V[i+1, j, 0] + 3/8 V[i , j, 0] )
Us = (-1/8 U[i , j+1, 0] + 6/8 U[i, j, 0] + 3/8 U[i , j-1, 0] )
Vs = (- 1/8 V[i+2 , j-1, 0] + 6/8 V[i+1, j-1, 0] + 3/8 V[i , j-1, 0] )

and for y direction:

Quote:

If V[i,j,0]>0 & V[i,j-1,0]>0
dv2/dy = 1/dy [V2n - U2s] =

Ve = ( -1/8 V[i , j-1, 0] + 6/8 V[i, j, 0] + 3/8 V[i, j+1, 0] )
Vw = (-1/8 V[i , j-2, 0] + 6/8 V[i, j-1, 0] + 3/8 V[i, j, 0] )

duv/dx = 1/dx [(uv)e-(uv)w] =

Ue = (-1/8 U[i , j-1, 0] + 6/8 U[i, j, 0] + 3/8 U[i , j+1, 0] )
Ve = (- 1/8V[i-1 , j, 0] + 6/8 V[i, j, 0] + 3/8 V[i+1 , j, 0] )
Uw = (-1/8 U[i , j-2, 0] + 6/8 U[i, j-1, 0] + 3/8 U[i , j, 0] )
Vw = (- 1/8 V[i-1 , j-1, 0] + 6/8 V[i, j-1, 0] + 3/8 V[i+1 , j-1, 0] )


If V[i,j,0]<0 & V[i,j-1,0]<0
dv2/dy = 1/dy [V2n - U2s] =

Ve = ( -1/8 V[i , j+2, 0] + 6/8 V[i, j+1, 0] + 3/8 V[i, j, 0] )
Vw = (- 1/8V[i , j+1, 0] + 6/8 V[i, j, 0] + 3/8 V[i, j-1, 0] )

duv/dx = 1/dx [(uv)e-(uv)w] =

Ue = (- 1/8 U[i , j+2, 0] + 6/8 U[i, j+1, 0] + 3/8 U[i , j, 0] )
Ve = (- 1/8V[i+2 , j, 0] + 6/8 V[i+1, j, 0] + 3/8 V[i , j, 0] )
Uw = (-1/8 U[i , j+1, 0] + 6/8 U[i, j, 0] + 3/8 U[i , j-1, 0] )
Vw = (- 1/8 V[i+2 , j-1, 0] + 6/8 V[i+1, j-1, 0] + 3/8 V[i , j-1, 0] )



AshwaniAssam February 17, 2014 03:25

Hi,
We should check wheter flux = V * Area of face to determine the direction. We can calculate the flux at the face by taking average of the velocity ( for uniform cells) on either side of a face multiplie by its area.
And also for each face we would have to check for the flux direction.

regards.


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