calculate spatio_temporal_average command

Purpose

This command calculates cell-based averages (as described in calculate spatial_average) of properties and variables and averages them over time.

Syntax

calculate spatio_temporal_average spatial_average_keywords spatial_average_values keywords values
  • spatial_average_keywords and spatial_average_values are documented in the calculate spatial_average command

  • keyword = weighting_factor (obligatory) or use_favre (optional) or use_favre_for_properties (optional) or use_favre_for_variables (optional)

weighting_factor values = w
  w = obligatory weighting factor used for time averaging [0,1]
use_favre values = yes or no
  yes = applies Favre averaging to all parameters
  no = disables Favre averaging globally (default)
use_favre_for_properties value = {fp_1,....,fp_n}
  {fp_1,....,fp_n} = list of yes/no for each property which determines of Favre averaging must be used (default is no)
use_favre_for_variables value = {fv_1,...,fv_n}
  {fv_1,....,fv_n} = list of yes/no for each variable which determines of Favre averaging must be used (default is no)

Examples

calculate spatio_temporal_average weighting_factor 0.1
calculate spatio_temporal_average write_every_time 1e-2 cell_size_relative 2 properties {vel} weighting_factor 0.01
calculate spatio_temporal_average cell_size_relative 4.5 properties {vel,vf} variables {v_myVar} weighting_factor 1e-3 use_favre yes
calculate spatio_temporal_average cell_size_relative 4.5 properties {vel,vf} variables {v_myVar} weighting_factor 1e-3 use_favre_for_properties {yes,no}

Description

As the mean of each properties is calculated, also the variance can be calculated by sigma^2 = mean_square - average ^2. The time average is calculated via a sliding average avg_new = (1-weighting_factor) * avg_old + weighting_factor * current_bin_value.

The weighting_factor is used to generate a moving average, where 1/weighting_factor is proportional to the number of mesh values used for average.

Note

Since the mesh values are generated only every write_every_time, the weighting_factor is linked to this value. For instance, if the values write_every_time = 1e-3 and weighting_factor = 0.001 are used it means that it takes roughly write_every_time / weighting_factor = 1 time unit until the average value has settled for a constant field.

The keyword use_favre can be used to perform a Favre averaging (for all properties and variables) when calculating the mean. This implies that the quantity that is to be averaged is multiplied with an instantaneous particle property and normalized with the time average of this property. E.g. the formula for the Favre averaged velocity computation, where mass is the scaling property, is given by v_avg_new = (1 - weighting_factor*m_avg_old/m_avg_new)*avg_old + weighting_factor*m_current_bin_value/m_avg_new * current_bin_value. This feature is particularly important for polydisperse systems in which only conservation quantities (like momentum) reach a steady state. The scaling properties for each quantity is set in the code to a suitable one and cannot be changed. The use_favre keyword can not be combined with use_favre_for_properties or use_favre_for_variables. With these two keywords it is possible to control the Favre averaging for each property (or variable). The length of these lists must be equal to the number of properties (variables), or contain only a single value (which is then used for all properties (variables).

Warning

The averaging is based on a structured grid, which does not adapt to the shape of complex walls. Thus cells near the wall may never completely fill up and averaged information such as volume fraction may be biased.

Restart, fix_modify, output, run start/stop

No information about this command is written to binary restart files.

This command supports fix_modify with option average = ‘start’, ‘stop’ or ‘reset’ to start, stop or reset the averaging in between two runs.

This command computes the above-mentioned quantities, and will add these automatically via the output_settings command to the aspherix_simulation.pvd file (as Euler Fields) if write_every_time and file are not specified explicitly by the user (recommended). If the user specifies any of these keywords, separate vts files will be written. It is also possible to output the same data via the dump euler/vtk/custom command using the command-ID. Note that the values can only be accessed on time levels that are multiples of write_every_time since that is when calculations are performed.

No parameter of this command can be used with the start/stop keywords of the run command.

Restrictions

Volume fractions and stresses are calculated based on the assumption of a structured (equidistant regular) grid, so volume fractions and stresses near walls that are not aligned with the grid will be incorrect.

Coarse-graining information:

Using coarsegraining in combination with this command might lead to different dynamics or system state and thus to inconsistencies. However, the influence of this model on the global dynamics or system state might be small so in some cases the results may be valid. This has to be reviewed by a specialist on a case-by-case basis.

Defaults

id = spatio_temporal_average_XX, particle_group = all, region = simulation_domain_region_, cell_size_relative = 3, file = post/spatio_temporal_average_XX_*.vts, properties = {vf,vel,stress_tensor,pressure}, variables = empty, variable_weights = empty, use_favre = no