Computes the force due to substrate friction based on the height `h` and slip length `δ`.
Computes the force due to a substrate friction based on the height `h`, the flow velocity `velocity` and slip length `δ`.
# Theory
Although the model does pretty good job simulating thin film dynamics, i.e. `` \\partial_t h = \\nabla(m(h)\\nabla p)``, it has a few shortcomings.
A rather serious one is the interaction with the substrate.
Our approach is one the hand to use a disjoining potential as used in `capillarypressure` but on the other hand we need to regularize velocity of the three phase contact line.
The later is taken care of with this forcing, which is nothing more than a parabolic interpolation of velocity profiles.
There are two natural boundary conditions, first being the stress free surface, here the velocity of the film is `v`.
However on the substrate depending on the strict choice of the mobility term `m(h)` we would like to observe a vanishing velocity, such a **no-slip** bc.
Now to interpolate between those two we use
`` F_{sl} = a h^2 + b h + c. ``
Which is simply a polynomial of second degree.
The force should be strong if `` h \\rightarrow 0 ``, therefore the full term is given by
function thermalflutuations!(F::Force,mom::Moment,col::collisionparams)
# Some random number generation, have to switch between GPU and CPU
randn!(F.x)
randn!(F.y)
F.x.*=sqrt.(2.*col.kᵦT.*col.μ.*6.*mom.height./
(2.*mom.height.*mom.height.+
6.*mom.height.*col.δ.+
3.*col.δ.*col.δ))
F.y.*=sqrt.(2.*col.kᵦT.*col.μ.*6.*mom.height./
(2.*mom.height.*mom.height.+
6.*mom.height.*col.δ.+
3.*col.δ.*col.δ))
returnnothing
end
# pressure has to be circular padded for this function!
"""
filmpressure!(f, mom, T)
h∇p!(fx, fy, height, pressure)
Computation of h∇p.
Pressure gradient times the height, the driving force of the *thin film equation*.
Here we compute the gradient of the pressure field, which needs to be circular padded, and multiply the result with the height field.
The gradient is computed over a nine point stencil, that accounts for the *D2Q9* nature of the lattice Boltzmann.
# Theory
Starting with the thin film equation
`` \\partial_t h = \\nabla(m(h)\\nabla p), ``
one immediately sees that `h` can only change due to `` \\nabla p ``, assuming a constant mobility.
The pressure `p` here however is the sum of the laplacian of the height `` \\gamma\\Delta h `` and the wetting potential or disjoining pressure `` \\Pi(h) ``.
For details take a look at the `pressure.jl` file.
For the gradient of a *D2Q9* lattice Boltzmann field I suggested to use the paper by Junk and Klar
julia> f.y
5×5 CuArray{Float32,2}:
-3.75 2.5 2.5 2.5 -3.75
-3.75 2.5 2.5 2.5 -3.75
-3.75 2.5 2.5 2.5 -3.75
-3.75 2.5 2.5 2.5 -3.75
-3.75 2.5 2.5 2.5 -3.75
```
# References
- [Discretizations for the Incompressible Navier--Stokes Equations Based on the Lattice Boltzmann Method](https://epubs.siam.org/doi/pdf/10.1137/S1064827599357188)
- [Isotropic discrete Laplacian operators from lattice hydrodynamics](https://www.sciencedirect.com/science/article/pii/S0021999112004226?via%3Dihub)
See also: [`collidestreamBGK_periodic!`](@ref)
"""
function filmpressure!(f::Force,mom::Moment)
len,wid=size(mom.pressure)
Threads.@threadsforj=1:wid
@inboundsfori=1:len
ip=mod1(i+1+len,len)
im=mod1(i-1-len,len)
jp=mod1(j+1+wid,wid)
jm=mod1(j-1-wid,wid)
f.x[i,j]=mom.height[i,j]*(1/3*(mom.pressure[ip,j]-mom.pressure[im,j])# up and down