Utilities (3d)

rollover.three_d.utils.contact

Module to setup the rail-wheel contact

rollover.three_d.utils.contact.setup(the_model, contact_stiffness=1000000.0, friction_coefficient=None, elastic_slip_fraction=0.005)[source]

Add a contact property and a surface-to-surface contact in the_model according to the given settings.

Parameters
  • the_model (Model object (Abaqus)) – The model to which the contact settings should be applied

  • contact_stiffness (float) – The stiffness used in the normal penalty formulation.

  • friction_coefficient (float) – The friction coefficient for the tangential behavior. If none, no tangential behavior will be defined and the contact will be frictionless .

  • elastic_slip_fraction (float) – The allowed elastic tangential slip. This will adjust the penalty stiffness for the tangential contact.

Returns

None

Return type

None

rollover.three_d.utils.fil_output

This module is used to control the output to the Abaqus result (.fil) file

Note

Uses direct editing of input and should be called after all cae options have been set.

rollover.three_d.utils.fil_output.add(the_model, num_cycles)[source]

Add .fil output to input file for each rolling step. For the first, add node coordinates and displacements. For the remaining, add only displacements. If rail reference point is used, add node coord and displacements If rail substructure is used, the instance set names change…

Parameters
  • the_model (Model object (Abaqus)) – The model to which the output is to be added

  • num_cycles (int) – Number of rollover cycles to simulate

rollover.three_d.utils.fil_output.add_to_step(kwb, varstr, step_name, rail_rp=None, use_substr=False)[source]

Add output specified to given step.

Parameters
  • kwb (KeywordBlock object (Abaqus)) – The keyword block that can be used to edit input file directly.

  • varstr (str) – The string specifying which variables to add to output

  • step_name (str) – The name of the step to which output should be added/modified

  • rail_rp (str) – The name of the rail reference point set

  • use_substr (bool) – Is a rail substructure used?

rollover.three_d.utils.fil_output.get_node_file_output_str(nset, varstr, frequency=99999999)[source]

Get the string to add to the input file.

Parameters
  • nset (str) – Name of node set from which output should be output

  • varstr (str) – comma separated list of variables to output

  • frequency (int) – How often to write output (increments)

Returns

The string to add

Return type

str

rollover.three_d.utils.loading

rollover.three_d.utils.loading.setup(the_model, rolling_length, rolling_radius, vertical_load, cycles=[1], speed=1.0, slip=0.0, rail_ext=0.0, num_cycles=1, initial_depression=0.1, inbetween_step_time=1e-06, inbetween_max_incr=100, max_incr=1000, min_incr=100)[source]

Setup the loading for the rollover simulation

“cycle data type”: If value is scalar, the same value will be

applied to all cycles. If list, it should have the same length as cycles, and the value will be applied from the corresponding cycle and onwards.

Parameters
  • the_model (Model object (Abaqus)) – The model to which the contact settings should be applied

  • rolling_length (float) – The length the wheel shall roll (not accounting for rail extensions)

  • rolling_radius (float) – The rolling radius used to calculate wheel rotation as function of slip.

  • vertical_load (float / list[ float ]) – Vertical wheel load. See “cycle data type”.

  • cycles (list[ int ]) – List of cycle numbers where new load parameters are specified.

  • speed (float / list[ float ]) – The linear speed of the wheel. See “cycle data type”.

  • slip (float / list[ float ]) – The slip ratio of the rolling. See “cycle data type”.

  • rail_ext (float / list[ float ]) – The rail extension length. See “cycle data type”.

  • num_cycles (int) – Number of rollover cycles

  • initial_depression (float) – The amount to lower the wheel (in y-dir) before changing to load control.

  • inbetween_step_time (float) – The step time used for initial depression, first load application, moving back step, reapplication of load, and release of node steps.

  • inbetween_max_incr (int) – Max number of increments for steps for which inbetween_step_time applies

  • max_incr (int) – Max number of increments during the rolling step

  • min_incr (int) – Min number of increments during the rolling step

Returns

Number of cycles used

Return type

int

rollover.three_d.utils.loading.write_loading_file(initial_depression_speed, rolling_length, rolling_radius, cycles, load, speed, slip, rail_ext)[source]

Write the loading file, names.loading_file, used by the user subroutine DISP.

