TransWikia.com

Singularity in gradient caused by Dirichlet boundary condition

Computational Science Asked by balborian on December 17, 2020

I am looking for a mathematical explanation for the singularity caused by a Dirichlet boundary condition partially imposed at a boundary.

For instance
$$
nabla^2u=0 ~ text{in}~Omega
$$

where $Omega$ is a rectangle of 10 by 4. Dirichlet boundary condition $u=0$ is imposed at
$
y=0 ~text{and}~ y = 4 ~text{and}~ x < 2
$

and a flux is applied at the boundary $x=10$

Plotting the flux, you can see the singularity where the Dirichlet boundary condition ends

enter image description here

I plotted this with the following FEniCS code

from fenics import *

mesh = RectangleMesh(Point(0, 0), Point(10, 4), 400, 160, diagonal='crossed')

V = FunctionSpace(mesh, 'CG', 1)
u, v = TrialFunction(V), TestFunction(V)

a = inner(grad(u), grad(v))*dx


def MyDirichlet(x, on_boundary):
    return on_boundary and (x[0] < 2.0) and (x[0] > 0.0)

class MyNeumann(SubDomain):
    def inside(self, x, on_boundary):
        return on_boundary and near(x[0], 10.0)

subdomain = MeshFunction("size_t", mesh, mesh.topology().dim() - 1)
subdomain.set_all(0)
myneumann = MyNeumann()
myneumann.mark(subdomain, 1)
ds = Measure('ds', domain=mesh, subdomain_data=subdomain)

bc = DirichletBC(V, Constant(0.0), MyDirichlet)

L = Constant(1.0)*v*ds(1)

u_sol = Function(V)

solve(a==L, u_sol, bcs=bc)
File("sing_example.pvd") << u_sol
Vflux = VectorFunctionSpace(mesh, 'CG', 1)
File("sing_flux.pvd") << project(grad(u_sol), Vflux)

One Answer

It looks to me that you don't have a well posed problem, so who knows how the fenics is handling that. I know that you can get some odd results for ill-posed poisson problems when the solver doesn't diverge, but instead returns garbage. This seems to be on of those cases. Relatedly you can have certain fixed point iterations that solve linear systems of singular matrices without diverging, but any inverse of a singular matrix is clearly meaningless.

Answered by EMP on December 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP