Bug introduced in version 12.0 (or earlier) and fixed in version 13.0 (or earlier)
I am using Mathematica 12.0. The present calculation is a simple "test case" to prove efficacy, but I am receiving an error I haven't seen before. e.g:
Part: Part{32, 30, 534} of {} does not exist
I have put together a simple 2D transient heat transfer problem with 4 Neumann conditions and a known initial condition of u = 1. The top surface, at y = 2, is subject to radiation cooling. The other surfaces are all subject to the standard Neumann/convection condition. My code is provided below:
Remove["Global`*"]
Needs["NDSolve`FEM`"];
\[CapitalOmega] = Rectangle[{0, 0}, {1, 2}];
op = D[u[t, x, y], t] - \!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[t, x, y]\)\);
Subscript[\[CapitalGamma], rad] =
NeumannValue[-\[Epsilon] \[Sigma] (u[t, x, y]^4 - Subscript[T,
0]^4), y == 2];
Subscript[\[CapitalGamma], conv] =
NeumannValue[-h (u[t, x, y] - Subscript[T, 0]),
x == 0 || x == 1 || y == 0];
Subscript[\[CapitalGamma], ic] = u[0, x, y] == 1;
parameters = {\[Epsilon] -> 0.5, \[Sigma] -> 5.67*10^-8,
Subscript[T, 0] -> 0, Subscript[T, i] -> 0.5, h -> 1};
pde = {op ==
Subscript[\[CapitalGamma], rad] + Subscript[\[CapitalGamma],
conv], Subscript[\[CapitalGamma], ic]} //. parameters;
uSol = NDSolveValue[pde,
u, {t, 0, 1}, {x, y} \[Element] \[CapitalOmega]];
I've tried refining the mesh using
uSol = NDSolveValue[pde,
u, {t, 0, 1}, {x, y} \[Element] \[CapitalOmega],
Method -> {"PDEDiscretization" -> {Automatic,
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {MaxCellMeasure -> 0.001}}}}]
but to no avail. Unless I'm missing something, there seems to be precious little information on this error when using NDSolveValue. Perhaps the most perplexing part of this is that I still get a converged solution after the computation ends, but this comes with a screen full of "Part" error (and subsequent errors afterward). This, naturally, gives me pause.
Any thoughts?