snappy.QualityMetrics#

class QualityMetrics#

Bases: Flow360BaseModel

Mesh quality control parameters for snappyHexMesh meshing process.

Attributes

max_non_orthogonality: AngleType.Positive | 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 * degree

max_boundary_skewness: AngleType.Positive | Literal[False]#

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

Default:

20 * degree

max_internal_skewness: AngleType.Positive | Literal[False]#

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

Default:

50 * degree

max_concavity: AngleType.Positive | Literal[False]#

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

Default:

50 * 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: AreaType.Positive | 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)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')