Time averaging with offset after restart

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
philippks
Posts: 9
Joined: Sat Jun 20, 2015 6:08 pm

Time averaging with offset after restart

Post by philippks »

Hi,

In Code_Saturne version 4.0.4., I want to write out time averages of a number of variables, for which I aim on using cs_time_moment_define_by_field_ids() in cs_user_parameters.c like this example:

Code: Select all

    int moment_f_id[] = {CS_F_(u)->id};
    int moment_c_id[] = {-1};
    int n_fields = 1;
    cs_time_moment_define_by_field_ids("U_mean",
                                       n_fields,
                                       moment_f_id,
                                       moment_c_id,
                                       CS_TIME_MOMENT_MEAN,
                                       1000, /* nt_start */
                                       -1,   /* t_start */
                                       CS_TIME_MOMENT_RESTART_AUTO,
                                       NULL);
However, I want to use the 1000 timesteps (nt_start) as an offset from the timestep number of the previous simulation in case of a restart, i.e. ntpabs + 1000. I tried using ntpabs directly in this function, but it didn't work. Do you have any suggestion?
Many thanks for your help!
philippks
Posts: 9
Joined: Sat Jun 20, 2015 6:08 pm

Re: Time averaging with offset after restart

Post by philippks »

I have found the solution in the meanwhile:

Code: Select all

    cs_time_moment_define_by_field_ids("u_avg",
                                       n_fields,
                                       moment_f_id,
                                       moment_c_id,
                                       CS_TIME_MOMENT_MEAN,
                                       cs_glob_time_step->nt_prev + 1000, /* nt_start */
                                       -1,   /* t_start */
                                       CS_TIME_MOMENT_RESTART_AUTO,
                                       NULL);
Post Reply