MovingStatistic#

class MovingStatistic[source]#

Bases: Flow360BaseModel

MovingStatistic class for moving statistic settings in ProbeOutput, SurfaceProbeOutput, SurfaceIntegralOutput and ForceOutput.

Notes

  • The window size is defined by the number of data points recorded in the output.

  • For steady simulations, the solver typically outputs a data point once every 10 pseudo steps. This means a moving_window_size = 10 would cover 100 pseudo steps. Thus, the start_step value is automatically rounded up to the nearest multiple of 10 for steady simulations.

  • For unsteady simulations, the solver outputs a data point for every physical step. A moving_window_size = 10 would cover 10 physical steps.

  • When method is set to “standard_deviation”, the standard deviation is computed as a sample standard deviation normalized by \(n-1\) (Bessel’s correction), where \(n\) is the number of data points in the moving window.

  • When method is set to “range”, the difference between the maximum and minimum values of the monitored field in the moving window is computed.

Example

Define a moving statistic to compute the standard deviation in a moving window of 10 data points, with the initial 100 steps skipped.

>>> fl.MovingStatistic(
...     moving_window_size=10,
...     method="standard_deviation",
...     start_step=100,
... )

Attributes

moving_window_size: int#

The size of the moving window in data points over which the statistic is calculated. Must be greater than or equal to 2.

Default:

10

start_step: int#

The number of steps (pseudo or physical) to skip at the beginning of the simulation before the moving statistics calculation starts. For steady simulations, this value is automatically rounded up to the nearest multiple of 10, as the solver outputs data every 10 pseudo steps.

Default:

0

Additional Constructors

classmethod from_file(filename)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')