SPH
|
Criterion setting time step based on value-to-derivative ratio for time-dependent quantities. More...
#include <TimeStepCriterion.h>
Public Member Functions | |
DerivativeCriterion (const RunSettings &settings) | |
virtual TimeStep | compute (IScheduler &scheduler, Storage &storage, Float maxStep, Statistics &stats) override |
Computes the value of the time step. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Criterion setting time step based on value-to-derivative ratio for time-dependent quantities.
The value-to-derivative ratio is evaluated for each particle and each first-order quantity in the storage. This criterion ensures a constant relative error of the timestepping algorithms. Quantities that allows for (zero or negative) values, such as all vector and tensor quantities, have to be treated differently, as zero values with any non-zero derivatives would formally lead to zero time step. Therefore, all time-depended quantities have a scale value assigned. For quantity value
\[x\]
with scale value
\[x_0\]
and derivative
\[dx\]
, the time step is computed as
\[ dt = \frac{|x| + x_0}{|dx|} \]
.
The scale value can be chosen arbitrarily, it represents a transitional value between relative and absolute error of the quantity. The optimal scale value is about 0.01 to 0.1 of the typical value of the quantity in the run; for density 2700 kg/m^3, the default scale value is 50 kg/m^3. Larger scale value makes the criterion less restrictive (allowing larger time steps), and vice versa. Setting the scale value to a very large number (10^20, for example) excludes the quantity from the criterion.
The scale value can be set differently for each material. The value can be set by calling IMaterial::setRange and later obtained by IMaterial::minimal.
By default, the most restrictive time step is chosen, i.e. the lowest time step for all particles and all quantities. This can be relaxed by setting a power (parameter RunSettingsId::TIMESTEPPING_MEAN_POWER) of a mean, computed from time steps of individual particles. This makes the resulting time step more 'smooth', as it is less influenced by outliers. The lower the value of the power, the more restrictive time step.
Definition at line 79 of file TimeStepCriterion.h.
|
explicit |
Definition at line 121 of file TimeStepCriterion.cpp.
|
overridevirtual |
Computes the value of the time step.
scheduler | Scheduler than can be used for parallelization. |
storage | Storage containing all physical quantities from which the time step is determined. |
maxStep | Maximal allowed time step. |
stats | Used to save statistics of the criterion. |
Implements ITimeStepCriterion.
Definition at line 127 of file TimeStepCriterion.cpp.