Model.cleanup_unoffsetable_nodes#
- Model.cleanup_unoffsetable_nodes(collection, angle_threshold, layers, iters)#
Smooths the area around any unoffsetable nodes to attempt to make them offsetable. Useful for CFD BL meshing.
Consider a node and all its surrounding elements. The visibility angle of an element is the signed angle between the node normal and the element normal after subtracting 90 degrees. The visibility angle of the node is the minimum of the element visibility angle for all surrounding elements. The best visibility angle of the node is the maximum of the node visibility angle for all choices on the node normal. A node having zero or negative best visibility angle is considered absolutely unoffsetable. A node having its best visibility angle less than
angle_thresholdis considered unoffsetable.- Parameters:
collection (Collection) – The collection containing the input entities. Valid entities are components and elements.
angle_threshold (double) – A value ≥ 0.0 and < 45.0 that defines the threshold visibility angle in degrees for determining a node is unoffsetable.
layers (int) – Defines the number of adjacent layers to consider for the smoothing. Must be ≥ 1. A value between 1 and 3 is generally recommended.
iters (int) – The number of smoothing iterations to perform. Must be ≥ 1. A value between 1 and 5 is generally recommended.
Example#
Fix unofsettable nodes for elements with IDs 10-13, using an angle of 2.5, using 2 layers and 3 smoothing iterations#import hm import hm.entities as ent model = hm.Model() model.cleanup_unoffsetable_nodes( collection=hm.Collection(model, ent.Element, [10, 11, 12, 13]), angle_threshold=2.5, layers=2, iters=3, )