UniformRefinement#

class UniformRefinement[source]#

Bases: Flow360BaseModel

Uniform spacing refinement inside specified region of mesh. For AxisymmetricBody entities, specify per-segment spacing overrides via face_spacing.

Example

>>> fl.UniformRefinement(
...     entities=[cylinder, box, axisymmetric_body, sphere],
...     spacing=1*fl.u.cm,
...     face_spacing={
...         axisymmetric_body.segment(2): 0.2*fl.u.cm,
...     }
... )

Attributes

name: str, optional#
Default:

'Uniform refinement'

entities: EntityList[Box, Cylinder, AxisymmetricBody, Sphere]#

UniformRefinement can be applied to Box, Cylinder, AxisymmetricBody, and Sphere regions.

spacing: Length.PositiveFloat64#

The required refinement spacing.

project_to_surface: bool, optional#

Whether to include the refinement in the surface mesh. Defaults to True when using snappy.

Default:

None

face_spacing: dict[AxisymmetricSegment, Length.PositiveFloat64], optional#

Per-segment spacing overrides for AxisymmetricBody entities. Use body.segment(i) as keys, where segment i is defined between profile_curve[i] and profile_curve[i+1]. Segments without overrides use the default spacing.

Default:

None

Methods

classmethod check_entities_used_with_beta_mesher(values)[source]#

Check that AxisymmetricBody and Sphere are used with beta mesher.

check_annular_cylinder_used_with_beta_mesher()[source]#

Reject a hollow cylinder the legacy volume mesher cannot express.

The legacy mesher builds the refinement region from the outer radius alone and its input schema rejects the key outright, so such a run fails in its first validation step; caught here, at submit, instead.

A refinement that snappy will project to the surface is left to the snappy validator, whose message names snappy. A volume-only refinement (project_to_surface=False) is not snappy’s to check, so it is not exempt. That is why this is a model validator: project_to_surface is declared after entities and a field validator on entities could not see it.

classmethod check_entities_used_with_snappy(values)[source]#

Check that only Box, Cylinder, and Sphere entities are used with snappyHexMesh.

check_project_to_surface_with_snappy()[source]#

Check that project_to_surface is used only with snappy.

check_face_spacing()[source]#

Validate face_spacing keys reference registered AxisymmetricBody entities.