Wall shear stress calculation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
knewlands
Posts: 42
Joined: Mon Mar 26, 2012 10:53 am

Wall shear stress calculation

Post by knewlands » Wed Jun 13, 2012 3:06 pm

Hello,

I have a question regarding the calculation of wall shear stress in code_saturne version 2.0.5.

I have enabled "Domain boundary post-processing" in the gui and I have found from previous posts that the output Efforts are the sum of the pressure forces, viscous stresses and turbulent stresses. Would it therefore be possible to use the Efforts to calculate the wall shear stress and output the value on the boundary mesh in usvpst?

Perhaps there is a standard way to determine the wall shear stress? I would be extremely grateful for any help/suggestions.

Thank you,

Kristin

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

Re: Wall shear stress calculation

Post by Yvan Fournier » Tue Jun 19, 2012 12:32 am

Hello,

I'll let others answer, but you may find some answers perusing the older forums, replicated here, as similar questions have arisen before (though I'm not sure for this exact variant).

This should also soon be simpler, as Martin is working on a boundary condition modeling improvement/cleanup. At that point, we will be able to document things better, to make this kind of postprocessing easier.

Best regards,

Yvan

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

Re: Wall shear stress calculation

Post by Jacques Fontaine » Tue Jun 19, 2012 11:38 am

Hello,

If you are using LES and the van Driest wall damping, the friction velocity is stored in the array uetbor. If not, you should modify clptur.f90 and copy it from Code_Saturne sources to the SRC folder in order to save the friction velocity (create a new user array and make a copy user_array<-uet a the same place that for uetbor<-uet).

Best regards,
JF

knewlands
Posts: 42
Joined: Mon Mar 26, 2012 10:53 am

Re: Wall shear stress calculation

Post by knewlands » Tue Jul 17, 2012 8:21 pm

Hello,

Thank you for the response to my previous question, I have been able to output the friction velocity stored in uetbor as, so far, I have been using LES with the Smagorinsky model, for which the Van Driest wall damping is activated by default.

However, I would like to run a simulation using LES with the Dynamic model and my understanding is that in order to output the friction velocity I have to modify clptur.f90 since the Van Driest wall damping is not active. If I were using the classic Smagorinsky model, the section of code of interest in clptur is:

Code: Select all

! Sauvegarde de la vitesse de frottement et de la viscosite turbulente
! apres amortissement de van Driest pour la LES
! On n'amortit pas mu_t une seconde fois si on l'a deja fait
! (car une cellule peut avoir plusieurs faces de paroi)

    if(itytur(iphas).eq.4.and.idries(iphas).eq.1) then
      uetbor(ifac,iphas) = uet
      if (visvdr(iel,iphas).lt.-900.d0) then
        propce(iel,ipcvst) = propce(iel,ipcvst)                   &
             *(1.d0-exp(-yplus/cdries(iphas)))**2
        visvdr(iel,iphas) = propce(iel,ipcvst)
        visctc = propce(iel,ipcvst)
      endif
    endif
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Now, I'm supposed to
create a new user array and make a copy user_array<-uet a the same place that for uetbor<-uet
Does this mean that I should have something like:

if(iturb(iphas).eq.41.and.idries(iphas).eq.0) then
do ifac=1, nfac
rtuser(nrtuse) = uet
enddo
endif

in place of the code above? I'm guessing that instead of nrtuse being a constant number it should somehow account for the face number, but I'm not sure how to do that and I would greatly appreciate some help.

Please forgive my inexperience,

Kristin

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

Re: Wall shear stress calculation

Post by Jacques Fontaine » Thu Jul 19, 2012 9:21 am

Hello,
something like that (for uet):

Code: Select all

if(iturb(iphas).eq.41.and.idries(iphas).eq.0) then
  rtuser(ifac) = uet
endif
You must allocate rtuser in the gui or in usini1 (you must know before you calculation the number of faces in your mesh, set the size of rtuser to 1.5*nb_faces).

Regards,

