TimeWindowedStatisticsPostProcessor

Windowed statistics (mean, std, drift) and a running time average of a postprocessor, using only samples from start_time onwards.

Description

The TimeWindowedStatisticsPostProcessor reports a time statistic of another postprocessor, selected with "postprocessor". For example, it can be used to monitor whether a quantity in a pseudo-transient or statistically steady simulation has settled, or to report its time average once it has. Only samples from time steps with "start_time" are used, so an initial transient can be excluded.

One sample is recorded per time step. With the number of samples in the window, which is the smaller of "window" and the number of samples recorded so far, the "statistic" parameter selects one of the following:

  • mean: the arithmetic mean of the last samples,

  • std: the sample standard deviation of the last samples,

    which is 0 when only one sample has been recorded.

  • time_integrated_mean: the time-weighted mean of all samples since averaging started,

    where is the part of the time step of sample after "start_time", so that no time before "start_time" is included. At "start_time", the integration interval is empty and the current value of the monitored postprocessor is returned.

  • statistics_time: the total time over which time_integrated_mean is taken.

The window is measured in time steps, not in simulation time, and the windowed statistics weigh all samples equally regardless of the time step size. Before "start_time" is reached, mean and time_integrated_mean return the current value of the monitored postprocessor, while std and statistics_time return 0.

commentnote

At most one sample is recorded per time step, so the statistics are not affected if the object executes several times in a time step. Samples are taken from the value of the monitored postprocessor at the time of execution, so the default execute_on = TIMESTEP_END is the intended use.

Example Input Syntax

In this example, the monitored postprocessor f is equal to the simulation time, which advances by 1 each time step. Averaging starts at and the window holds the last 3 time steps. One TimeWindowedStatisticsPostProcessor is declared for each statistic: at , the windowed mean is the mean of 4, 5 and 6, the std is 1, and the time_integrated_mean is the mean of 3 through 6 weighted by the parts of the time steps after , which are 0.5 for the sample at and 1 for the others.

[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [f]
    type = FunctionValuePostprocessor<<<{"description": "Computes the value of a supplied function at a single point (scalable)", "href": "FunctionValuePostprocessor.html"}>>>
    function<<<{"description": "The function which supplies the postprocessor value."}>>> = f
  []
  [mean]
    type = TimeWindowedStatisticsPostProcessor<<<{"description": "Windowed statistics (mean, std, drift) and a running time average of a postprocessor, using only samples from start_time onwards.", "href": "TimeWindowedStatisticsPostProcessor.html"}>>>
    postprocessor<<<{"description": "The postprocessor to monitor."}>>> = f
    start_time<<<{"description": "Simulation time from which samples are used for all statistics."}>>> = 2.5
    window<<<{"description": "Number of time steps in one window."}>>> = 3
    statistic<<<{"description": "Which statistic to report."}>>> = mean
  []
  [std]
    type = TimeWindowedStatisticsPostProcessor<<<{"description": "Windowed statistics (mean, std, drift) and a running time average of a postprocessor, using only samples from start_time onwards.", "href": "TimeWindowedStatisticsPostProcessor.html"}>>>
    postprocessor<<<{"description": "The postprocessor to monitor."}>>> = f
    start_time<<<{"description": "Simulation time from which samples are used for all statistics."}>>> = 2.5
    window<<<{"description": "Number of time steps in one window."}>>> = 3
    statistic<<<{"description": "Which statistic to report."}>>> = std
  []
  [time_integrated_mean]
    type = TimeWindowedStatisticsPostProcessor<<<{"description": "Windowed statistics (mean, std, drift) and a running time average of a postprocessor, using only samples from start_time onwards.", "href": "TimeWindowedStatisticsPostProcessor.html"}>>>
    postprocessor<<<{"description": "The postprocessor to monitor."}>>> = f
    start_time<<<{"description": "Simulation time from which samples are used for all statistics."}>>> = 2.5
    window<<<{"description": "Number of time steps in one window."}>>> = 3
    statistic<<<{"description": "Which statistic to report."}>>> = time_integrated_mean
  []
  [statistics_time]
    type = TimeWindowedStatisticsPostProcessor<<<{"description": "Windowed statistics (mean, std, drift) and a running time average of a postprocessor, using only samples from start_time onwards.", "href": "TimeWindowedStatisticsPostProcessor.html"}>>>
    postprocessor<<<{"description": "The postprocessor to monitor."}>>> = f
    start_time<<<{"description": "Simulation time from which samples are used for all statistics."}>>> = 2.5
    window<<<{"description": "Number of time steps in one window."}>>> = 3
    statistic<<<{"description": "Which statistic to report."}>>> = statistics_time
  []
[]
(test/tests/postprocessors/time_windowed_statistics/time_windowed_statistics.i)

Input Parameters

  • postprocessorThe postprocessor to monitor.

    C++ Type:PostprocessorName

    Unit:(no unit assumed)

    Controllable:No

    Description:The postprocessor to monitor.

  • start_timeSimulation time from which samples are used for all statistics.

    C++ Type:Real

    Unit:(no unit assumed)

    Controllable:No

    Description:Simulation time from which samples are used for all statistics.

Required Parameters

  • reference_value0Scale used to normalize relative_drift. If 0, the magnitude of the window mean is used.

    Default:0

    C++ Type:Real

    Unit:(no unit assumed)

    Controllable:No

    Description:Scale used to normalize relative_drift. If 0, the magnitude of the window mean is used.

  • statisticMEANWhich statistic to report.

    Default:MEAN

    C++ Type:MooseEnum

    Options:MEAN, STD, TIME_INTEGRATED_MEAN, STATISTICS_TIME

    Controllable:No

    Description:Which statistic to report.

  • window100Number of time steps in one window.

    Default:100

    C++ Type:unsigned int

    Range:window > 1

    Controllable:No

    Description:Number of time steps in one window.

Optional Parameters

  • allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).

  • execute_onTIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

    Default:TIMESTEP_END

    C++ Type:ExecFlagEnum

    Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, MULTISYSTEM_FIXED_POINT_ITERATION_END, FINAL, CUSTOM, TRANSFER

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

    Default:0

    C++ Type:int

    Controllable:No

    Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.

  • force_postauxFalseForces the UserObject to be executed in POSTAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in POSTAUX

  • force_preauxFalseForces the UserObject to be executed in PREAUX

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREAUX

  • force_preicFalseForces the UserObject to be executed in PREIC during initial setup

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Forces the UserObject to be executed in PREIC during initial setup

Execution Scheduling Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

    C++ Type:std::vector<OutputName>

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Material Property Retrieval Parameters

Input Files