[Nek5000-users] problem with applying boundary conditions

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Sep 14 11:29:10 CDT 2017


Dear Neks,

I am trying to run a simulation, replicating the Nek5000 run from this
youtube video:
https://www.youtube.com/watch?v=RmmN-KFSvAY

The inlet BC is constant velocity (which is set to 1.0), and as can be seen
from the video, the velocity magnitude reasonably away from the inlet is
zero at starting times. However, in all of my simulations, I see the
velocity magnitude as one at all the interior points away from the inlet
from the beginning (the inlet BC ux=1.0 I am applying is somehow propagated
to all interior elements). Am I doing something wrong somewhere, or is this
the expected behavior? Please see my userbc() and useric() from my .usr
file below:

      subroutine userbc (ix,iy,iz,iside,eg)
      include 'SIZE'
      include 'TOTAL'
      include 'NEKUSE'
      integer ix,iy,iz,eg,e,i,n

CC "My inlet is at x=0"

      if (x.le.1e-4) then
        ux=1.0
      endif

      return
      end

      subroutine useric (ix,iy,iz,eg)
      include 'SIZE'
      include 'TOTAL'
      include 'NEKUSE'

      ux=0
      uy=0

      return
      end

I believe userbc() is executed for only 'v' in my case. For the other
constraints on the elements (like 'W', 'O', 'E'),  I think userbc() would
not run (please correct me if I am wrong, I am learning here). Since the
above functions wouldn't work as expected, I changed userchk() and removed
the above if statements in userbc(). My userchk() is as follows:

      subroutine userchk
      include 'SIZE'
      include 'TOTAL'
      integer i,n

      n = nx1*ny1*nz1*nelv

      if (istep.eq.0) then
        do i=1,n
          if (xm1(i,1,1,1).le.1e-4) then
            vx(i,1,1,1)=1
          endif
        enddo
      endif

      return
      end

This didn't work either. Can somebody point me in the right direction?

Thanks,
Ajay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20170914/bb155242/attachment-0001.html>


More information about the Nek5000-users mailing list