I had a code that was working fine and I tried to add an extra few lines to find the solution of the same equation with different conditions. The original NDSolveValue solutions work fine but when it gets to evaluating solnG it just makes a "Ding" and stops evaluating the code. What is the cause of this sound and why will it not continue to evaluate the code?
Here is the code:
<< "NDSolve`FEM`"
ts = .000250; tsl = .000250; (* m *)
ρs = 3980; ρsl = 958; (* kg/m3 *)
ks = .035; ksl = .00067; (* kW/m/K *)
cs = .75; csl = 4.22; (* kJ/kg/K *)
ρ = If[0 <= z < ts, ρs, ρsl];
k = If[0 <= z < ts, ks, ksl];
c = If[0 <= z < ts, cs, csl];
td = 0.075;
tg = 0.01;
eqn1 = k*D[T1[z], z] + 28;
Tbl = 100;
Subscript[Γ1, D] = DirichletCondition[T1[z] == Tbl, z == ts + tsl];
BCr = NDSolveValue[{eqn1 == 0, Subscript[Γ1, D]}, T1, {z, 0, ts + tsl}];
Plot[BCr[z], {z, 0, ts + tsl}, GridLines -> {{ts}, {0}}]
Ti[z_] := \[Piecewise] {
{BCr[z], 0 <= z < ts},
{100, True}
};
Plot[Ti[z], {z, 0, ts + tsl}, GridLines -> {{ts}, {0}}]
eqn2 = c ρ Derivative[1, 0][T][t, z] - k Derivative[0, 2][T][t, z]
Subscript[Γ, D] = DirichletCondition[T[t, z] == Tbl, z == ts + tsl];
Subscript[Γ, N] = NeumannValue[-28, z == 0];
solnD =
NDSolveValue[
{eqn2 == Subscript[Γ, N],
Subscript[Γ, D], T[0, z] == Ti[z]},
T, {t, 0, 1}, {z, 0, ts + tsl},
Method ->
{"PDEDiscretization" ->
{"MethodOfLines",
"SpatialDiscretization" ->
{"FiniteElement", "MeshOptions" -> {"MaxCellMeasure" -> (ts + tsl)/1011}}}}]
Plot[solnD[t, ts], {t, 0, 1}, GridLines -> {{0}, {107}}, PlotRange -> Full]
Plot[solnD[td, z], {z, 0, ts + tsl}, GridLines -> {{ts}, {0}}]
eqn3 = ρ c D[Tg[t, z], t] - k D[Tg[t, z], z, z];
TiG[z_] := solnD[td, z];
Plot[TiG[z], {z, 0, ts}]
Tits = solnD[td, ts];
Subscript[Γd, N] = NeumannValue[-28, z == 0];
solnG =
NDSolveValue[
{eqn3 == Subscript[Γd, N],
(Tg[t, z] /. z -> ts) == (-300*t + Tits),
Tg[0, z] == TiG[z]},
Tg, {t, 0, .1}, {z, 0, ts},
Method ->
{"PDEDiscretization" ->
{"MethodOfLines",
"SpatialDiscretization" ->
{"FiniteElement", "MeshOptions" -> {"MaxCellMeasure" -> (ts)/1011}}}}]
Animate[
Plot[solnG[t, z], {z, 0, ts}, PlotRange -> {99, 111}], {t, 0, 1}]