-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
PIDcircuitTikZ.tex
1398 lines (1276 loc) · 64.6 KB
/
PIDcircuitTikZ.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% MIT License
%
% Copyright (c) 2018 Jelle Spijker
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.
\pdfminorversion=5
\pdfobjcompresslevel=2
\documentclass[a4paper]{ltxdoc}
\usepackage[hyphens]{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage[version=latest]{pgf}
\usepackage{calc,listings,tikz,units}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true, % use true to enable colors below:
linkcolor=blue,%red,
filecolor=blue,%magenta,
urlcolor=blue,%cyan,
citecolor=blue,
pdfborder=0 0 0,
}
\usepackage{tikz}
\usetikzlibrary{backgrounds, circuits.pid.ISO14617}
\newif\ifgdccodebasic
\newif\ifgdccodeogdf
\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{xxcolor}
\usepackage{makeidx}
\usepackage{enumitem}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{siunitx}
\usepackage{tabu}
\input{pgfmanual-en-macros}
\def\pgfautoxrefs{1}
\def\unitexample#1{%
\texttt{#1}\indexkey{#1}
&
\tikz [baseline,inner sep=0pt] \node[#1=1] {};\\
}
\def\pidlineexample#1{
\texttt{#1}\indexkey/ISO14617/#1
&
\tikz[baseline=-.5ex,circuit pid ISO14617] \draw (0,0) to [#1] (3,0);
}
\newcommand{\pidsymbolexample}[4]{
\texttt{#1}\index{ISO14617!#1@\protect\texttt{#1}}
&
\texttt{#2}\indexkey{#2}
&
\texttt{#4}
&
\tikz[baseline=-.5ex,circuit pid ISO14617] \draw (0,0) to [#2={#3}] (1.5,0)(3,0); \\
}
\newcommand{\pidsimplesymbolexample}[4]{
\texttt{#1}\index{ISO14617!#1@\protect\texttt{#1}}
&
\texttt{#2}\indexkey{#2}
&
\texttt{#4}
&
\tikz[baseline=-.5ex,circuit pid ISO14617] \node[#2={#3}] (0,0) {}; \\
}
\newcommand{\pidmeasurementsymbol}[5]{
\texttt{#1}\index{Symbols!#1@\protect\texttt{#1}}
&
\texttt{#2}\index{ISO14617!#2@\protect\texttt{#2}}
&
\texttt{#3}\index{ISO14617!#3@\protect\texttt{#3}}
&
\texttt{#4}\index{ISO14617!#4@\protect\texttt{#4}}
&
\texttt{#5}\index{ISO14617!#5@\protect\texttt{#5}} \\ \hline
}
\def\empty{}
\makeatletter
\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index}}
\renewcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{2.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi}
\renewcommand*\l@subsection{\@dottedtocline{2}{2.5em}{3.3em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{5.8em}{4.2em}}
\def\@pnumwidth{2.2em}
\makeatother
\RequirePackage{pgfmanual}
\pgfkeys{
% whenever an unqualified key is found, the following key prefix
% list is tried to find a match.
/pdflinks/search key prefixes in={/tikz/,/pgf/},
%
% the link prefix written to the pdf file:
/pdflinks/internal link prefix=pgfp,
%
/pdflinks/codeexample links=true,
/pdflinks/warnings=false, % for debugging
/pdflinks/show labels=false,% for debugging
}
% Global styles:
\tikzset{
every plot/.style={prefix=plots/pgf-},
shape example/.style={
color=black!30,
draw,
fill=yellow!30,
line width=.5cm,
inner xsep=2.5cm,
inner ysep=0.5cm}
}
\makeindex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This file really starts here, all the above is for pgfmanual
% compatibility
% \usetikzlibrary{tikzlibrarycircuits.pid}
\tikzset{circuit symbol unit=2.5mm}
\sloppy
\def\d{2}
% counter for automatic placement
\newcount\xpos
\newcount\ypos
\begin{document}
\title{Typesetting a Process and Instrumentation Diagram with \LaTeX{} and \tikzname{}}
\author{Jelle Spijker\\e-mail: \texttt{[email protected]}}
\date{Version: 1.0, Version date: 02/11/2018}
\maketitle
\section{Abstract}
This package contains a collection of symbols, intended to be used with a \emph{Process \& Instrumentation Diagram}. The symbols are meant to be in agreement with international standard ISO-14617. It extends and modifies, when needed, the \tikzname-library |circuits|. A drafting class is also included, which allows a \tikzname-library |circuits.pid| diagrams, to be presented as a standalone document.
\section{Introduction}
P\&IDs are used in a variety a industries, to design and illustrate the workings of various processes. The purpose of ISO 14617 in its final form is the creation of a library of harmonized graphical symbols for diagrams used in technical applications. Their work has been, and will be, performed in close cooperation between ISO and IEC. The ultimate result is intended to be published as a standard common to ISO and IEC, which their technical committees responsible for specific application fields can use in preparing International Standards and manuals. This \tikzname-library is a translation of these norms, such that the can be used in \LaTeX documents.
The author has access to the current ISO version, via his employer \textbf{Royal IHC}, these norms were bought by them and cannot be redistribute to the general public. However all individual ISO-14617 symbols can also be found at \href{https://www.iso.org/obp/ui#search}{ISO.org}, just search for 14617 and go to the graphical symbols tab.
\bigskip
\noindent The following sub norms are used for this \tikzname-library:
\begin{itemize}
\setlength\itemsep{0pt}
\item 14617-1 General information and indexes
\item 14617-2 Symbols having general application
\item 14617-3 Connections and related devices
\item 14617-4 Actuators and related devices
\item 14617-5 Measurement and control devices
\item 14617-6 Measurement and control functions
\item 14617-7 Basic mechanical components
\item 14617-8 Valves and dampers
\item 14617-9 Pumps, compressors and fans
\item 14617-10 Fluid power converters
\item 14617-11 Devices for heat transfer and heat engines
\item 14617-12 Devices for separating, purification and mixing
\item 14617-13 Devices for material processing
\item 14617-14 Devices for transport and handling of material
\item 14617-15 Installation diagrams and network maps
\end{itemize}
\section{Example}
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617, every info/.style={black, font=\tiny}]
\begin{complex device}[name=solar absorption cooler, xshift=-160mm, yshift=100mm, show border, show label]
\coordinate (solar absorption cooler base) at (0,0);
\node[envelope={name=SC1, light, quantity transition to higher, info={[xshift=-2, yshift=-10]T},
info'={[xshift=10, yshift=30]\( SC_{1} \)}}] at (solar absorption cooler base) {};
\node[pressure vessel={name=T1, info={[yshift=-15]right:\( T_{1} \)}, rotate=90, anchor=north,
circuit symbol size=width 5 height 3}] at ($(SC1.output)+(\d,0)$) {};
\node[pump={name=P1, displacement, info=\( P_{1} \)}] at ($(SC1)!0.5!(T1)-(0,\d)$) {};
\node[envelope={name=G1, with={heating coil}{0}{0},info={[xshift=10]\( G_{1} \)}}] at ($(T1)+(2*\d,0)$) {};
\node[pump={name=P2, displacement, info=\( P_{2} \)}] at ($(T1)!0.5!(G1)+(0,\d)$) {};
\node[envelope={name=R1, device for separating, info={[yshift=-15]CH}, info'=above:\( R_{1} \)}]
at ($(G1)+(\d,0)$) {};
\node[envelope={name=C1, with={heating coil}{0}{0},info={[xshift=-5]\( C_{1} \)}}] at ($(R1)+(\d,0)$) {};
\node[valve={name=V1, info={\( V_{1} \)}, rotate=90}] at ($(C1.south)-(-\d,2*\d)$) {};
\node[envelope={name=E1, with={heating coil}{0}{0},info={[xshift=-5]\( E_{1} \)}}] at ($(V1)-(\d,2*\d)$) {};
\node[cooling tower={name=CT1, with={spray nozzle}{0}{2.5}, info=\( CT_{1} \)}] at ($(C1)+(2*\d,0)$) {};
\node[pump={name=P3, displacement, rotate=-90, info={\( P_{3} \)}}] at (CT1 |- V1) {};
\node[coil shaped heat exchanger={name=H1, rotate=90, info=\( H_{1} \), huge circuit symbols},
anchor=refrigerant in] at ($(G1)-(0,\d+0.125*\d)$) {};
\node[pump={name=P4, displacement, info=\( P_{4} \), rotate=90}] at (V1 -| H1.input) {};
\node[valve={name=V2, info=\( V_{2} \), rotate=90}] at (P4 -| H1.refrigerant in) {};
\node[envelope={name=A1, with={heating coil}{0}{0}, info={[xshift=5]\( A_{1} \)}}] at ($(V2)-(0,\d)$) {};
% === Solar refrigerant system ===
\begin{flow system}[color=red!80!white, id=010]
\draw[flow path, id=P001, show'] (T1.north) to (SC1);
\draw[flow path, id=P002, show, pos=0.8] (SC1) to (P1 -| SC1) to (P1);
\draw[flow path, id=P003, show, pos=0.2] (P1) to (P1 -| T1) to (T1.west);
\draw[flow path, id=P004, show', pos=0.85] (G1-heating coil.south) to ($(G1-heating coil.south -| T1.south)$);
\draw[flow path, id=P005, show, pos=0.75] (T1) to (T1 |- P2) to (P2);
\draw[flow path, id=P006, show, pos=0.3] (P2) to (P2 -| G1) to (G1-heating coil.north);
\end{flow system}
% == Cooling water system ===
\begin{flow system}[id=020, color=blue!80]
\draw[flow path, id=P001, show] (C1-heating coil.north) to (CT1-spray nozzle.north -| C1)
to (CT1-spray nozzle.north);
\draw[flow path, id=P002, show'] (CT1.south) to (P3);
\draw[flow path, id=P003, show'] (P3) to (P3 |- A1-heating coil.south) to (A1-heating coil.south);
\draw[flow path, id=P004, show, pos=0.3] (A1-heating coil.north) to (A1-heating coil.north -| C1)
to (C1-heating coil.south);
\end{flow system}
% === NH3 refrigerant
\begin{flow system}[id=030, color=red!50!black]
\draw[flow path, id=P001, show] (R1) to (C1);
\draw[flow path, id=P002, show', pos=0.75] (C1) to (C1 -| V1) to (V1);
\draw[flow path, id=P004, show', pos=0.85] (V1) to (V1 |- E1) to (E1);
\draw[flow path, id=P005, show'] (E1) to (E1 -| A1) to (A1);
\crossings{020P003}{030P004}
\end{flow system}
% === NH3-H20 refrigerant
\begin{flow system}[id=040, color=green!50!blue]
\draw[flow path, id=P001, show] (G1) to (R1);
\draw[flow path, id=P002, show'] (R1) to ++(0,-0.75\d) to ([xshift=5]\currentcoordinate -| G1)
to ([xshift=5]G1.south);
\draw[flow path, id=P003, show'] (H1.refrigerant in) to (V2);
\draw[flow path, id=P004, show'] (V2) to (A1);
\draw[flow path, id=P005, show, pos=0.75] (A1) to (A1 -| P4) to (P4);
\draw[flow path, id=P006, show] (P4) to (H1.input);
\draw[flow path, id=P007, show] (H1.output) to (G1.south -| H1.output);
\draw[flow path, id=P008, show', pos=0.8] (G1) to (G1 -| H1.refrigerant out) to (H1.refrigerant out);
\crossings{010P004}{040P008};
\end{flow system}
\end{complex device}
\end{tikzpicture}
\end{codeexample}
\newpage
\section{P\&ID library}
The |circuit pid| libraries can be used to draw different kind of \emph{Process \& Instrumentation Diagrams}. It is not a single library, but a hierarchy of libraries that work in concert. The main goal was to convert the ISO-14617 symbols and drawing conventions to a \LaTeX / \tikzname\ environment. This library is setup in such a way that it can easily be extended with different drawing conventions and norms.
A P\&ID circuit typically consist of numerous elements, such as pumps, valves, heaters, actuators, sensors, tanks etc; which are connected through a flow of a certain quantity, usually: mass, volume, electrical charge or information. In
\pgfname/\tikzname, we use nodes for these elements and normal lines for the flow of a quantity. \tikzname\ offers a large number of different ways of positioning and connecting nodes in general, all of which can be used here. Additionally, the |circuits.pid| library defines additional useful commands, such as |to|-path, |with|-node and |at|-node. Those are useful for elements such as actuators en sensors, or for the combination of various nodes configurations.
A simple example shows how a P\&ID could be created. A user has to decide which symbol graphics he would like to use. Which only option (at the time) is the ISO-14617 norm at the moment. By include the library |circuits.pid.ISO14617| in the preamble of his document.
\begin{codeexample}[code only]
\usetikzlibrary{circuits.pid.ISO14617}
\end{codeexample}
To create a \tikzname-picture illustrating the process of pumping a fluid between two tanks the following code suffices.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617]
\node[tank={name=T1}] at (0,0) {};
\node[tank={name=T2}] at (3,0) {};
\draw (T1) to [pump] (T2);
\end{tikzpicture}
\end{codeexample}
The example above can be extended with the use of \emph{annotations}, these are extensions for nodes, that give supplementary information. The pump used in the previous example can easily desribed as a displacement pump, with the use of annotations.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617]
\draw (0,0) to [pump=displacement] (2,0);
\end{tikzpicture}
\end{codeexample}
\subsection{The Base Circuit Library}
The following sections is directly copied out of the \pgfname/\tikzname-manual, such that this manual can be used as a stand-alone document. The code and examples are converted from electrical type circuits to P\&ID circuits.
\begin{tikzlibrary}{circuits}
This library is a base library that is included by other circuit
libraries. You do not include it directly, but you will typically
use some of the general keys, described below.
\end{tikzlibrary}
\begin{key}{/tikz/circuits}
This key should be passed as an option to a picture or a scope that
contains a circuit. It will do some internal setups. This key is
normally called by more specialized keys like |circuit ee IEC| or |circuit pid ISO14617|.
\end{key}
\subsubsection{Symbol Size}
\begin{key}{/tikz/circuit symbol unit=\meta{dimension} (initially 7pt)}
This dimension is a ``unit'' for the size of symbols. The libraries
generally define the sizes of symbols relative to this
dimension. For instance, the symbol of a pump, by
default, in the ISO14617 library equal to two and a half times this
\meta{dimension}. When you change this \meta{dimension}, the size of
all symbols will automatically change accordingly.
Note, that it is still possible to overwrite the size of any
particular symbol. These settings apply only to the default sizes.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617]
\draw (0,1) to [valve] (3.5,1);
\draw[circuit symbol unit=14pt]
(0,0) to [valve] (3.5,0);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{stylekey}{/tikz/huge circuit symbols}
This style sets the default circuit symbol unit to |10pt|.
\end{stylekey}
\begin{stylekey}{/tikz/large circuit symbols}
This style sets the default circuit symbol unit to |8pt|.
\end{stylekey}
\begin{stylekey}{/tikz/medium circuit symbols}
This style sets the default circuit symbol unit to |7pt|.
\end{stylekey}
\begin{stylekey}{/tikz/small circuit symbols}
This style sets the default circuit symbol unit to |6pt|.
\end{stylekey}
\begin{stylekey}{/tikz/tiny circuit symbols}
This style sets the default circuit symbol unit to |5pt|.
\end{stylekey}
\begin{key}{/tikz/circuit symbol size=|width| \meta{width} |height|
\meta{height}}
This key sets |minimum height| to \meta{height} times the current
value of the circuit symbol unit and the |minimum width| to
\meta{width} times this value. Thus, this option can be used with a
node command to set the size of the node as a multiple of the
circuit symbol unit.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617]
\draw (0,1) to [valve] (2,1) to[pump] (4,1);
\begin{scope}
[every valve/.style={circuit symbol size=width 4 height 1}]
\draw (0,0) to [valve] (2,0) to[pump] (4,0);
\end{scope}
\end{tikzpicture}
\end{codeexample}
\end{key}
\subsubsection{Declaring New Symbols}
\begin{key}{/tikz/circuit declare symbol=\meta{name}}
This key is used to declare a symbol. It does not cause this symbol
to be shown nor does it set a graphic to be used for the symbol, it
simply ``prepares'' several keys that can later be used to draw a
symbol and to configure it.
In detail, the first key that is defined is just called
\meta{name}. This key should be given as an option to a |node| or on
a |to| path, as explained below. The key will take options, which
can be used to influence the way the symbol graphic is rendered.
Let us have a look at an example. Suppose we want to define a symbol
called |foo|, which just looks like a simple rectangle. We could
then say
\begin{codeexample}[code only]
\tikzset{circuit declare symbol=foo}
\end{codeexample}
The symbol could now be used like this:
\begin{codeexample}[code only]
\node [foo] at (1,1) {};
\node [foo={red}] at (2,1) {};
\end{codeexample}
However, in the above example we would not actually see anything
since we have not yet set up the graphic to be used by |foo|. For
this, we must use a key called |set foo graphic| or, generally,
|set| \meta{name} |graphic|. This key gets graphic options as parameter
that will be set when a symbol |foo| should be shown:
\begin{codeexample}[]
\begin{tikzpicture}
[circuit pid ISO14617,
circuit declare symbol=foo,
set foo graphic={draw,shape=rectangle,minimum size=5mm}]
\node [foo] at (1,1) {};
\node [foo={red}] at (2,1) {};
\end{tikzpicture}
\end{codeexample}
In detail, when you use the key \meta{name}=\meta{options} with a
node, the following happens:
\begin{enumerate}
\item The |inner sep| is set to |0.5pt|.
\item The following style is executed:
\begin{stylekey}{/tikz/every circuit symbol}
Use this style to set up things in general.
\end{stylekey}
\item The graphic options that have been set using
|set| \meta{name} |graphic| are set.
\item The style |every |\meta{name} is executed. You can use it to
configure the symbol further.
\item The \meta{options} are executed.
\end{enumerate}
The key \meta{name} will have a different effect when it is used on
a |to| path command inside a |circuit| environment (the |circuit|
environment sets up |to| paths in such a way that the use of a key
declared using |circuit declare symbol| is automatically detected).
When \meta{name} is used on a |to| path, the above actions also
happen (setting the inner separation, using the symbol graphic, and
so on), but they are passed to the key |circuit handle symbol|,
which is explained next.
\end{key}
\begin{key}{/tikz/circuit handle symbol=\meta{options}}
This key is mostly used internally. Its purpose is to render a
symbol. The effect of this key differs, depending on whether it is
used as the optional argument of a |to| path command or elsewhere.
If the key is not used as an argument of a |to| path command, the
\meta{options} are simply executed.
The more interesting case happens when the key is given on a |to|
path command. In this case, several things happen:
\begin{enumerate}
\item The |to| path is locally changed and set to an internal
path (which you should not try to change) that consists mostly of
a single straight line.
\item The \meta{options} are tentatively executed with filtering
switched on. Everything is filtered out, except for the key |pos|
and also the styles |at start|, |very near start|, |near start|,
|midway|, |near end|, |very near end|, and |at end|. If none of
them is found, |midway| is used.
\item The filtered option is used to determine a position for the
symbol on the path. At the given position (with |pos=0|
representing the start and |pos=1| representing the end), a node
will be added to the path (in a manner to be described presently).
\item This node gets \meta{options} as its option list.
\item The node is added by virtue of a special |markings|
decoration. This means that a |mark| command is executed that
causes the node to be placed as a mark on the path.
\item The marking decoration will automatically subdivide the path
and cause a line to be drawn from the start of the path to the
node's border (at the position that lies on a line from the node's
center to the start of the path) and then from the node's border
(at a position on the other side of the node) to the end of the
path.
\item The marking decoration will also take care of the case that
multiple marks are present on a path, in this case the lines from
and to the borders of the nodes are only between consecutive
nodes.
\item The marking decoration will also rotate the coordinate system
in such a way that the $x$-axis points along the path. Thus, if
you use the |transform shape| option, the node will ``point
along'' the path.
\item In case a node is at |pos=0| or at |pos=1| some special code
will suppress the superfluous lines to the start or end of the
path.
\end{enumerate}
\end{key}
\subsubsection{Pointing Symbols in the Right Direction}
Unlike normal nodes, which generally should not be rotated since this
will make their text hard to read, symbols often need to be
rotated. There are two ways of achieving such rotations:
\begin{enumerate}
\item When you place a symbol on a |to| path, the graphic symbol is
automatically rotated such that it ``points along the path.'' Here
is an examples that shows how the pump shape is automatically rotated around:
\begin{codeexample}[]
\tikz [circuit pid ISO14617]
\draw (3,0) to[valve] (1,0) to[pump] (0,2);
\end{codeexample}
\item Many shapes cannot be placed ``on'' a path in this way, namely
whenever there are more than two possible inputs. Also, you may wish
to place the nodes first, possibly using a matrix, and connect them
afterwards. In this case, you can simply add rotations like
|rotate=90| to the shapes to rotate them. The following four keys
make this slightly more convenient:
\begin{key}{/tikz/point up}
This is the same as |rotate=90|.
\begin{codeexample}[]
\tikz [circuit pid ISO14617] \node [pump,point up] {};
\end{codeexample}
\end{key}
\begin{key}{/tikz/point down}
This is the same as |rotate=-90|.
\begin{codeexample}[]
\tikz [circuit pid ISO14617] \node [pump,point down] {};
\end{codeexample}
\end{key}
\begin{key}{/tikz/point left}
This is the same as |rotate=-180|.
\begin{codeexample}[]
\tikz [circuit pid ISO14617] \node [pump,point left] {};
\end{codeexample}
\end{key}
\begin{key}{/tikz/point right}
This key has no effect.
\begin{codeexample}[]
\tikz [circuit pid ISO14617] \node [pump,point right] {};
\end{codeexample}
\end{key}
\end{enumerate}
\subsubsection{Info Labels}
Info labels are used to add text to a circuit symbol. Unlike normal
nodes like a rectangle, circuit symbols typically do not have text
``on'' them, but the text is placed next to them (like the text
``$\SI{3}{\meter\per\second}$'' next to a pump).
\tikzname\ already provides the |label| option for this purpose. The
|info| option is built on top of this option, but it comes in some
predefined variants that are especially useful in conjunction with
circuits.
\begin{key}{/tikz/info=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
This key has nearly the same effect as the |label| key, only the
following style is used additionally automatically:
\begin{stylekey}{/tikz/every info}
Set this style to configure the styling of info labels. Since this
key is \emph{not} used with normal labels, it provides an easy way
of changing the way info labels look without changing other
labels.
\end{stylekey}
The \meta{options} and \meta{angle} are passed directly to the
|label| command.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617, every info/.style=red]
\node [valve,info=$\SI{3}{\meter\per\second}$] {};
\end{tikzpicture}
\end{codeexample}
Hint: To place some text \emph{on} the main node, use |center| as
the \meta{angle}:
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617,every info/.style=red]
\node [pump,info=center:$\SI{3}{\meter\per\second}$] {};
\node [pump,point up,info=center:$P_1$] at (2,0) {};
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/tikz/info'=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
This key works exactly like the |info| key, only in case the
\meta{angle} is missing, it defaults to |below| instead of the
current value of |label position|, which is usually |above|. This
means that when you use |info|, you get a label above the node,
while when you use the |info'| key you get a label below the
node. In case the node has been rotated, the positions of the info
nodes are rotated accordingly.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617,every info/.style=red]
\draw (0,0) to[valve={info={$\SI{3}{\meter\per\second}$},info'={$V_1$}}] (3,0)
to[pump={info={$\SI{3}{\meter\per\second}$},info'={$P_1$}}] (3,2);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/tikz/info sloped=\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{text}}
This key works like |info|, only the |transform shape| option is set
when the label is drawn, causing it to follow the sloping of the
main node.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617,every info/.style=red]
\draw (0,0) to[valve={info sloped={$\SI{3}{\meter\per\second}$}}] (3,0)
to[valve={info sloped={$\SI{3}{\meter\per\second}$}}] (3,2);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/tikz/info' sloped=}
This is a combination of |info'| and |info sloped|.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617,every info/.style=red]
\draw (0,0) to[valve={info' sloped={$\SI{3}{\meter\per\second}$}}] (3,0)
to[valve={info' sloped={$\SI{3}{\meter\per\second}$}}] (3,2);
\end{tikzpicture}
\end{codeexample}
\end{key}
\begin{key}{/tikz/circuit declare unit=\marg{name}\marg{unit}}
This key is used to declare keys that make it easy to attach
physical units to nodes. The idea is that instead of
|info=$\SI{3}{\meter\per\second}$| you can write |speed=3| or instead of
|info'=$\SI{1}{\cubic\meter\per\second}$| you can write |volume flow'=5|. Although units can be described as |$\frac{m^3}{s}$| it is good practice to make us of the |siunitx| package.
In detail, four keys are defined, namely |/tikz/|\meta{name},
|/tikz/|\meta{name}|'|, |/tikz/|\meta{name} |sloped|, and
|/tikz/|\meta{name}|'| |sloped|. The arguments of all of these keys
are of the form
\opt{|[|\meta{options}|]|\meta{angle}|:|}\meta{value} and it is
passed (slightly modified) to the corresponding key |info|, |info'|,
|info| |sloped|, or |info'| |sloped|. The ``slight modification'' is the
following: The text that is passed to the, say, |info| key is not
\meta{value}, but rather |$\mathrm{|\meta{value}\meta{unit}|}$|
This means that after you said |circuit declare unit={speed}{\si{\meter\per\second}}|,
then |speed=5| will have the same effect as
|info={[every ohm]$\mathrm{5\si{\meter\per\second}}$}|. Here, |every speed| is a style that allows you to configure the appearance of this unit. Since the |info| key is used internally, by changing the |every info| style, you can change the appearance of all units infos.
\begin{codeexample}[]
\begin{tikzpicture}[circuit pid ISO14617,
circuit declare unit={my speed}{\si{\kilo\meter\per\hour}}]
\draw (0,0) to[valve={my speed' sloped=3}] (3,2);
\end{tikzpicture}
\end{codeexample}
\end{key}
\medskip
\noindent The |circuit.pid| library predefines the following unit keys:
\medskip
\begin{tabu}{p{5cm} c}
\emph{Key} & \emph{Appearance of $1$ unit} \\[.25em]
\unitexample{/tikz/speed}
\unitexample{/tikz/mass flow}
\unitexample{/tikz/volume flow}
\end{tabu}
\subsection{The P\&ID library}
\begin{tikzlibrary}{circuits.pid}
This library defines general keys for the creation of \emph{Process \& Instrumentation Diagrams}. This library is written as an extension of \tikzname-library |circuits|. It allows for the creation of new type of circuit diagram, using the same syntax and conventions established by \tikzname-library |circuits|. The reader is urged to read the Section~``Circuit Libraries'' of \tikzname\ manual.
\end{tikzlibrary}
\noindent The following keys are defined:
\begin{key}{/tikz/circuit pid}
This key should be passed as an option to a picture or a scope that contains a diagram. It will do some internal setups. At the time of writing only ISO-14617 P\&ID are implemented. You normally do not use this library directly since it does not
define any symbol graphics; This is done with the sublibrary |circuits.pid.ISO14617|
\end{key}
\begin{key}{/tikz/measure=\opt{\meta{options}}}
A
\tabulinesep=1mm
\begin{tabu}{|l c | X[l] | X[l] | X[l] |}\hline
\rowfont{\bfseries}Symbol & & Measured or initiating variable & Modifier & Function \\ \hline
\pidmeasurementsymbol{1051}{A}{}{}{alarming}
\pidmeasurementsymbol{1052}{B}{}{}{displaying discrete state}
\pidmeasurementsymbol{1053}{C}{}{}{controlling}
\pidmeasurementsymbol{1054}{D}{density}{difference}{}
\pidmeasurementsymbol{1055}{E}{electric variable}{}{sensing}
\pidmeasurementsymbol{1056}{F}{flow rate}{ratio, fraction}{}
\pidmeasurementsymbol{1057}{G}{gauge, position, length}{}{viewing}
\pidmeasurementsymbol{1058}{H}{hand}{}{}
\pidmeasurementsymbol{1059}{I}{}{}{indicating}
\pidmeasurementsymbol{1060}{J}{power}{scanning}{}
\pidmeasurementsymbol{1061}{K}{time}{time rate of change}{}
\pidmeasurementsymbol{1062}{L}{level}{}{}
\pidmeasurementsymbol{1063}{M}{moisture, humidity}{momentarily}{}
\pidmeasurementsymbol{1064}{N}{user's choice}{}{user's choice}
\pidmeasurementsymbol{1065}{O}{user's choice}{}{}
\pidmeasurementsymbol{1066}{P}{pressure, vacuum}{}{connection of test point}
\pidmeasurementsymbol{1067}{Q}{quality}{integral, total}{integrating, summing}
\pidmeasurementsymbol{1068}{R}{radiation}{}{registering, recording}
\pidmeasurementsymbol{1069}{S}{speed, frequency}{}{switching}
\pidmeasurementsymbol{1070}{T}{temperature}{}{transmitting}
\pidmeasurementsymbol{1071}{U}{multi-variable}{}{multi-function}
\pidmeasurementsymbol{1072}{V}{user's choice}{}{impact on process by valve, pump, etc.}
\pidmeasurementsymbol{1073}{W}{weight, force}{Multiplying}{}
\pidmeasurementsymbol{1074}{X}{unclassified}{}{unclassified}
\pidmeasurementsymbol{1075}{Y}{user's choice}{}{converting, computing }
\pidmeasurementsymbol{1076}{Z}{number of events, quantity}{}{emergency or safety acting}
\end{tabu}
\end{key}
\begin{key}{/tikz/at}
test
\end{key}
\begin{key}{/tikz/with}
test
\end{key}
\begin{decoration}{/tikz/flow path}
test
\begin{key}{/tikz/id}
test
\end{key}
\begin{key}{/tikz/show}
test
\end{key}
\begin{key}{/tikz/show'}
test
\end{key}
\begin{key}{/tikz/pos}
test
\end{key}
\begin{key}{/tikz/pos slope}
test
\end{key}
\end{decoration}
\subsection{Implementation: The P\&ID-symbols shape library}
\begin{pgflibrary}{shapes.gates.pid}
This library defines basic shapes that can be used by all pid-circuit
libraries. Currently, it defines the following shapes:
\begin{itemize}
\item |rectangle pid|
\item |circle pid|
\item |direction pid|
\end{itemize}
Additionally, the library defines the following arrow tip:
The |direction pid| arrow tip is basically the same as a |triangle 45|
arrow tip with rounded joins.
\begin{tabu}{l l}
\symarrow{direction pid}
\end{tabu}
However, unlike normal arrow tips, its size does \emph{not} depend on
the current line width. Rather, it depends on the value of its
arrow options, which should be set to the desired size. Thus, you
should say something like |\pgfsetarrowoptions{direction pid}{5pt}| to
set the size of the arrow.
\end{pgflibrary}
\begin{shape}{rectangle pid}
This shape is completely identical to a normal |rectangle|, only
there are two additional anchors: The |input| anchor is an alias for
the |west| anchor, while the |output| anchor is an alias for the
|east| anchor.
\end{shape}
\begin{shape}{circle pid}
Like the |rectangle pid| shape, only for circles.
\end{shape}
\begin{shape}{direction pid}
This shape is rather special. It is intended to be used to ``turn an
arrow tip into a shape.'' First, you should set the following key to
the name of an arrow tip:
\begin{key}{/pgf/direction pid arrow=\meta{right arrow tip name}}
The value of this key will be used for the arrow tip depicted in
an |direction pid| shape.
\end{key}
When a node of shape |direction pid| is created, several things
happen:
\begin{enumerate}
\item The size of the shape is computed according to the following
rules: The width of the shape is set up so that the left border of
the shape is at the left end of the arrow tip and the right border
is at the right end of the arrow tip. These left and right
``ends'' of the arrow are the tip end and the back end specified
by the arrow itself. You usually need not worry about this width
setting.
By comparison, the height of the arrow is given by the current
setting of |minimum height|. Thus, this key must have been set up
correctly to reflect the ``real'' height of the arrow tip. The
reason is that the height of an arrow is not specified when arrows
are declared and is, thus, not available, here.
Possibly, the height computation will change in the future to
reflect the real height of the arrow, so you should generally
set up the |minimum height| to be the same as the real height.
\item A straight line from left to right inside the shape's
boundaries is added to the background path.
\item The arrow tip, pointing right, is drawn before the background
path.
\end{enumerate}
The anchors of this shape are just the compass anchors, which lie on
a rectangle whose width and height are the above-computed height and
width.
\begin{codeexample}[]
\begin{tikzpicture}
\pgfsetarrowoptions{direction pid}{6cm}
\node[name=s,shape=direction pid,shape example,minimum height=0.7654*6cm] {};
\foreach \anchor/\placement in
{center/above, 30/above right,
north/above, south/below, east/left, west/right,
north east/above, south east/below, south west/below, north west/above,
input/left,output/right}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\begin{codeexample}[]
\begin{tikzpicture}[direction pid arrow=angle 45]
\node[name=s,shape=direction pid,shape example,minimum height=1.75cm] {};
\foreach \anchor/\placement in {north/above, south/below,
output/right, input/left}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\end{shape}
\subsection{Implementation: The ISO-14617 style P\&ID-symbol shape library}
\begin{pgflibrary}{shapes.gates.pid.ISO14617}
This library defines shapes for depicting pid symbols according to
the ISO14617 recommendations. These shapes will typically be
used in conjunction with the graphic mechanism detailed earlier, but
you can also used them directly.
\end{pgflibrary}
\begin{shape}{generic circle ISO14617}
This shape inherits from |circle pid|, which in turn is just a normal
|circle| with additional |input| and |output| anchors at the left
and right ends. However, additionally, this shape allows you to
specify a path that should be added before the background path using
the following key:
\begin{key}{/pgf/generic circle ISO14617/before background=\meta{code}}
When a node of shape |generic circle ISO14617| is created, the current
setting of this key is used as the ``before background path.''
This means that after the circle's background has been
drawn/filled/whatever, the \meta{code} is executed.
When the \meta{code} is executed, the coordinate system will have
been transformed in such a way that the point
$(1\mathrm{pt},0\mathrm{pt})$ lies at the right end of the circle
and $(0\mathrm{pt},1\mathrm{pt})$ lies at the top of the
circle. (More precisely, these points will lie exactly on the
middle of the radial line.)
\end{key}
Here is an examples of how to use this shape:
\begin{codeexample}[]
\tikz \node [generic circle ISO14617,
circuit symbol size = width 5 height 5,
/pgf/generic circle ISO14617/before background={
\pgfpathmoveto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfpathlineto{\pgfpoint{1pt}{0pt}}
\pgfpathlineto{\pgfpoint{0pt}{1pt}}
\pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfusepath{draw}
},
transform shape,
draw] {};
\end{codeexample}
\end{shape}
\begin{shape}{generic rectangle ISO14617}
The same as |generic circle ISO14617|, only now it inherits from |rectangle pid|, and it allows for non-uniform scaling along the x and y-axis.
This shape also allows you to use you to specify a path that should be added before the background path using
the following key:
\begin{key}{/pgf/generic rectangle ISO14617/before background=\meta{code}}
When a node of shape |generic rectangle ISO14617| is created, the current
setting of this key is used as the ``before background path.''
This means that after the rectangle's background has been
drawn/filled/whatever, the \meta{code} is executed.
When the \meta{code} is executed, the coordinate system will have
been transformed in such a way that the point
$(1\mathrm{pt},0\mathrm{pt})$ lies at the right end of the rectangle
and $(0\mathrm{pt},1\mathrm{pt})$ lies at the top of the
rectangle.
\end{key}
Here is an examples of how to use this shape:
\begin{codeexample}[]
\tikz \node [generic rectangle ISO14617,
circuit symbol size = width 5 height 5,
/pgf/generic rectangle ISO14617/before background={
\pgfpathmoveto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfpathlineto{\pgfpoint{1pt}{0pt}}
\pgfpathlineto{\pgfpoint{0pt}{1pt}}
\pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfusepath{draw}
},
transform shape,
draw] {};
\end{codeexample}
When the |circuit symbol size| key is changed the scale of the before background path is altered as well.
\begin{codeexample}[]
\tikz \node [generic rectangle ISO14617,
circuit symbol size = width 15 height 5,
/pgf/generic rectangle ISO14617/before background={
\pgfpathmoveto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfpathlineto{\pgfpoint{1pt}{0pt}}
\pgfpathlineto{\pgfpoint{0pt}{1pt}}
\pgfpathlineto{\pgfpoint{-0.5pt}{-0.5pt}}
\pgfusepath{draw}
},
transform shape,
draw] {};
\end{codeexample}
\end{shape}
\begin{shape}{2531 ISO14617}
A shape based on the |rectangle| with a top compartment, where the |input| and |output| anchors are placed at the top part of the rectangle. This shape is used for symbol 2531 which is a boiler/steam generator.
\begin{codeexample}[]
\begin{tikzpicture}
\node [2531 ISO14617,
circuit symbol size = width 20 height 20,
shape example,
draw] (s) {};
\foreach \anchor/\placement in
{center/above,
north/above, south/below, east/left, west/right,
north east/above, south east/below, south west/below, north west/above,
input/left,output/right}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\end{shape}
\begin{shape}{2518 ISO14617}
A shape based on the |rectangle| with a top compartment, where the following anchors are defined |input in|, |output in|, |input out| and |output out|. These anchors represent the ingoing flow and the return flow for a regenerative pre-heater.
\emph{ToDo:} \href{https://github.com/peer23peer/PIDcircuitTikZ/issues/1}{issue \#1}
\begin{codeexample}[]
\begin{tikzpicture}
\node [2518 ISO14617,
circuit symbol size = width 25 height 40,
shape example,
draw] (s) {};
\foreach \anchor/\placement in
{center/above,
north/above, south/below, east/left, west/right,
north east/above, south east/below, south west/below, north west/above,
input in/left,output in/right, input out/left,output out/right}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\end{shape}
\begin{shape}{2521 ISO14617}
A shape based on the |rectangle| with a bottom compartment, where the following anchors are defined |input| and |output|. This shape is used for symbol 2521 which is a cooling tower.
\begin{codeexample}[]
\begin{tikzpicture}
\node [2521 ISO14617,
circuit symbol size = width 20 height 40,
shape example,
draw] (s) {};
% \foreach \anchor/\placement in
% {center/above,
% north/above, south/below, east/left, west/right,
% north east/above, south east/below, south west/below, north west/above,
% input/left,output/right}
% \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
% node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\end{shape}
\begin{shape}{heat exchanger long ISO14617}
A shape based on the |rectangle| with a top and a bottom compartment, where the following anchors are defined |input|, |output|, |refrigerant in| and |refrigerant out|. This shape is used for symbol |2511| and |2514| which heat exhangers.
This shape allows the use for a custum background path using the following key:
\begin{key}{/pgf/heat exchanger long ISO14617/before background=\meta{code}}
When a node of shape |heat exchanger long ISO14617| is created, the current
setting of this key is used as the ``before background path.''
This means that after the shapes background has been
drawn/filled/whatever, the \meta{code} is executed.
When the \meta{code} is executed, the coordinate system will have
been transformed in such a way that the point
$(1\mathrm{pt},0\mathrm{pt})$ lies at the right end of the rectangle
and $(0\mathrm{pt},1\mathrm{pt})$ lies at the top of the
rectangle.
\end{key}
\begin{codeexample}[]
\begin{tikzpicture}
\node [heat exchanger long ISO14617,
circuit symbol size = width 25 height 50,
shape example,
draw] (s) {};
\foreach \anchor/\placement in
{center/above,
north/above, south/below, east/left, west/right,
north east/above, south east/below, south west/below, north west/above,
input/left,output/right,refrigerant in/left,refrigerant out/right}
\draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}