Page 1 of 1

Incorrect value for convective outlet boundary condition coefficients in condli.f90

Posted: Sun Aug 30, 2020 11:53 am
by Mohammad
Hello,

As it is mentioned in the theory PDF file of Code_Saturne 6.0.4, for the convective outlet boundary condition we have:
A = (1/(1+CFL))Y
B = (CFL/(1+CFL))
I checked these values by discretizing the equation and they are 100% correct.

As I noticed the A corresponds to coefa and B corresponds to coefb in the condli.f90 file.
But in that file for the set_convective_outlet_vector subroutine, the value of B is:

Code: Select all

coefb(isou,jsou) = cflv(isou)*(1.d0+cflv(isou))
Which means:
B = (CFL*(1+CFL))
Now you can see that the "*" must be replaced by "/" in the code which leads to:

Code: Select all

coefb(isou,jsou) = cflv(isou)/(1.d0+cflv(isou))
This mistake has also been taken place in the set_convective_outlet_tensor and set_convective_outlet_vector_aniso subroutines.

========================================
Also the input values for this type of B.C was confusing for me and some users, so I checked the code and found out that for this type of B.C we have:
rcodcl(ifac,ivar,1) = The value of ivar at previous time step
rcodcl(ifac,ivar,2) = CFL number based on the celerity value.

Hope that this will be helpful and will be corrected in the next versions.

Regards,
Mohammad

Re: Incorrect value for convective outlet boundary condition coefficients in condli.f90

Posted: Mon Aug 31, 2020 2:42 pm
by Yvan Fournier
Hello,

Thanks for the feedback. Some colleagues who know this part of the code better than I do should be looking into this, so it should be fixed soon.

Best regards,

Yvan

Re: Incorrect value for convective outlet boundary condition coefficients in condli.f90

Posted: Sun Sep 06, 2020 10:00 pm
by Erwan Le Coupanec
Hello,

Many thanks for the bug report. It is now fixed on master, 6.2, 6.1, 6.0 and 5.0 branches.

Best regards,
Erwan