CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Problem in coding QUICK scheme for convection term

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AshwaniAssam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2014, 21:29
Question Problem in coding QUICK scheme for convection term
  #1
New Member
 
Mehdi
Join Date: Aug 2013
Location: Australia
Posts: 22
Rep Power: 13
mahdi_kh8 is on a distinguished road
Send a message via Yahoo to mahdi_kh8
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] )

mahdi_kh8 is offline   Reply With Quote

Old   February 17, 2014, 04:25
Default
  #2
Senior Member
 
Ashwani
Join Date: Sep 2013
Location: Hyderabad
Posts: 154
Rep Power: 13
AshwaniAssam is on a distinguished road
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.
mahdi_kh8 likes this.
AshwaniAssam is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source term problem in UEqn of simpleFoam fisch OpenFOAM Programming & Development 1 June 17, 2011 11:57
Godunov scheme Peter Main CFD Forum 6 November 27, 2009 11:51
problem about numerical scheme in LES. libin Main CFD Forum 4 July 1, 2004 05:32
Problem Buoyancy Term Andreas Main CFD Forum 1 March 4, 2004 01:35
2nd order boundary condition for QUICK scheme Jafarnia Main CFD Forum 0 February 25, 2004 10:03


All times are GMT -4. The time now is 23:26.