11

I am trying to find the temperature field in a semi-infinite solid on whose surface there is an isotherm spherical cap sunken by a length p. For example:

R = 10;
p = 3;
SphericalPlot3D[
 1/2 (Sqrt[2] Sqrt[Cos[2 θ] (R - p)^2 + 2 p R + R^2 - p^2] + 
    2 Cos[θ] (R - p)), {θ, Pi/2, 3/2 Pi}, {ϕ, 0, 
  2 Pi}]

The rest of the surface is adiabatic.

In a spherical coordinate system (physical convention) centered at the "center" of the cap, the PDE is: $$\frac{\partial }{\partial r}\left(r^2\frac{\partial T}{\partial r}\right)+\frac{1}{\sin \theta }\frac{\partial }{\partial \theta }\left(\sin \theta \frac{\partial T}{\partial \theta }\right)=0$$ With boundary conditions in dimensionless form given by:

$T=0$, $r\to \infty$, this sets $T$ equal to the initial value far from the cap,

$T=1$, $r=\frac{1}{2} \left(\sqrt{2} \sqrt{-p^2+(1-p)^2 \cos (2 \theta )+2 p+1}+2 (1-p) \cos (\theta )\right)$, this imposes $T$ on the cap

$\frac{\partial T}{\partial \theta}\bigg| _{\theta=\pi/2}=0$, adiabatic condition

$\frac{\partial T}{\partial \theta}\bigg| _{\theta=\pi}=0$, symmetry condition.

I tried this:

p = 0.2;

boundaries = {-r + 1/2 (Sqrt[2] Sqrt[Cos[2 θ] (1 - p)^2 + 2 p + 1 - p^2] + 2 Cos[θ] (1 - p)), r - 100, -θ + Pi/2, θ - Pi} Ω = ImplicitRegion[And @@ (# <= 0 & /@ boundaries), {r, θ}]; RegionPlot[Ω, PlotRange -> {{0, 3}, {1, 5}}] NDSolveValue[{r^2 D[T[r, θ], {r, 2}] + 2 r D[T[r, θ], r] + D[T[r, θ], {θ, 2}] + Cot[θ] D[T[r, θ], θ] == {NeumannValue[0., boundaries[[3]] == 0], NeumannValue[0., boundaries[[4]] == 0]}, {DirichletCondition[ T[r, θ] == 1., boundaries[[1]] == 0.], DirichletCondition[T[r, θ] == 0., boundaries[[2]] == 0.]}}, T, {r, θ} ∈ Ω]

But it does not seem to work. I have two Dirichlet conditions and two Neumann conditions, but I don't know if I inserted them in NDSolve in the right way.

user21
  • 39,710
  • 8
  • 110
  • 167
umby
  • 585
  • 2
  • 10
  • 1
  • You need to express the b.c. involving derivative with NeumannValue, related: https://mathematica.stackexchange.com/q/224812/1871 2. How can $\theta=3\pi/2$ in spherical coordinates? What convention do you follow?
  • – xzczd Apr 27 '21 at 11:01
  • Using physical convention $\theta \leq \pi$, you're right. The question was corrected according to your comment. Thank you. – umby Apr 28 '21 at 11:17