slippy.contact.IterSemiSystem

class slippy.contact.IterSemiSystem(step_name: str, reynolds_solver: slippy.core.abcs._NonDimensionalReynoldSolverABC, rolling_speed: Union[float, Sequence[float]], number_of_steps: int = 1, no_time: bool = False, time_period: float = 1.0, off_set_x: Union[float, Sequence[float]] = 0.0, off_set_y: Union[float, Sequence[float]] = 0.0, interference: Optional[Union[float, Sequence[float]]] = None, normal_load: Optional[Union[float, Sequence[float]]] = None, relative_loading: bool = False, movement_interpolation_mode: str = 'linear', profile_interpolation_mode: str = 'nearest', periodic_geometry: bool = False, periodic_axes: tuple = (False, False), max_it_pressure: int = 5000, rtol_pressure: float = 2e-06, max_it_interference: int = 5000, rtol_interference: float = 0.0001, relaxation_factor: float = 0.1, initial_guess: Union[Callable, str, Sequence] = 'previous', no_update_warning: bool = True)[source]

Lubrication solutions by iteration of semi systems

Parameters
  • step_name (str) – An identifying name for the step used for errors and outputs

  • reynolds_solver (_NonDimensionalReynoldSolverABC) – A reynolds solver object which will be used to solve for pressures

  • rolling_speed (float or Sequence of float, optional (None)) –

    The mean speed of the surfaces (u1+u2)/2 parameters can be:

    • A constant (float) value, indicating a constant rolling speed.

    • A two element sequence of floats, indicating the the start and finish rolling speed, if this is used, the movement_interpolation_mode will be used to generate intermediate values

    • A 2 by n array of n rolling speed and n time values normalised to a 0-1 scale. array[0] should be position values and array[1] should be time values, time values must be between 0 and 1. The movement_interpolation_mode will be used to generate intermediate values

  • number_of_steps (int) – The number of sub steps the problem will be split into, together with the time_period this controls the duration of the time steps used

  • no_time (bool, optional (False)) – Set to true if there is no time dependence and the time steps can be solved in any order (no permanent changes between steps such as plastic deformation or heat generation), if True the model will be solved more efficiently

  • time_period (float, optional (1.0)) – The total time period of this model step, used for solving sub-models and writing outputs

  • off_set_x (float or Sequence of float, optional (0.0)) –

    The off set between the surfaces in the x and y directions, this can be a relative off set or an absolute off set, controlled by the relative_loading parameter:

    • A constant (float) value, indicating a constant offset between the surfaces (no relative movement of profiles)

    • A two element sequence of floats, indicating the the start and finish offsets, if this is used, the movement_interpolation_mode will be used to generate intermediate values

    • A 2 by n array of n absolute position values and n time values normalised to a 0-1 scale. array[0] should be position values and array[1] should be time values, time values must be between 0 and 1. The movement_interpolation_mode will be used to generate intermediate values

  • off_set_y (float or Sequence of float, optional (0.0)) –

    The off set between the surfaces in the x and y directions, this can be a relative off set or an absolute off set, controlled by the relative_loading parameter:

    • A constant (float) value, indicating a constant offset between the surfaces (no relative movement of profiles)

    • A two element sequence of floats, indicating the the start and finish offsets, if this is used, the movement_interpolation_mode will be used to generate intermediate values

    • A 2 by n array of n absolute position values and n time values normalised to a 0-1 scale. array[0] should be position values and array[1] should be time values, time values must be between 0 and 1. The movement_interpolation_mode will be used to generate intermediate values

  • interference (float or Sequence of float, optional (None)) –

    The interference and normal load between the surfaces, only one of these can be set (the other will be solved for) setting neither keeps the interference as it is at the start of this model step. As above for the off sets, either of these parameters can be:

    • A constant (float) value, indicating a constant load/ interference between the surfaces.

    • A two element sequence of floats, indicating the the start and finish load. interference, if this is used, the movement_interpolation_mode will be used to generate intermediate values

    • A 2 by n array of n absolute position values and n time values normalised to a 0-1 scale. array[0] should be position values and array[1] should be time values, time values must be between 0 and 1. The movement_interpolation_mode will be used to generate intermediate values

  • normal_load (float or Sequence of float, optional (None)) –

    The interference and normal load between the surfaces, only one of these can be set (the other will be solved for) setting neither keeps the interference as it is at the start of this model step. As above for the off sets, either of these parameters can be:

    • A constant (float) value, indicating a constant load/ interference between the surfaces.

    • A two element sequence of floats, indicating the the start and finish load. interference, if this is used, the movement_interpolation_mode will be used to generate intermediate values

    • A 2 by n array of n absolute position values and n time values normalised to a 0-1 scale. array[0] should be position values and array[1] should be time values, time values must be between 0 and 1. The movement_interpolation_mode will be used to generate intermediate values

  • relative_loading (bool, optional (False)) – If True the load or displacement and off set will be applied relative to the value at the start of the step, otherwise the absolute value will be used. eg, if the previous step ended with a load of 10N and this step ramps from 0 to 10N setting relative_loading to True will ramp the total load form 10 to 20N over this step.

  • movement_interpolation_mode (str or int, optional ('linear')) – Any valid input to scipy.interpolate.interp1d as the ‘kind’ parameter, using ‘nearest’, ‘previous’ or ‘next’ will cause a warning. This parameter controls how the offset and loading is interpolated over the step

  • profile_interpolation_mode ({'nearest', 'linear'}, optional ('nearest')) – Used to generate the grid points for the second surface at the location of the grid points for the first surface, nearest ensures compatibility with sub models which change the profile, if the grid spacings of the surfaces match

  • periodic_geometry (bool, optional (False)) – If True the surface profile will warp when applying the off set between the surfaces

  • periodic_axes (tuple, optional ((False, False))) – For each True value the corresponding axis will be solved by circular convolution, meaning the result is periodic in that direction. NOTE: this only controls the deformation result from the materials, ensure that the reynolds equation solver used supports periodic solutions and is set to produce a periodic solution to the pressure equation. Additionally, ensure that the axes of periodicity match.

  • max_it_pressure (int, optional (100)) – The maximum number of iterations in the fluid pressure calculation loop

  • rtol_pressure (float, optional (1e-7)) – The relative tolerance for the fluid pressure calculation loop

  • max_it_interference (int, optional (100)) – The maximum number of iterations in the loop that finds the interference between the surfaces

  • rtol_interference (float, optional (1e-7)) – The relative tolerance on the total load (integral of the pressure solution minus the applied load)

  • initial_guess ({callable, 'previous', list}, optional ('previous')) – The initial guess for the interference, and/ or pressure profile between the surfaces, any callable will be called with the contact model and the undeformed nd_gap as positional arguments, it must return the interference and the pressure profile. ‘previous’ will use the result(s) from the previous step, if results are not found the interference and pressure profile will be set to 0. Can also be a 2 element list, the first element being the interference and the second being the pressure profile as an array, if this is the wrong shape zeros wil be used.

  • no_update_warning (bool, optional (True)) – Change to False to suppress warning given when no movement or loading changes are specified

