Y+ post-treatment

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Pauline Delteil

Y+ post-treatment

Post by Pauline Delteil »

Hello,
I study a flow inside a pipe and I need to calculate the average of the y+ at the wall, so I wrote the next program :
!==============================================================================
! Post-traitement du y+
!==============================================================================
!
!================Post-traitement du y+ en entree===============================
!
! localisation du groupe representant l'entree du tube
! nom : "ENTREE"
CALL GETFBR('ENTREE',NLELT,LSTELT)
!=========
DO ILELT = 1, NLELT
IFAC = LSTELT(ILELT)
IEL = IFABOR(IFAC)
YPLUS_E = YPLUS_E + RA(IYPLBR+IEL-1)
ENDDO
!
! si calcul parallele
IF(IRANGP >= 0) THEN
CALL PARSOM(YPLUS_E)
ENDIF
!
!
IF(IRANGP >= 0) THEN
CALL PARCPT(NLELT)
ENDIF
!
NLELT_E = NLELT
!
!
!================Post-traitement du y+ en sortie===============================
!
! localisation du groupe representant la sortie du tube
! nom : "SORTIE"
CALL GETFBR('SORTIE',NLELT,LSTELT)
!=========
DO ILELT = 1, NLELT
IFAC = LSTELT(ILELT)
IEL = IFABOR(IFAC)
YPLUS_S = YPLUS_S + RA(IYPLBR+IEL-1)
ENDDO
!
!
! si calcul parallele
IF(IRANGP >= 0) THEN
CALL PARSOM(YPLUS_S)
ENDIF
!
!
IF(IRANGP >= 0) THEN
CALL PARCPT(NLELT)
ENDIF
!
NLELT_S = NLELT
!
!
!================Post-traitement du y+ au milieu===============================
!
! localisation du groupe representant le milieu du tube
! nom : "EXT"
CALL GETFBR('EXT',NLELT,LSTELT)
!=========
DO ILELT = 1, NLELT
IFAC = LSTELT(ILELT)
IEL = IFACEL(2,IFAC)
YPLUS_M = YPLUS_M + RA(IYPLBR+IEL-1)
ENDDO
!
!
! si calcul parallele
IF(IRANGP >= 0) THEN
CALL PARSOM(YPLUS_M)
ENDIF
!
!
IF(IRANGP >= 0) THEN
CALL PARCPT(NLELT)
ENDIF
!
NLELT_M = NLELT
!
!
!===========Calcul de la moyenne de y+ sur le domaine=======================
!
!
YPLUS_MOY = (YPLUS_E + YPLUS_S + YPLUS_M)/(NLELT_E + NLELT_S + NLELT_M)
I noticed two surprising things:
1) I use this code on two different configurations, a straight pipe and a curving pipe. In comparison with paraview, I obtain good results for the curving pipe but not for the straight pipe. So does someone know if I have some mistakes in my code.
2) I observe when we see just "YPLUS = RA(IYPLBR+IEL-1)", we obtain some negative and zero values, I don't understand why, have you an idea about the origin of my problem? Furthermore, I would like to know how the y+ is really calculated.
 
Many thanks,

Best regards,

Pauline
Yvan Fournier

Re: Y+ post-treatment

Post by Yvan Fournier »

Hello,

I think the issue in your code is for example:

Code: Select all

CALL GETFBR('ENTREE',NLELT,LSTELT)
!=========

DO ILELT = 1, NLELT
  IFAC = LSTELT(ILELT)
  IEL = IFABOR(IFAC)
  YPLUS_E = YPLUS_E + RA(IYPLBR+IEL-1)
ENDDO
Where RA(IYPLBR) is defined on boundary faces, not on cells, so

Code: Select all

CALL GETFBR('ENTREE',NLELT,LSTELT)
!=========

DO IELT= 1, NLELT
  IFAC = LSTELT(ILELT)
  YPLUS_E = YPLUS_E + RA(IYPLBR+IFAC-1)
ENDDO
would seem better (otherwise, you are not adressing the correct memory locations).

You should change the code in all similar cases.

Best regards,

  Yvan
Pauline Delteil

Re: Y+ post-treatment

Post by Pauline Delteil »

Hello Yvan,
thank you for your answer, it's much better like this.
Best regards, Pauline
Post Reply