Can anyone help me figure out how to set up a solution for NDSolveValue that incorporates the use of Cylindrical Coordinates. I tried using SetCoordinates[Cylindrical] but it is not working (as in it wont recognize SetCoordinates). I am using version 10.2 so the VectorAnalysis functionality should be included. I am confused as to why it is not working.
edit: adding code
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];
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"]
ρ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}]
??
by the desired initial condition, replace{r, z} ∈ mesh
by{r, -reff, reff}, {z, 0, zmax}
, and define the constants that appear in your code. Your challenge here is not cylindrical coordinates per se (although negativer
is an issue) but in producing self-consistent code. $\endgroup$