Hi all, I am trying to find a numerical solution to Laplaces equation in spherical coordinates. My geometry is an interesting one which is a ball with a cone removed out of the center of it. I want the outside surface of the ball to be at one constant value and the interior surface of the cone to be at another value. I believe that I have generated the correct region but I do not know how to correctly specify the surface boundary of both the sphere and cone. I have attached the code that I am working with so far.
Graphics3D[{Ball[{-1, -1, -1}], Ball[{1, 2, 3}, 2]}]
To center 2 balls, that is the way it is.
Your region is in cartesian coordinates, while your function V is spherical coordinates. That is a mismatch.
I tried to solve your equation in cartesian coordinates, but I have run into shortcomings of the current computational geometry:
c1 = Ball[{0, 0, 0}, 1];
c2 = Cone[{{0, 0, 0}, {0, 0, 1/2}}, 1/4];
\[CapitalOmega] = DiscretizeRegion@RegionDifference[c1, c2];
bdry = DiscretizeRegion@RegionBoundary[\[CapitalOmega]];
DiscretizeRegion@RegionIntersection[bdry, Ball[{0, 0, 0}, 9/10]]
fails with the message “DiscretizeRegion was unable to discretize the region RegionIntersection[<<2>>]”
It seems to work this way:
c1 = Ball[];
c2 = Cone[{{0, 0, 0}, {0, 0, 1/2}}, 1/4];
\[CapitalOmega] = RegionDifference[c1, c2];
op = Laplacian[V[x, y, z], {x, y, z}] == 0;
\[CapitalGamma] = {DirichletCondition[V[x, y, z] == 10,
x^2 + y^2 + z^2 > 9/10],
DirichletCondition[V[x, y, z] == 2, x^2 + y^2 + z^2 < 9/10]};
sol = NDSolveValue[{op, \[CapitalGamma]},
V, {x, y, z} \[Element] \[CapitalOmega]]