knewlands
Posts: 42
Joined: Mon Mar 26, 2012 10:53 am

Re: Wall shear stress calculation

Post by knewlands » Sun Aug 26, 2012 6:23 pm

Hello,

Sorry to come back to this again, but I'm having some problems with the output values for the friction velocity.

I have the following code in usvpst for LES using the Dynamic model, with the modification in clptur to save the friction velocity:

Code: Select all

       ! Friction Velocity
       do ii = 1, 32
          namevr (ii:ii) = ' '
       enddo
       namevr = "U_Fric"
       idimt  = 1
       ivarpr = 0
       do iloc = 1, nfbrps
          ifac = lstfbr(iloc)
          trafbr(iloc) = rtuser(ifac)
       enddo
       ! Output values
       call psteva(ipart, namevr, idimt, ientla, ivarpr,    &
       !==========
                 ntcabs, ttcabs, tracel, trafac, trafbr)
This seems to work.


However, in the LES case using the Smagorinsky model where I haven't interfered with clptur, I have the following in usvpst:

Code: Select all

       ! Friction Velocity
       do ii = 1, 32
          namevr (ii:ii) = ' '
       enddo
       namevr = "U_Fric"
       idimt  = 1
       ivarpr = 0
       do iloc = 1, nfbrps
          ifac = lstfbr(iloc)
          trafbr(iloc) = uetbor(ifac,iphas)
       enddo
       ! Output values
       call psteva(ipart, namevr, idimt, ientla, ivarpr,    &
       !==========
                 ntcabs, ttcabs, tracel, trafac, trafbr)
The output from this is not correct (the values are too small, e.g. 1e-12), whereas the uet printed in the listing is what I would expect (ranges between 0.2e-01 and 0.8e-01). So I think there is a basic mistake in the code above, but I'm not sure what it is. Any ideas?

Kind regards,

Kristin

knewlands
Posts: 42
Joined: Mon Mar 26, 2012 10:53 am

Re: Wall shear stress calculation

Post by knewlands » Thu Aug 30, 2012 10:45 am

I'm sorry, but I don't understand how the above post on cooling towers has anything to do with my friction velocity problem.

[Edit by administrator: post above was a spam, and spammer's account and post deleted. please do not respond to such parasites, and simply send a message to an administrator so that we remove this junk in case we have not noticed it yet].

In fact, I have not yet managed to solve why the friction velocity output by the LES with the Smagorinsky model is incorrect. Would anyone be able to offer some help/advice please?

Kind regards,

Kristin

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

Re: Wall shear stress calculation

Post by Yvan Fournier » Thu Aug 30, 2012 11:21 am

Hello,

uetbor is normally not defined in usvpst. did you add arguments to the function ?

Also, did you check that you set iphas to 1 ?

Finally, and most importantly, if you check for uetbor in clptur.f90, you'll notice that its value is defined only for LES with Van Driest damping. So you should define/use rtuser instead.

Regards,

Yvan

Loïc A.
Posts: 9
Joined: Mon Mar 10, 2014 7:56 pm

Re: Wall shear stress calculation

Post by Loïc A. » Wed Apr 09, 2014 10:53 pm

Hello,

I'm using Code_Saturne 3.0.3. It's been a long time that I'm trying to calculate in simple way the wall shear stress in code_Saturne but without sucess.

I have selected "Efforts, tangential" in "Surface solution control". But I can't find the results in my post-processing files. Can you tell me why?
But when I just select “Efforts”, I have results in my post-processing files: (effort(0) effort(1) effort(2) effort(magnitude).

Thank you in advance for your help.

Best regards,
Loïc A.

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

Re: Wall shear stress calculation

Post by Yvan Fournier » Thu Apr 10, 2014 10:32 am

Hello,

I just checked, and this indeed seems to be a bug (it should work in 3.x). I'll try to fix it for 3.0.4, and in the meantime, send you a temporary fix by tomorrow.

Regards,

Yvan

Post Reply