yplus output

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
knewlands

yplus output

Post by knewlands »

Hello,

I'm using Code_Saturne version 2.0.5 and I have a question regarding the output of yplus.

I'm running LES and I selected "Domain Boundary post-processing" under output control in the GUI, so I have output yplus in binary format and I can open it in ParaView. I have also changed usvpst to output the coordinates, the calculated moments and the instantaneous velocities in text format so that I can use Matlab to manipulate the data. The problem I have now is that I need the yplus data for my analysis in Matlab and I only have it in binary format. So my question is: how can I also output yplus in text format bearing in mind I already have a user array to output the friction velocity? Or would it be more convenient to extract the data in a .csv file from ParaView that I can then open in Matlab? My problem with this possibility is that I'm not sure of the order of the output data and how to organise it so that it is arranged according to the text files output by Code_Saturne.

I hope my request for help makes sense and I look forward to receiving some advice.

Kindest regards,

Kristin
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: yplus output

Post by Yvan Fournier »

Hello,

You can force the EnSight output to text format (either using the GUI, in usini1.f90, or with an additonal output in usdpst.f90/usvpst.f90), but values are sorted by element type in that case.

Otherwise, outputting it in usproj.f90 is a solution, though in that case, you have to handle parallel aspects yourself.

You might also be able to do some initial postprocessing under EnSight or ParaView, so as to output the data in something managable by MatLab, but that depends on what you want to do

Cheers,

Yvan
knewlands

Re: yplus output

Post by knewlands »

Hello,

Thank you for your reply Yvan, I have managed to output yplus in text format by rearranging the writers in usdpst and setting the default writer in the GUI to Ensight text. I now have another related question: whilst the LES simulation using the Smagorinsky model outputs yplus for both hexa8 and quad4 elements, the LES simulation with the classic Dynamic model only outputs values for quad4 elements. I notice that this was also the case in binary format and ParaView tells me that yplus is partial in the Dynamic model case.

The only difference in the setup between the two simulations is that I added the modified clptur.f90 subroutine to the SRC folder for the Dynamic model so that I could output the friction velocity. I'm probably missing something very obvious, but why does the yplus output file for the dynamic case not provide information on the volume cells?

Thank you,

Kristin
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: yplus output

Post by Jacques Fontaine »

Hello,

y+ on whole domain is only computed (and post-processed) when the van-Driest wall damping (idries = 1) is activated.
van-Driest wall damping is only activated by default when iturb = 40 (LES Smag) and is not for LES Dyn.
Regards,
JF
knewlands

Re: yplus output

Post by knewlands »

Thank you for your reply Jacques, at least now I understand the reason for the different output.
Jacques Fontaine wrote: y+ on whole domain is only computed (and post-processed) when the van-Driest wall damping (idries = 1) is activated.

As it is not computed, is there an additional code I could perhaps add to usproj.f90 or is it not possible to output y+ for the whole domain when using the Dynamic model? If it is possible, are there any example codes?

Kind regards,

Kristin
Jacques Fontaine
Posts: 118
Joined: Mon Feb 20, 2012 2:07 pm

Re: yplus output

Post by Jacques Fontaine »

It's not possible in usproj.f90 (or in other user subroutine).

You must modify the code source : clptur.f90 and tridim.f90.

y+ on whole domain is computed in the subroutine distyp.f90 called in tridim when iturb = 4x and idries = 1. To calculate y+ distyp needs the array uetbor. uetbor is filled in clptur only when iturb = 4x and idries = 1.

I think if you modify this both tests, it will be ok.
Regards,
JF
knewlands

Re: yplus output

Post by knewlands »

Thank you for your advice Jacques and apologies for asking once more, but I'm still not able to output the value of yplus for the volume cells.

I had already edited the clptur code to save the friction velocity, so instead of

Code: Select all

uetbor(ifac,iphas) = uet
I have

Code: Select all

rtuser(ifac) = uet

Therefore, in distyp.f90 I changed

Code: Select all

coefax(ifac) = uetbor(ifac,iphas)*propce(iel,ipcrom)/propce(iel,ipcvis)
to

Code: Select all

coefax(ifac) = rtuser(ifac)*propce(iel,ipcrom)/propce(iel,ipcvis)
In tridim.f90, before the calls to memdyp and distyp are made I have:

