Page 1 of 1

Wall stress discontinuous at restart

Posted: Thu May 05, 2016 12:20 pm
by C.FLAG.
Dear users / developpers,

I am running version 4.0.4, LES of a periodic channel flow. I monitor the stress at the wall (output in the listing).

I have set ineedf=1 in the subroutine usipes. I compute the wall stress in cs_f_user_extra_operations, following the examples provided (cs_user_extra_operations-global_efforts.f90).

However, after a restart, the wall stress is discontinuous compared with the previous values. Maybe usipes is not the correct location to set ineedf = 1 ?

Any help would be much appreciated.
Best regards,
Cedric

P.S.: code in cs_user_extra_operations.f90

Code: Select all

! Local variables
integer          ifac
integer          ii
integer          ilelt  , nlelt
double precision xfor(3)
double precision, dimension(:,:), pointer :: bfprp_for
integer, allocatable, dimension(:) :: lstelt

! Initialization

if (ineedf.eq.1) call field_get_val_v(iforbr, bfprp_for)
! Allocate a temporary array for cells or interior/boundary faces selection
allocate(lstelt(nfabor))!max(ncel,nfac,nfabor)))

if (ineedf.eq.1) then

  ! Bottom wall
  do ii = 1, ndim
    xfor(ii) = 0.d0
  enddo
  call getfbr('y<=-0.999', nlelt, lstelt)
  do ilelt = 1, nlelt
    ifac = lstelt(ilelt)
    do ii = 1, ndim
      xfor(ii) = xfor(ii) + bfprp_for(ii, ifac)
    enddo
  enddo
  if (irangp.ge.0) then
    call parrsm(ndim,xfor)
  endif
  if (irangp.eq.0) then
    write(nfecra,*) 'output : friction bot wall = ',xfor
  endif

  ! Top wall
  do ii = 1, ndim
    xfor(ii) = 0.d0
  enddo
  call getfbr('y>=0.999', nlelt, lstelt)
  do ilelt = 1, nlelt
    ifac = lstelt(ilelt)
    do ii = 1, ndim
      xfor(ii) = xfor(ii) + bfprp_for(ii, ifac)
    enddo
  enddo
  if (irangp.ge.0) then
    call parrsm(ndim,xfor)
  endif
  if (irangp.eq.0) then
    write(nfecra,*) 'output : friction top wall = ',xfor
  endif

endif

! Deallocate the temporary array
deallocate(lstelt)

return

Re: Wall stress discontinuous at restart

Posted: Fri May 06, 2016 10:38 pm
by Yvan Fournier
Hello,

usipsu is a better place than usipes to add ineedf = 1, so you should try this first.

If this is not enough (ie. there is no improvement), it would be interesting to see if other fieds (velocity, pressure, turbulence variables) also exhibit a "jump" or not.

In theory, a restart should be "smooth", but if any quantity computed using a variable or preperty at the previous time step is computed before that variable or property is read, or if that term is not available in the restart info, you will have such a jump, so seeing which other variables are affected is a first step towards debugging.

Regards,

Yvan

Re: Wall stress discontinuous at restart

Posted: Wed Jun 22, 2016 7:33 am
by C.FLAG.
Dear Yvan,

My apologies for replying late. Your suggestion works like a charm, the stress is now continuous at restart.

Thank you for your help,
Regards,
Cedric

Re: Wall stress discontinuous at restart

Posted: Wed Jun 22, 2016 8:05 am
by Yvan Fournier
Hello Cedric,

There is also a bug in the z-component of the stress (see other threafs in this forum), so you need to update condli.f90 from the svn (download/viewvc on site site) branch 4.0.

Regards,

Yvan