Model.detectandcreateface2facecontacts#
- Model.detectandcreateface2facecontacts(collection, tolerance, reverse_angle, use_shell_thickness, consolidate_surfaces, run_intersection_check, contact_type, main_entity_type, secondary_entity_type, property_option, contact_property_id, static_friction_value, contact_material_id, contact_main_sensor_id, contact_secondary_sensor_id, skip_preview, consider_self, thickness_type, thickness_value, friction_direction, set_name_prefix, csurf_name_prefix, include_whole_components, copy_tolerance_to_contact, numExtraMainLayers, featureAngleForLayers)#
Detects if the specified components are within the contact distance specified and creates contact entities relevant to the solver interface.
The current solver template is used as an implicit input.
The output contact entities are created specific to a supported solver. For example, in it will create contact surfaces and groups whereas in it will create groups with card images.
This is supported for ANSYS, OptiStruct, Nastran (MSC), and ADVC.
- Parameters:
collection (Collection) – The collection containing the entities to search for contact within the specified distance. Valid entities are components and elements.
tolerance (double) – A non-zero search distance specified as the vicinity within which the contact is to be detected by executing the penetration collision logic. Components spaced greater than the vicinity tolerance are not considered to be in contact.
reverse_angle (double) – The angle value used to compute the extent of the contact surface. This parameter is used in detecting the span of a convex contact surface on non-planar surfaces.
use_shell_thickness (unsigned int) – A flag to use element thickness values specified on shell elements as the search distance. When this flag is specified as 1, then tolerance is ignored or can be 0.
consolidate_surfaces (unsigned int) – After the contact is detected, contact surfaces are created. Those contact surfaces can be on different topological locations (discontinuous) on the base component that is in contact with that particular target component. When set as 0, a contact surface for each discontinuous patch is created and updated in the contact group. If set as 1, then only 1 contact surface is created for all the discontinuous patches.
run_intersection_check (unsigned int) –
Before a contact is detected and established using the penetration algorithm, the user has the option to execute the intersection check between any two components for the same input parameters of
toleranceandreverse_angleby setting this as 1. Intersection is detected even if one element on the source component physically intersects an element on the target component. In such cases the contact surface normal is not uniquely defined for those intersecting elements.When this is 0, the intersection check is not executed. However, the contact will be detected and contact surfaces will be created, but the resulting contact surface normal may not be desirable.
contact_type (unsigned int) –
The type of contact to create. The following values are supported:
Solver
Value
Type
OptiStruct
0
contact
1
Tie
Nastran (NX)
0
BCTSET
1
BGSET
ADVC
0
Not specified
1
Tying
2
ShearTying
3
SmallSliding
4
FiniteSliding
5
NotSliding
main_entity_type (unsigned int) –
The main entity type. The following values are supported:
Solver
Value
Type
OptiStruct
0 (default)
SET_ELEM
1
SURF
secondary_entity_type (unsigned int) –
The secondary entity type. The following values are supported:
Solver
contact_type
Value
Type
OptiStruct
all
0
SET_GRID
1
SET_ELEM
2
SURF
property_option (unsigned int) –
The property option. The following values are supported:
Solver
contact_type
Value
Type
ANSYS
N/A
0
Existing property ID is used
1
Infer sensors and auto-generate properties
OptiStruct
0 (Contact)
0
SLIDE
1
STICK
2
FREEZE
Nastran (MSC)
N/A
<prop_id>
Geometric contact property ID (BCGPIC)
contact_property_id (unsigned int) –
On creation of contact pairs, some of the interfaces have attributes to select property ID as the input. When this argument is specified with an ID, and if it exists, it is attached to the contact pair. For non-relevant interfaces this will be ignored.
Note that this argument supersedes
property_optionandstatic_friction_value, except for ANSYS. In ANSYS, ifproperty_optionis specified, thencontact_property_idis ignored.In this is the physical contact property (BCPPID).
This is relevant for ANSYS, Nastran, Nastran (NX), and OptiStruct.
For the ADVC interface, a contact pair can be assigned with friction ID. When this argument is specified with friction ID (as an integer), and if it exists, it is attached to the generated contact pair.
static_friction_value (double) –
The value for the static friction coefficient. This is superseded by
contact_property_idandproperty_optionarguments. Ifcontact_property_id,property_option argumentsandstatic_friction_valueare all specified,contact_property_idtakes precedence. Ifproperty_optionandstatic_friction_valueare both specified,property_optiontakes precedence. In both cases, the friction value is adjusted internally to a negative number to establish precedence and thus will be ignored.This is only relevant for OptiStruct.
contact_material_id (unsigned int) –
On creation of contact pairs, some of the interfaces have attributes to select material ID as the input. When this argument is specified with such an ID, and if it exists, it is attached to the contact pair. For non-relevant interfaces this will be ignored.
This is only relevant for ANSYS.
contact_main_sensor_id (unsigned int) –
On creation of contact pairs, some of the interfaces have attributes to select main sensor ID as the input. When this argument is specified with such an ID, and if it exists, it is attached to the contact pair. For non-relevant interfaces this will be ignored. In ANSYS,
property_optionis ignored when specified along with this option.This is only relevant for ANSYS.
contact_secondary_sensor_id (unsigned int) –
On creation of contact pairs, some of the interfaces have attributes to select secondary sensor ID as the input. When this argument is specified with such an ID, and if it exists, it is attached to the contact pair. For non-relevant interfaces this will be ignored. In ANSYS,
property_optionis ignored when specified along with this option.This is only relevant for ANSYS.
skip_preview (unsigned int) – After creation of contact entities, when specified as 0, all the newly created contact entities are considered to be “under review” and their export flag is turned off. If you choose to confirm all the auto-contact created entities and have their export flag turned on, this should be 1 or 2. When specified as 1, a confirmation dialog box with the entities list is also skipped.
consider_self (unsigned int) – Consider elements in the same component for creation of contacts. By default (0), elements within the same components are not considered for the creation of contacts. If a single component is selected as input, this should be set to 1.
thickness_type (unsigned int) –
The parameter defining the interpretation of
thickness_value.0 -
thickness_valuewill be added to the thicknesses of shell elements. (default)1 -
thickness_valuespecifies a multiplication factor for shell elements.thickness_value (double) – Based on the
thickness_typevalue, this is either an add-on value or a multiplication factor for shell thicknesses during proximity detection.friction_direction (hwString) –
The value of parameter friction on the created $CONTACT cards.
This is only relevant for Permas.
set_name_prefix (hwString) –
The optional prefix string for created Set entities.
This is only relevant for OptiStruct, Radioss, LS-DYNA, Nastran, Permas, and ADVC.
csurf_name_prefix (hwString) –
The optional prefix string for the created contact surface entities.
This is only relevant for OptiStruct, Radioss, Abaqus, and LS-DYNA.
include_whole_components (unsigned int) –
0 - Only the elements detected during the proximity check are included in the created contact surfaces (default).
1 - The contact surfaces will include entire components even if only a few elements of the component are detected during the proximity check.
This is only relevant for Abaqus.
copy_tolerance_to_contact (unsigned int) –
Copies the tolerance value specified by the user to a relevant search distance parameter on the created group entity. By default (0), no value is copied to the createdgroup entity. When specified as 1, the specified tolerance value is copied to the following parameter on the created group entity:
Solver
Group Parameter
OptiStruct
SRCHDIS
numExtraMainLayers (unsigned int) –
Applicable only to Abaqus. Defines the number of extra face or element layers to add to the main surfaces. This ensures that the main surfaces are larger than their corresponding secondary surfaces.
If set to 0 (default), no extra face or element layers are added to the main surfaces.
The extra face or element layers are terminated at feature edges defined by
featureAngleForLayers.featureAngleForLayers (double) –
Applicable only to Abaqus. Specifies the angle in degrees that defines feature edges when adding extra face or element layers to the main surfaces, that is, when
numExtraMainLayers > 0.If less than 0, extra layers of faces or elements are not terminated at any feature edges and
numExtraMainLayersof faces or elements are simply added to the main surfaces.
Examples#
Detect contacts between all components in the model by use tolerance of 1.o and reverse angl of 15.0 degrees#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements to be detached components_collection = hm.Collection(model, ent.Component) model.detectandcreateface2facecontacts( collection=components_collection, tolerance=1.0, reverse_angle=15.0 )
Create contacts between components by use shell thickness and consolidate surfaces#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements to be detached components_collection = hm.Collection(model, ent.Component) model.detectandcreateface2facecontacts( collection=components_collection, tolerance=0, reverse_angle=15.0, use_shell_thickness=1, )
Create contacts in ANSYS with property with ID 1 , material with ID 2 , main and secondary sensor with IDs ( 3,4 respectively ) specified#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements to be detached components_collection = hm.Collection(model, ent.Component) model.detectandcreateface2facecontacts( collection=components_collection, tolerance=1.0, reverse_angle=15.0, thickness_type=0, use_shell_thickness=0, consolidate_surfaces=1, run_intersection_check=0, contact_type=0, main_entity_type=0, secondary_entity_type=0, property_option=1, contact_property_id=0, contact_material_id=2, contact_main_sensor_id=3, contact_secondary_sensor_id=4, )
Run an intersection check and create contact entities in OptiStruct with main entity type as SURF(1 ) and secondary entity type as SURF(2 ) with static friction coefficient as 0.18#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements to be detached components_collection = hm.Collection(model, ent.Component) model.detectandcreateface2facecontacts( collection=components_collection, tolerance=5.0, reverse_angle=15.0, use_shell_thickness=0, consolidate_surfaces=1, run_intersection_check=1, contact_type=0, main_entity_type=1, secondary_entity_type=2, property_option=0, contact_property_id=0, static_friction_value=0.18, )
Run intersection check and create contact entities in OptiStruct with main entity type as SET OF ELEMENTS(0 ) and secondary entity type as SET OF NODES(1 ) with property option as STICK(1 )#import hm import hm.entities as ent model = hm.Model() # Creating a collection that contains the elements to be detached components_collection = hm.Collection(model, ent.Component) model.detectandcreateface2facecontacts( collection=components_collection, tolerance=5.0, reverse_angle=15.0, use_shell_thickness=0, consolidate_surfaces=1, run_intersection_check=1, contact_type=0, main_entity_type=0, secondary_entity_type=1, property_option=1, )