Page 1 of 1

moment postprocess

Posted: Wed Oct 19, 2016 11:49 am
by Muhsin
Hi,

I recently migrating my codes from v3 to v4. I'm having a problem where when I try to specify my Time Averages start to be post-processed and monitored from the point it starts to do the averaging. I'm adding a line of the following which starts from the line 2114 in the attached cs_user_parameters file
n_moments = cs_time_moment_n_moments()

if (n_moments.gt.0) then
do imom=1,n_moments
f_id=time_moment_field_id(imom)
ipp = field_post_id(f_id)
if (ntcabs.le.6000)then
call field_set_key_int(f_id, keyvis, 0)
call field_set_key_int(f_id, keylog, 1)
ihisvr(ipp,1) = 0
else
call field_set_key_int(f_id, keyvis, 1)
call field_set_key_int(f_id, keylog, 1)
ihisvr(ipp,1) = -1
endif
enddo
endif
However, after it exceeds the ntcabs 6000, the postprocessing and the monitor from the probes are not produced. Or is there a better way to control the postprocess file and monitoring file for the averages.

Re: moment postprocess

Posted: Wed Oct 19, 2016 12:38 pm
by Yvan Fournier
Hello,

The cs_user_parameters are read just before the time loom, so you should not use tests on ntcabs there (unless you want a behavior specific to some restarts).

You cannot postprocess some variables at regular intervals, and others such as moments only at a subset of those, as it can cause issues with tools reading the data.

You could output time moments using an alias postprocessing mesh and a separate writer, using cs_user_postprocess.c and cs_user_postprocess_var.f90.

Otherwise, moments are set to zero before being active, so simply not trying to change their output options is simplest.

Regards,

Yvan

Re: moment postprocess

Posted: Wed Oct 19, 2016 4:51 pm
by Muhsin
Hi Yvan,

Thank you for your reply.
Just want to check with you with some basic questions.
If I would like to create an additional writer in the cs_user_postprocess.c, I will need to specify the postprocessed variables in the cs_user_postprocess_var.f90 at the specified ipart which equivalent to the writer_id in the cs_user_postprocess.c
Another thing is, all my moments will be in order 1 to N for the N number declarations of moments in cs_user_parameters.c. Am I right?

Muhsin

Re: moment postprocess

Posted: Wed Oct 19, 2016 5:09 pm
by Yvan Fournier
Hello,

cs_user_postprocess_var uses the mesh id, not the writer id (it calls the output for all associated writers), so you need an extra mesh (either a duplicate of the main mesh, in which case you can also define the additional volume mesh and additional writer with the GUI, or an "alias" mesh, to save memory).

Otherwise, moments appear in the order in which they are defined (to be safe, you can also access the matching fields by name).

Regards,

Yvan