Processing method for automatically defining riveting connection of passenger car aluminum body based on HyperMesh
By automatically defining riveting connections in HyperMesh and automatically creating rivet hole axes and rigid elements using functions and commands, the complex riveting connection problem in the finite element analysis of passenger vehicles is solved, and an efficient preprocessing workflow is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the preprocessing stage of finite element analysis for passenger vehicles, especially the definition of riveting connections, is complicated and lengthy, resulting in low efficiency and making it impossible to quickly establish 3,000 to 4,000 rivet connections on the vehicle body.
By utilizing the functions provided by HyperMesh to automatically obtain the center point and plane normal of the circular hole, and combining the TCL and TK commands, the rivet hole axis and rigid element are automatically created. Multiple rivet connections are processed through loop statements, and over-constrained elements are deleted, forming an automated processing method.
It improves the efficiency of the preprocessing stage, reduces repetitive operations, shortens modeling time, enhances the efficiency of engineers, and reduces the probability of errors.
Smart Images

Figure FDA0005741537390000041 
Figure FDA0005741537390000042 
Figure FDA0005741537390000043
Abstract
Description
Technical Field
[0001] This invention belongs to the field of finite element simulation technology for passenger vehicles, and relates to a preprocessing method for quickly and automatically establishing riveting connections of the vehicle body, specifically a processing method for automatically defining riveting connections of aluminum body of passenger vehicles based on HyperMesh. Background Technology
[0002] Finite element analysis (FEM) of passenger vehicles is a technique that uses mathematical approximations to analyze the mechanical properties of passenger vehicle structures. The analysis process mainly includes a pre-processing stage, a solution stage, and a post-processing stage. In existing finite element analysis of passenger vehicles, the pre-processing stage accounts for a large proportion of the time, especially in stiffness-strength finite element analysis, where the pre-processing time can sometimes reach 60% to 80% of the entire analysis process. Therefore, how to improve the efficiency of the pre-processing stage is an urgent problem to be solved.
[0003] In the finite element analysis of passenger vehicles, preprocessing includes steps such as mesh generation, material definition, property definition, and connection definition. Currently, the preprocessing software HyperMesh has significantly improved the efficiency of simulation engineers in steps such as mesh generation, material definition, and property definition. However, due to the numerous types of connections between components in passenger vehicle finite element simulation, and the different methods used by each company to define connections in finite element analysis, existing technologies lack a function to automatically and quickly establish the 3000-4000 rivet connections on the vehicle body when engineers use the rigid element (RBE2 element) in the Optistruct solver to simulate the riveting connection between profiles and connecting pieces. This makes the entire preprocessing process complex and lengthy. Summary of the Invention
[0004] The main objective of this invention is to provide a method for automatically defining riveting connections of aluminum bus bodies based on HyperMesh. This method can automatically create 3,000 to 4,000 RBE2 elements in HyperMesh to replace the riveting connections, check whether the degrees of freedom of these rigid elements meet the calculation requirements, and remove over-constrained RBE2 elements.
[0005] The technical solution of this invention:
[0006] A method for automatically defining riveting connections for aluminum bus bodies based on HyperMesh includes the following steps:
[0007] P1. Import the bus body geometry model;
[0008] P2. Divide the grid according to the analysis specifications;
[0009] P3. Select the connecting surfaces based on material and purpose;
[0010] P4. Establish the axis of the rivet hole;
[0011] P5. Establish rigid units for rivet connections;
[0012] P6. Delete the rigid elements that have been constrained.
[0013] Preferably, establishing the rivet hole axis as described in P4 includes:
[0014] P41. Obtain the center of the plane hole and the normal of the plane containing the hole;
[0015] P42. Establish a straight line based on the center of the circle, the normal, and the length of the line segment.
[0016] Previously, creating a circular hole center in Hypermesh required selecting three points on the hole's edge to create a single center. For scenarios requiring multiple centers, this involved selecting each point on the hole's edge individually. The same applied to creating the plane normal. To improve efficiency, this application utilizes functions provided by Hypermesh to automatically obtain the coordinates of the circular hole center point and the plane normal.
[0017] The main idea of this application is to obtain the center point information and plane normal information of the circular hole, and output the information to a text file using a loop statement.
[0018] The main implementation process is as follows:
[0019] Step 1: Use commands to create a text file named "holes.txt";
[0020] Step 2: In the HyperMesh graphical interface, use the corresponding command to select the two-dimensional plane from which you want to extract hole information;
[0021] Step 3: Use the hm_holedetectionfindholes command to obtain information about the holes in the two-dimensional plane obtained in Step 2;
[0022] Step 4: Use a command to obtain the number of holes and assign the number to the variable n;
[0023] Step 5: Determine if n is greater than 0;
[0024] Step 6: If step 5 is true, use a while loop to iterate through the output hole information into "holes.txt"; if step 5 is false, terminate the program.
[0025] Step 7: Save the text file "holes.txt" using the close command.
[0026] Previously, creating a single line in Hypermesh required selecting a starting point, extension vector, and line length. For scenarios requiring multiple lines, each point had to be selected individually, and the extension vector and line length had to be specified. To improve efficiency, this method uses the TCl and TK commands to take the user-input length as the line segment length, and uses the coordinates of the center point and the plane normal vector stored in a file to replace manual selection. It then automatically creates multiple lines using a loop.
[0027] The main implementation process is as follows:
[0028] Step 1: Use frames to create the window's frame;
[0029] Step 2: Create a label using the text "LINE LENGTH";
[0030] Step 3: Create an input box using the entry field, allowing the user to input the length of the line segment;
[0031] Step 4: Create a button using the `button` property and run the window commands;
[0032] Step 5: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the length of the line.
[0033] Step 6: Use the open command to read the text file "holes.txt";
[0034] Step 7: Use a while loop to iterate through the text file "holes.txt", get the string of each line, and assign the string to the variable lines;
[0035] Step 8: Use the split command to split the variable lines and assign the split string to the variable fields;
[0036] Step 9: Use the lindex command to get the string at index 6 of the variable fields, and assign the string to the variable node1_x;
[0037] Step 10: Use the lindex command to get the string at index 7 of the field variable and assign the string to the variable node1_y;
[0038] Step 11: Use the lindex command to get the string at index 8 of the variable fields, and assign the string to the variable node1_z;
[0039] Step 12: Use the lindex command to get the string at index 9 of the field variable and assign that string to the variable axis1_x;
[0040] Step 13: Use the lindex command to get the string at index 10 of the variable fields, and assign the string to the variable axis1_y;
[0041] Step 14: Use the lindex command to get the string at index 11 of the variable fields, and assign the string to the variable axis1_z;
[0042] Step 15: Record the node number using the hm_entityrecorder command;
[0043] Step 16: Use the *createnode command to create the center node, with node space coordinates of node1_x, node1_y, node1_z;
[0044] Step 17: Use the hm_entityrecorder nodes ids command to obtain the node IDs and assign the node IDs to the variable nodes_ids;
[0045] Step 18: Use the *createvector command to create a vector with spatial coordinates axis1_x, axis1_y, and axis1_z;
[0046] Step 19: Use the *linecreatedragnodealongvector command to create a straight line as the axis of the hole.
[0047] Previously, when creating rigid elements in Hypermesh, creating a single rigid element required selecting profile nodes and connecting plate nodes based on the riveting radius. For creating thousands of rigid elements, repeatedly selecting nodes was not only tedious but also prone to errors. To improve efficiency, this method uses the TCl and TK commands to take the user-input length as the riveting radius and extension line length, uses the axis established above to construct a cylindrical space, selects the nodes in the space one by one as the slave points of the rigid element, and uses a loop statement to automatically create multiple rigid elements.
[0048] The main implementation process is as follows:
[0049] Step 1: Use frames to create the window's frame;
[0050] Step 2: Create labels using the text "Base radius" and "Extension distance";
[0051] Step 3: Create an input box using the entry field, allowing the user to input the riveting radius and extension line length;
[0052] Step 4: Create a button using the `button` property and run the window commands;
[0053] Step 5: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the riveting radius and extension line length.
[0054] Step 6: In the Hypermesh graphical interface, use the corresponding command to select the line generated in claim 5;
[0055] Step 7: Use the hm_getmark command to retrieve the line from Step 6, and assign the line number to the variable line_list;
[0056] Step 8: Use the foreach command to iterate through the list line_list;
[0057] Step 9: Use the hm_getlinestartpoint command to obtain the starting point information of the line; and assign the information to the variable list_start;
[0058] Step 10: Use the lindex command to get the string at index 0 of the variable list_start, and assign that string to the variable x;
[0059] Step 11: Use the lindex command to get the string at index 1 of the variable list_start, and assign the string to the variable y;
[0060] Step 12: Use the lindex command to get the string at index 2 of the variable list_start, and assign the string to the variable z;
[0061] Step 13: Use the hm_getlineendpoint command to obtain the endpoint information of the line; and assign the information to the variable list_end.
[0062] Step 14: Use the lindex command to get the string at index 0 of the variable list_end, and assign that string to the variable i;
[0063] Step 15: Use the lindex command to get the string at index 1 of the variable list_end, and assign the string to the variable j;
[0064] Step 16: Use the lindex command to get the string at index 2 of the variable list_end, and assign the string to the variable k;
[0065] Step 17: Starting from (x,y,z) and ending at (i,j,k), calculate the line using the formula for a straight line in space. Perform the calculation and assign the length value to the variable d;
[0066] Step 18: Based on variables x, i, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to x1;
[0067] Step 19: Based on variables y, j, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to y1;
[0068] Step 20: Based on variables z, k, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to z1;
[0069] Step 21: Based on variables x, i, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to x2;
[0070] Step 22: Based on variables y, j, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to y2;
[0071] Step 23: Based on variables z, k, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to z2;
[0072] Step 24: Starting from (x1, y1, z1) and ending at (x2, y2, z2), calculate the line using the formula for a straight line in space. Perform the calculation and assign the result to the variable h;
[0073] Step 25: Using x1, y1, z1, x2, y2, z3, h, and Base radius as parameters from the previous steps, select nodes using the "by cylinder" method in the *createmark command, and use the catch command to catch exceptions, skipping cases where no nodes are caught.
[0074] Step 26: Use the *rigidlinkinodecalandcreate command to create rigid elements with the nodes selected in step 25.
[0075] Preferably, in the processing method for automatically defining body riveting connections based on HyperMesh of the present invention, step P6, which involves deleting over-constrained rigid elements, includes:
[0076] P61 Deletes over-constrained elements based on repeating axes;
[0077] P62 removes constrained cells based on the number of points.
[0078] Previously, when deleting over-constrained elements in Hypermesh, the Hypermesh inspection function could filter out all over-constrained elements. However, due to the need to simulate rivets, these elements cannot all be deleted. Instead, one element from the over-constrained elements at the same location should be retained. The causes of over-constraint errors should be summarized, and the TCL command should be used to traverse the master and slave points of all over-constrained elements to find the elements that need to be deleted and the elements that need to be retained.
[0079] To address the over-constraint problem caused by multiple axes, the main idea of this invention is to search for rigid elements whose principal point is another element's slave point. Based on this principle, all over-constrained elements are classified, and finally, redundant elements are deleted using a loop statement.
[0080] The main implementation process is as follows:
[0081] Step 1: In the Hypermesh graphical interface, use the corresponding command to select rigid elements of type rigidlink. These rigid elements have the problem of over-constraint.
[0082] Step 2: Use the hm_getmark command to retrieve the cells from Step 1 and assign these cells to the variable elems_list;
[0083] Step 3: Create an empty list named delete_elems using the command;
[0084] Step 4: Use the foreach command to iterate through the list elems_list;
[0085] Step 5: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_1;
[0086] Step 6: In the current loop, use the foreach command to traverse the list elems_list;
[0087] Step 7: Use the hm_getvalue command to obtain the list of principal points of the rigid element in the current cycle, and assign the list of principal points to the variable master_elem_2;
[0088] Step 8: Use the lsearch command to search for whether master_elem_2 exists in slave_elem_1, and assign the search result to variable a_1;
[0089] Step 9: Determine if a_1 is less than 0;
[0090] Step 10: If step 9 is true, use the lappend command to add the current loop element to the delete_elems list; if step 9 is false, use the continue command to proceed to the next loop.
[0091] Step 11: Use the foreach command to iterate through the list delete_elems;
[0092] Step 12: Use *createmark to select the unit in the current loop;
[0093] Step 13: Use the *deletemark command to delete the unit in the current loop.
[0094] To address the over-constraint problem with varying numbers of slave points, the main idea of this invention is to retrieve the number of slave points for all over-constrained units, classify all over-constrained units based on this principle, and finally use loop statements to delete redundant units.
[0095] The main implementation process is as follows:
[0096] Step 1: In the Hypermesh graphical interface, use the corresponding command to select rigid elements of type rigidlink. These rigid elements have the problem of over-constraint.
[0097] Step 2: Use the hm_getmark command to retrieve the cells from Step 1 and assign these cells to the variable elems_list;
[0098] Step 3: Create an empty list named delete_elems using the command;
[0099] Step 4: Use the foreach command to iterate through the list elems_list;
[0100] Step 5: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_1;
[0101] Step 5: Create a dictionary dict_1 using commands;
[0102] Step 6: Use the foreach command to iterate through the list of slaves_elem_1;
[0103] Step 7: Use commands to construct key-value pairs where the key is the dot number and the value is 1;
[0104] Step 8: Create an empty list elem_1_bro using the command;
[0105] Step 9: Use the lappend command to add the current cell to the list elem_1_bro;
[0106] Step 10: In the current loop, use the foreach command to traverse the list elems_list;
[0107] Step 11: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_2;
[0108] Step 12: In the current loop, use the foreach command to traverse the set of points slaves_elem_2;
[0109] Step 13: Use the `dict exists` command to filter and determine whether `dict_1` contains a node in `slaves_elem_2`, and assign the result to the variable `a_1`.
[0110] Step 14: Determine if a_1 is less than 0;
[0111] Step 15: If step 14 is true, use the lappend command to append the current cell to the list elem_1_bro;
[0112] Step 16: Exit the current loop using the break command;
[0113] Step 15: Use the llength command to list the length of elem_1_bro and assign the length to the variable length_1;
[0114] Step 16: Determine if length_1 is greater than 1;
[0115] Step 17: If step 16 is true, use the command to define the maximum value max_1 as 0;
[0116] Step 18: Use the foreach command to iterate through the list elem_1_bro;
[0117] Step 19: Use the hm_getvalue command to get the list of slave points of the current loop unit and assign the value to the variable slaves_elem_3;
[0118] Step 20: Use the llength command to get the length of the list slaves_elem_3, and assign the length to the variable length_2;
[0119] Step 21: Use a command to determine the size of variables length_2 and max_1; if variable length_2 is greater than variable max_1, then assign the value of variable length_2 to variable max_1;
[0120] Step 22: Use the foreach command to iterate through the list elem_1_bro;
[0121] Step 23: Use the hm_getvalue command to get the list of slave points of the current loop unit and assign the value to the variable slaves_elem_3;
[0122] Step 24: Use the llength command to get the length of the list slaves_elem_3, and assign the length to the variable length_2;
[0123] Step 25: Use the command to determine the size of variables length_2 and max_1; if variable length_2 is less than variable max_1, use the lappend command to add the current loop cell to the list delete_elems;
[0124] Step 26: Use the foreach command to iterate through the list delete_elems;
[0125] Step 27: Use *createmark to select the cell in the current loop;
[0126] Step 28: Use the *deletemark command to delete the cell in the current loop.
[0127] Meanwhile, this invention also provides steps and methods for finite element engineers to perform riveting connections on aluminum bus bodies, and transforms these methods into executable programs in the HyperMesh command window. By configuring the HyperMesh user file, engineers can quickly call these methods during project applications.
[0128] The beneficial effects of this invention are as follows: This invention utilizes functions provided by Hypermesh to automatically obtain the coordinates of the center point of the circular hole and the coordinates of the plane normal vector. It uses the TCl and TK commands to take the user-inputted length as the line segment length, and uses the center point coordinates and plane normal vector coordinates already stored in the file to replace manual selection. Multiple straight lines are automatically created through loop statements. The TCl and TK commands are used to take the user-inputted length as the riveting radius and extension line length. A cylindrical space is constructed using the established axis. Nodes within the space are selected one at a time as the slave points of rigid elements, and multiple rigid elements are automatically created using loop statements. This shortens the modeling time for defining the body rivet connection, reduces the workload of repetitive tasks, and improves work efficiency. Attached Figure Description
[0129] Figure 1 This is a flowchart illustrating the design steps of an embodiment of the present invention;
[0130] Figure 2 This is the program interface in the embodiments of the present invention;
[0131] Figure 3 This is the geometric model in the embodiments of the present invention;
[0132] Figure 4 This refers to the establishment of an axis model in an embodiment of the present invention;
[0133] Figure 5 This is for establishing a rigid element model in the embodiments of the present invention. Detailed Implementation
[0134] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0135] Example
[0136] like Figure 1 As shown, this embodiment is a method for automatically defining riveting connections of aluminum bus bodies based on HyperMesh, and takes the side panels and roof of a certain model of all-aluminum body as the processing objects. It includes the following steps:
[0137] 1. Import the bus body geometry model.
[0138] 2. Divide the grid according to the analysis specifications.
[0139] 3. Select the connecting surfaces based on material and purpose.
[0140] IV. Establish the axis of the rivet holes.
[0141] (1) Obtain the center of the plane hole and the normal to the plane containing the hole:
[0142] Step 1: Use the command `set holesfile[open "E: / TEMP / holes.txt""w"]` to create a text file;
[0143] Step 2: Use the *createmark surfs 1displayed command to select the face from which you want to extract hole information;
[0144] Step 3: Use the hm_holedetectionfindholes 1 command to obtain information about the planar holes;
[0145] Step 4: Use the command `set n[hm_holedetectiongetnumberofholes]` to get the number of holes;
[0146] Step 5: Determine if n is greater than 0;
[0147] Step 6: If step 5 is true, use puts$holesfile"i=$i[hm_holedetectiongetholedetails$i] to traverse and output the hole information to a text file;
[0148] Step 7: Save the text file using the close$holesfile command.
[0149] (2) Obtain the center of the plane hole and the normal to the plane containing the hole:
[0150] Step 1: Use the command `set file2[open "E: / TEMP / holes.txt""r"]` to read the text file;
[0151] Step 2: Use the `while{[gets$file2lines]!=-1}` command to iterate through the text file;
[0152] Step 3: Use the `set fields[split$lines]` command to split the information lines;
[0153] Step 4: Use the commands set node1_x[lindex$fields 6], set node1_y[lindex$fields7], and set node1_z[lindex$node1_z 0] to obtain the spatial coordinates of the center point;
[0154] Step 5: Use the commands `set axis1_x[lindex$fields 9]`, `set axis1_y[lindex$fields 10]`, and `set axis1_z[lindex$fields 11]` to obtain the spatial coordinates of the vector;
[0155] Step 6: Record the node numbers using the command hm_entityrecorder nodes on;
[0156] Step 7: Use the command *createnode$node1_x$node1_y$node1_z 000 to create the center node;
[0157] Step 8: Use the command `set nodes_ids[hm_entityrecorder nodes ids]` to get the node IDs;
[0158] Step 9: Use the command *createvector 1$axis1_x$axis1_y$axis1_z to create a vector;
[0159] Step 10: Use *linecreatedragnodealongvector nodes 11$line_length to create a straight line;
[0160] Step 11: Create the window's frame using frames;
[0161] Step 12: Create a label using the text "LINE LENGTH";
[0162] Step 13: Create an input box using the entry field, allowing the user to input the line segment length;
[0163] Step 14: Create a button using the button object and run the window commands;
[0164] Step 11: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the length of the line.
[0165] 5. Establish rigid units for rivet connections.
[0166] Step 1: Select the axis lines using the *createmarkpanel lines 1 command;
[0167] Step 2: Use the command `set line_list[hm_getmark lines 1]` to create a list of lines;
[0168] Step 3: Use the foreach center_line$line_list command to iterate through the line list;
[0169] Step 4: Use the command `set list_start[hm_getlinestartpoint$center_line]` to obtain the starting point information of the line;
[0170] Step 5: Use the commands set x[lindex$list_start 0], set y[lindex$list_start 1], and set z[lindex$list_start 2] to obtain the spatial coordinates of the starting point of the line;
[0171] Step 6: Use the command `set list_end[hm_getlineendpoint$center_line]` to obtain the endpoint information of the line;
[0172] Step 7: Use the commands set i[lindex$list_end 0], set j[lindex$list_end 1], and set k[lindex$list_end 2] to obtain the endpoint information of the line;
[0173] Step 8: Use the command `set d[expr{sqrt(($i-$x)**2+($j-$y)**2+($k-$z)**2)}]` to get the length of the line;
[0174] Step 9: Use x1[expr$x-$::extension_distance*($i-$x) / $d], set y1[expr$y-$::extension_distance*($j-$y) / $d], set z1[expr
[0175] $z-$::extension_distance*($k-$z) / $d],set x2[expr
[0176] $i+$::extension_distance*($i-$x) / $d],set y2[expr
[0177] $j+$::extension_distance*($j-$y) / $d],set z2[expr
[0178] The command $k+$::extension_distance*($k-$z) / $d] obtains the new starting and ending coordinates;
[0179] Step 10: Use set h[expr
[0180] The command {sqrt(($x2-$x1)**2+($y2-$y1)**2+($z2-$z1)**2)}] calculates the length of the extension line;
[0181] Step 11: Use the command *createmark nodes 1"by cylinder"$x1$y1$z1$x2$y2$z2$::base_radius$h inside 100 to select nodes, and use the catch command to catch exceptions, skipping cases where no nodes are selected;
[0182] Step 11: Create a rigid element using the command *rigidlinkinodecalandcreate 100123456;
[0183] Step 12: Use frames to create the window's frame;
[0184] Step 13: Create labels using the text "Base radius" and "Extension distance";
[0185] Step 14: Create an input box using the entry field, allowing the user to input the riveting radius and extension line length;
[0186] Step 15: Create a button using the button object and run the window commands;
[0187] Step 16: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the riveting radius and extension line length.
[0188] 6. Delete rigid elements that have been constrained.
[0189] (1) Delete constrained elements based on repeating axes:
[0190] Step 1: Use the command *createmarkpanel elems 1 to select rigid elements of type rigidlink;
[0191] Step 2: Use the command `set elems_list[hm_getmark elems 1]` to create a list of cells;
[0192] Step 3: Use the `set delete_elems{}` command to create an empty list;
[0193] Step 4: Use the foreach elem_1$elems_list command to iterate through the cell list;
[0194] Step 5: Use `set slave_elem_1[hm_getvalue elems id=$elem_1]`
[0195] The command `dataname=dependentnodes]` records data from the set of nodes;
[0196] Step 6: Use the foreach elem_2$elems_list command to iterate through the cell list;
[0197] Step 7: Use the command `set master_elem_2[hm_getvalue elems id=$elem_2dataname=independentnode]` to record the master node set;
[0198] Step 8: Use the command `set a_1[lsearch$slave_elem_1$master_elem_2]` to search for whether the master point of a rigid element is a slave point of another rigid element;
[0199] Step 9: Use the command `lappend delete_elems$elem_1` to add elements whose principal point is another rigid element and whose slave point is the corresponding list;
[0200] Step 10: Use the foreach elem$delete_elems command to iterate through the list of cells;
[0201] Step 11: Delete the cells using the commands *createmark elements 1$elem, *deletemark elements 1.
[0202] (2) Delete constrained elements based on the number of points:
[0203] Step 1: Use the command *createmarkpanel elems 1 to select rigid elements of type rigidlink;
[0204] Step 2: Use the command `set elems_list[hm_getmark elems 1]` to create a list of cells;
[0205] Step 3: Use the `set delete_elems{}` command to create an empty list;
[0206] Step 4: Use the foreach elem_1$elems_list command to iterate through the cell list;
[0207] Step 5: Use the command `set slaves_elem_1[hm_getvalue elems id=$elem_1dataname=dependentnodes]` to record the slave node set;
[0208] Step 5: Create a dictionary using the command `set dict_1 [dict create]`;
[0209] Step 6: Use the foreach item$slaves_elem_1 command to traverse the set of points;
[0210] Step 7: Use the command `dict set dict_1$item 1` to construct a dictionary starting from the dot number - 1;
[0211] Step 8: Create an empty list using the `set elem_1_bro{}` command;
[0212] Step 9: Add cells to the list using the command `lappend elem_1_bro$elem_1`;
[0213] Step 10: Iterate through the list using the foreach elem_2$elems_list command;
[0214] Step 11: Use the command `set slaves_elem_2[hm_getvalue elems id=$elem_2dataname=dependentnodes]` to record the slave node set;
[0215] Step 12: Use the command foreach item1$slaves_elem_2 to iterate through the set of points;
[0216] Step 13: Use the command `dict exists$dict_1$item1` to filter cells that intersect with the given point. If there is no intersection, proceed to the next loop.
[0217] Step 14: Add cells to the list using the command `lappend elem_1_bro$elem_2`;
[0218] Step 15: Use the command `set length_1[llength$elem_1_bro]` to record the list length;
[0219] Step 16: Use the if{$length_1>1} command to filter the set of cells that intersect with the points;
[0220] Step 17: Define the maximum value using the `set max_10` command.
[0221] Step 18: Iterate through the list using the foreach item2$elem_1_bro command;
[0222] Step 19: Use the command `set slaves_elem_3[hm_getvalue elems id=$item2dataname=dependentnodes]` to record the slave node set;
[0223] Step 20: Use the command `set length_2[llength$slaves_elem_3]` to record the length of the list;
[0224] Step 21: Use the command `if{$length_2>$max_1}{set max_1$length_2}` to get the maximum number of points;
[0225] Step 22: Iterate through the list using the foreach item2$elem_1_bro command;
[0226] Step 23: Use the command `set slaves_elem_3[hm_getvalue elems id=$item2dataname=dependentnodes]` to record the slave node set;
[0227] Step 24: Use the command `set length_2[llength$slaves_elem_3]` to record the length of the point list;
[0228] Step 25: Add cells to the list using the command if{$length_2<$max_1}{lappend delete_elems$item2};
[0229] Step 26: Use the foreach elem$delete_elems command to iterate through the list of cells;
[0230] Step 27: Delete the cells using the commands *createmark elements 1$elem, *deletemark elements 1.
[0231] This invention utilizes the TCL and TK languages within the HyperMesh interface for secondary development, forming a complete method for defining riveting connections on the aluminum body of passenger buses. This invention can automatically define the riveting connections between body profiles and connecting pieces, and adds automated processing methods to the pre- and post-processing stages of defining riveting connections, improving the efficiency of engineers in this part of the work. Using this method, engineers can complete the definition of 3000-4000 riveting connections on the body within a day, shortening the modeling time for defining body riveting connections, reducing the intensity of repetitive work, and improving work efficiency. This invention uses TCL commands to traverse the principal and secondary points of all constrained elements, thereby identifying elements that need to be deleted and those that need to be retained, reducing the probability of modeling errors by engineers.
[0232] The above descriptions are merely some embodiments of the present invention. For those skilled in the art, various modifications and improvements can be made without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A method for automatically defining riveting connections for aluminum bus bodies based on HyperMesh, characterized in that: Includes the following steps: P1. Import the bus body geometry model; P2. Divide the grid according to the analysis specifications; P3. Select the connecting surfaces based on material and purpose; P4. Establish the axis of the rivet hole; P5. Establish rigid units for rivet connections; P6. Delete over-constrained rigid elements; The step P4 establishes the rivet hole axis, including: P41, obtaining the center of the planar hole and the normal of the plane containing the hole; P42, establishing a straight line based on the center, normal, and line segment length; Step P5 establishes a rigid unit for the rivet connection, including: obtaining the start and end points of the straight line, calculating the new start and end points of the straight line, establishing a rigid unit, and finally encapsulating the above commands into a function and establishing a TK interface to allow the user to input the riveting radius and extension line length. Step P6, which involves deleting over-constrained rigid elements, includes: P61 deleting over-constrained elements based on repeating axes; and P62 deleting over-constrained elements based on the number of points.
2. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 1, characterized in that: Step P41 involves obtaining the center of the planar hole and the normal of the plane containing the hole, including creating a text file, detecting the information of the planar hole, obtaining the number of circular holes, and outputting the hole information to the text file.
3. The processing method for automatically defining riveting connections of aluminum bus bodies based on HyperMesh according to claim 2, characterized in that: Step P41, which involves obtaining the center of the planar hole and the normal to the plane containing the hole, specifically includes: Step 1: Use commands to create a text file named "holes.txt"; Step 2: In the HyperMesh graphical interface, use the corresponding command to select the two-dimensional plane from which you want to extract hole information; Step 3: Use the hm_holedetectionfindholes command to obtain information about the holes in the two-dimensional plane obtained in Step 2; Step 4: Use a command to obtain the number of holes and assign the number to the variable n; Step 5: Determine if n is greater than 0; Step 6: If step 5 is true, use a while loop to iterate through the output hole information into "holes.txt"; if step 5 is false, terminate the program. Step 7: Save the text file "holes.txt" using the close command.
4. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 1, characterized in that: In step P42, a straight line is established based on the center, normal, and line segment length. This includes reading a text file, establishing the center point of the plane hole, establishing a vector, establishing a straight line, and finally encapsulating the above commands into a function and establishing a TK interface for the user to input the line segment length.
5. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 4, characterized in that: Step P42, which establishes a straight line based on the center, normal, and segment length, specifically includes: Step 1: Use frames to create the window's frame; Step 2: Create a label using the text "LINE LENGTH"; Step 3: Create an input box using the entry field, allowing the user to input the line segment length; Step 4: Create a button using the button object and run the window commands; Step 5: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the length of the line. Step 6: Use the open command to read the text file "holes.txt"; Step 7: Use a while loop to iterate through the text file "holes.txt", get the string of each line, and assign the string to the variable lines; Step 8: Use the split command to split the variable lines and assign the split string to the variable fields; Step 9: Use the lindex command to get the string at index 6 of the variable fields, and assign the string to the variable node1_x; Step 10: Use the lindex command to get the string at index 7 of the variable fields, and assign the string to the variable node1_y; Step 11: Use the lindex command to get the string at index 8 of the variable fields, and assign the string to the variable node1_z; Step 12: Use the lindex command to get the string at index 9 of the field variable and assign that string to the variable axis1_x; Step 13: Use the lindex command to get the string at index 10 of the variable fields, and assign the string to the variable axis1_y; Step 14: Use the lindex command to get the string at index 11 of the variable fields, and assign the string to the variable axis1_z; Step 15: Record the node number using the hm_entityrecorder command; Step 16: Use the *createnode command to create the center node, with node space coordinates of node1_x, node1_y, node1_z; Step 17: Use the hm_entityrecorder nodes ids command to obtain the node IDs and assign the node IDs to the variable nodes_ids; Step 18: Use the *createvector command to create a vector with spatial coordinates axis1_x, axis1_y, and axis1_z; Step 19: Use the *linecreatedragnodealongvector command to create a straight line as the axis of the hole.
6. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 1, characterized in that: Step P5 establishes the rigid unit of the rivet connection, specifically including: Step 1: Use frames to create the window's frame; Step 2: Create labels using the text "Base radius" and "Extension distance"; Step 3: Create an input box using the entry field, allowing the user to input the riveting radius and extension line length; Step 4: Create a button using the button object and run the window commands; Step 5: Use the pack command to pack the frame, label, entry, and button into the TK interface so that the user can input the riveting radius and extension line length; Step 6: In the Hypermesh graphical interface, use the corresponding command to select the line generated in claim 5; Step 7: Use the hm_getmark command to retrieve the line from Step 6, and assign the line number to the variable line_list; Step 8: Use the foreach command to iterate through the list line_list; Step 9: Use the hm_getlinestartpoint command to obtain the starting point information of the line; and assign the information to the variable list_start; Step 10: Use the lindex command to get the string at index 0 of the variable list_start, and assign that string to the variable x; Step 11: Use the lindex command to get the string at index 1 of the variable list_start, and assign the string to the variable y; Step 12: Use the lindex command to get the string at index 2 of the variable list_start, and assign the string to the variable z; Step 13: Use the hm_getlineendpoint command to obtain the endpoint information of the line; and assign the information to the variable list_end; Step 14: Use the lindex command to get the string at index 0 of the variable list_end, and assign that string to the variable i; Step 15: Use the lindex command to get the string at index 1 of the variable list_end, and assign the string to the variable j; Step 16: Use the lindex command to get the string at index 2 of the variable list_end, and assign the string to the variable k; Step 17: Starting from (x, y, z) and ending at (i, j, k), calculate the line using the formula for a straight line in space. Perform the calculation and assign the length value to the variable d; Step 18: Based on variables x, i, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to x1; Step 19: Based on variables y, j, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to y1; Step 20: Based on variables z, k, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to z1; Step 21: Based on variables x, i, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to x2; Step 22: Based on variables y, j, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to y2; Step 23: Based on variables z, k, d, and the user-input extension_distance variable, calculate using the formula... Perform the calculation and assign the result to z2; Step 24: Starting from (x1, y1, z1) and ending at (x2, y2, z2), calculate the line using the formula for a straight line in space. Perform the calculation and assign the result to the variable h; Step 25: Using x1, y1, z1, x2, y2, z3, h, and Base radius as parameters from the above steps, select nodes using the "by cylinder" method in the *createmark command, and use the catch command to catch exceptions, skipping cases where no nodes are caught. Step 26: Use the *rigidlinkinodecalandcreate command to create rigid elements with the nodes selected in step 25.
7. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 1, characterized in that: In step P61, deleting constrained elements based on repeating axes includes recording all slave points of the rigid element, recording all master points of the rigid element, filtering rigid elements whose master points appear in the slave point set, and deleting these elements.
8. The processing method for automatically defining riveting connections of aluminum bus bodies based on HyperMesh as described in claim 7, characterized in that: The step P61, which involves deleting constrained elements based on repeating axes, specifically includes: Step 1: In the Hypermesh graphical interface, use the corresponding command to select rigid elements of type rigidlink. These rigid elements have the problem of over-constraint. Step 2: Use the hm_getmark command to obtain the cells described in Step 1, and assign these cells to the variable elems_list; Step 3: Create an empty list named delete_elems using the command; Step 4: Use the foreach command to iterate through the list elems_list; Step 5: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_1; Step 6: In the current loop, use the foreach command to traverse the list elems_list; Step 7: Use the hm_getvalue command to obtain the list of principal points of the rigid element in the current cycle, and assign the list of principal points to the variable master_elem_2; Step 8: Use the lsearch command to search for whether master_elem_2 exists in slave_elem_1, and assign the search result to variable a_1; Step 9: Determine if a_1 is less than 0; Step 10: If step 9 is true, use the lappend command to add the current loop element to the list delete_elems; if step 9 is false, use the continue command to proceed to the next loop. Step 11: Use the foreach command to iterate through the list delete_elems; Step 12: Use *createmark to select the unit in the current loop; Step 13: Use the *deletemark command to delete the unit in the current loop.
9. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 1, characterized in that: In step P62, the constrained elements are deleted based on the number of slave points. This includes recording all slave points of the rigid element, filtering elements with overlapping slave points, finding the element with the most slave points among these elements, and deleting the remaining elements.
10. The processing method for automatically defining riveting connections of bus aluminum bodies based on HyperMesh as described in claim 9, characterized in that: The step P62, which involves deleting constrained cells based on the number of points, specifically includes: Step 1: In the Hypermesh graphical interface, use the corresponding command to select rigid elements of type rigidlink. These rigid elements have the problem of over-constraint. Step 2: Use the hm_getmark command to obtain the cells described in Step 1, and assign these cells to the variable elems_list; Step 3: Create an empty list named delete_elems using the command; Step 4: Use the foreach command to iterate through the list elems_list; Step 5: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_1; Step 5: Create a dictionary dict_1 using commands; Step 6: Use the foreach command to iterate through the list of slaves_elem_1; Step 7: Use commands to construct key-value pairs where the key is the dot number and the value is 1; Step 8: Create an empty list elem_1_bro using the command; Step 9: Use the lappend command to add the current cell to the list elem_1_bro; Step 10: In the current loop, use the foreach command to traverse the list elems_list; Step 11: Use the hm_getvalue command to obtain the slave point list of the rigid element in the current cycle, and assign the slave point list to the variable slave_elem_2; Step 12: In the current loop, use the foreach command to traverse the set of points slaves_elem_2; Step 13: Use the `dict exists` command to filter and determine whether `dict_1` contains a node in `slaves_elem_2`, and assign the result to the variable `a_1`. Step 14: Determine if a_1 is less than 0; Step 15: If step 14 is true, use the lappend command to append the current cell to the list elem_1_bro; Step 16: Exit the current loop using the break command; Step 15: Use the llength command to list the length of elem_1_bro and assign the length to the variable length_1; Step 16: Determine if length_1 is greater than 1; Step 17: If step 16 is true, use the command to define the maximum value max_1 as 0; Step 18: Use the foreach command to iterate through the list elem_1_bro; Step 19: Use the hm_getvalue command to get the list of slave points of the current loop unit and assign the value to the variable slaves_elem_3; Step 20: Use the llength command to get the length of the list slaves_elem_3, and assign the length to the variable length_2; Step 21: Use a command to determine the size of variables length_2 and max_1: If variable length_2 is greater than variable max_1, then assign the value of variable length_2 to variable max_1; Step 22: Use the foreach command to iterate through the list elem_1_bro; Step 23: Use the hm_getvalue command to get the list of slave points of the current loop unit and assign the value to the variable slaves_elem_3; Step 24: Use the llength command to get the length of the list slaves_elem_3, and assign the length to the variable length_2; Step 25: Use the command to determine the size of variables length_2 and max_1: If variable length_2 is less than variable max_1, use the lappend command to add the current loop cell to the list delete_elems; Step 26: Use the foreach command to iterate through the list delete_elems; Step 27: Use *createmark to select the cell in the current loop; Step 28: Use the *deletemark command to delete the cell in the current loop.