flow360.snappy.QualityMetrics#

class QualityMetrics#

Bases: Flow360BaseModel

Mesh quality control parameters for snappyHexMesh meshing process.

max_non_orthogonality: Annotated[_Constrained, PlainSerializer(func=_dimensioned_type_serializer, return_type=PydanticUndefined, when_used=always)] | Literal[False] = unyt_quantity(85, 'degree') (alias 'max_non_ortho')#

Maximum face non-orthogonality angle: the angle made by the vector between the two adjacent cell centres across the common face and the face normal. Set to False to disable this metric.

max_boundary_skewness: Annotated[_Constrained, PlainSerializer(func=_dimensioned_type_serializer, return_type=PydanticUndefined, when_used=always)] | Literal[False] = unyt_quantity(20, 'degree')#

Maximum boundary skewness. Set to False to disable this metric.

max_internal_skewness: Annotated[_Constrained, PlainSerializer(func=_dimensioned_type_serializer, return_type=PydanticUndefined, when_used=always)] | Literal[False] = unyt_quantity(50, 'degree')#

Maximum internal face skewness. Set to False to disable this metric.

max_concavity: Annotated[_Constrained, PlainSerializer(func=_dimensioned_type_serializer, return_type=PydanticUndefined, when_used=always)] | Literal[False] = unyt_quantity(50, 'degree') (alias 'max_concave')#

Maximum cell concavity. Set to False to disable this metric.

min_pyramid_cell_volume: float | Literal[False] = 1e-15 (alias 'min_vol')#

Minimum cell pyramid volume [mesh_unit³]. Set to False to disable this metric (uses -1e30 internally).

min_tetrahedron_quality: float | Literal[False] = 1e-09 (alias 'min_tet_quality')#

Minimum tetrahedron quality. Set to False to disable this metric (uses -1e30 internally).

min_face_area: Annotated[_Constrained, PlainSerializer(func=_dimensioned_type_serializer, return_type=PydanticUndefined, when_used=always)] | Literal[False] | None = None (alias 'min_area')#

Minimum face area. Set to False to disable. Defaults to 1e-12 of mesh unit.

min_twist: float | Literal[False] = False#

Minimum twist. Controls the twist quality of faces. Set to False to disable this metric.

min_cell_determinant: float | Literal[False] = False (alias 'min_determinant')#

Minimum cell determinant. Set to False to disable this metric (uses -1e5 internally).

min_volume_ratio: Annotated[float, Ge(ge=0)] | Literal[False] = 0 (alias 'min_vol_ratio')#

Minimum volume ratio between adjacent cells.

min_face_weight: Annotated[float, Ge(ge=0)] | Literal[False] = 0#

Minimum face interpolation weight. Controls the quality of face interpolation.

min_triangle_twist: float | Literal[False] = False#

Minimum triangle twist. Set to False to disable this metric.

n_smooth_scale: Annotated[int, Ge(ge=0)] = 4#

Number of smoothing iterations. Used in combination with error_reduction.

Constraints:
  • ge = 0

error_reduction: float = 0.75#

Error reduction factor. Used in combination with n_smooth_scale. Must be between 0 and 1.

Constraints:
  • ge = 0

  • le = 1

zmetric_threshold: Annotated[float, Ge(ge=0)] | Literal[False] = 0.8 (alias 'zfactor_threshold')#

Threshold for z-factor limiting during mesh quality checks and smoothing. Set to False to disable this metric.

Constraints:
  • le = 2

feature_edge_deduplication_tolerance: Annotated[float, Ge(ge=0)] | Literal[False] = 0.2#

Relative tolerance to deduplicate feature edges when snapping and smoothing. Set to False to disable this metric.

min_volume_collapse_ratio: float | Literal[False] = 0 (alias 'min_vol_collapse_ratio')#

Minimum volume collapse ratio. If > 0: preserves single cells with all pointson the surface if the resulting volume after snapping is larger than min_vol_collapse_ratio times the old volume (i.e., not collapsed to flat cell). If < 0: always deletes such cells.