Parameters
  • initial_depression_speed (float) – The speed at which the wheel is lowered during the initial depression step

  • rolling_length (float) – The length the wheel shall roll (not accounting for rail extensions)

  • rolling_radius (float) – The rolling radius used to calculate wheel rotation as function of slip.

  • cycles (list[ int ]) – List of cycle numbers where new load parameters are specified.

  • load (list[ float ]) – List of vertical wheel loads for each cycle in cycles.

  • speed (list[ float ]) – List of linear wheel speeds for each cycle in cycles.

  • slip (float / list[ float ]) – List of wheel slips for each cycle in cycles.

  • rail_ext (list[ float ]) – List of rail extension length for each cycle in cycles.

Returns

None

Return type

None

rollover.three_d.utils.loading.get_cycle_data(cycle_nr, cycles, cycle_data)[source]

Given a list of cycle data, give the relevant data for cycle_nr

Parameters
  • cycle_nr (int) – The cycle number for which the cycle data should be extracted

  • cycles (list[ int ]) – List of cycles for which the items in cycle data are specified for.

  • cycle_data (list[ list [float/int] ]) –

    List of cycle data.

    Each cycle data is a list with the same length as cycles.

Returns

A list containing the items in each list in cycle data on the position i in cycle_nr before cycle_nr < cycles[i]

Return type

list[ float/int ]

rollover.three_d.utils.loading.setup_step(the_model, name, prev_name, step_time, min_num, max_num, amp=step.RAMP)[source]

Setup a new step.

Parameters
  • the_model (Model object (Abaqus)) – The model for which the step should be set up

  • name (str) – The name of the step

  • prev_name (str) – The name of the previous step

  • step_time (float) – The total time duration of the step

  • min_num (int) – The minimum number of increments to take

  • max_num (int) – The maximum number of increments to take

  • amp (int (Abaqus constant)) – Which amplitude type to use, defaults to ramping

rollover.three_d.utils.loading.make_sym_sets(the_model)[source]

Based on the contact node set and the symmetric node set, create 2 new sets:

  • One set that contains all nodes in the contact node set, except those that also are in the symmetric node set

  • One set that contains the nodes in both the contact node set and the symmetric node set.

Parameters

the_model (Model object (Abaqus)) – The model containing the rail part with the sets initial sets and to which the new sets are added

Returns

A list of the created sets, see list above. The sets belong to the rail instance.

Return type

list[ Set object (Abaqus) ]

rollover.three_d.utils.mesh_tools

This module contains functions that helps when working with meshes

rollover.three_d.utils.mesh_tools.get_source_region(source_face)[source]

Create a “surface-like” region, source_region, of elements on source_face

Parameters

source_face (Face (Abaqus object)) – A meshed face

Returns

The “surface-like” region describing the meshed surface

Return type

Region (Abaqus object)

rollover.three_d.utils.mesh_tools.get_elem_by_face_type(source_face, elems=None)[source]

Get a dictionary with each elements of each face type, e.g. face1Elements, face2Elements etc. (up to face6Elements) as keys.

Parameters
  • source_face (Face (Abaqus object)) – A meshed face

  • elems (dict) – The dictionary to return, will add to it if not None

Returns

Dictionary keys as described above, containing MeshElement objects

Return type

dict

rollover.three_d.utils.mesh_tools.create_offset_mesh(the_part, source_face, source_region, offset_distance=20.0)[source]

Create an offsetted orphan mesh

Parameters
  • the_part (Part (Abaqus object)) – The part

  • source_face (Face (Abaqus object)) – The meshed face whose mesh will be offset

  • source_region (Region (Abaqus object)) – A “surface-like” mesh region describing the face whose mesh will be offset

  • offset_distance (float, optional) – The distance to offset the mesh by, defaults to 20.0

Returns

(shadow_elems, offset_vector)

  • shadow_elems: The created offsetted orphan elements

  • offset_vector: The vector with which the elements where offsetted

Return type

tuple(MeshElementArray (Abaqus object), np.array)

rollover.three_d.utils.mesh_tools.convert_bounding_box(bb_from_get)[source]

Convert bounding box specified by by {‘low’: (x_min, y_min, z_min), ‘high’: (x_max, y_max, z_max)} to {‘xMin’: x_min, ‘yMin’: y_min, …, ‘zMax’: z_max}

Input typically comes from Abaqus’ function getBoundingBox. Output, bb_to_get_by, can be used in Abaqus’ function getByBoundingBox as getByBoundingBox(**bb_to_get_by) (i.e. using kwargs)

Parameters

bb_from_get – Dictionary describing a bounding box by points ‘low’ and ‘high’

Returns

Dictionary describing a bounding box by values ‘xMin’, ‘xMax’, ‘yMin’, …, ‘zMax’

Return type

dict

rollover.three_d.utils.odb_output

This module is used to control the output to the Abaqus result (.fil) file

Note

Uses direct editing of input and should be called after all cae options have been set.

rollover.three_d.utils.odb_output.add(the_model, field_output_requests, num_cycles)[source]

Add the user specified field output requests. Default outputs are deleted.

Parameters
  • the_model (Model object (Abaqus)) – The model to which the output requests will be added

  • field_output_requests (dict) –

    A dictionary with field output request specifications. Each field should be a dictionary containing the following fields:

    • set: Which set the output applies

      to. Refers to sets in the rail instance, except special sets:

      • ’FULL_MODEL’: The entire model

      • ’WHEEL_RP’: Wheel ctrl point

    • var: List of variables to save,

      e.g. (‘U’, ‘S’)

    • freq: How often to output during step. I.e. every incr=1. Set to -1 for only last increment.

    • cycle: How often to output cycles, i.e. 1 implies every cycle, 10 implies every 10th cycle, etc.

Returns

None

Return type

None

rollover.three_d.utils.sketch_tools

Tools to work with sketches

rollover.three_d.utils.sketch_tools.import_sketch(the_model, sketch_profile, name='profile')[source]

Import the sketch sketch_profile and add it to the_model.

Parameters
  • the_model (Model (Abaqus object)) – The model to which the sketch will be added

  • sketch_profile (str) – Path to an Abaqus sketch profile saved as .sat file (acis)

  • name (str) – Name of the created sketch, defaults to ‘profile’

Returns

The added sketch

Return type

ConstrainedSketch (Abaqus object)

rollover.three_d.utils.symmetric_mesh_module

rollover.three_d.utils.symmetric_mesh_module.make_periodic_meshes(the_part, source_sets, target_sets)[source]

Ensure that meshes are the same on the paired face sets on the_part. Given an already meshed part, the_part: For each set source_set and target_set in source_sets and target_sets, apply the mesh on the faces described by source_set to the faces described by target_set. The mesh on the remaining of the part is removed and only the faces described by the sets in source_sets and target_sets will have meshes.

Parameters
  • the_part (Part (Abaqus object)) – The part to be meshed

  • source_sets (list(Set (Abaqus object))) – Sets containing faces from which meshes will be copied to target_sets

  • target_sets (list(Set (Abaqus object))) – Sets containing faces to which meshes from source_sets will be copied

Returns

None

Return type

None

rollover.three_d.utils.symmetric_mesh_module.create_shadow_mesh(the_part, source_set)[source]

Create an offsetted 2d-planar mesh for each face in source_set

Parameters
  • the_part (Part (Abaqus object)) – The part to be meshed

  • source_set – Set containing faces from which a copy of the meshes will be offsetted

Returns

(shadow_regions, ref_points_s)

  • shadow_regions: List of sets containing the offsetted mesh corresponding to each face in source_set.faces

  • ref_points_s: List of lists containing 3 points on edges of the offsetted face. The coordinates are described by numpy arrays with x, y, z coordinates.

Return type

tuple(list(Set (Abaqus object)), list(list(np.array)))

rollover.three_d.utils.symmetric_mesh_module.getref_points(the_part, source_face, offset_vector)[source]

Get reference points on the mesh on source_face offsetted by offset_vector

The points are located on the edges of source_face.

Parameters
  • the_part (Part (Abaqus object)) – The part to be meshed

  • source_face (Face (Abaqus object)) – A meshed face

Returns

List of three reference points described by numpy arrays with x, y, z coordinates

Return type

list(np.array)

rollover.three_d.utils.symmetric_mesh_module.order_target_sets_faces(source_sets, target_sets)[source]

Determine the order of faces in each set in target_sets corresponding to the face order in each set in the corresponding set in source_sets. See also order_target_set_faces for description of how each set is handled.

Parameters
  • source_sets (list(Set (Abaqus object))) – A list of sets that contain faces

  • target_sets (list(Set (Abaqus object))) – A list of sets (containing faces) that corresponds to the sets in source_sets. The faces must have equal geometry as those in the sets in source_sets and be translated only in the face’s normal directions.

Returns

A list of lists containing the order of faces in target_sets corresponding to source_sets.

Return type

list(list(int))

rollover.three_d.utils.symmetric_mesh_module.order_target_set_faces(source_set, target_set)[source]

Determine the order of faces in target_set corresponding to the face order source_set. See find_matching_face for how a matching face is determined.

Parameters
  • source_set – A set containing faces

  • target_set – A set containing faces that corresponds to the faces in source_set. The faces must have equal geometry to the faces in source_set and be translated only in the face’s normal directions. See find_matching_face for details on how a corresponding face is determined.

Returns

A list containing the order of faces in target_set corresponding to source_set.

Return type

list(list(int))

rollover.three_d.utils.symmetric_mesh_module.find_matching_face(the_face, search_faces, offset_vector)[source]

Determine the face in search_faces that is equal to the_face but offset by offset_vector. A matching face is determined by having the same

  • Area (Relative tolerance 1e-6)

  • Centroid (norm(Error)/(sqrt(Area)+norm(centroid)) < 1e-6)

  • Bounding_box (norm(Error)/(norm(offset_vector)) < 1e-3). This is calculated from the nodes, hence the larger tolerance

Parameters
  • the_face (Face (Abaqus object)) – The face that we want to find a match for in search_faces. The face must be meshed.

  • search_faces (list(Face (Abaqus object))) – A list of faces from which we seek a match to the_face. The faces must be meshed.

  • offset_vector (np.array) – The with which the search_faces are offset from the_face

Returns

A list containing the order of faces in target_set corresponding to source_set.

Return type

list(list(int))

rollover.three_d.utils.symmetric_mesh_module.add_mesh_to_faces(the_part, face_set, add_regions, ref_points_s, face_order=None)[source]

Add offsetted orphan meshes specified by add_regions to the faces in face_set

Parameters
  • the_part (Part (Abaqus object)) – The part

  • face_set (Set (Abaqus object)) – The set containing faces that we want to add the orphan meshes to

  • add_regions (list(Set (Abaqus object))) – list of sets containing the orphan meshes to be added

  • ref_points_s (list(list(np.array))) – List of lists containing 3 points on edges of the faces containing the offsetted orphan mesh. The points are described by numpy arrays with x, y, and z coordinates.

  • face_order (list(int)) – List of indices of faces in face_set such that the order corresponds to the order in add_regions. If none, the order is unaltered., defaults to None

Returns

None

Return type

None

rollover.three_d.utils.symmetric_mesh_module.add_mesh_to_face(the_part, to_face, add_region, ref_points)[source]

Add an offsetted orphan mesh specified by add_region to the face to_face in face_set

Parameters
  • the_part (Part (Abaqus object)) – The part

  • to_face – The face that we want to add the orphan mesh to

  • add_region (Set (Abaqus object)) – Set containing the orphan mesh to be added

  • ref_points (list(np.array)) – List containing 3 points on edges of the face with the offsetted orphan mesh. The points are described by numpy arrays with x, y, and z coordinates.

Returns

None

Return type

None

rollover.three_d.utils.symmetric_mesh_module.get_copy_nodes_and_coord(to_face, add_region, ref_points)[source]

Find the nodes in the orphan mesh described by add_region corresponding to the coordinates in ref_points. Also return the coordinates of the corresponding points on the face to_face.

Parameters
  • to_face – The face on which we want the coordinates

  • add_region (Set (Abaqus object)) – Set containing the orphan mesh whose node corresponding to ref_points should be found.

  • ref_points (list(np.array)) – List containing 3 points on edges of the face with the offsetted orphan mesh. The points are described by numpy arrays with x, y, and z coordinates.

Returns

(add_ref_nodes, face_point_coords)

  • add_ref_nodes: list of nodes at the coordinates specified by ref_points

  • face_point_coords: list of points on to_face corresponding to the nodes in add_ref_nodes

Return type

tuple(list(Node (Abaqus object)), list(np.array))

rollover.three_d.utils.symmetric_mesh_module.get_offset_vector(to_face, add_region)[source]

Find the vector from add_region to to_face which is normal to to_face

Parameters
  • to_face – A face

  • add_region (Set (Abaqus object)) – Set describing a face containing an orphan mesh

Returns

A vector from add_region to to_face which is normal to to_face.

Return type

np.array

rollover.three_d.utils.symmetric_mesh_module.get_ref_nodes(add_region, ref_points)[source]

Find the nodes in add_region corresponding to ref_points.

Parameters
  • add_region (Set (Abaqus object)) – Set describing a face containing an orphan mesh (or any other object containing list of Node (Abaqus object) accessible via add_region.nodes

  • ref_points (list(np.array)) – List of points where we shall locate nodes.

Returns

A list of nodes with coordinates corresponding to ref_points

Return type

list(Node (Abaqus object))