CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Implementation of BC's in FV code (https://www.cfd-online.com/Forums/main/15007-implementation-bcs-fv-code.html)

alex March 31, 2008 18:38

Implementation of BC's in FV code
 
Hi there,

Im not sure how to implement boundary conditions in a finite volume method.

This is what I have so far:

Discretized transport equation (pure convection) is of the form

ap*phi_P -aw*phi_W -ae*phi_E = S

and aP=aE+aW

I'm using upwind for face values ( and U is positive) so aE=0 On a boundary, I set the coefficient of the boundary face to zero and add the flux to the source term. So on the west boundary, aW is set to zero and the source term is nonzero. However, this will make aP=(aW+aE)=0 so the TDMA solver will not converge.

Any help greatly appreciated

Thanks!

Ananda Himansu March 31, 2008 20:00

Re: Implementation of BC's in FV code
 
At the west boundary, calculate aW (non-zero) by the usual method (from the prescribed flux, likely). Set aP=(aW+aE) = aW+0 = aW. Next, set aW to zero (without changing aP), and add the prescribed flux to the source term S (making the latter non-zero). Solve using the TDMA. Allow to cool, stir, and enjoy.


All times are GMT -4. The time now is 09:39.