checks pack¶
6 nodes, in noodlelab and in the tiers that build on it.
Checks¶
Expect Conserved¶
checks.expect_conserved
Expect a quantity that should be conserved (energy, mass, charge, momentum) to be the same after a calculation as before it: within the tolerances, or within k standard uncertainties of the difference. The uncertainty is taken on the difference itself, so what before and after share cancels.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Optional. |
|
|
Relative tolerance, as a fraction of the value before Default |
|
|
Absolute tolerance, in the unit of the value before Default |
|
|
With uncertainties: agree within k combined standard uncertainties Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Expect Converged¶
checks.expect_converged
Expect a result to have converged under refinement: the results of the
same calculation on successively finer meshes, smaller time steps or
tighter solver tolerances, coarsest first, each level finer than the one
before by refinement_ratio. This is Roache’s Grid Convergence Index,
the estimate of discretisation error that ASME V&V 20 uses for the
numerical uncertainty of a simulation.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
How much finer each level is than the one before (h_coarse / h_fine) Default |
|
|
The largest Grid Convergence Index allowed, as a fraction Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expect In Range¶
checks.expect_in_range
Expect a number, an array or a column to lie within limits (either may be left empty). Missing values (NaN) fail unless allowed.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Optional. |
|
|
Optional. |
|
|
The limits’ unit, for a quantity Default |
|
|
Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Expect Limit¶
checks.expect_limit
Expect a result to approach a known limiting value: a model that must reduce to the textbook answer as a parameter goes to zero or to infinity (a correction that vanishes for small angles, a thick-plate formula that tends to the thin-plate one, a steady state after a long time). Link x and y from a sweep.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
|
|
|
Default |
|
|
Where x goes: to zero, to its largest value, or to the value ‘at’ Default |
|
|
The value x approaches, when toward is ‘value’ Default |
|
|
Tolerance at the limit, as a fraction of the expected value (of the largest |y| when the expected value is zero) Default |
|
|
Absolute tolerance, in the expected value’s unit Default |
|
|
How many points nearest the limit must approach Default |
|
|
With uncertainties: agree within k combined standard uncertainties Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Expect Table¶
checks.expect_table
Expect a table to have its columns, no gaps where it matters, a unique key and a plausible number of rows.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Columns it must have, comma-separated Default |
|
|
Columns without missing values (* for all) Default |
|
|
A column whose values must not repeat Default |
|
|
Default |
|
|
0: no limit Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Expect Value¶
checks.expect_value
Expect a result to equal a value: typed (“9.81”, “9.81 m/s^2”, “9.81 ± 0.02”) or linked. Passes within the tolerance, or, when either side has an uncertainty, when |Δ| ≤ k·u(Δ), the standard uncertainty of the difference (which is √(u₁² + u₂²) when they share no inputs). Complex values are compared by the modulus of the difference. Arrays are compared element-wise.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|
Default |
|
|
Absolute tolerance, in the expected value’s unit Default |
|
|
Relative tolerance, in % of the expected value Default |
|
|
With uncertainties: agree within k combined standard uncertainties Default |
Outputs
Name |
Type |
Description |
|---|---|---|
|
|
|
|
|