Discretization of advectiondiffusion equation
2 Attachment(s)
Hi All.
My supervisor told me to write the advectiondiffusion 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 

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. 

Thanks guys. :)

Advection term
Hi all,
I wrote code in Matlab but my advection term doesn't work. I used FDM method, could u please help me. It is said "Attempted to access q(37.95); index must be a positive integer or logical." Probably, it is a parenthesis mistake, but i can't figure out, I am stuck here. Could u please send me the original advection term for FDM? In the class, we used adv as d(uu)/dx+d(uv)/dy in the xdir and d(vu)/dx+d(vv)/dy in ydir. Please help!!!!!! ad(iu(i,j))=((0.5.*(q(iu(i+1,j))+q(iu(i,j))))^2(0.5.*(q(iu(i,j))+q(iu(i1,j))))^2)/dx ... +(0.25.*(q(iu(i,j+1))+q(iu(i,j))).*(q(iv(i,j+1)) + q(iv(i1,j+1))) ... 0.25.*(q(iu(i,j)+q(iu(i,j1))).*(q(iv(i,j))+q(iv(i1,j)))))/dy; 
Quote:

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.)

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