Notes

The solver iterates through a ‘pressure loop’ until the solution has converged to a set of pressure values, then the loading is checked, if the total pressure is too low the surfaces are brought closer together. This is continued until the total load has converged to the set value. This outer loop is referred to as the interference loop.

Examples

In this example we will model smooth surface EHL with a non newtonian fluid:

>>> import slippy
>>> slippy.CUDA = False  # Note: we are using a reynolds solver which does not currently support the CUDA back end
>>> import slippy.surface as s
>>> import slippy.contact as c
>>>
>>> radius = 0.01905       # The radius of the ball
>>> load = 800             # The load on the ball in N
>>> rolling_speed = 4      # The rolling speed in m/s (The mean speed of the surfaces)
>>> youngs_modulus = 200e9 # The youngs modulus of the surfaces
>>> p_ratio = 0.3          # The poission's ratio of the surfaces
>>> grid_size = 65         # The number of points in the descretisation grid
>>> eta_0 = 0.096          # Coefficient in the roelands pressure-viscosity equation
>>> roelands_p_0 = 1/5.1e-9# Coefficient in the roelands pressure-viscosity equation
>>> roelands_z = 0.68      # Coefficient in the roelands pressure-viscosity equation
>>>
>>> # Solving the hertzian contact to get the domain size and the initial guess
>>> hertz_result = c.hertz_full([radius, radius], [float('inf'), float('inf')],
>>>                             [youngs_modulus, youngs_modulus],
>>>                             [p_ratio, p_ratio], load)
>>> hertz_pressure = hertz_result['max_pressure']
>>> hertz_a = hertz_result['contact_radii'][0]
>>> hertz_deflection = hertz_result['total_deflection']
>>> hertz_pressure_function = hertz_result['pressure_f']
>>>
>>> # make the surfaces
>>> ball = s.RoundSurface((radius,)*3, shape = (grid_size, grid_size),
>>>                       extent=(hertz_a*4,hertz_a*4), generate = True)
>>> flat = s.FlatSurface()
>>>
>>> # assigning materials
>>> steel = c.Elastic('steel', {'E' : youngs_modulus, 'v' : p_ratio})
>>> ball.material = steel
>>> flat.material = steel
>>>
>>> # make the non newtonian fluid
>>> oil = c.Lubricant('oil') # Making a lubricant object to contain our sub models
>>> oil.add_sub_model('nd_viscosity', c.lubricant_models.nd_roelands(eta_0, roelands_p_0,
>>>                                                                  hertz_pressure, roelands_z))
>>> oil.add_sub_model('nd_density', c.lubricant_models.nd_dowson_higginson(hertz_pressure))
>>>
>>> # make the contact model
>>> my_model = c.ContactModel('lubrication_test', ball, flat, oil)
>>>
>>> # make a reynolds solver
>>> reynolds = c.UnifiedReynoldsSolver(time_step = 0,
>>>                                    grid_spacing = ball.grid_spacing,
>>>                                    hertzian_pressure = hertz_pressure,
>>>                                    radius_in_rolling_direction=radius,
>>>                                    hertzian_half_width=hertz_a,
>>>                                    dimentional_viscosity=eta_0,
>>>                                    dimentional_density=872)
>>>
>>> # Find the hertzian pressure distribution as an initial guess
>>> X, Y = ball.get_points_from_extent()
>>> X, Y = X + ball._total_shift[0], Y + ball._total_shift[1]
>>> hertzian_pressure_dist = hertz_pressure_function(X, Y)
>>>
>>> # Making the step
>>> step = c.IterSemiSystem('main', reynolds, rolling_speed, 1, no_time=True, normal_load=load,
>>>                         initial_guess=[hertz_deflection, hertzian_pressure_dist],
>>>                         relaxation_factor=0.05, max_it_interference=3000)
>>>
>>> # Adding the step to the contact model
>>> my_model.add_step(step)
>>>
>>> # solve the model:
>>> state = my_model.solve()
__init__(step_name: str, reynolds_solver: slippy.core.abcs._NonDimensionalReynoldSolverABC, rolling_speed: Union[float, Sequence[float]], number_of_steps: int = 1, no_time: bool = False, time_period: float = 1.0, off_set_x: Union[float, Sequence[float]] = 0.0, off_set_y: Union[float, Sequence[float]] = 0.0, interference: Optional[Union[float, Sequence[float]]] = None, normal_load: Optional[Union[float, Sequence[float]]] = None, relative_loading: bool = False, movement_interpolation_mode: str = 'linear', profile_interpolation_mode: str = 'nearest', periodic_geometry: bool = False, periodic_axes: tuple = (False, False), max_it_pressure: int = 5000, rtol_pressure: float = 2e-06, max_it_interference: int = 5000, rtol_interference: float = 0.0001, relaxation_factor: float = 0.1, initial_guess: Union[Callable, str, Sequence] = 'previous', no_update_warning: bool = True)[source]

Methods

__init__(step_name, reynolds_solver, ...[, ...])

add_output(output)

add_sub_model(sub_model)

Add a sub model to be exec :param sub_model: :return:

check_outputs(current_state)

Data check all outputs

check_sub_models(current_state)

Check all the sub models of the current step

data_check(current_state)

To be overwritten by steps that need more complicated checking

save_outputs(current_state, output_file)

Writes all outputs for the step into the output file

solve(previous_state, output_file)

Take in the current state solve the step and update the current state and any field outputs, printing in the solve method will add to the log file, the standard output will be changed before running

solve_sub_models(current_state)

update_interference(it_num, ...)

This method updates the interference between the 2 surfaces during solution

update_movement(relative_time, original)

Attributes

model

name

The name of the step

provides

reynolds

initial_guess