Register Blogs Members List Search Today's Posts Mark Forums Read

November 26, 2012, 03:29
#1
Member

Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 13
Hi All.
My supervisor told me to write the advection-diffusion equation in discrete form. I have found it carried out in Suhas Patankars Book 'Numerical heat transfer and fluid flow', and I have attached the pages here.
But I can't figure out how he integrated over the control volume and found equation (5.50). Can one of you guys show me how the terms Je, Jw, Jn and Js looks?

Thanks

Thomas
Attached Images
 Capture.jpg (52.9 KB, 32 views) Capture1.PNG (9.3 KB, 7 views)

 November 26, 2012, 05:40 #2 Senior Member   Join Date: Dec 2011 Location: Madrid, Spain Posts: 134 Rep Power: 15 Hi, performing the integration of the flux terms over the control volume you get: . You just have to evaluate the flux terms at the boundaries of your control volume. So pick up expressions 5.49 (a) and (b) and evaluate them at the west. east, north and south boundaries of your cell. Does it help? Cheers.

 November 26, 2012, 06:46 #3 Member   Thomas Hoffmann Join Date: Oct 2012 Posts: 67 Rep Power: 13 This far I understand, but I would like to write it out in more details. Would you say the following evaluation is correct? Thanks

 November 26, 2012, 07:21 #4 Senior Member   Join Date: Dec 2011 Location: Madrid, Spain Posts: 134 Rep Power: 15 Hi, regarding the convective terms they are correctly formulated. For a staggered grid you have velocity directly available at the cell faces so you already know Ue and Uw. For the value of phi at the cell faces you'll have to use a discretization scheme. For instance if you use and upwind approximation phi_e will be the value of phi at the cell located left to the control cell (for positive Ue) and the value of phi at the control cell (for negative value of Ue, so flow going to the left). The diffusive terms you wrote are wrong. You have to calculate the gradient at the cell (for example by using a centered scheme based on finite differences). The way you wrote it suggests that diffusive transport is proportional to the value of phi, whereas you know the diffusive flux is proportional to the gradient at that location, right? Also you can choose to discretize both convective and diffusive terms at once, making use of an analytical expression, by using the exponential, power law or hybrid schemes (remember this is only strictly valid for 1D problems without source terms). Anyway, all this is thoroughly described in Patankar's so you just have to look it up. Cheers.

 November 26, 2012, 07:45 #5 Senior Member     Chris DeGroot Join Date: Nov 2011 Location: Canada Posts: 414 Rep Power: 17 Yes your gradient term is not right. Lets assume you interpolate correctly for and you are using a non staggered grid. Then Where e refers to the east integration point P refers to the cell centre and E refers to the neighbour to the east. Hope that helps.

 November 26, 2012, 08:22 #6 Member   Thomas Hoffmann Join Date: Oct 2012 Posts: 67 Rep Power: 13 Thanks guys.

March 28, 2013, 07:36
#8
Senior Member

Chris DeGroot
Join Date: Nov 2011
Posts: 414
Rep Power: 17
Quote:
Well, the error is pretty clear. You are trying to use a real number (37.95) as an index to an array. My guess is that either iu or iv contains real numbers somewhere. What is the purpose of iu and iv? How do you define them?

 March 28, 2013, 07:58 #9 Senior Member   andy Join Date: May 2009 Posts: 276 Rep Power: 18 Not sure if this thread is still alive but in response to the OP it is conventional to subtract phi_p * Continuity from the RHS in order for the coefficients to be in a more convenient form. Continuity of course should be zero. (Apologies if it says this in attached figure but it is too small for me to read.)