A bit messy in places, and the use of clipping makes the arcs ends of the vertical "pipe" thinner, but relatively straightforward:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations,arrows.meta}
\pgfdeclareverticalshading{heat}{100bp}{%
color(0bp)=(white); color(25bp)=(white); color(30bp)=(blue!50);
color(70bp)=(red!50); color(75bp)=(white); color(100bp)=(white)}
\begin{document}
\begin{tikzpicture}[>={Triangle[angle=60:1 2]}]
\path [shading=heat]
(-2,2) rectangle (2,3/2) (-2,-2) rectangle (2,-3/2);
\draw (-2,3/2) -- (2,3/2) (-2,-3/2) -- (2,-3/2);
\scoped{
\clip (-3/2,-7/4) rectangle (3/2,7/4);
\draw [shading=heat]
(3/4,2) -- (-3/4,2) -- (-3/4,7/4) arc (90:0:1/4) -- (-1/2,-3/2)
arc (360:270:1/4) -- (-3/4,-2) -- (1/4,-2) -- (1/4,-7/4)
arc (270:180:1/4) -- (0,-3/2) -- (0,1/4)
arc (180:270:1/2) -- (2,-1/4) -- (2,1/4) -- (3/4,1/4)
arc (270:180:1/4) -- (1/2,3/2) arc (180:90:1/4) -- (3/4,2);
}
\path (-2,2) node {Hot resevoir $T_h$} (-2,-2) node {Cold resevoir $T_c$};
\draw [red!75, line width=1cm/4, ->] (0,3/2) -- (0,1/2);
\draw [red!75, line width=1cm/8, ->] (-1/4,-1/2) -- (-1/4,-3/2);
\draw [blue!75, line width=1cm/8, ->] (1,0) -- (2,0);
\end{tikzpicture}
\end{document}

And here's a version that includes an intriguing use for a decoration.
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations,arrows.meta}
\newcount\pgfalphacount
\pgfdeclaredecoration{alpha-labels}{setup}{
\state{setup}[width=0pt, next state=label,
persistent precomputation={\pgfalphacount=1}]{}
\state{label}[width=\pgfdecoratedinputsegmentlength,
persistent postcomputation={\advance\pgfalphacount by1}]
{\expandafter\pgfcoordinate\expandafter%
{\csname pgffor@alpha\endcsname\pgfalphacount}{\pgfpointorigin}}
}
\pgfdeclareverticalshading{heat}{100bp}{%
color(0bp)=(white); color(25bp)=(white); color(30bp)=(blue!50);
color(70bp)=(red!50); color(75bp)=(white); color(100bp)=(white)}
\begin{document}
\begin{tikzpicture}[>={Triangle[angle=60:1 2]}]
\path [shading=heat, postaction={decoration=alpha-labels, decorate}]
(-2, 2) -- (-2, 3/2) -- (-1/2, 3/2) -- (-1/2, -3/2) -- (-2,-3/2) --
(-2,-2) -- (2,-2) -- (2,-3/2) -- (0,-3/2) -- (0,1/4)
arc (180:270:1/2) -- (3/2,-1/4) -- (3/2,1/4) -- (3/4,1/4)
arc (270:180:1/4) -- (1/2,3/2) -- (2,3/2) -- (2,2) -- cycle;
\draw (b) -- (c) (e) -- (d) (h) -- (i) (p) -- (q);
\draw (c) ++(-1/4,1/4) arc (90:0:1/4) -- (d) arc (360:270:1/4);
\draw (i) ++(1/4,-1/4) arc (270:180:1/4) -- (j) arc (180:270:1/2) -- (l)
(m) -- (n) arc (270:180:1/4) -- (p) arc (180:90:1/4);
\path (-2,2) node {Hot resevoir $T_h$} (-2,-2) node {Cold resevoir $T_c$};
\draw [red!75, line width=1cm/4, ->] (0,3/2) -- (0,1/2);
\draw [red!75, line width=1cm/8, ->] (-1/4,-1/2) -- (-1/4,-3/2);
\draw [blue!75, line width=1cm/8, ->] (1,0) -- (2,0);
\end{tikzpicture}
\end{document}
