snappy.QualityMetrics#

class QualityMetrics#

Bases: Flow360BaseModel

Mesh quality control parameters for snappyHexMesh meshing process.

Attributes

max_non_orthogonality: Any | Literal[False]#

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.

Default:

85 * fl.u.degree

max_boundary_skewness: Any | Literal[False]#

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

Default:

20 * fl.u.degree

max_internal_skewness: Any | Literal[False]#

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

Default:

50 * fl.u.degree

max_concavity: Any | Literal[False]#

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

Default:

50 * fl.u.degree

min_pyramid_cell_volume: float | Literal[False], optional#

Minimum cell pyramid volume [mesh_unit³]. Set to False to disable this metric (uses -1e30 internally). Defaults to (effective_min_spacing³) * 1e-10 when not specified.

Default:

None

min_tetrahedron_quality: float | Literal[False]#

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

Default:

1e-09

min_face_area: Any | Literal[False], optional#

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

Default:

None

min_twist: float | Literal[False]#

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

Default:

False

min_cell_determinant: float | Literal[False]#

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

Default:

False

min_volume_ratio: float | Literal[False]#

Minimum volume ratio between adjacent cells.

Default:

0

min_face_weight: float | Literal[False]#

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

Default:

0

min_triangle_twist: float | Literal[False]#

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

Default:

False

n_smooth_scale: int#

Number of smoothing iterations. Used in combination with error_reduction.

Default:

4

error_reduction: float#

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

Default:

0.75

zmetric_threshold: float | Literal[False]#

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

Default:

0.8

feature_edge_deduplication_tolerance: float | Literal[False]#

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

Default:

0.2

min_volume_collapse_ratio: float | Literal[False]#

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.

Default:

0

Additional Constructors

classmethod from_file(filename)#

Load a Flow360BaseModel from a .json file.

Parameters:

filename (str)

Return type:

Flow360BaseModel

Methods

help(methods=False)#

Print fields and methods of a Flow360BaseModel using rich.

Parameters:

methods (bool)

Return type:

None

to_file(filename, **kwargs)#

Export Flow360BaseModel instance to a .json file.

Parameters:
Return type:

None