A python package for tribologists
Project description
A python package for tribologists. Including:
- surface analysis and generation:
multiple random surface generation methods
easy integration with alicona and .csv files
easy generation of common surface shapes for modelling
- boundary element normal contact analysis:
CPU and GPU back ends available
easily extendable system for custom behaviour
simple user interface allowing the user to build complex models
mixed lubrication modelling with user defined non newtonian fluids
Installation
To install slippy, you need to have python installed. If you are not familiar with python, we recommend installing the anaconda distribution, as it comes with many other useful tools. We also recommend installing slippy in a virtual environment. If you are using anaconda you can create a suitable virtual environment, install python and pip, and activate the environment, by running the following in the anaconda prompt:
conda create -n name_of_env python==3.8 pip
conda activate name_of_env
Once activated, you should see the name of the environment in brackets in the command prompt. Packages are only installed for the currently active environment. When you have python and pip installed there are two ways to install slippy:
From PyPI:
The last released version can be installed from the python package index PyPI:
python -m pip install slippy
From github:
The latest version can be installed from github, this version will gain functionality first but may be unstable during development:
python -m pip install git+https://github.com/FrictionTribologyEnigma/slippy.git@master
If you are working on linux you may have to replace ‘python’ with ‘python3’ in the installation commands.
You are now ready to run models using CPU backend, if you are unfamiliar with slippy a good place to start would be the examples folder in the github repository, these show working code examples for some common problems. They can be viewed online or downloaded and run locally. Running locally requires you to install jupyter (‘python -m pip install jupyter’ in anaconda prompt) in the same environment as slippy is installed in. You can then start a notebook server (‘jupyter notebook’ in anaconda prompt) and open the .ipynb file through the webpage this opens.
Installing the GPU backend:
Slippy can run simulations on Nvidia GPUs, this is often much faster for large simulations. However, this functionality is not possible on all computers. Because of this we don’t attempt to install the GPU backend with the requirements as this would make it impossible for many users to install slippy. In order to run models on the GPU you must also install cupy, instructions for installing cupy can be found here. This step is optional, if cupy is installed slippy will use the GPU by default, otherwise it will use the CPU backend.
Citation
We are working on a paper to cite if you find slippy useful, please also check documentation of the functions you use, to ensure credit goes to the original authors.
Example usage
Many detailed examples are available in the examples directory in the github repository. However most contact models will follow a standard work flow:
Define surface profiles either by reading from file or generating
If a profile has been read from file, fill in missing data
Define materials and assign then to the surfaces
Make a contact model object to coordinate the solution
Make modelling steps which describe the problem you need to solve
Add the steps to the model
Add sub models to the steps as required
Add output requests to the steps as required
Check and solve the model
Post process the results
In this simple example a rough cylinder is pressed into a flat plane, materials are elastic but with a maximum allowable pressure to simulate an elastic perfectly plastic material. Where the loads is equal to this maximum load the surfaces are allowed to penetrate each other, here a wear sub-model is used to remove this overlap as wear, this permanently changes the surface profiles.
A more detailed description of the decisions behind the code can be found in the example:
import numpy as np
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
yield_stress = 3 * np.exp(0.736 * 0.3) * 705e6
material = c.Elastic('steel', properties = {'E':200e9, 'v':0.3},
max_load = yield_stress)
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 sub models
wear_submodel = c.sub_models.WearElasticPerfectlyPlastic('wear_l', 0.5, 0.5, True)
my_step.add_sub_model(wear_submodel)
# add output requests
output_request = c.OutputRequest('Output-1',
['interference', 'total_normal_load',
'loads_z', 'total_displacement_z',
'converged'])
my_step.add_output(output_request)
# solve the model
final_result = my_model.solve()
Some examples of results which could be generated from the output of this model are shown below:
Solution Details
The process of generating a contact model can be difficult to understand, however the process slippy works through in solving a model is relatively simple. For each model step, first any offset (tangential motion) between the surfaces is applied. Next the contact mechanics problem is solved, this should include any processes which need to be two way coupled, for example fluid pressures and deformation in a EHL step.
After this the sub-models are solved, these are one way coupled to the contact mechanics problem in this time step. This means that the result of the contact model can be used in their solution but they cannot impact the solution of the contact mechanics problem in a single time step. Processes like wear, film growth, temperature change, and in some cases tangential contact can be solved in sub-models.
Finally the requested outputs are written to file so they can be post processed at a later time. Depending on the step this process can repeat for the same step or the model can move on to the next step:
Documentation
We are working on a detailed documentation website, for now there are detailed documentation strings with each function or class and examples for common problems. If you find these examples or documentation lacking, please consider contributing to the development of the documentation, your experience of using the functions without having developed them is invaluable as an indication of the problems new users are likely to face.
Contributing
We welcome contributions in many forms. Please see the contributing page for more information
Credits
This package was created with Cookiecutter.
History
0.3.0 (2021-09-2)
Sub surface stress calculations
Backend for coupled and multi convolutions
Contact stiffness and rolling sliding submodels
More efficient normal contact solver
0.1.1 (2020-11-9)
Mixed lubrication api brought into line with other steps
bug fixes in mixed lubrication solver
added just in time compilation to unified reynolds solver
converted IterSemiSystem to quasi static
0.1.0 (2020-11-7)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file slippy-0.4.1.tar.gz
.
File metadata
- Download URL: slippy-0.4.1.tar.gz
- Upload date:
- Size: 160.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a01d7fcfd8eab23d288599466c76cb6509794ee3f7b565381139ea0403640c07 |
|
MD5 | afab828492a6ae55ce0354ae280dee21 |
|
BLAKE2b-256 | 9ba70e86aa8b27c4a9f0a1e9e8b8936d77b53569c26c8fef0c2ef1f8e2cb5149 |
File details
Details for the file slippy-0.4.1-py2.py3-none-any.whl
.
File metadata
- Download URL: slippy-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 179.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2aaeb0add6ca778792015be2e28c3f47f954f44bc258803ee48188889d749e4 |
|
MD5 | 426fc02481799835a7eed751f536b3ec |
|
BLAKE2b-256 | 94e6308f86d6a7db739eea8ebd46cabd6a89ecc4fbf35cd52af120ee01cddd8f |