This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

nonlinear robin boundary conditions

+2 votes

How can we implement a nonlinear robin boundary condition?

I found a suggestion to the old question posted here called "How to write Neumann conditions with non-linear term of "u"?"

It means, we do not want to implement the typical right side of this kind of boundary condition r(u-s) but r(u^(n)-s).

The suggestion made by Jan Blechta was to make a fixed point iteration for n=2

u0 = Function(V)
a = inner(nabla_grad(u), nabla_grad(v))*dx + p*u0*u*v*ds(0)

u = Function(V)
until convergence:
     u0.assign(u)
     solve(a == L, u, bcs)

or a Newton method

u = Function(V)
F = inner(nabla_grad(u), nabla_grad(v))*dx + p*u*u*v*ds(0) \
    - f*v*dx - g*v*ds(1) + p*q*v*ds(0)
J = derivative(F, u)
solve(F == 0, u, bcs, J)

in the first case there is no convergence after 10000 iterations and in the second it simply does not work.

Any suggestion?

thx in advance

asked Jun 19, 2017 by questionsfenics FEniCS Novice (150 points)

1 Answer

+1 vote

A nonlinear solver will only work if at least one solution exists and you start with a sufficiently close initial guess.

The problem you are solving does not have solutions for all values of f, g, and q. Even when it has solutions, the linearised system solved within an iteration may be singular.

You need to first make sure the problem you are solving is well-posed. Then make sure the initial guess is reasonable. You can specify bounds bounds for the solution if you use SNES instead of the default Newton solver, which can be used for example to ensure a nonnegative solution.

answered Jun 27, 2017 by Magne Nordaas FEniCS Expert (13,820 points)

Thanks for your time Magne,
Indeed I have been working in the way you have suggested and it looks the proper way.
Thanks again.
Just an extra comment, this kind of boundary conditions are more than common in some branches of science. I do not know why they are not reported more frequently in numerical examples.

...