[Nek5000-users] previous value of drag coefficient

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Wed Nov 22 07:25:51 CST 2017


Hi, 

I tried but still the same problem, here is the code what i tried, only 100 time steps I have given in .rea file. The output looks like this: for the first step it gives 0.5 as expected but from next time step onwards it gives zero. I think after each time step it deletes all its memory and store again.

If suppose I give: write (6,7020) y(istep) instead of write (6,7020) y(istep-1) it will print all the time steps as it is stored.

So is there anyway to get just previous value from an array at each time step?

remember that i need lift coefficient instead of istep. istep is just a dummy parameter to check.

Thanks

Regards

Sijo GEORGE

c-----------------------------------------------------------------------
      subroutine userchk
      include 'SIZE'
      include 'TOTAL'
      include 'RESTART'

      real x0(3),y(100)
      save x0
      data x0 /3*0/

      parameter (lt=lx1*ly1*lz1*lelv)
      common /scrns/ vort(lt,3), w1(lt), w2(lt)


      n = nx1*ny1*nz1*nelv
      call comp_vort3(vort , w1, w2, vx, vy, vz)
      call copy (T,vort,n)    ! Vorticity --> T
      ifto = .true.           ! Dump vorticity as T

      if (istep.eq.0) call set_obj  ! define objects for surface integrals

       scale = 2.  ! Cd = F/(.5 rho U^2 ) = 2*F
c       if (mod(istep,10).eq.0)
      call torque_calc(scale,x0,.true.,.false.)

      y(0)=0.5
      y(istep) = istep
        write (6,7020) y(istep-1)
7020    format(7f20.8)



      ifusermv = .true.
      if (ifusermv) call my_meshv      ! Compute our own mesh velocity

      return
      end
c-----------------------------------------------------------------------


----- Mail original -----
De: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
À: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
Envoyé: Mercredi 22 Novembre 2017 11:23:14
Objet: Re: [Nek5000-users] previous value of drag coefficient

just declare an array "lift(nabstep)", and at each step you push the 
content up by one index:

do i=nabstep-1,-1,1
   lift(i+1) = lift(i)
end do
lift(1) = current_lift

something like that.

philipp


On 2017-11-22 11:18, nek5000-users at lists.mcs.anl.gov wrote:
> Thank you Philip. I am sorry I just started to use NEK5000 and in Fortran too. I could not find an example of the concept of lag array. I know its a silly question. But could you please help me how to initialize such an array.
> 
> Thanks again
> Sijo GEORGE
> 
> ----- Mail original -----
> De: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
> À: "nek5000-users" <nek5000-users at lists.mcs.anl.gov>
> Envoyé: Mercredi 22 Novembre 2017 11:05:45
> Objet: Re: [Nek5000-users] previous value of drag coefficient
> 
> Hi,
> I suggest to use lag arrays as done for the BDF scheme, that is to have an array of size #multisteps and at each new time step to copy the old RHS (as you do AB) one step backwards.
> This is then somewhat consistent with Nek. Just be careful during the startup.
> Hth, Philipp
> 
> On November 22, 2017 10:31:11 AM GMT+01:00, nek5000-users at lists.mcs.anl.gov wrote:
>> Hi Neks,
>>
>> Since I am trying to implement Adams bashforth scheme on my FSI problem
>> (for equation of motion), I would like to pass the lift coefficients of
>> the current timestep and the just previous time step to the function
>> where I implemented the Adams Bashforth module. But its seems a bit
>> difficult to fetch the just previous value of dragy value since it
>> calls a new value at every time step. I simply tried a swapping method.
>> But it gets zero value. Could you please tell me whether is there any
>> way to fetch the just previous value of a variable (from an array or
>> something?)
>>
>>
>> Thanks regards
>>
>> Sijo GEORGE
> 
_______________________________________________
Nek5000-users mailing list
Nek5000-users at lists.mcs.anl.gov
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users


More information about the Nek5000-users mailing list