Calculation of time averages is currently done in cs_user_parameters.c, for example for the velocity moments:
Code: Select all
/* Average and variance of the velocity vector */
int moment_f_id[] = {CS_F_(u)->id};
int moment_c_id[] = {-1};
int n_fields = 1;
const char *sum_comp_name[] = {"Vel_avg", "Vel_var"};
cs_time_moment_type_t m_type[] = {CS_TIME_MOMENT_MEAN,
CS_TIME_MOMENT_VARIANCE};
for (int i = 0; i < 2; i++) {
bft_printf("velocity i %d \n", i);
cs_time_moment_define_by_field_ids(sum_comp_name[i],
n_fields,
moment_f_id,
moment_c_id,
m_type[i],
n_start, /* nt_start */
-1, /* t_start */
CS_TIME_MOMENT_RESTART_AUTO,
NULL);
};
So could anyone shed some light on how I would go about doing this?