slippy.contact.QuasiStaticStep¶
- class slippy.contact.QuasiStaticStep(step_name: str, number_of_steps: int, 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, mean_gap: Optional[Union[float, Sequence[float]]] = None, relative_loading: bool = False, adhesion: bool = True, unloading: bool = False, fast_ld: bool = False, impact_properties: Optional[dict] = None, movement_interpolation_mode: str = 'linear', profile_interpolation_mode: str = 'nearest', periodic_geometry: bool = False, periodic_axes: tuple = (False, False), method: str = 'auto', max_it: int = 1000, tolerance=1e-08, max_it_outer: int = 100, tolerance_outer=0.0001, no_update_warning: bool = True, upper: float = 4.0)[source]¶
A model step for quasi static relative movement
To be used for loading, unloading and sliding as well as quasi static impacts, can be used for rolling-sliding with appropriate sub models for tangential behaviour.
- Parameters
step_name (str) – An identifying name for the step used for errors and outputs
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, normal load and mean gap between the surfaces, only one of these can be set, 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, normal load and mean gap between the surfaces, only one of these can be set, 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
mean_gap (float or Sequence of float, optional (None)) –
The interference, normal load and mean gap between the surfaces, only one of these can be set, 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.
adhesion (bool, optional (True)) – If True the adhesion model set for the contact model will be used, If set to false this step will ignore the adhesion model (typically used for loading steps)
unloading (bool, optional (False)) – If True the contact nodes will be constrained to be a sub set of those found in the previous time step.
fast_ld (bool, optional (False)) – If True the load and displacements can be swapped to give a faster simulation, eg: if 100 equally spaced load steps are specified by a start and finish load, the displacement at the maximum load will be found and instead 100 equally spaced displacement controlled steps will solved between just touching and the maximum deflection. This swapping makes the computation much faster as it removes an optimisation loop.
impact_properties (list, optional (None)) – This is currently not supported, providing a value will cause an error
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
method ({'auto', 'pk', 'double', 'rey'}, optional ('auto')) – The method by which the normal contact is solved, only used for load controlled contact. ‘pk’ uses the Polonsky and Keer algorithm for elastic contact. ‘double’ uses a double iteration procedure, suitable for elastic contact with a maximum pressure. ‘auto’ automatically selects ‘pk’ if there is no maximum pressure and ‘double’ if there is.
max_it (int, optional (1000)) – The maximum number of iterations used in the main loop
tolerance (float, optional (1e-4)) – The relative tolerance used for convergnece of the main loop
max_it_outer (int, optional (100)) – Only used for the double iteration method
tolerance_outer (float, optional (1e-4)) – The norm of the residual used to declare convergence of the bccg iterations
tolerance – The norm of the residual used to declare convergence of the bccg iterations
no_update_warning (bool, optional (True)) – Change to False to suppress warning given when no movement or loading changes are specified
upper (float, optional (4.0)) – For load controlled contact the upper bound for the interference between the bodies will be this factor multiplied by the largest just touching gap. 4 is suitable for flat on flat contacts but for ball on flat contacts a lower value will give faster converging solutions
Examples
In the following example we model the contact between a rough cylinder and a flat plane. Both surface are elastic. This code could be used to generate load displacement curves.
>>> import slippy.surface as s >>> import slippy.contact as c >>> # define contact geometry >>> cylinder = s.RoundSurface((1 ,np.inf, 1), shape=(256, 256), grid_spacing=0.001) >>> roughness = s.HurstFractalSurface(1, 0.2, 1000, shape=(256, 256), grid_spacing=0.001, >>> generate = True) >>> combined = cylinder + roughness * 0.00001 >>> flat = s.FlatSurface(shape=(256, 256), grid_spacing=0.001, generate = True) >>> # define material behaviour and assign to surfaces >>> material = c.Elastic('steel', properties = {'E':200e9, 'v':0.3}) >>> combined.material = material >>> flat.material = material >>> >>> # make a contact model >>> my_model = c.ContactModel('qss_test', combined, flat) >>> >>> # make a modelling step to describe the problem >>> max_int = 0.002 >>> n_time_steps = 20 >>> my_step = c.QuasiStaticStep('loading', n_time_steps, no_time=True, >>> interference = [max_int*0.001, max_int], >>> periodic_geometry=True, periodic_axes = (False, True)) >>> # add the steps to the model >>> my_model.add_step(my_step) >>> # add output requests >>> output_request = c.OutputRequest('Output-1', >>> ['interference', 'total_normal_load', >>> 'loads_z', 'total_displacement', >>> 'converged']) >>> my_step.add_output(output_request) >>> # solve the model >>> final_result = my_model.solve()
- __init__(step_name: str, number_of_steps: int, 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, mean_gap: Optional[Union[float, Sequence[float]]] = None, relative_loading: bool = False, adhesion: bool = True, unloading: bool = False, fast_ld: bool = False, impact_properties: Optional[dict] = None, movement_interpolation_mode: str = 'linear', profile_interpolation_mode: str = 'nearest', periodic_geometry: bool = False, periodic_axes: tuple = (False, False), method: str = 'auto', max_it: int = 1000, tolerance=1e-08, max_it_outer: int = 100, tolerance_outer=0.0001, no_update_warning: bool = True, upper: float = 4.0)[source]¶
Methods
__init__(step_name, number_of_steps[, ...])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_movement(relative_time, original)Attributes
modelnameThe name of the step
upper