Code: Select all

    if( (itytur(iphas).eq.4.and.idries(iphas).eq.1)                 &
         .or. (iilagr.ge.1 .and. iroule.eq.2)                       &
         .or. (iturb(iphas).eq.41.and.idries(iphas).eq.0) )  then
 
      !       On calcule si on a demande ce mode de calcul
      !               et s'il y a des parois (si pas de paroi, pas de y+)
      if(abs(icdpar).eq.1.and.infpar.gt.0) then

        iismph = iisymp+nfabor*(iphas-1)
following this and before the call to vandri is made I have again:

Code: Select all

    if( (itytur(iphas).eq.4 .and. idries(iphas).eq.1)                   &
          .or. (iturb(iphas).eq.41.and.idries(iphas).eq.0) )  then
However, I'm missing something somewhere or I've made a mistake, as I still only obtain output for the quad4 cells.

Would you be able to tell me where I went wrong please?

Kindest regards,

Kristin
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: yplus output

Post by Yvan Fournier »

Hello,

For the output to occur, you probably also need either to modify a similar test on itytur and idries in dvvpst.f90 (or add the output in usvpst.f90)

Best regards,

Yvan
knewlands

Re: yplus output

Post by knewlands »

Hello Yvan,

Thank you for your reply. Following your suggestions, in addition to the changes I mentioned in clptur, distyp and tridim, I also altered the test in dvvpst.f90 to the following:

Code: Select all

  if (ineedy.eq.1 .and. abs(icdpar).eq.1) then

    ineeyp = 0
    do iphas = 1, nphas
      if( (itytur(iphas).eq.4.and.idries(iphas).eq.1)             & 
         .or. (iturb(iphas).eq.41.and.idries(iphas).eq.0) )  then
        ineeyp = 1
      endif
    enddo

    if (ineeyp.eq.1) then

      NAMEVR = 'Yplus'
      idimt = 1
      ientla = 0
      ivarpr = 1

      call psteva(nummai, namevr, idimt, ientla, ivarpr,          &
      !==========
                  ntcabs, ttcabs, ra(iyppar), rbid, rbid)

    endif

  endif
However, I still only obtain values for the quad4 cells in the chr.ensight folder. So I also tried the following code in usvpst to output the values of yplus on the volume

Code: Select all

    namevr = 'yplus_vol'
    idimt = 1
    ivarpr = 0

    do iloc = 1, ncelps
       iel = lstcel(iloc)
       tracel(iloc) = ra(iyppar+iel-1)
    enddo

    call psteva(ipart, namevr, idimt, ientla, ivarpr,  &
                  ntcabs, ttcabs, tracel, trafac, trafbr)
and on the boundary

Code: Select all

       do ii = 1, 32
          namevr (ii:ii) = ' '
       enddo
       namevr = "yplus_sur"
       idimt  = 1
       ivarpr = 0
       do iloc = 1, nfbrps
          ifac = lstfbr(iloc)
          trafbr(iloc) = ra(iyplbr+ifac-1)
       enddo
       ! Output values
       call psteva(ipart, namevr, idimt, ientla, ivarpr,    &
       !==========
                 ntcabs, ttcabs, tracel, trafac, trafbr)
I now obtain an output for yplus on both the volume and the boundary cells, but I would like to confirm that the above code is correct before I invest days for the actual simulation. On this subject, I would also like to ask a rather basic question about restarts: if I have a total number of time steps of 50000 for example, is there a way to interrupt the calculation before the end and then restart from that point? In other words, if I choose to post-process every 'n' time steps and interrupt a calculation before the end, is there a way to restart from the last saved data? So far I have only been able to restart once the previous calculation had completed the total number of time steps, so I've had to break the calculation down into 'intervals' and then restart each time until I reached the desired total number of time steps.I did this to avoid losing large amounts of computation times if something went wrong before the end of the simulation, but perhaps I'm missing something obvious and I would be very grateful for a clarification.

Thanks again,

Kristin
JamesMcNaughton
Posts: 72
Joined: Mon Mar 19, 2012 1:21 pm

Re: yplus output

Post by JamesMcNaughton »

Hi,

to interupt a calculation make a file called ficstp in the tmp_Saturne/CASE.12345678 folder.

Leave first line of ficstp blank then on the second line enter the new time-step number to stop at, if you enter a value less than the value already reached it will stop at the next time-step.

This ends the calculation normally and you can restart as usual.

Hope that helps,

James
Post Reply