Mass flow balance issue

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Meskine
Posts: 26
Joined: Thu Jul 19, 2012 1:56 pm

Mass flow balance issue

Post by Meskine »

Hello everybody,

I am working on Code Saturne 2.0.6

I have a mass flow balance issue in a simple case. My mesh is hexahedral and regular. I put an inlet condition for a number of boundary faces on the up left of the domain and an outlet condition for an identical number of boundary faces on the down right of the domain (see associated picture cas.jpg, color what you see is velocity).

The surface inlet and oulet are the same. In the user subroutine usproj, I determine the total inlet and outlet flux by using values of density an velocity of the associated boundary cells (iel= ifabor(ifac) )
See usproj : Flux Integration over ifac of :
flux1=rtp(iel,iu(1))*propce(iel,ipproc(irom(1)))*surfbo(1,ifac)
flux2=rtp(iel,iv(1))*propce(iel,ipproc(irom(1)))*surfbo(2,ifac)
flux3=rtp(iel,iw(1))*propce(iel,ipproc(irom(1)))*surfbo(3,ifac)

It is strange that the total flux obtained for inlet and outlet is different :

from the listing at iteration 5 (line 1491 and 1492) :

usproj - Flux_total = 18.098588275678861 (flux_total is actualy outlet flux)
usproj - Flux_entree1 = 21.228373686915845 (flux_entree1 is actualy inlet flux)

Or in the mass flow semms to be correct at iteration 5 :

** BOUNDARY MASS FLOW INFORMATION
------------------------------

Phase : 1
---------------------------------------------------------------
Boundary type Code Nb faces Mass flow
---------------------------------------------------------------
Inlet 2 420 -0.212000000E+02
Smooth wall 5 43488 0.310910794E-17
Rough wall 6 0 0.000000000E+00
Symmetry 4 0 0.000000000E+00
Free outlet 3 420 0.212000000E+02
Undefined 1 0 0.000000000E+00
---------------------------------------------------------------

Is the integration over associated boundary cells (ifabor(ifac)) correct ? How could you explain these differences ?

Thank you for your help

Regards,

Meskine
Attachments
usproj.f90
(21.97 KiB) Downloaded 190 times
listing.txt
(68.49 KiB) Downloaded 195 times
Fluid is moving from left to right
Fluid is moving from left to right
Brian Angel

Re: Mass flow balance issue

Post by Brian Angel »

Hello,

It would seem that you are using cell values, propce, to calculate the mass flow in and out of your domain. I think that you should use boundary face values, variable propfb if I remember correctly. The use of face values should also result in flux2 and flux3 being zero given that your boundaries appear to be aligned with the YZ plane.

Regards,

Brian Angel.
Post Reply