Viscous dissipation becomes zero in post-processing mode with load_fld

25 views
Skip to first unread message

Chinthaka Jacob

unread,
Apr 23, 2026, 8:57:16 AMApr 23
to Nek5000

YuHsiang Lan

unread,
Apr 23, 2026, 7:43:44 PMApr 23
to Nek5000
Hi Chinthaka,

Does the code behave when you run with nstep=1?
I typically just call exitt manually in userchk and never run under post-processing mode...

Also, does your mesh coordinates come from the checkpoint files?
If so, you will need to manually call geom_reset afterward.
The code doesn't re-compute them even the load_fld might have updated the mesh coordinates.

However, I'd still expect the mesh and those geometric factors has been computed based on the rea/re2.
Twice, actually. The first one is generated in gengeom and the second one is called from fix_geom after usrdat2.
The logfile should have something like these:
    generate geometry data
    regenerate geometry data

In fact, I just tested with eddy example that nstep=0 still have rx, ry, sx and sy at the first userchk.
      subroutine userchk
      include 'SIZE'    
      include 'TOTAL'
      n = lx1*ly1*lz1*nelv
      a1 = glamax(rxm1, n)
      a2 = glamax(rym1, n)
      a3 = glamax(sxm1, n)
      a4 = glamax(sym1, n)

      if (nio.eq.0) write(*,*)'dbg',istep,nsteps,a1,a2,a3,a4
      return
      end
log:
 nsteps=0 -> skip time loop
 running solver in post processing mode

 call userchk
 dbg           0           0  0.19634954084939693        5.8175686490358203E-014   4.4853010194856324E-014  0.19634954084939693


BTW, it's usually fine but accumulating fields like this can lose accuracy if you have, says, 1000 files. 
         call add2(eta_sum,snrm,n)
Unless the numbers are iid to zero mean, it's basically doing the round-off "big_number += small number" and you will lose significant digits from small number.
A safer approach is to follow avg_all
         beta  = dtime/atime
         alpha = 1.-beta
         ! compute averages E(X)
         call avg1    (uavg,vx,alpha,beta,ntot ,'um  ',ifverbose)

Hope this helps,
Yu-Hsiang
--

Chinthaka Jacob

unread,
Apr 26, 2026, 10:13:52 PMApr 26
to Nek5000

Many thanks, Yu-Hsiang, for the detailed explanation! This resolved the issue cleanly, and the note on accumulation accuracy was particularly helpful going forward.

Chinthaka.

Reply all
Reply to author
Forward
0 new messages