Skip to content

Elastohydrodynamic Lubrication Point Contact Solver for MATLAB

License

Notifications You must be signed in to change notification settings

theComputeKid/ehl-point-stationary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

-----------------------------------------------------------------
>> Elastohydrodynamic Lubrication Point Contact Solver for MATLAB
-----------------------------------------------------------------

Based on the theory presented in Venner and Lubrecht's book "Multilevel Methods in Lubrication", with the following modifications:
- Fourier Transforms are used to calculate deformation instead of the Multi-Level Multi-Integration mentioned in the book
- Parallel line solvers are provided.
- An option to execute the solver using the GPU is added

There are multiple execution strategies that can be used:
- cpu_seq : The CPU will solve and progress in the domain line by line, using a banded matrix solver with 6 bands. This is faithful to the algorithm mentioned in the book.
- cpu_par : The CPU solves in parallel, solving multiple lines at the same time, provided that the data required does not overlap (similar to a red-black algorithm, except for lines). There is some overhead to launching a parallel pool. Requires Parallel Computing Toolbox.
- gpu_seq : The GPU will solve and progress in the domain line by line, using a banded matrix solver with 5 bands. Only for debugging purposes because this is slow.
- gpu_par : The GPU solves in parallel, solving multiple lines at the same time, provided that the data required does not overlap (similar to a red-black algorithm, except for lines). Performance relative to the CPU will scale with the number of lines that can be solved in parallel. 

Examples are provided in the +examples folder. To run them, you must be in the project root folder (i.e. where this README is). From there, you can run examples from the examples namespace. E.g. from the command window in the root folder:

CPU Examples:
>> examples.ex1 : Basic Example with Result Plots
>> examples.ex2 : Basic Example with Textual Verbosity
>> examples.ex3 : Non-Isoviscous Fluids with Graphical Verbosity
>> examples.ex4 : Non-Isoviscous Fluids with Single Precision
>> examples.ex5 : Uses the parallel line solver, but single grid only
>> examples.ex6 : Uses the parallel line solver, but with multiple grids

GPU Examples (require MATLAB with Parallel Computing Toolbox and a supported NVIDIA GPU):
>> examples.ex7 : Sequential GPU solver
>> examples.ex8 : Parallel GPU line solver, but with single grid
>> examples.ex9 : Parallel GPU line solver, but with multiple grids

Benchmarks are provided to show the difference in performance between the execution modes. They are located in the +bench folder:
>> bench.singleGrid : Single Grid benchmarks for 5 iterations.
>> bench.multiGrid : Multi-Grid benchmarks for 1 iteration.

Note on GPU support: GPU support requires mex building, as a batch pentadiagonal solver is not part of MATLAB (yet). The mex file uses C++17, which needs a (recent) version of MATLAB that uses a version of CUDA that supports it. It is built automatically as part of the solution process when required. No user intervention is required.

Tested on MATLAB R2023b. In MATLAB 2024a, the banded solver now only accepts a square full matrix, which requires changes to the project. Previously, supplying only the bands of the matrix was sufficient.

Variable naming conventions are kept similar to those used in "Multilevel Methods in Lubrication".

References:
Venner, C.H., Lubrecht, A.A. (Eds.), 2000. Chapter 6 - ElastoHydrodynamic Lubrication, in: Multilevel Methods in Lubrication, Tribology Series. Elsevier, pp. 179–223. https://doi.org/10.1016/S0167-8922(00)80010-3