CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   outflow boundary contition (

kordou November 25, 2010 09:28

outflow boundary contition
i need some help with an outflow bc. i am writing an 1D code for a flow in a duct. i am using 1D finite volume equations and an crank nikolson method.

at the last node "n" (exit flow node) i need a bc because i do not know the "n+1" node. i found that one proper boundary contrition is the
DT/dt + v*DT/dx =0 (1)
(I am solving only the energy equation).

what i'd like to ask is that in my me equation which is in form
A(n,n-1)Tn-1(t+dt) + A(n,n)Tn(t+dt) + A(n,n+1)Tn+1(t+dt) =
B(n,n-1)Tn-1(t) + B(n,n)Tn(t) + B(n,n+1)Tn+1(t)

i have to terms that i do not know the Tn+1(t+dt) and the Tn+1(t).

to do this i have to solve the (1) two times one implicit and one explicit so to replace the two above terms ?


khahar December 8, 2010 11:04

Y don't U use CFD softwares?

kordou December 8, 2010 12:42

I am using cfd. the purpose of the code that i make is to speedup the cfd calculations

khahar December 9, 2010 15:14

which program U write codes with? I just know some fortran 90.

kordou December 9, 2010 17:49

I am also using fortran 90.

i found that the vdT/Dx = 0 seems to work good. but i don't know if this is the best BC

khahar December 19, 2010 11:13

Sorry. I don't know either.

Hamidzoka December 20, 2010 03:32

Dear Kordou;
it seems you need basic studies in CFD.
All T(t) terms,like Tn(t) or Tn+1(t) or Tn-1(t), are determined either from a previous time step olution or an initial guess.
-if you use an implicit scheme for the term of vdT/Dx , you will have two unknown terms for each point, namely Tn(t+dt) and Tn+1(t+dt). knowing the boundary condition for first and last points, (inlet and outlet) a set of equations will be earned. solution of this set will give you the right answer.
it is unconditionally stable but its solution needs more efforts.since a set of equations wil be solved simultaniously.
-if you use an explicit scheme, there is only one unknown term, namely Tn(t+dt), which is easily found at each point. but it is not unconditionally stable and may diverge for specific values of dt,dx and v.


kordou December 20, 2010 15:52

Dear Hamidzoka

At start thank you for the help :)
Indeed I have the basic knowledge of finite element method.

I have a code that uses the crank-nicolson method (both implicit and explicit) to solve a system of equations (the Energy equation) in the above form (1st post here). The terms in the right of the equation at time (t) are known from either a initial guess of from a previews time step.

My problem for the boundary condition (1) of the first post is not the term vDT/Dx. I calculate this as you suggest it. My problem is the that in one Boundary condition i have 2 terms, one that depends on time (DT/Dt) and the other that depents on space (vDT/Dx). If i apply only the second term as a boundady condition vDT/Dx=0 (as a read this is ok for steady state) which basically gives the same BC as DT/DX=0, my result are very good. But i have a transient code so (as i read) i have to also include the term DT/Dt (whicj is (T(n+1)-T(n))/dt as well.

but i have never worked on a BC both on time and space.

As i said i I do not have much knowledge on cfd theory, so sorry i have said something stupid.

thank you again

Hamidzoka December 21, 2010 02:17

Dear Kordou;
you are not permitted to descritize the energy equation in "n"th (exit flow) node as well as first (inlet flow).disctritization starts from node 2 to n-1.
since there is no n+1 or 0 node in domain!
lets focus on BC:
you have to choices for "n"th (exit flow) BC as the following:
1-temperature: Tn is specified
2-heat flux: Qn is specified
suppose that you 've selected the temperature. therefore Tn is known.
so, let review all temperature nodes at node "n-1":
Tn-2(t+dt) : is known from previous time step or an initial guess
Tn-2(t) : is known from previous time step or an initial guess
Tn-1(t+dt) : is unknown and should be computed
Tn-1(t) : is known from previous time step or an initial guess
Tn(t+dt)=Tn(t) : Tn is BC and assumed to be fixed. therefore it dies not change with time.(in case boundary condition of Tn varies with the time, its function should be known and therefore Tn(t+dt) is calculated using its function).
you will see there is no other unknown term.

does it help?


kordou December 21, 2010 04:25

Dear Hamidzoka

Your answer is quite helpful!

thank you

All times are GMT -4. The time now is 06:04.