Skip to main content
Post Closed as "Not suitable for this site" by Dr. belisarius, MarcoB, user9660, dr.blochwave, m_goldberg
edited code
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
op = ρ*c*\!\(
  ρ c \*SubscriptBox[\(\[PartialD]\)D[T[t, \(t\)]\(T[tr, rz], z]\)\)t] - (k/r) \!\(
   D[r \*SubscriptBox[\(\[PartialD]\)D[T[t, \(r\)]\((r 
    \*SubscriptBox[\(\[PartialD]\), \(r\)]\((T[tz], rr], z])\))\)\)r] - k \!\(
    \*SubscriptBox[\(\[PartialD]\)D[D[T[t, \(z\)]\((
    \*SubscriptBox[\(\[PartialD]\)r, \(z\)]\((T[tz], rz], z])\))\)\) - g; 

Subscript[Γ, D] = {DirichletCondition[T[t, r, z] == Tbl, 
      z == ts + tito + tsl && -reff < r < reff], 
      DirichletCondition[T[t, r, z] == BCr[z], r == -reff && r == reff]};
Subscript[Γ, N] = NeumannValue[0, z == 0 && -reff <= r <= reff];

td = 100;

Temp = NDSolveValue[{op == Subscript[Γ, N], Subscript[Γ, D], 
         T[0, r, z] == ?? }, T, {t, 0, td}, {r, z} ∈ mesh];
reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[
   "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, 
      ts + tito}, {reff, ts + tito + tsl}, {-reff, 
      ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}];
mesh = ToElementMesh[bmesh];
bmesh["Wireframe"]
mesh["Wireframe"]

\[Rho]sρs = 3980; \[Rho]itoρito = 7120; \[Rho]slρsl = 958;
ks = .035; kito = .011; ksl = .00067;
cs = .75; cito = .25; csl = 4.22;
gs = 0; gito = 2800000; gsl = 0;

\[Rho]ρ = If[0 <= z < ts, \[Rho]sρs, 
   If[ts <= z < ts + tito, \[Rho]itoρito, \[Rho]sl]];ρsl]];
k =  If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]];
c =  If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]];
g =  If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*\!\(
\*SubscriptBox[\(\[PartialD]\)k D[T1[z], \(z, z\)]\(T1[z]\)\)z] + g; 

Tbl = 100;
Tl[z_] = Tbl;
Subscript[\[CapitalGamma]1Subscript[Γ1, D] = 
  DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl];
Subscript[\[CapitalGamma]1Subscript[Γ1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[\[CapitalGamma]1Subscript[Γ1, N], 
    Subscript[\[CapitalGamma]1Subscript[Γ1, D]}, T1, {z, 0, ts + tito + tsl}, 
   MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}]
BCr[0]
BCr[ts]
BCr[ts + tito]
BCr[ts + tito + tsl]
Plot[BCr[z], {z, ts, ts + tito + tsl}]
Plot[BCr[z], {z, 0, ts}]
Plot[BCr[z], {z, ts, ts + tito}]
Plot[BCr[z], {z, ts + tito, ts + tito + tsl}]
Plot[BCr[z], {z, ts - tito, ts + tito}]
Plot[BCr[z], {z, ts - 2*tito, ts + 3*tito}]
Plot[BCr[z], {z, ts + tito, ts + 3*tito}]
 
Ti[z_] := \[Piecewise] Piecewise[{
    {BCr[z], 0 <= z < ts + tito},
    {100, True}
   };];
Plot[Ti[z], {z, 0, ts + tito + tsl}]
op = ρ*c*\!\(
    \*SubscriptBox[\(\[PartialD]\), \(t\)]\(T[t, r, z]\)\) - (k/r) \!\(
    \*SubscriptBox[\(\[PartialD]\), \(r\)]\((r 
    \*SubscriptBox[\(\[PartialD]\), \(r\)]\((T[t, r, z])\))\)\) - k \!\(
    \*SubscriptBox[\(\[PartialD]\), \(z\)]\((
    \*SubscriptBox[\(\[PartialD]\), \(z\)]\((T[t, r, z])\))\)\) - g;

Subscript[Γ, D] = {DirichletCondition[T[t, r, z] == Tbl, 
      z == ts + tito + tsl && -reff < r < reff], 
      DirichletCondition[T[t, r, z] == BCr[z], r == -reff && r == reff]};
Subscript[Γ, N] = NeumannValue[0, z == 0 && -reff <= r <= reff];

td = 100;

Temp = NDSolveValue[{op == Subscript[Γ, N], Subscript[Γ, D], 
         T[0, r, z] == ?? }, T, {t, 0, td}, {r, z} ∈ mesh];
reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[
   "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, 
      ts + tito}, {reff, ts + tito + tsl}, {-reff, 
      ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}];
