8
$\begingroup$

I am trying to learn something about simulation of heat transfer by looking at this problem which is an answer by user21. If I try this in Version 11.3 the following happens:

$VersionNumber

11.3

Needs["NDSolve`FEM`"]   
tdiff[z_] := 0.5 + 0.1 UnitStep[z - 1] + 0.2 UnitStep[z - 2];

eqn = tdiff[z]*D[u[t, r, z],t] - 
(D[u[t, r, z], z, z] + (1/r) D[r D[u[t, r, z], r], r]);
Ω = ImplicitRegion[True, {{r, 0.001, 200}, {z, 0, 3}}];

   sol = NDSolveValue[{
   eqn == NeumannValue[30 - u[t, r, z], z == 0],
   DirichletCondition[u[t, r, z] == 35, z == 3],
   DirichletCondition[u[t, r, z] == 0, r == 200],
   u[0, r, z] == 0},
  u, {t, 0, 1000}, {r, z} ∈ Ω]

There are error messages related to NDSolveValue the first of which is:

Mathematica graphics

However, if I repeat the above in

$VersionNumber

11.2

I do get a solution.

Mathematica graphics

Which I can plot as

   Animate[Plot3D[sol[t, r, z], {r, z} ∈ Ω, 
  PlotRange -> {All, All, {0, 35}}], {t, 0, 5}]

fig1

Is there something changed in version 11.3?

$\endgroup$
  • 2
    $\begingroup$ Workaround,with this: \[CapitalOmega] = ImplicitRegion[True, {{r, 1/1000, 200}, {z, 0, 3}}]; works. $\endgroup$ – Mariusz Iwaniuk Nov 8 '18 at 13:32
6
$\begingroup$

As a quick fix you could use generate the mesh with ToElementMesh first:

mesh = ToElementMesh[\[CapitalOmega], RegionBounds[\[CapitalOmega]]]
sol = NDSolveValue[{eqn == NeumannValue[30 - u[t, r, z], z == 0], 
   DirichletCondition[u[t, r, z] == 35, z == 3], 
   DirichletCondition[u[t, r, z] == 0, r == 200], u[0, r, z] == 0}, 
  u, {t, 0, 1000}, {r, z} \[Element] mesh]

or, as suggested in a comment use an exact region representation in your original code:

\[CapitalOmega] = ImplicitRegion[True, {{r, 1/1000, 200}, {z, 0, 3}}];

I'd need to look a bit closer to see what is going on in your case. Sorry about that.

These two function calls should return the same but they do not and that is a bug I'll report:

Region`Mesh`BoundariesToBoundaryMeshRegion[{0.001 - x <= 
    0 && -200 + x <= 0 && -y <= 0 && -3 + y <= 0}, {x, 1/1000, 
  200}, {y, 0, 3}]

and

Region`Mesh`BoundariesToBoundaryMeshRegion[{1/1000 - x <= 0 && -200 + x <= 0 && -y <= 0 && -3 + y <= 0}, {x, 1/1000, 200}, {y, 0, 3}]
$\endgroup$
  • $\begingroup$ Thanks, got me going again as usual. $\endgroup$ – Hugh Nov 9 '18 at 12:20
  • 1
    $\begingroup$ @Hugh, glad I could help. The fix for the code should make it into the sources today and then a next release will have the fix for you. Sorry for the trouble and thanks for reporting. $\endgroup$ – user21 Nov 9 '18 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.