Hi
I am trying to solve nonlinear poisson boltzman
the problem looks like this :
|--dom0--|--dom1--|--dom2--|--dom3--|--dom4--|--dom5--|--dom6--|
D1 N1 N2 N3 N4 N5 N6 D2
where D represents Dirichlet and N represents Neuman boundaries
the source term is highly nonlinear , I followed the nonlinear poisson and nonlinear examples from the tutorial and came up with the following summarized code :
V = FunctionSpace(mesh, "CG", 1)
u = TrialFunction(V)
v = TestFunction(V)
u_ = Function(V)
bcs = [DirichletBC(V, 0.0, boundaries, 1), DirichletBC(V, 0.0, boundaries, 7)]
dx = Measure("dx")[domains]
dS = Measure("dS")[boundaries]
F = ( inner(e0grad(u), grad(v))dx(0)
+ inner(e1grad(u), grad(v))dx(1)
+ inner(e2grad(u), grad(v))dx(2)
+ inner(e3grad(u), grad(v))dx(3)
+ inner(e4grad(u), grad(v))dx(4)
+ inner(e5grad(u), grad(v))dx(5)
- fvdx(0) - fvdx(1) - fvdx(2) - fvdx(3)- fvdx(4) - fvdx(5)
+ p1v('+')dS(2) + p2v('+')dS(3) +p3v('+')dS(5)
+ beta1sinh( alpha1 * u ) v* dx(4) + beta2sinh( alpha2 * u ) v* dx(5) )
F = action(F,u_)
J = derivative(F,u_,u )
problem = NonlinearVariationalProblem(F , u_ , bcs , J )
solver = NonlinearVariationalSolver(problem)
solver.solve()
the solver is converging to a solution which is obviously wrong, and moreover changing the source terms and neuman boundaries have no effect on the converged solution,
Thank you so much for your help