mesh = ToElementMesh[bmesh];
bmesh["Wireframe"]
mesh["Wireframe"]

\[Rho]s = 3980; \[Rho]ito = 7120; \[Rho]sl = 958;
ks = .035; kito = .011; ksl = .00067;
cs = .75; cito = .25; csl = 4.22;
gs = 0; gito = 2800000; gsl = 0;

\[Rho] = If[0 <= z < ts, \[Rho]s, 
   If[ts <= z < ts + tito, \[Rho]ito, \[Rho]sl]];
k =  If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]];
c =  If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]];
g =  If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*\!\(
\*SubscriptBox[\(\[PartialD]\), \(z, z\)]\(T1[z]\)\) + g;

Tbl = 100;
Tl[z_] = Tbl;
Subscript[\[CapitalGamma]1, D] = 
  DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl];
Subscript[\[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[\[CapitalGamma]1, N], 
    Subscript[\[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, 
   MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}]
BCr[0]
BCr[ts]
BCr[ts + tito]
BCr[ts + tito + tsl]
Plot[BCr[z], {z, ts, ts + tito + tsl}]
Plot[BCr[z], {z, 0, ts}]
Plot[BCr[z], {z, ts, ts + tito}]
Plot[BCr[z], {z, ts + tito, ts + tito + tsl}]
Plot[BCr[z], {z, ts - tito, ts + tito}]
Plot[BCr[z], {z, ts - 2*tito, ts + 3*tito}]
Plot[BCr[z], {z, ts + tito, ts + 3*tito}]
 
Ti[z_] := \[Piecewise] {
    {BCr[z], 0 <= z < ts + tito},
    {100, True}
   };
Plot[Ti[z], {z, 0, ts + tito + tsl}]
op = ρ c D[T[t, r, z], t] - k/r D[r D[T[t, r, z], r], r] - k D[D[T[t, r, z], z], z] - g; 

Subscript[Γ, D] = {DirichletCondition[T[t, r, z] == Tbl, 
      z == ts + tito + tsl && -reff < r < reff], 
      DirichletCondition[T[t, r, z] == BCr[z], r == -reff && r == reff]};
Subscript[Γ, N] = NeumannValue[0, z == 0 && -reff <= r <= reff];

td = 100;

Temp = NDSolveValue[{op == Subscript[Γ, N], Subscript[Γ, D], 
         T[0, r, z] == ?? }, T, {t, 0, td}, {r, z} ∈ mesh];
reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[
   "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, 
      ts + tito}, {reff, ts + tito + tsl}, {-reff, 
      ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}];
mesh = ToElementMesh[bmesh];
bmesh["Wireframe"]
mesh["Wireframe"]

ρs = 3980; ρito = 7120; ρsl = 958;
ks = .035; kito = .011; ksl = .00067;
cs = .75; cito = .25; csl = 4.22;
gs = 0; gito = 2800000; gsl = 0;

ρ = If[0 <= z < ts, ρs, 
   If[ts <= z < ts + tito, ρito, ρsl]];
k =  If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]];
c =  If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]];
g =  If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k D[T1[z], z, z] + g; 

Tbl = 100;
Tl[z_] = Tbl;
Subscript[Γ1, D] = 
  DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl];
Subscript[Γ1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[Γ1, N], 
    Subscript[Γ1, D]}, T1, {z, 0, ts + tito + tsl}, 
   MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}]
BCr[0]
BCr[ts]
BCr[ts + tito]
BCr[ts + tito + tsl]
Plot[BCr[z], {z, ts, ts + tito + tsl}]
Plot[BCr[z], {z, 0, ts}]
Plot[BCr[z], {z, ts, ts + tito}]
Plot[BCr[z], {z, ts + tito, ts + tito + tsl}]
Plot[BCr[z], {z, ts - tito, ts + tito}]
Plot[BCr[z], {z, ts - 2*tito, ts + 3*tito}]
Plot[BCr[z], {z, ts + tito, ts + 3*tito}]
Ti[z_] := Piecewise[{{BCr[z], 0 <= z < ts + tito}, {100, True}}];
Plot[Ti[z], {z, 0, ts + tito + tsl}]

editedit: adding code

edit #2edit #2: adding more code (defining variables and calculating initial temperature profile)

reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[
   "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, 
      ts + tito}, {reff, ts + tito + tsl}, {-reff, 
      ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}];
mesh = ToElementMesh[bmesh];
bmesh["Wireframe"]
mesh["Wireframe"]

\[Rho]s = 3980; \[Rho]ito = 7120; \[Rho]sl = 958;
ks = .035; kito = .011; ksl = .00067;
cs = .75; cito = .25; csl = 4.22;
gs = 0; gito = 2800000; gsl = 0;

\[Rho] = If[0 <= z < ts, \[Rho]s, 
   If[ts <= z < ts + tito, \[Rho]ito, \[Rho]sl]];
k =  If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]];
c =  If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]];
g =  If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*\!\(
\*SubscriptBox[\(\[PartialD]\), \(z, z\)]\(T1[z]\)\) + g;

Tbl = 100;
Tl[z_] = Tbl;
Subscript[\[CapitalGamma]1, D] = 
  DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl];
Subscript[\[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[\[CapitalGamma]1, N], 
    Subscript[\[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, 
   MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}]
BCr[0]
BCr[ts]
BCr[ts + tito]
BCr[ts + tito + tsl]
Plot[BCr[z], {z, ts, ts + tito + tsl}]
Plot[BCr[z], {z, 0, ts}]
Plot[BCr[z], {z, ts, ts + tito}]
Plot[BCr[z], {z, ts + tito, ts + tito + tsl}]
Plot[BCr[z], {z, ts - tito, ts + tito}]
Plot[BCr[z], {z, ts - 2*tito, ts + 3*tito}]
Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := \[Piecewise] {
    {BCr[z], 0 <= z < ts + tito},
    {100, True}
   };
Plot[Ti[z], {z, 0, ts + tito + tsl}]

bmesh = ToBoundaryMesh[ "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, ts + tito}, {reff, ts + tito + tsl}, {-reff, ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}]; mesh = ToElementMesh[bmesh]; bmesh["Wireframe"] mesh["Wireframe"]

[Rho]s = 3980; [Rho]ito = 7120; [Rho]sl = 958; ks = .035; kito = .011; ksl = .00067; cs = .75; cito = .25; csl = 4.22; gs = 0; gito = 2800000; gsl = 0;

[Rho] = If[0 <= z < ts, [Rho]s, If[ts <= z < ts + tito, [Rho]ito, [Rho]sl]]; k = If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]]; c = If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]]; g = If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*!( *SubscriptBox[([PartialD]), (z, z)](T1[z])) + g;

