Wheel (3d)¶
rollover.three_d.wheel.substructure¶
Create a wheel super element
Create a 2-d wheel section mesh using abaqus cae
Based on this mesh, generate an input file for a full 3d-wheel
Run the input file to obtain the substructure stiffness matrix
-
rollover.three_d.wheel.substructure.generate(wheel_param)[source]¶ Create the wheel substructure for a 3d wheel and return the job object. The job is not submitted.
- Parameters
wheel_param (dict) – The model containing the wheel part. The dictionary should contain arguments to
generate_2d_mesh(), except wheel_model. It should also contain wheel_angles, seecreate_retained_set().- Returns
The job object, allowing submission of job or writing to input file if desired.
- Return type
Job object (Abaqus)
-
rollover.three_d.wheel.substructure.get_wheel_angles(mesh_angles, wheel_angles)[source]¶ Get the limits, wheel_angles, such that an element is not split
- Parameters
mesh_angles (np.array) – Division of circumferential mesh elements in [0, 2*pi)
wheel_angles (list[ float ]) – Lower and upper bound for wheel angle to be retained.
- Returns
The adjusted wheel angles to avoid splitting an element.
- Return type
list[ float ]
-
rollover.three_d.wheel.substructure.generate_2d_mesh(wheel_model, wheel_profile, mesh_sizes, wheel_contact_pos, partition_line, fine_mesh_edge_bb=None, quadratic_order=True)[source]¶ Generate a mesh of the wheel profile.
- Parameters
wheel_model (Model object (Abaqus)) – The model containing the wheel part
wheel_profile (str) – Path to an Abaqus sketch profile saved as .sat file (acis)
mesh_sizes (list[ float ] (len=2)) – Mesh sizes, mesh_sizes[0]=fine mesh in contact, mesh_sizes[1] coarse mesh
wheel_contact_pos (list[ float ] (len=2)) – min and max x-coordinate for the wheel contact region (retained dofs)
partition_line – y-value for the line where the wheel profile will be partitioned to give a better mesh value.
fine_mesh_edge_bb (dict) – Dictionary with bounding box parameters for determining which edges the fine mesh should be applied to. Keys are ‘xMin’, ‘yMax’, etc. If None, set h = partition_line*(1+1.e-6) and set ‘yMax’ to h if partition_line < 0 or ‘yMin’ to h if partition_line > 0. The adjustment ensures that the partition line is not included amongst the fine mesh edges.
quadratic_order (bool) – Should quadratic elements be used, default is True
- Returns
Bounding box for the generated mesh, given by points with keys ‘low’ and ‘high’ and a list of coordinates for the contact nodes.
- Return type
None
-
rollover.three_d.wheel.substructure.generate_3d_mesh(wheel_model, mesh_sizes)[source]¶ Given a wheel_model containing a meshed planar 3d wheel section (in the xy-plane with y the radial direction), create a 3d revolved mesh.
- Parameters
wheel_model (Model object (Abaqus)) – The model containing the wheel part
mesh_sizes (list[ float ] (len=2)) – Mesh sizes, mesh_sizes[0]=fine mesh in contact, mesh_sizes[1] coarse mesh
- Returns
None
- Return type
None
-
rollover.three_d.wheel.substructure.create_retained_set(wheel_part, wheel_angles, contact_2d_nodes)[source]¶ Create a set for the retained dofs
The wheel part should have a 3d-revolved mesh. This function will create a node set with the nodes at positions corresponding to contact_2d_nodes that are within the angular interval specified by wheel_angles.
- Parameters
wheel_part (Part object (Abaqus)) – The wheel part containing the orphan 3d mesh
wheel_angles (list[ float ] (len=2)) – Interval of angles (wrt. negative y-direction, positive rotation around x-axis) for retained nodes
contact_2d_nodes (list[ list[ float ] ]) – List of coordinates in the xy-plane (negative y) describing which node positions to retain in the 3d-mesh.
- Returns
None
- Return type
None
-
rollover.three_d.wheel.substructure.get_nodes_in_ang_int(wheel_part, wheel_angles, x0, considered_nodes=None)[source]¶ Get the nodes that are within the interval specified by wheel_angles that are revolved from coordinate x0
- Parameters
wheel_part (Part object (Abaqus)) – The wheel part containing the orphan 3d mesh
wheel_angles (list[ float ] (len=2)) – Interval of angles (wrt. negative y-direction, positive rotation around x-axis) for retained nodes
x0 (tuple[ float ] (len=3)) – Coordinates of the reference point for revolution
considered_nodes – Which nodes to consider to possible be in the nodes to find. Can be used to speed up, if None all nodes in wheel_part are used.
- Returns
The created set
- Return type
Set object (Abaqus)
-
rollover.three_d.wheel.substructure.create_inner_set(wheel_part, section_bb)[source]¶ Create a set for the nodes on the inner shaft with name names.wheel_inner_set. This function assumes that the inner surface is cylindrical.
- Parameters
wheel_part (Part object (Abaqus)) – The wheel part containing the orphan 3d mesh
section_bb (dict) – The bounding box for the section mesh in the xy-plane. Contains x, y, z coordinates given by keys ‘low’ and ‘high’.
- Returns
None
- Return type
None
rollover.three_d.wheel.three_d_mesh¶
This module is used to generate a 3d mesh based on a 2d section in
the xy-plane that is revolved around the x-axis. Note that only
quadratic elements are supported. For linear elements, Abaqus’ builtin
routine works reasonably well (although the node coordinate accuracy
seem a bit low), see
generate_3d_mesh()
-
rollover.three_d.wheel.three_d_mesh.generate(wheel_model, mesh_size)[source]¶ Based on a meshed 2d-profile of a wheel, generate a 3d-revolved mesh with angular spacing such that the elements on the outer radius have a circumferential size of mesh_size.
- Parameters
wheel_model (Model object (Abaqus)) – A model that contains a wheel part with a 2d section mesh
mesh_size (float) – The mesh size to decide the angular increments
- Returns
The wheel part and the angles for the element end planes
- Type
tuple( Part object(Abaqus), np.array )
-
rollover.three_d.wheel.three_d_mesh.get_2d_mesh(wheel_part)[source]¶ Based on the wheel part, determine the 2d mesh information
- Parameters
wheel_part (Part object (Abaqus)) – The wheel part containing the 2d mesh
- Returns
Mesh specification with the following fields:
nodes: np.array with node coordinates
elements: dictionary with keys according to number of nodes in element: N3,N4,N6,N8. Each item contains a list of list of node labels
edge_nodes: list of labels of nodes that belong to the edges of the elements (and not the corners)
corner_nodes: list of labels of nodes that belong to the corners of the elements.
- Return type
dict
-
rollover.three_d.wheel.three_d_mesh.make_3d_mesh_quad(mesh_2d, mesh_size)[source]¶ Revolve a 2d-mesh into a 3d-mesh
- Parameters
mesh_2d (dict) –
Mesh specification with the following fields:
nodes: np.array with node coordinates
elements: dictionary with keys according to number of nodes in element: N3,N4,N6,N8. Each item contains a list of list of node labels
edge_nodes: list of labels of nodes that belong to the edges of the elements (and not the corners)
corner_nodes: list of labels of nodes that belong to the corners of the elements.
mesh_size (float) – The circumferential mesh size at largest radius
- Returns
Mesh specification with the following fields:
nodes: np.array with node coordinates
elements: dictionary with keys according to number of nodes in element: N15, N20. Each item contains a list of list of node labels
angles: np.array of angles for angular increments of elements.
- Return type
dict
-
rollover.three_d.wheel.three_d_mesh.get_elements(elem_2d_con, angle_inds, corner_node_num_2d, edge_node_num_2d, corner_node_num, edge_ip_node_num, edge_op_node_num)[source]¶ Get the node lists of the revolved elements belonging to a given set of node lists of elements from the 2d mesh.
- Parameters
elem_2d_con (list[ list[ int ] ]) – list of list of 2d nodes for each element
angle_inds (np.array) – indices of angles, counting 0, 1, 2, …, N, 0
corner_node_num_2d (list[ int ]) – node numbers of corner nodes from 2d
edge_node_num_2d (list[ int ]) – node numbers for edge nodes from 2d
corner_node_num (np.array( int )) – array of node numbers for corner nodes in 3d. First index refers to index in corner_node_num_2d and second index to angle_inds
edge_ip_node_num (np.array( int )) – array of node numbers for in-plane nodes in 3d. First index refers to index in edge_node_num_2d and second to angle_inds
edge_op_node_num (np.array( int )) – array of node numbers for out-of-plane nodes in 3d. First index refers to index in corner_node_num_2d and second to angle_inds.
- Returns
list of list containing element node labels for 3d mesh
- Return type
np.array
-
rollover.three_d.wheel.three_d_mesh.rotate_coords(coords, angles)[source]¶ Rotate 2d coords in the xy-plane around the x-axis.
Note
The function supports either a list of coordinates or a list of angles, not both at the same time
- Parameters
coords (np.array) – Coordinates in xy-plane to be rotated. Can also contain z-coordinate, but this is ignored. Can be either a single coordinate, or 2d array. In the latter case, the last index should give the axis, i.e. size [N,2] or [N,3] where N is number of coords
angles (float, int, list, np.array) – List of angles to rotate a single coordinate with.
- Returns
An array of rotated coordinates: [N, 3], where N is number of coordinates, i.e. N=max(len(angles), coords.shape[0])
- Return type
np.array
-
rollover.three_d.wheel.three_d_mesh.save_3d_mesh_to_inp(mesh_3d)[source]¶ Given a specification of the 3d mesh, save this to an input file for use when generating substructure.
- Parameters
mesh_3d (dict) –
Mesh specification with the following fields:
nodes: np.array with node coordinates
elements: dictionary with keys according to number of nodes in element: N15, N20. Each item contains a list of list of node labels
angles: np.array of angles for angular increments of elements.
- Returns
Relative path of input file
- Return type
str
rollover.three_d.wheel.super_element¶
Analyze the results from a wheel substructure and create the necessary data structures to setup the user element.
-
rollover.three_d.wheel.super_element.get_uel_mesh(quadratic_elements=True)[source]¶ Determine the mesh from the substructure simulation. Produces the following files:
names.uel_stiffness_file: The stiffness matrix to be read by the fortran uel subroutine
names.uel_coordinates_file: The coordinates of the contact nodes in the user element.
names.uel_elements_file: The indices of the user element nodes that belong to each element.
-
rollover.three_d.wheel.super_element.get_stiffness(mtx_file)[source]¶ Extracts the stiffness from the mtx file mtx_file, which was generated by an Abaqus substructure generate step.
- Parameters
mtx_file (str) – Name of the mtx file to read the stiffness matrix from.
- Returns
The stiffness matrix
- Return type
np.array
-
rollover.three_d.wheel.super_element.get_mtx_nodes(mtx_file)[source]¶ Extracts the node labels from the mtx file mtx_file, which was generated by an Abaqus substructure generate step. Note, node numbers starts from zero, while node labels starts from 1.
- Parameters
mtx_file (str) – Name of the mtx file to read the node labels matrix from.
- Returns
List with items
Element node index for reference point node (int) (Has to be between 0 and number of nodes in element)
np.array of contact node labels corresponding to the node labels in names.uel_contact_node_labels_file. (These are not restricted to be less than the number of nodes in the element)
- Return type
list
-
rollover.three_d.wheel.super_element.reorder_stiffness(ke_raw, rp_nr)[source]¶ Reorder the stiffness such that the dofs related to the reference point comes first. The order of the remaining nodes is unaffacted.
- Parameters
ke_raw (np.array) – Unordered stiffness matrix
rp_nr (int) – Node number in the element for the reference point
- Returns
Ordered stiffness matrix
- Return type
np.array
-
rollover.three_d.wheel.super_element.get_node_coords(coords_file, labels_file=None, contact_node_labels=None)[source]¶ {TEST} Get coordinates from coords_file with labels according to labels_file. The coordinates are sorted such that the labels match contact_node_labels if this list is present.
- Parameters
coords_file (str) – .npy file containing node coordinates
labels_file (str) – .npy file containing node labels. Required if contact_node_labels is not None.
contact_node_labels (iterable[ int ]) – List of contact node labels that may have a different order than those from the labels_file. The returned coordinate list will be sorted to follow the order of contact_node_labels, if not None. Defaults to None.
- Returns
The coordinates from coords_file, sorted according to contact_node_labels, if it is present.
- Return type
np.array
-
rollover.three_d.wheel.super_element.get_element_connectivity(coords)[source]¶ Knowing that the mesh is revolved around the x-axis and that we only have coordinates of the contact nodes. Create the element connectivity (which nodes belong to which element) for the quoad mesh.
- Parameters
coords (np.array (shape = [npoints, 3])) – List of x,y,z coordinates generated by revolution around the x-axis
- Returns
List of which 4 node indices that belong to each element.
- Return type
list[ list[ int ] ]
-
rollover.three_d.wheel.super_element.get_element_connectivity_quad(coords)[source]¶ Knowing that the mesh is revolved around the x-axis and that we only have coordinates of the contact nodes. Create the element connectivity (which nodes belong to which element) for the quoad mesh.
- Parameters
coords (np.array (shape = [npoints, 3])) – List of x,y,z coordinates generated by revolution around the x-axis
- Returns
List of which 4 node indices that belong to each element.
- Return type
list[ list[ int ] ]
-
rollover.three_d.wheel.super_element.get_mesh_inds(coords)[source]¶ {TEST} Given a list of randomly sorted coordinates coords representing points generated by a revolution pattern from points on a curve in the xy-plane around the x-axis: Determine an index matrix such the indices of the nearest neighbours can be located via the matrix.
- Note
Limitations of the current implementation:
The points on the initial curve must be sufficiently spaced in the x-direction.
A full revolution is not supported and only points crossing the xy-plane with a negative y-coordinate is supported.
- Parameters
coords (np.array (shape = [npoints, 3])) – List of x,y,z coordinates generated by revolution around the x-axis
- Returns
A matrix with indices corresponding to the elements of coords. The first index goes in the positive angular direction around the x-axis, while the second goes in the positive x-direction.
- Return type
list[ list[ int ] ]
-
rollover.three_d.wheel.super_element.get_unique(vector, tol=0)[source]¶ {TEST} Given a vector vector, return a new vector containing only the unique entries in vector. The output is sorted. If a tolerance is given, it represents the maximum difference between two elements considered to be non-unique.
- Parameters
vector (iterable[ float / int ]) – Iterable from which unique values will be identified.
tol (float / int) – Tolerance within which elements of vector should be considered unique, defaults to 0
- Returns
List of unique (within tol) values in vector
- Return type
np.array
-
rollover.three_d.wheel.super_element.find_coord(find_coords, search_coords, tol=1e-06)[source]¶ {TEST} Find the index for the coordinate in search_coords that matches the coordinate find_coords.
- Parameters
find_coords (tuple[ float ]) – Coordinates for the point to find
search_coords (tuple[ np.array ]) – Coordinate lists to be searched through for match. Length of tuple must match find_coords
tol (float / tuple[ float ]) – Tolerance for the found coordinate to be considered a match. If tuple, the length must match find_coords
- Returns
Index of the found coordinate
- Return type
int
-
rollover.three_d.wheel.super_element.save_uel(stiffness, coordinates, elements)[source]¶ Save the stiffness, node coordinates and element connectivity for the user element to be imported. Stiffness will be read by fortran subroutine, while coordinates and elements will be read by abaqus python when setting up the new simulation.
- Parameters
stiffness (np.array) – Stiffness matrix, will be saved to names.uel_stiffness_file
coordinates (np.array) – Node coordinates, will be saved to names.uel_coordinates_file
elements (np.array) – Element connectivity (nodes in coordinates belonging to which element), will be saved to names.uel_elements_file
- Returns
None
- Return type
None