# Including point heat sources in a 2D transient PDE heat equation

I want to be sure that I included the point heat sources correctly in my PDE. The result should be:

I wrote:

q0 = 1;
Subscript[Q, 0] =
q0*(DiracDelta[x - x1]*DiracDelta[y - y1] +
DiracDelta[x - x1]*DiracDelta[y - y2]*DiracDelta[x - x2]*
DiracDelta[y - y1] + DiracDelta[x - x2]*DiracDelta[y - y2]);
heqn1 = Subscript[k,
CLS]*(D[Subscript[T, D][x, y, t], x, x] +
D[Subscript[T, D][x, y, t], y, y]) + Subscript[Q, 0] ==
Subscript[\[Rho], CLS]*Subscript[Cp, CLS]*
D[Subscript[T, D][x, y, t], t]


I haven't considered the time-dependency for the heat source just yet to simplify the notation. Thank you in advance!

There is an example of this in the documentation. Have a look at the Heat Transfer Monograph. There is a section on Sources and a subsection on Point Sources.

Subscript[\[Rho], air] = ThermodynamicData["Air", "Density"];
Subscript[Cp, air] =
ThermodynamicData["Air", "IsobaricHeatCapacity"];
Subscript[k, air] = ThermodynamicData["Air", "ThermalConductivity"];
reg = Rectangle[{0, 0}, {0.2, 0.2}];
tend = 600;
vars = {T[t, x, y], t, {x, y}};
pars = <|"ThermalConductivity" -> Subscript[k, air],
"MassDensity" -> Subscript[\[Rho], air],
"SpecificHeatCapacity" -> Subscript[Cp, air]|>;
RegularizedDeltaPoint[\[Gamma]_, X_List, Xs_List] :=
Piecewise[{{Times @@
Thread[1/(4 \[Gamma]) (1 + Cos[\[Pi]/(2 \[Gamma]) (X - Xs)])],
And @@ Thread[RealAbs[X - Xs] <= 2 \[Gamma]]}, {0, True}}]
xs = 0.1;
ys = 0.1;
reg = Rectangle[{0, 0}, {0.2, 0.2}];
mesh = NDSolveFEMToElementMesh[reg, "IncludePoints" -> {{xs, ys}}];
Subscript[h, mesh] = Sqrt[Min[mesh["MeshElementMeasure"]]];
Subscript[\[Gamma], reg] = Subscript[h, mesh]/2;

\!$$\*OverscriptBox[\(Qp$$, $$~$$]\) = 10;
pars["HeatSource"] =
RegularizedDeltaPoint[Subscript[\[Gamma], reg], {x, y}, {xs, ys}]*
\!$$\*OverscriptBox[\(Qp$$, $$~$$]\)
pde = {HeatTransferPDEComponent[vars, pars] == 0, T[0, x, y] == 0};
Tfun = NDSolveValue[pde, T, {t, 0, tend}, {x, y} \[Element] mesh];
pRange = MinMax[Tfun["ValuesOnGrid"]];
legendBar =
BarLegend[{"TemperatureMap", pRange}, Sequence[
50, LegendLabel -> Style["[\[Degree]C]",
Opacity[0.6]]]];
options = {PlotRange -> pRange, Sequence[
ColorFunction -> ColorData[{"TemperatureMap", pRange}],
ContourStyle -> None, FrameLabel -> {"x", "y"},
ColorFunctionScaling -> False,
PlotLabel -> Style["Transient Temperature Field: T(t,x,y)", 18],
AspectRatio -> Automatic, Contours -> 75, PlotPoints -> 41,
ImageSize -> Medium]};
boundaryHighlight = Graphics[{{
Directive[Purple, Thick],
Point[{xs, ys}]},
Text[
Style["Point Heat Source \!$$\*SubscriptBox[\(Q$$, $$p$$]\)", 14,
Black], {0.11, 0.125}]}];
nframes = 30;
frames = Table[
Show[Legended[
ContourPlot[Tfun[t, x, y], {x, y} \[Element] mesh,
Evaluate[options]], legendBar], boundaryHighlight], {t, 0, tend,
tend/nframes}];
frames = Rasterize[#1, "Image", ImageResolution -> 80] & /@ frames;
ListAnimate[frames, SaveDefinitions -> True]


• I tried changing the domain with mine and I've put the location for my point heat source, but I'm not able to add more than one. Most importantly, I don't understand what this line means: "RegularizedDeltaPoint[[Gamma]_, X_List, Xs_List] := Piecewise[{{Times @@ Thread[1/(4 [Gamma]) (1 + Cos[[Pi]/(2 [Gamma]) (X - Xs)])], And @@ Thread[RealAbs[X - Xs] <= 2 [Gamma]]}, {0, True}}]". Mar 9, 2021 at 13:51