Circuitikz custom symbol

circuitikztikz-circuit-lib

I want to reproduce the circuit below:

enter image description here

How can I reproduce the circulator symbol? Circuitikz have some thermodynamic symbols library?

My code:

\documentclass{standalone}
\usepackage{circuitikz}

\begin{document}

    \begin{circuitikz}[scale=1.5]
        \draw (0,0) to (0,1.5);
        \draw (0,1.5) to (0.5,1.5);
        \draw (0.5,1.5) to [R, l_=$q_{refrigerator}$](1.5,1.5);
        \draw (1.5, 1.5) to (4,1.5);
        \draw (4,1.5) to (4,0);
        \draw (4,0) to [R, l_=$q$](0,0);
        \draw[dashed] (0.25,1.25) rectangle ++(1.5,2);
        \node[font=\sffamily, align = center] at (1,2.75) {Refrigerator\\or storage\\reservoir};
        \node[font=\sffamily, align = center] at (2,-0.5) {Channels of internally\\cooled device};
        \node[font=\sffamily, align = center] at (3,2.75) {Pump or\\compressor};
    \end{circuitikz}
\end{document}

enter image description here

Thanks!

Best Answer

Second version

The approach I used before (you can look at it in the history of the answer) was wrong. An explanation at the end.

You can leverage an empty source here, using the standard "decoration" for labels and the arrow --- which resembles a straight voltage. Then you can add the lines to the shape. After naming P the shape, you have a set of anchors that you can use. In this case, I used the expression (requires calc, but that is loaded by circuitikz):

($(P.center)!1!60:(P.east)$)

that expression means: consider the line from P.center to P.east, full length (this is the 1), then rotate it 60 degrees to find the requested coordinate. See TikZ manual around page 147, "The Syntax for Partway Modifiers".

I have added comments to the code to explain.

\documentclass[border=2.78mm]{standalone}
\usepackage[RPvoltages]{circuitikz}
\begin{document}

    \begin{circuitikz}[scale=1.5]
        \draw (0,0) to (0,1.5);
        \draw (0,1.5) to (0.5,1.5);
        % notice also how I have written the symbol here, and compare 
        % the position of the "f"
        \draw (0.5,1.5) to [R, l^=$\dot{q}_{\mathit{refrigerator}}$](1.5,1.5);
        % an empty generator with name "P" and its labels...
        \draw (1.5, 1.5) to[esource, name=P,
            l=$\dot{q}_{\mathit{circulator}}$,
            voltage=straight, v_<=$\dot{m}$,
            ] (4,1.5);
        % let's decorate it. Look at Ti*k*Z manual, page 147
        \draw [thick] ($(P.center)!1!60:(P.east)$) -- ($(P.center)!1!170:(P.east)$);
        \draw [thick] ($(P.center)!1!-60:(P.east)$) -- ($(P.center)!1!-170:(P.east)$);
        \draw (4,1.5) to (4,0);
        \draw (4,0) to [R, l_=$q$](0,0);
        \draw[dashed] (0.25,1.25) rectangle ++(1.5,2);
        \node[font=\sffamily, align = center] at (1,2.75) {Refrigerator\\or storage\\reservoir};
        \node[font=\sffamily, align = center] at (2,-0.5) {Channels of internally\\cooled device};
        \node[font=\sffamily, align = center] at (3,2.75) {Pump or\\compressor};
    \end{circuitikz}
\end{document}

enter image description here

Addendum The old answer used border anchor, which (as written explicitly in the manual) should not be used for this. They are used to position the label, voltages etc., and they track the rectangle around the symbol, not the symbol itself. Things are too tangled to change them in a backward-compatible way, so...

Related Question