1D lubrication HMM: the Reynolds equation across scales
HMM
lubrication
Reynolds equation
NGSolve
The Heterogeneous Multiscale Method applied to a 1D lubrication film: the steady, isoviscous, Newtonian Reynolds equation solved as a smooth macro baseline, a fine-resolved textured reference, and an HMM coupling whose micro cell problems supply effective coefficients to a coarse macro solve. Implemented in NGSolve.
Published
June 19, 2026
This is the lubrication counterpart to the generic 1D HMM demo: the same multiscale machinery, but applied to a thin-film bearing rather than a generic elliptic problem. We solve the steady, isoviscous, Newtonian Reynolds equation in flux-conservation form,
where \(H(x)\) is the film thickness, \(U\) the entrainment speed, \(\eta\) the viscosity and \(P\) the pressure — the Couette (shear-driven) and Poiseuille (pressure-driven) contributions to the flux \(q\). As in the elliptic demo, three scenarios are compared: a smooth macro solve using only the large-scale film shape; a deterministic solve that resolves the full textured film on a fine mesh; and the HMM solve, where micro cell problems over a representative patch of texture feed an effective flux relation back to a coarse macro solve. The finite-element solves use NGSolve.
Open in Colab and run all cells — the notebook’s first cell installs NGSolve automatically via FEM on Colab on a real cloud kernel.
One dependency to wire up first: the notebook imports a local helper module with from plot_funcs import *. Opening the notebook in Colab loads only the .ipynb, not the rest of the repo, so that import will fail until plot_funcs.py is made available — either by adding a setup cell that fetches it (!wget <raw-github-url>/plot_funcs.py) or by pasting its contents into the notebook.
The full notebook is embedded below (install cell and console logs trimmed for reading; the runnable version is linked above).
Parameters and initialisation of macroscale finite element spaces
from ngsolve import*from ngsolve.webgui import Drawfrom ngsolve.meshes import*import matplotlib.pyplot as plt### Macro Meshing ###k =1# Order of elementsNe =212# Number of elements### Deterministic Meshing ###Ne_deterministic =10000### Micro Meshing ###Ne_m =75lm =5e-3### Physical ###U =2eta =1e-1rho =1h0 =0.2dhdx =0.15# Microscale roughnessAh =10e-3# Coupling tolerancep_tol =1e-6# Newton solver tolerance (macro and micro)Newton_tol =1e-6
Macroscale Solver
Solving the smooth, steady, isoviscous, newtonian 1D Lubrication problem.
We can define the problem as being conservation of flux.
This notebook is built on NGSolve/Netgen, run on Google Colab through FEM on Colab. If you use it in your own work, please cite them:
J. Schöberl. C++11 Implementation of Finite Elements in NGSolve. ASC Report 30/2014, Institute for Analysis and Scientific Computing, TU Wien (2014). asc.tuwien.ac.at
J. Schöberl. NETGEN — An advancing front 2D/3D-mesh generator based on abstract rules. Computing and Visualization in Science 1(1):41–52 (1997). doi:10.1007/s007910050004
The notebook code is released under the MIT License; the written explanation and figures are released under CC BY 4.0. Reuse in your own teaching is welcome — see licence & reuse for how to attribute.