[Nek5000-users] Increase DT in Usrchk based on CFL

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Fri Jul 9 09:59:25 CDT 2010


Another option --- set param 12 (dt) to be a positive number - the
max you'll allow, and let nek determine dt to meet your desired CFL.

(I've never particularly liked the auto-dt selection in nek - and
also it interferes with the projection routines, so I rarely use it)

Paul



On Fri, 9 Jul 2010, nek5000-users at lists.mcs.anl.gov wrote:

>
>
> On Fri, 9 Jul 2010, nek5000-users at lists.mcs.anl.gov wrote:
>
>> Hi,
>> 
>> I would like to increase my DT dynamically by checking the current CFL
>> at each step.  For example:
>> 
>> 
>> if C < 0.15 then  param(12) = param(12) + 1E-05 
>> 
>> I know I can adjust the time step in usrchk by setting param(12), but
>> can I access C in the same manner by param(26)? Or is this only the
>> parameter I set in the rea, and it is accessed by another variable?
>> 
>> This issue occurs after a few 100 steps where my C drops and starts to
>> settle around 0.1-0.15.  The problem is I'm not sure that it always
>> occurs around the same time steps, and there for would like to adjust
>> it based on the actual value. I know nek will adjust DT if my C
>> becomes too large, but when C becomes too small is the issue DT is
>> not adjusted so long as it meets what I set in the rea .
>> 
>
> Michael,
>
> I use the following routine, which I call w/no arguments from userchk.
>
> It takes your initial dt and sets it to dt/(scale^2), then ramps back
> to your target dt value.
>
> Paul
>
>
> c-----------------------------------------------------------------------
>      subroutine usr_dt
>
> c     Reduce initial dt by scale*scale. c     Then ramp up by 5% each step to 
> dt/scale.
> c     Then resume ramping after Step 120 till dt = dtmax.
>
>      include 'SIZE'
>      include 'TOTAL'
>
>      real dtmx1,dtmax,p93,p94,p95,p103
>      save dtmx1,dtmax,p93,p94,p95,p103
>
>      if (istep.eq.0) then
>         scale = 10.
>         dtmax = abs(param(12))
>         dtmx1 = dtmax/scale
>         dt    = dtmx1/scale
>         p93   = param(93)
>         p94   = param(94)
>         p95   = param(95)
>         p103  = param(103)
>      endif
>      dt = dt*1.05
>      dt = min(dtmx1,dt)
>      param(12) = -dt
>
>      param(93) = p93   ! turn off projection till dt is fixed
>      param(94) = p94
>      param(95) = p95
>      if (dt.lt.dtmx1) then
>         param(93) = 0
>         param(94) = 0
>         param(95) = 0
>         p95       = istep
>      endif
>      if (istep.gt.120) dtmx1 = dtmax
>
>      if (nid.eq.0.and.istep.le.20) write(6,*) istep,dt,dtmax,' dtmax'
>
>      fexp       = 0.85   ! filter strength doubled for first few steps
>      param(103) = p103*(dt/dtmax)**fexp   ! adjust filter weight
>      if (nid.eq.0.and.istep.le.110)
>     $   write(6,*) istep,param(103),p103,' p103'
>
>      param(103) = p103   ! std filter weight
>
>      return
>      end
> c-----------------------------------------------------------------------


More information about the Nek5000-users mailing list