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.
Colab is the route to use here — 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. (Binder isn’t offered for this one: the repo’s shared Binder environment targets the FEniCS notebooks, whereas this one self-installs NGSolve on Colab.)
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.