Nek5000 / nekRS

our next generation fast and scalable CFD code
https://nek5000.mcs.anl.gov/
Other
269 stars 71 forks source link

Incorrect istep in field files #445

Closed yslan closed 1 year ago

yslan commented 2 years ago

Describe the bug With empty UDF_ExecuteStep, the *0.f0* files generated by NekRS using writeControl will have timesteps=0 in the header.

Paraview will have issues when there are multiple files with same timesteps.

To Reproduce Run turbPipePeriodic example without cimode. Use the following keys in .par

stopAt = numSteps
numSteps = 200

writeControl = steps
writeInterval = 20

Expected behavior current

head -c 132 *0.f0*
==> turbPipe0.f00001 <==
#std 4  8  8  8       7840       7840  0.1200000000000E+00         0      0      1 XUP         0.0000000E+00 F 

expect

head -c 132 *0.f0*
==> turbPipe0.f00001 <==
#std 4  8  8  8       7840       7840  0.1200000000000E+00        20      0      1 XUP         0.0000000E+00 F 

hot fix

void UDF_ExecuteStep(nrs_t *nrs, dfloat time, int tstep)
{
  // extra copy to make istep non-zero in *0.f0*
  if (nrs->isOutputStep) {
    nek::ocopyToNek(time, tstep);
  }
}
stgeke commented 1 year ago

Fixed in https://github.com/Nek5000/nekRS/commit/833f1b5a9e2e38279e93975c4227b7812fed8155