# Mathematica heat transfer tutorial problem

I want to solve some heat transfer problems with Mathematica. I am trying to run the heat transfer tutorial cases but I am always getting the error "NDSolveValue: Equation or list of equations expected instead of ..." I was reading into the HeatTransferPDEComponent documentation and tried running the example case, but the same problem appears. See the code below, I tried some stuff I found on the forum in the top 3 lines.

What is causing these errors and how can I fix it?

Needs["NDSolveFEM"]
Clear[vars, pars, \[CapitalOmega], eqn, Tfun]

ClearAll[vars, pars, \[CapitalOmega], eqn, Tfun]

vars = {\[CapitalTheta][x], {x}};

pars = <|"ThermalConductivity" -> 0.026, "HeatSource" -> 1|>;
\[CapitalOmega] = Line[{{0}, {1}}];

eqn = HeatTransferPDEComponent[vars, pars] == 0

Tfun = NDSolveValue[{eqn,
HeatTemperatureCondition[x == 0, vars,
pars, <|"SurfaceTemperature" -> 0|>]}, \[CapitalTheta],
x \[Element] \[CapitalOmega]];
Plot[Tfun[x], {x} \[Element] \[CapitalOmega]]


I want to add that I am new to Mathematica. Further I tried running some code snippets not using the HeatTransferPDEComponent stuff but defining the heat equation in the code, which worked just fine.

• Indeed, I can't activate HeatTransferPDEComponent[{\[CapitalTheta][t, x], t, {x}}, <| "MassDensity" -> \[Rho], "SpecificHeatCapacity" -> Subscript[C, p], "ThermalConductivity" -> \[Kappa]|>] in 12.3. Jul 15, 2021 at 9:02
• I am running 12.1 by the way. Jul 15, 2021 at 9:13
• @user64494, works just fine for me on 12.3 Jul 15, 2021 at 9:22
• @user21: I obtain "Div::sclr: The scalar expression (-[Kappa]).{([CapitalTheta]^(0,1))[t,x]} does not have a divergence." Jul 15, 2021 at 10:59
• @user64494, what OS? Jul 15, 2021 at 11:17

The HeatTransferPDEComponent was introduced in version 12.2 so will need at least that version to run it. See how the function name is still blue - this means that symbol is not defined in the version you run.
• Paste PDEModels/tutorial/HeatTransfer/HeatTransfer into the help system Jul 15, 2021 at 10:34