Tbl = 100; Tl[z_] = Tbl; Subscript[[CapitalGamma]1, D] = DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl]; Subscript[[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[[CapitalGamma]1, N], Subscript[[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}] BCr[0] BCr[ts] BCr[ts + tito] BCr[ts + tito + tsl] Plot[BCr[z], {z, ts, ts + tito + tsl}] Plot[BCr[z], {z, 0, ts}] Plot[BCr[z], {z, ts, ts + tito}] Plot[BCr[z], {z, ts + tito, ts + tito + tsl}] Plot[BCr[z], {z, ts - tito, ts + tito}] Plot[BCr[z], {z, ts - 2tito, ts + 3tito}] Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := [Piecewise] { {BCr[z], 0 <= z < ts + tito}, {100, True} }; Plot[Ti[z], {z, 0, ts + tito + tsl}]

edit: adding code

edit #2: adding more code (defining variables and calculating initial temperature profile)

reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[ "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, ts + tito}, {reff, ts + tito + tsl}, {-reff, ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}]; mesh = ToElementMesh[bmesh]; bmesh["Wireframe"] mesh["Wireframe"]

[Rho]s = 3980; [Rho]ito = 7120; [Rho]sl = 958; ks = .035; kito = .011; ksl = .00067; cs = .75; cito = .25; csl = 4.22; gs = 0; gito = 2800000; gsl = 0;

[Rho] = If[0 <= z < ts, [Rho]s, If[ts <= z < ts + tito, [Rho]ito, [Rho]sl]]; k = If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]]; c = If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]]; g = If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*!( *SubscriptBox[([PartialD]), (z, z)](T1[z])) + g;

Tbl = 100; Tl[z_] = Tbl; Subscript[[CapitalGamma]1, D] = DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl]; Subscript[[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[[CapitalGamma]1, N], Subscript[[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}] BCr[0] BCr[ts] BCr[ts + tito] BCr[ts + tito + tsl] Plot[BCr[z], {z, ts, ts + tito + tsl}] Plot[BCr[z], {z, 0, ts}] Plot[BCr[z], {z, ts, ts + tito}] Plot[BCr[z], {z, ts + tito, ts + tito + tsl}] Plot[BCr[z], {z, ts - tito, ts + tito}] Plot[BCr[z], {z, ts - 2tito, ts + 3tito}] Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := [Piecewise] { {BCr[z], 0 <= z < ts + tito}, {100, True} }; Plot[Ti[z], {z, 0, ts + tito + tsl}]

edit: adding code

edit #2: adding more code (defining variables and calculating initial temperature profile)

reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[
   "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, 
      ts + tito}, {reff, ts + tito + tsl}, {-reff, 
      ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, 
   "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 
        5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}];
mesh = ToElementMesh[bmesh];
bmesh["Wireframe"]
mesh["Wireframe"]

\[Rho]s = 3980; \[Rho]ito = 7120; \[Rho]sl = 958;
ks = .035; kito = .011; ksl = .00067;
cs = .75; cito = .25; csl = 4.22;
gs = 0; gito = 2800000; gsl = 0;

\[Rho] = If[0 <= z < ts, \[Rho]s, 
   If[ts <= z < ts + tito, \[Rho]ito, \[Rho]sl]];
k =  If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]];
c =  If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]];
g =  If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*\!\(
\*SubscriptBox[\(\[PartialD]\), \(z, z\)]\(T1[z]\)\) + g;

Tbl = 100;
Tl[z_] = Tbl;
Subscript[\[CapitalGamma]1, D] = 
  DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl];
Subscript[\[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[\[CapitalGamma]1, N], 
    Subscript[\[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, 
   MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}]
BCr[0]
BCr[ts]
BCr[ts + tito]
BCr[ts + tito + tsl]
Plot[BCr[z], {z, ts, ts + tito + tsl}]
Plot[BCr[z], {z, 0, ts}]
Plot[BCr[z], {z, ts, ts + tito}]
Plot[BCr[z], {z, ts + tito, ts + tito + tsl}]
Plot[BCr[z], {z, ts - tito, ts + tito}]
Plot[BCr[z], {z, ts - 2*tito, ts + 3*tito}]
Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := \[Piecewise] {
    {BCr[z], 0 <= z < ts + tito},
    {100, True}
   };
Plot[Ti[z], {z, 0, ts + tito + tsl}]
added 1951 characters in body
Source Link

edit #2: adding more code (defining variables and calculating initial temperature profile)

reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[ "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, ts + tito}, {reff, ts + tito + tsl}, {-reff, ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}]; mesh = ToElementMesh[bmesh]; bmesh["Wireframe"] mesh["Wireframe"]

[Rho]s = 3980; [Rho]ito = 7120; [Rho]sl = 958; ks = .035; kito = .011; ksl = .00067; cs = .75; cito = .25; csl = 4.22; gs = 0; gito = 2800000; gsl = 0;

[Rho] = If[0 <= z < ts, [Rho]s, If[ts <= z < ts + tito, [Rho]ito, [Rho]sl]]; k = If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]]; c = If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]]; g = If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*!( *SubscriptBox[([PartialD]), (z, z)](T1[z])) + g;

Tbl = 100; Tl[z_] = Tbl; Subscript[[CapitalGamma]1, D] = DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl]; Subscript[[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[[CapitalGamma]1, N], Subscript[[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}] BCr[0] BCr[ts] BCr[ts + tito] BCr[ts + tito + tsl] Plot[BCr[z], {z, ts, ts + tito + tsl}] Plot[BCr[z], {z, 0, ts}] Plot[BCr[z], {z, ts, ts + tito}] Plot[BCr[z], {z, ts + tito, ts + tito + tsl}] Plot[BCr[z], {z, ts - tito, ts + tito}] Plot[BCr[z], {z, ts - 2tito, ts + 3tito}] Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := [Piecewise] { {BCr[z], 0 <= z < ts + tito}, {100, True} }; Plot[Ti[z], {z, 0, ts + tito + tsl}]

edit #2: adding more code (defining variables and calculating initial temperature profile)

reff = .001; ts = .000250; tito = .000005; tsl = .00023;

bmesh = ToBoundaryMesh[ "Coordinates" -> {{-reff, 0}, {reff, 0}, {reff, ts}, {reff, ts + tito}, {reff, ts + tito + tsl}, {-reff, ts + tito + tsl}, {-reff, ts + tito}, {-reff, ts}}, "BoundaryElements" -> {LineElement[{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 8}, {8, 1}, {8, 3}, {7, 4}}]}]; mesh = ToElementMesh[bmesh]; bmesh["Wireframe"] mesh["Wireframe"]

[Rho]s = 3980; [Rho]ito = 7120; [Rho]sl = 958; ks = .035; kito = .011; ksl = .00067; cs = .75; cito = .25; csl = 4.22; gs = 0; gito = 2800000; gsl = 0;

[Rho] = If[0 <= z < ts, [Rho]s, If[ts <= z < ts + tito, [Rho]ito, [Rho]sl]]; k = If[0 <= z < ts, ks, If[ts <= z < ts + tito, kito, ksl]]; c = If[0 <= z < ts, cs, If[ts <= z < ts + tito, cito, csl]]; g = If[0 <= z < ts, gs, If[ts <= z < ts + tito, gito, gsl]];

eqn1[z_] = k*!( *SubscriptBox[([PartialD]), (z, z)](T1[z])) + g;

Tbl = 100; Tl[z_] = Tbl; Subscript[[CapitalGamma]1, D] = DirichletCondition[T1[z] == Tbl, z == ts + tito + tsl]; Subscript[[CapitalGamma]1, N] = NeumannValue[0, z == 0];

BCr = NDSolveValue[{eqn1[z] == Subscript[[CapitalGamma]1, N], Subscript[[CapitalGamma]1, D]}, T1, {z, 0, ts + tito + tsl}, MaxStepSize -> 0.0000000001];

Plot[{BCr[z], VerticalSlider}, {z, 0, ts + tito + tsl}] BCr[0] BCr[ts] BCr[ts + tito] BCr[ts + tito + tsl] Plot[BCr[z], {z, ts, ts + tito + tsl}] Plot[BCr[z], {z, 0, ts}] Plot[BCr[z], {z, ts, ts + tito}] Plot[BCr[z], {z, ts + tito, ts + tito + tsl}] Plot[BCr[z], {z, ts - tito, ts + tito}] Plot[BCr[z], {z, ts - 2tito, ts + 3tito}] Plot[BCr[z], {z, ts + tito, ts + 3*tito}]

Ti[z_] := [Piecewise] { {BCr[z], 0 <= z < ts + tito}, {100, True} }; Plot[Ti[z], {z, 0, ts + tito + tsl}]

improved formatting a bit
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160
Loading
improved formatting a bit
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160
Loading
added 836 characters in body
Source Link
Loading
edited tags
Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
Loading
Source Link
Loading