ibfoamrig.core.ResidualData#
- class ibfoamrig.core.ResidualData(frame)[source]#
Bases:
objectSolver residuals over the iterations or time steps of a run.
- classmethod from_file(path)[source]#
Loads a
residuals.datfile written by OpenFOAM.- Parameters:
path (StrPath) – Path to the file.
- Returns:
The loaded residuals.
- Raises:
FileNotFoundError – If the file does not exist.
FoamParseError – If the file is malformed.
- Return type:
- final()[source]#
Returns the residuals of the last iteration.
- Returns:
A mapping from residuals name to its last value, or None if it was not solved in the last iteration.
- Raises:
ValueError – If the frame has no rows.
- Return type:
- is_converged(tol)[source]#
Checks whether the last residuals are below a tolerance.
- Parameters:
tol (float | Mapping[str, float]) – One tolerance for all residuals, or a mapping from name to tolerance. Name is either a column or the base name of a vector or tensor, which covers all its components. Residuals missing from the mapping are not checked.
- Returns:
True if every checked residual is below its tolerance. A null residual counts as not converged.
- Raises:
KeyError – If a name in
tolmatches no residual column.ValueError – If the frame has no rows.
- Return type: