@@ -134,11 +134,19 @@ class MovingStatistic(Flow360BaseModel):
134134 :class:`ProbeOutput`, :class:`SurfaceProbeOutput`,
135135 :class:`SurfaceIntegralOutput` and :class:`ForceOutput`.
136136
137+ Notes
138+ -----
139+ - The window size is defined by the number of data points recorded in the output.
140+ - For steady simulations, the solver typically outputs a data point once every **10 pseudo steps**.
141+ This means a :py:attr:`moving_window_size`=10 would cover 100 pseudo steps.
142+ Thus, the :py:attr:`start_step` value is automatically rounded up to
143+ the nearest multiple of 10 for steady simulations.
144+
137145 Example
138146 -------
139147
140148 Define a moving statistic to compute the standard deviation in a moving window of
141- 10 steps , with the initial 100 steps skipped.
149+ 10 data points , with the initial 100 steps skipped.
142150
143151 >>> fl.MovingStatistic(
144152 ... moving_window_size=10,
@@ -149,35 +157,24 @@ class MovingStatistic(Flow360BaseModel):
149157 ====
150158 """
151159
152- moving_window_size : pd .PositiveInt = pd .Field (
160+ moving_window_size : pd .StrictInt = pd .Field (
153161 10 ,
154- description = "The number of pseudo/physical steps to compute moving statistics. "
155- "For steady simulation, the moving_window_size should be a multiple of 10." ,
162+ ge = 2 ,
163+ description = "The size of the moving window in data points over which the "
164+ "statistic is calculated. Must be greater than or equal to 2." ,
156165 )
157166 method : Literal ["mean" , "min" , "max" , "std" , "deviation" ] = pd .Field (
158- "mean" , description = "The type of moving statistics used to monitor the output ."
167+ "mean" , description = "The statistical method to apply to the data within the moving window ."
159168 )
160169 start_step : pd .NonNegativeInt = pd .Field (
161170 0 ,
162- description = "The number of pseudo/physical steps to skip before computing the moving statistics. "
163- "For steady simulation, the moving_window_size should be a multiple of 10." ,
171+ description = "The number of steps (pseudo or physical) to skip at the beginning of the "
172+ "simulation before the moving statistics calculation starts. For steady "
173+ "simulations, this value is automatically rounded up to the nearest multiple of 10, "
174+ "as the solver outputs data every 10 pseudo steps." ,
164175 )
165176 type_name : Literal ["MovingStatistic" ] = pd .Field ("MovingStatistic" , frozen = True )
166177
167- @pd .field_validator ("moving_window_size" , "start_step" , mode = "after" )
168- @classmethod
169- def _check_moving_window_for_steady_simulation (cls , value ):
170- validation_info = get_validation_info ()
171- if (
172- validation_info
173- and validation_info .time_stepping == TimeSteppingType .STEADY
174- and value % 10 != 0
175- ):
176- raise ValueError (
177- "For steady simulation, the number of steps should be a multiple of 10."
178- )
179- return value
180-
181178
182179class _OutputBase (Flow360BaseModel ):
183180 output_fields : UniqueItemList [str ] = pd .Field ()
0 commit comments