Say you want to solve the movement of a particle in a viscous fluid such that the force on the particle is zero. In general, the solution is trivial since one has no-slip boundary conditions, ie the fluid moves at the same velocity as the particle.
But supposed you do have a slip velocity at the surface of the particles due to some microscopic phenomena. (See here for the paper) In particular, if the particles are in a varying field (electric, temperature, concentration of any solute) the velocity of the fluid at the surface of the particle is proportional to the (tangent) gradient of the field in that point.
The question is then, how to solve Stokes equation for those particles with the boundary conditions on the particles such that the force on them is zero and they move with a certain (unknown) velocity.
That was the physical introduction, now the code. First I review the simple boundary conditions for PDE, then present examples of integral boundary conditions, and finally the differential-integral boundary condition required by force=0.
<< NDSolve`FEM` L = 5; r = RegionDifference[Rectangle[{-L, -L}, {L, L}], Disk[{0, 0}, 1]]; mesh = ToElementMesh[ r ]; eqn = { Laplacian[u[x, y], {x, y}] - D[p[x, y], x] == 0, Laplacian[v[x, y], {x, y}] - D[p[x, y], y] == 0, D[u[x, y], x] + D[v[x, y], y] == 0}; (*with null boundary conditions in "infinite"*) bcs = {DirichletCondition[u[x, y] == 0, x == L || x == -L || y == L || y == -L], DirichletCondition[v[x, y] == 0, x == L || x == -L || y == L || y == -L], DirichletCondition[p[x, y] == 0., x == L || x == -L] }; One can solve for Dirichlet condition on the particle like this
pde = {eqn, bcs, DirichletCondition[u[x, y] == 1, Norm[{x, y}]^2 <= 1.], DirichletCondition[v[x, y] == 1, Norm[{x, y}]^2 <= 1.]}; {xVel, yVel, pressure} = NDSolveValue[pde, {u, v, p}, {x, y} ∈ mesh2, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}]; And it works.
Now, say you want to impose that the integral of the function over the particle is constant, something like this:
pde = {eqn, bcs,NIntegrate[u[x, y] + v[x, y], {x, y} ∈ Circle[]]==1}; {xVel, yVel, pressure} = NDSolveValue[pde, {u, v, p}, {x, y} ∈ mesh2, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}] This is what I understand for an integral boundary condition and this won't work. For what I could find online seems that mathematica cannot deal with this atm.
Now, the condition of force=0 on the particle is slightly more complicated. First we need to remember that the force acting on a surface due to the fluid is $F_i = \sigma_{ik}dA_k$. For the sake of simplicity let's say that the force is only in x direction, so for the case of our particle we have that
force = NIntegrate[(-pressure[Cos[ϕ], Sin[ϕ]] + Subscript[σ, xx][Cos[ϕ], Sin[ϕ]]) Cos[ϕ] + Subscript[σ, xy][Cos[ϕ], Sin[ϕ]] Sin[ϕ], {ϕ, 0, 2 π}] is the force acting on the particle, with the stress tensor components given by
Subscript[σ, yy][x_, y_] = Evaluate[2 D[yVel[x, y], {y}]]; Subscript[σ, xx][x_, y_] = Evaluate[2 D[xVel[x, y], {x}]]; Subscript[σ, xy][x_, y_] = Evaluate[D[xVel[x, y], {y}] + D[yVel[x, y], {x}]] That's an integro-differential boundary condition and it's what I need to solve. I have a way to to do this which consists of iteratively, given the slip velocity on the particle, I start with a velocity, solve Stokes equation for that boundary condition, and compute the force. If the force is negative I need a larger velocity and if it's positive a smaller velocity. Eventually I reach the velocity where the force on the particle is zero.
However, what I would like to do is to pass the boundary condition to NDSolve just like this:
pde = {eqn, bcs, force==0}; {xVel, yVel, pressure} = NDSolveValue[pde, {u, v, p}, {x, y} ∈ mesh2, Method -> {"FiniteElement", "InterpolationOrder" -> {u -> 2, v -> 2, p -> 1}}] too much to ask?



u+v) over the boundary of theDisk(i.e. aCircle? TheDiskis what you have subtracted from the region why do you want to integrate over it now? $\endgroup$NIntegrate[u[x,y]+v[x,y], Element[{x,y}, Circle[]]]==1as a boundary condition. And the second is to compute some force from the resulting interpolation functions? Or is this force feed back (i.e. non-linear) into the boundary integral constraint? $\endgroup$