Skip to content

Alternative time-averaging for rectangular window to avoid performance degradation #1545

@ChristianBauerEng

Description

@ChristianBauerEng

Is your feature request related to a problem? Please describe.
In my transient cases I would like to average the flow-field over many time-iterations, in order to filter out highly dynamic effects. For me the volumentric time-averages and rms values have significant value. However, I have observed, that once averaging is enabled, the solver performance gradually decreases up to a point, where time-iterations are orders of magnitudes slower than without averaging. This does not seem to be a bug but rather inherent to the way averaging is implemented.

I suspect, that the averaging occurs over all timesteps and thus a complete history of all the values is required. This may gradually increase memory consumption and effort for calculating averages. I suspect this to happen around here, but I may be wrong.

void CWindowedAverage::addValue(su2double valIn, unsigned long curTimeIter,unsigned long startIter){
if (curTimeIter < startIter) return;
if (curTimeIter != lastTimeIter) {
lastTimeIter = curTimeIter;
values.push_back(valIn);
}
else values.back() = valIn;
}

I assume, that this may be a necessity for the higher-order windows, but seems to be overkill for a rectangular window, where the new time-average can be computed from the previous time-average, the number of iterations and the new values. Nevertheless, also the rectangular window seems to save the full value history:

su2double CWindowedAverage::NoWindowing() const {
su2double wnd_timeAvg = 0.0;
for(unsigned long curTimeIter=0; curTimeIter<values.size(); curTimeIter++){
wnd_timeAvg+=values[curTimeIter];
}
return wnd_timeAvg/static_cast<su2double>(values.size());
}

Describe the solution you'd like
Being able to calculate (at least) non-windowed time-averages without a gradual drop in performance would be a real asset for me. This may be possible by choosing a different averaging method. If this cannot be done due to the data structure used, a dry-run message warning the user about this may be helpful.

Describe alternatives you've considered
The same effect can be achieved by running simulations without time-averaging but with regular volumetric outputs and calculating time-averages as a post-processing step. However, the associated data overhead is considerable.

Additional context
I performed my tests so far with the RANS solver, employing SST turbulence and SLAU2 scheme. Time-averaging started at around time-iteration 160k and cintinous for another 200k iterations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions