rose.pre_process package

Submodules

rose.pre_process.default_trains module

class rose.pre_process.default_trains.TrainType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

BR189 = 8
CARGO_FALNS5 = 4
CARGO_SGNS = 5
CARGO_TAPPS = 6
DOUBLEDEKKER = 0
ICM = 3
SPRINTER_SGM = 2
SPRINTER_SLT = 1
TRAXX = 7
rose.pre_process.default_trains.build_cargo_train(time: ndarray, velocities: ndarray, start_coord: float, locomotive_type: TrainType, wagon_type: TrainType, nb_locomotives=1, nb_wagons=1)

Builds a cargo train model with locomotives and wagons

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • locomotive – type of locomotive

  • wagon – type of wagon

  • nb_locomotives – number of locomotives (default 1)

  • nb_wagons – number of wagons (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_br189_locomotive(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the Traxx locomotive

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_cargo_FALNS5_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the Dutch cargo train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_cargo_SGNS_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the Dutch cargo train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_cargo_TAPPS_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the Dutch cargo train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_double_dekker_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the dutch double dekker

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_icm_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the ICM train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_sprinter_sgm_train(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the dutch local sprinter train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_sprinter_slt_train(time, velocities, start_coord, nb_carts=2)

Sets a train model with the default parameters for the Dutch local sprinter train

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_train(time: ndarray, velocities: ndarray, start_coord: float, train_type: TrainType, nb_carts: int = 1)

Sets a default train according to the TrainType

Parameters:
  • time – all time steps

  • velocities – velocities of the train per time step

  • start_coord – initial coordinate of the middle of the cart

  • train_type – type of train

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.set_traxx_locomotive(time, velocities, start_coord, nb_carts=1)

Sets a train model with the default parameters for the Traxx locomotive

Parameters:
  • time – all time steps

  • velocities – velocity of the train

  • start_coord – initial coordinate of the cart

  • nb_carts – number of carts (default 1)

Returns:

TrainModel

rose.pre_process.default_trains.train_class_to_dict(train_class: TrainModel)

Function used in the dashboard to convert a train class to a dictionary

Parameters:

train_class – TrainModel

Returns:

train_dict

rose.pre_process.mesh_utils module

rose.pre_process.mesh_utils.add_no_displacement_boundary_to_bottom(bottom_model_part: ElementModelPart)

Adds constraint boundary condition to the bottom nodes of a model part :param bottom_model_part: element model part where the constrain boundary condition is applied to. :return:

rose.pre_process.mesh_utils.add_semi_rigid_hinge_at_x(rail_model_part, hinge_model_part, x_coordinate_hinge, mesh)

Adds a semi rigid hinge to the rail at a certain x coordinate. As a result, the rail model part is split in 4 parts. The elements before the hinge, the two elements connected to the hinge, and the elements after the hinge.

Parameters:
  • rail_model_part – original rail model part

  • hinge_model_part – hinge model part

  • x_coordinate_hinge – x coordinate of the hinge

  • hinge_stiffness – stiffness of the hinge

  • mesh – sorted mesh of system

Returns:

rose.pre_process.mesh_utils.calculate_cum_distances_coordinate_array(coordinates)
rose.pre_process.mesh_utils.combine_horizontal_tracks(tracks: List[Dict[str, ElementModelPart]], meshes: List[Mesh])

Combines multiple horizontal track parts. This function takes a list of tracks and connects the track parts to a model. The tracks in the list need to be ordered from left to right. Coordinates of the track parts are automatically recalculated.

This function assumes horizontal tracks over the x-axis

Parameters:
  • tracks – Ordered list of dictionaries of model parts belonging to a horizontal track part

  • meshes – list of meshes belonging to the track parts

Returns:

rose.pre_process.mesh_utils.create_hinge_model_part(hinge_data, rail_model_part, mesh)

Creates a hinge model part and adds it to the rail model part

Parameters:
  • hinge_data – dictionary of hinge data

  • rail_model_part – rail model part, on which the hinge is located

  • mesh – the mesh of the model

Returns:

rose.pre_process.mesh_utils.create_horizontal_track(n_sleepers, sleeper_distance, soil_depth, n_rail_per_sleeper=1)

Creates mesh of a horizontal track. Where the top of the track lies at z=0; the sleeper thickness is 1.0m.

Parameters:
  • n_sleepers – number of sleepers [-]

  • sleeper_distance – distance between sleepers [m]

  • soil_depth – depth of the soil [m]

  • n_rail_per_sleeper – number of rail elements per sleeper [-]

Returns:

Dictionary with: rail model part, rail pad model part, sleeper model part, soil model part. Mesh

rose.pre_process.mesh_utils.get_coordinates_node_array(nodes)
rose.pre_process.mesh_utils.set_load_vector_as_function_of_time(time, load, build_up_idxs, load_locations, lower_limit_location: float, upper_limit_location)

Module contents