[Nek5000-users] Questions on turbChannel

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Dec 1 21:21:28 CST 2016


Hi Marco,

>From my experience, I got benefitted by remodifying the eddy_visc code, by
having the element loop inside the subroutine as well. i.e. in the
eddy_visc() structure all the calculations of the stresses, etc. done as
follows. The benefit is that with the previous snippet, my code froze,
whenever the number of processors did not divide nelv, i.e. whenever
nelv/np had a non-zero remainder.

The following code gets rid of this short-coming.

 subroutine eddy_visc(ediff,cs)

      include 'SIZE'
      include 'TOTAL'

      integer e
      real zn0,zn01,zn02
      integer ntot
      real cs,kappa,z0
      real ediff(lx1,ly1,lz1,lelv)
      common /dynsmg/ sij (lx1,ly1,lz1,ldim,ldim)
     $              , dg2 (lx1,ly1,lz1,lelv)
     $              , snrm(lx1,ly1,lz1,lelv)

          cstat = 0.16
t
          ntot = nx1*ny1*nz1

          call set_grid_spacing(dg2)
          if(nid.eq.0) write(6,*) 'Calculating eddy visosity',session

          do e=1,nelv
          call comp_gije(sij,vx(1,1,1,e),vy(1,1,1,e),vz(1,1,1,e),e)
          call comp_sije(sij)

          call mag_tensor_e(snrm(1,1,1,e),sij)
          call cmult(snrm(1,1,1,e),2.0,ntot)

           do k = 1,nz1
             do j = 1,ny1
              do i = 1,nx1
              ediff(i,j,k,e) = param(2) +
     &                        (cstat**2)*snrm(i,j,k,e)
              enddo
             enddo
           enddo
          enddo

      return
      end

2. ifsplit flag is the for the formulation, ifsplit = true, --> Pn Pn, and
ifsplit = false, --> PnPn-2, and ifstrs formulation works only for PnPn-2
formulation (atleast in the older versions). if you use PnPn-2 formulation,
ifexplvis = .true. has no effect.

3. set_ds_filt() is the routine required for the second level of filtering
in dynamic Smagorinsky, .i.e. required for calculation of L_ij, M_ij. The
first level of filtering is assumed to be coming from the coarse grid. I
would recommend reading the mathematics of dynamic Smagorinsky model to
better understand the procedure. (See
http://www.scholarpedia.org/article/Turbulence:_Subgrid-Scale_Modeling)

Best Regards,
Tanmoy



On Wed, Nov 30, 2016 at 7:56 AM, <nek5000-users at lists.mcs.anl.gov> wrote:

> Hello,
>
> I have a few questions on the turbChannel example.
>
> 1) the ‘eddy viscosity ‘ is computed in the function eddy_visc and called
> in a loop over the elements of mesh 1. Inside the function eddy_visc there
> is the following piece of code:
>
> *     if (e.eq.nelv) then  ! planar avg and define nu_tau *
> *     …*
> *         ntot = nx1*ny1*nz1*nelv*
> *         do i=1,ntot*
> *            cdyn = 0*
> *            if (den(i,1).gt.0) cdyn = 0.5*num(i,1)/den(i,1)*
> *            cdyn = 0.16*0.16 ! max(cdyn,0.)   ! AS ALTERNATIVE, could
> clip ediff*
> *            ediff(i,1) = param(2)+cdyn*dg2(i,1)*snrm(i,1)*
> *         enddo*
> *      endif*
>
> eddy that stores the eddy viscosity is updated when the last element of
> mesh 1 is called. Is there any reason why it should be done in this manner?
>
> 2) I am still confused over the differences between ‘ifsplit’, ‘ifexplvis’
> and ‘ifstrs’. From the archive and the documentation I understand the
> following (please correct me if I am wrong):
>
>    - ‘ifexplvis’ is set to true when the user specified the viscosity
>    coefficient in uservp. It does not required, however, the stress formation
>    meaning the the diffusive term in the NS equations looks like \mu(x,t)
>    \nabla^2 \vec{u}.
>    - when ‘ifsplit’ is set to true, the viscosity is split in a explicit
>    part and an implicit part. If this correct, how and where are defined the
>    explicit and implicit parts?
>    - ‘ifstrs’: when set to true, ‘ifexplvis’ and ‘if split’ do not have
>    any effect.
>
>
> 3) could someone shed some light on the subroutine ‘set_ds_filt’ in
> turbChannel.usr, please? It seems to compute some sort of filter that is
> then used to compute M_{i,j} and L_{i,j}
>
>
> Thanks,
> Marco
>
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20161201/7a53e4b4/attachment.html>


More information about the Nek5000-users mailing list