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

Boundary conditions on Poisson equation for electrostatics

0 votes

Hello again,

I am going to reformulate the question, I am going to explain it better.

I would like to have a smooth transition between two parts of my mesh, the one that is inside boundary conditions and the one that is not.

I have a mesh representing a detector which is not completely depleted, depending on the bias voltage and its dimensions. In order to solve the weigthing potential (WP) I define different potentials (0 or 1) and different subDomains. Here you can see the function to solve WP

void SMSDetector::solve_w_u()
{
// Solving Laplace equation f = 0
Constant f(0.0);
_L_p.f = f;
BackPlaneBoundaryWP backplane(_x_min, _x_max, _depletion_width);
CentralStripBoundaryWP central_strip(_pitch, _width, _nns, _depletion_width);
NeighbourStripBoundaryWP neighbour_strips(_pitch, _width, _nns, _depletion_width);
// Set BC values
Constant central_strip_V(1.0);
Constant neighbour_strip_V(0.0);
Constant backplane_V(0.0);
// Set BC variables
DirichletBC central_strip_BC(_V_p, central_strip_V, central_strip);
DirichletBC neighbour_strip_BC(_V_p, neighbour_strip_V, neighbour_strips);
DirichletBC backplane_BC(_V_p, backplane_V, backplane);
// Collect them
std::vector bcs;
bcs.push_back(&central_strip_BC);
bcs.push_back(&neighbour_strip_BC);
bcs.push_back(&backplane_BC);
solve(_a_p == _L_p , _w_u, bcs);
}

Let's suppose that the detector of 300 um is half depleted, so there should be weigthing potential only until 150 um. So, what is the best way to manage the frontier?, the potential is decreasing but suddenly it abruptly goes down when approaches 150 um. How can I tell the program to go down smooth, i.e. more linearly?

Many thanks for your help.

asked Apr 25, 2017 by DocJey FEniCS Novice (130 points)
edited Apr 25, 2017 by DocJey

could you carefully format your code so we can interpret what you're trying to achieve?

1 Answer

+1 vote

Regarding the points outside the condition, are you specifying the initial condition for the rectangle as 0.0 and then applying the above condition? You will need to add more of your code (properly formatted) to see what the problem is.

For a having a smooth transition, what you can do is use something like a sigmoid function;
https://en.wikipedia.org/wiki/Sigmoid_function

answered Apr 25, 2017 by alexmm FEniCS User (4,240 points)
...