[Nek5000-users] Full restart during a simulation

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Jun 24 08:18:52 CDT 2013


Hi Neks,

I manage to solve part of the issue. Now I'm copyng all the variables (vx,
vxlag, pr ,prlag, abx1,abx2) at a certain step (let's say istep=10). At
istep=20 I replace the variables with the old ones and I call the routines
setup_convect to save the new convective velocities. For a simulation with
no moving boundaries the procedure works fine.

I tried  to use the same method also for a simulation where I have a moving
boundary (forcing the regenation of the jacobians with call geom_reset(1)),
but I have correct results  only if I set torder=1. Any hints?

Andrea


subroutine userchk
      include 'SIZE'
      include 'TOTAL'
      include 'RESTART'

      parameter (lt=lx1*ly1*lz1*lelv)
      common /scrns/ vort(lt,3), w1(lt), w2(lt)
      common /body/ ycyl,ycylold,vcyl,vcylold,vcylk,vrif


      real x0(3)
      save x0
      data x0 /3*0/
      real scale
      integer iostept
      integer maxsotiter
      common /indici/ indcyl(lx1,ly1,lz1,lelv)
      common /contatori/ icont,istepold,timeold
      integer icont, istepold,n,npre,firstit
      common /olddati/ vxo(lx1,ly1,lz1,lelv),vyo(lx1,ly1,lz1,lelv),
     $     vzo(lx1,ly1,lz1,lelv),xm1o(lx1,ly1,lz1,lelv),
     $     ym1o(lx1,ly1,lz1,lelv),zm1o(lx1,ly1,lz1,lelv),
     $     vxlago(lx1,ly1,lz1,lelv,2),vylago(lx1,ly1,lz1,lelv,2),
     $     vzlago(lx1,ly1,lz1,lelv,2)
     $     , ABX1o   (LX1,LY1,LZ1,LELV)
     $     , ABY1o   (LX1,LY1,LZ1,LELV)
     $     , ABZ1o   (LX1,LY1,LZ1,LELV)
     $     , ABX2o   (LX1,LY1,LZ1,LELV)
     $     , ABY2o   (LX1,LY1,LZ1,LELV)
     $     , ABZ2o   (LX1,LY1,LZ1,LELV)
     $     , PRLAGo  (LX2,LY2,LZ2,LELV,LORDER2),pro(lx2,ly2,lz2,lelv)
     $     ,   wxo(lx1m,ly1m,lz1m,lelt),wyo(lx1m,ly1m,lz1m,lelt),
     $     wzo(lx1m,ly1m,lz1m,lelt)
     $     ,   WXLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WYLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WZLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   W1MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W2MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W3MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   WMULTo (LX1M,LY1M,LZ1M,LELT)
      real alpha
      real tollit
      real errvc
      integer npcyl

      if (istep.eq.0) then
         call findcyl(indcyl)
      endif
      scale=1.
      call evalYcyl
      write(6,*) "ycyl=",ycyl
      n=lx1*ly1*lz1*lelv
      npre=lx2*ly2*lz2*lelv
      if (istep.eq.10) then
         call copy_step
      endif
      if(istep.eq.20) then
         call load_step
      endif

      call torque_calc(scale,x0,.true.,.false.)

      return
      end

c
-------------------------------------------------------------------------
      subroutine copy_step

      include 'SIZE'
      include 'TOTAL'
      include 'RESTART'

      common /indici/ indcyl(lx1,ly1,lz1,lelv)
      common /contatori/ icont,istepold,timeold,firstit
      integer icont, istepold,n,npre,firstit
      common /olddati/ vxo(lx1,ly1,lz1,lelv),vyo(lx1,ly1,lz1,lelv),
     $     vzo(lx1,ly1,lz1,lelv),xm1o(lx1,ly1,lz1,lelv),
     $     ym1o(lx1,ly1,lz1,lelv),zm1o(lx1,ly1,lz1,lelv),
     $     vxlago(lx1,ly1,lz1,lelv,2),vylago(lx1,ly1,lz1,lelv,2),
     $     vzlago(lx1,ly1,lz1,lelv,2)
     $     , ABX1o   (LX1,LY1,LZ1,LELV)
     $     , ABY1o   (LX1,LY1,LZ1,LELV)
     $     , ABZ1o   (LX1,LY1,LZ1,LELV)
     $     , ABX2o   (LX1,LY1,LZ1,LELV)
     $     , ABY2o   (LX1,LY1,LZ1,LELV)
     $     , ABZ2o   (LX1,LY1,LZ1,LELV)
     $     , PRLAGo  (LX2,LY2,LZ2,LELV,LORDER2),pro(lx2,ly2,lz2,lelv)
     $     ,   wxo(lx1m,ly1m,lz1m,lelt),wyo(lx1m,ly1m,lz1m,lelt),
     $     wzo(lx1m,ly1m,lz1m,lelt)
     $     ,   WXLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WYLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WZLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   W1MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W2MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W3MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   WMULTo (LX1M,LY1M,LZ1M,LELT), fyold

      n=lx1*ly1*lz1*lelv
      npre=lx2*ly2*lz2*lelv
      call opcopy(vxo,vyo,vzo,vx,vy,vz)
      call opcopy(wxo,wyo,wzo,wx,wy,wz)
      do i=1,lorder-1
         call opcopy(vxlago(1,1,1,1,i),vylago(1,1,1,1,i),
     $        vzlago(1,1,1,1,i),vxlag(1,1,1,1,i),vylag(1,1,1,1,i),
     $        vzlag(1,1,1,1,i))
         call opcopy(wxlago(1,1,1,1,i),wylago(1,1,1,1,i),
     $        wzlago(1,1,1,1,i),wxlag(1,1,1,1,i),wylag(1,1,1,1,i),
     $        wzlag(1,1,1,1,i))
      enddo
      call copy(w1masko,w1mask,n)
      call copy(w2masko,w2mask,n)
      call copy(w3masko,w3mask,n)
      call copy(wmulto,wmult,n)
      call copy(abx1o,abx1,n)
      call copy(aby1o,aby1,n)
      call copy(abz1o,abz1,n)
      call copy(abx2o,abx2,n)
      call copy(aby2o,aby2,n)
      call copy(abz2o,abz2,n)
      do i=1,lorder2
         call copy(prlago(1,1,1,1,i),prlag(1,1,1,1,i),npre)
      enddo
      call copy(pro,pr,npre)
      call opcopy(xm1o,ym1o,zm1o,xm1,ym1,zm1)
      return
      end
c--------------------------------------------
      subroutine load_step
      include 'SIZE'
      include 'TOTAL'
      include 'RESTART'

      parameter (lt=lx1*ly1*lz1*lelv)

      common /indici/ indcyl(lx1,ly1,lz1,lelv)
      common /contatori/ icont,istepold,timeold,firstit
      integer icont, istepold,n,npre,firstit
      common /olddati/ vxo(lx1,ly1,lz1,lelv),vyo(lx1,ly1,lz1,lelv),
     $     vzo(lx1,ly1,lz1,lelv),xm1o(lx1,ly1,lz1,lelv),
     $     ym1o(lx1,ly1,lz1,lelv),zm1o(lx1,ly1,lz1,lelv),
     $     vxlago(lx1,ly1,lz1,lelv,2),vylago(lx1,ly1,lz1,lelv,2),
     $     vzlago(lx1,ly1,lz1,lelv,2)
     $     , ABX1o   (LX1,LY1,LZ1,LELV)
     $     , ABY1o   (LX1,LY1,LZ1,LELV)
     $     , ABZ1o   (LX1,LY1,LZ1,LELV)
     $     , ABX2o   (LX1,LY1,LZ1,LELV)
     $     , ABY2o   (LX1,LY1,LZ1,LELV)
     $     , ABZ2o   (LX1,LY1,LZ1,LELV)
     $     , PRLAGo  (LX2,LY2,LZ2,LELV,LORDER2),pro(lx2,ly2,lz2,lelv)
     $     ,   wxo(lx1m,ly1m,lz1m,lelt),wyo(lx1m,ly1m,lz1m,lelt),
     $     wzo(lx1m,ly1m,lz1m,lelt)
     $     ,   WXLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WYLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   WZLAGo (LX1M,LY1M,LZ1M,LELT,LORDER-1)
     $     ,   W1MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W2MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   W3MASKo(LX1M,LY1M,LZ1M,LELT)
     $     ,   WMULTo (LX1M,LY1M,LZ1M,LELT), fyold
      n=lx1*ly1*lz1*lelv
      npre=lx2*ly2*lz2*lelv

      call opcopy(vx,vy,vz,vxo,vyo,vzo)
      call opcopy(wx,wy,wz,wxo,wyo,wzo)
      do i=1,lorder-1
         call opcopy(vxlag(1,1,1,1,i),vylag(1,1,1,1,i),
     $        vzlag(1,1,1,1,i),vxlago(1,1,1,1,i),vylago(1,1,1,1,i),
     $        vzlago(1,1,1,1,i))
         call opcopy(wxlag(1,1,1,1,i),wylag(1,1,1,1,i),
     $        wzlag(1,1,1,1,i),wxlago(1,1,1,1,i),wylago(1,1,1,1,i),
     $        wzlago(1,1,1,1,i))
      enddo

      call copy(abz1,abz1o,n)

      call copy(abx1,abx1o,n)
      call copy(aby1,aby1o,n)
      call copy(abz1,abz1o,n)
      call copy(abx2,abx2o,n)
      call copy(aby2,aby2o,n)
      call copy(abz2,abz2o,n)
      call copy(w1mask,w1masko,n)
      call copy(w2mask,w2masko,n)
      call copy(w3mask,w3masko,n)
      call copy(wmult,wmulto,n)
      do i=1,lorder2
         call copy(prlag(1,1,1,1,i),prlago(1,1,1,1,i),npre)
      enddo
      call copy(pr,pro,npre)
      call opcopy(xm1,ym1,zm1,xm1o,ym1o,zm1o)

      call geom_reset(1)
      call setup_convect(1)
      call setup_convect(2)

c      call setup_convect(3)

      return
      end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20130624/2cfa1143/attachment.html>


More information about the Nek5000-users mailing list