%% tikzlibrarytikzphysics.fluids.code.tex %% ----------------------------------------------------------- %% Editable fluid-mechanics nodes and teaching schematics. %% %% Public nodes: %% fluid tank, fluid cylinder, pressure element, meniscus, %% rotating fluid, flow tube, liquid ring, u tube %% Public pics: %% u tube diagram, gas manometer, hydraulic press, %% fluid cylinder diagram, fluid tank diagram, pressure element diagram, %% rotating tube, rotating fluid diagram, buoyancy, flow tube diagram, %% meniscus diagram, capillary, surface tension ring, liquid ring diagram %% %% Geometry lengths accept TeX units or unitless centimetres. %% Levels are fractions of height; angles are in degrees. %% %% Author : Vaibhav Blayer %% Version : v1.8.0 (2026-10-11) %% License : LPPL 1.3c %% ----------------------------------------------------------- \usetikzlibrary{tikzphysics.core} \usetikzlibrary{tikzphysics.piston} \usetikzlibrary{calc,arrows.meta,patterns} \makeatletter \pgfkeysgetvalue{/tikz/fill/.@cmd}{\tikzphysics@fluid@nativefill} \pgfkeysgetvalue{/tikz/pattern/.@cmd}{\tikzphysics@fluid@nativepattern} \def\tikzphysics@fluid@applyfill#1{\tikzphysics@fluid@nativefill{#1}\pgfeov} \def\tikzphysics@fluid@applypattern#1{\tikzphysics@fluid@nativepattern{#1}\pgfeov} \tikzset{fluid pic base/.code={% \tikzset{fill/.code={\def\tikzphysics@fluid@picpaint{##1}\tikzphysics@fluid@applyfill{##1}}, pattern/.code={\def\tikzphysics@fluid@picpaint{##1}\tikzphysics@fluid@applypattern{##1}}}}, fluid liquid paint/.code={% \def\tikzphysics@fluid@none{none}% \ifx\tikzphysics@fluid@picpaint\tikzphysics@fluid@none \tikzset{fill=none}% \else\tikzset{fill}\fi}} \newdimen\tikzphysics@fluid@length \def\tikzphysics@fluid@positive#1#2{% \tikzphysics@resolve@length{\tikzphysics@fluid@length}{#2}% \pgfmathsetmacro#1{\tikzphysics@fluid@length/1cm}} \def\tikzphysics@fluid@fraction#1#2{% \pgfmathparse{#2}\edef#1{\pgfmathresult}% \ifpgfmathunitsdeclared \PackageError{tikzphysics}{Fluid fractions must be unitless}{Use a number between zero and one.}\fi \ifdim#1pt<0pt \PackageError{tikzphysics}{Fluid fraction below zero}{Use a number between zero and one.}\fi \ifdim#1pt>1pt \PackageError{tikzphysics}{Fluid fraction above one}{Use a number between zero and one.}\fi} \def\tikzphysics@fluid@scalar#1#2{% \pgfmathparse{#2}% \ifpgfmathunitsdeclared \PackageError{tikzphysics}{Fluid angles and bend must be unitless}{Use degrees for angles and a pure number for bend.}\fi \edef#1{\pgfmathresult}} \tikzset{ every fluid outline/.style={}, every fluid liquid/.style={}, every fluid secondary liquid/.style={fill=gray!55}, every fluid label/.style={inner sep=.12em}, every fluid arrow/.style={>=latex}, every fluid dimension/.style={every fluid arrow,<->}, fluid width/.store in=\fwvalue, fluid height/.store in=\fhvalue, fluid tube width/.store in=\ftvalue, fluid level/.store in=\flvalue, fluid left level/.store in=\fllvalue, fluid right level/.store in=\frlvalue, fluid bend/.store in=\fbvalue, fluid angle/.store in=\favalue, fluid sweep/.store in=\fsvalue, fluid body label/.store in=\fbody, fluid left label/.store in=\fleft, fluid right label/.store in=\fright, fluid dimension label/.store in=\fdim, fluid force label/.store in=\fforce, fluid volume label/.store in=\fvolume, fluid pressure label/.store in=\fpressure, fluid pressure increment label/.store in=\fdpressure, fluid angular velocity label/.store in=\fomega, fluid position label/.store in=\fposition, fluid horizontal axis label/.store in=\fxaxis, fluid vertical axis label/.store in=\fyaxis, fluid inlet velocity label/.store in=\fvin, fluid outlet velocity label/.store in=\fvout, fluid contact angle label/.store in=\ftheta, fluid rise label/.store in=\frise, fluid tension label/.store in=\ftension, fluid circumference force label/.store in=\fringforce, fluid radius label/.store in=\fradius, fluid defaults/.style={fill=gray!25,pattern=dots,pattern color=black!55,fluid width=3cm,fluid height=3cm, fluid tube width=.3cm,fluid level=.65,fluid left level=.7, fluid right level=.5,fluid bend=.2,fluid angle=230,fluid sweep=65, fluid body label={},fluid left label={},fluid right label={}, fluid dimension label={},fluid force label={$F$},fluid volume label={$V$},fluid pressure label={$p$},fluid pressure increment label={$p+dp$},fluid angular velocity label={$\omega$},fluid position label={$x$},fluid horizontal axis label={$x$},fluid vertical axis label={$y$},fluid inlet velocity label={$v_1$},fluid outlet velocity label={$v_2$},fluid contact angle label={$\theta$},fluid rise label={$h$},fluid tension label={$T\cos\theta$},fluid circumference force label={$T\cos\theta\,(2\pi r)$},fluid radius label={$r$}}, } \def\tikzphysics@fluid@setup{% \tikz@textfont% Apply native pic/picture font before resolving em lengths. \tikzphysics@fluid@positive\fw{\fwvalue}% \tikzphysics@fluid@positive\fh{\fhvalue}% \tikzphysics@fluid@positive\ft{\ftvalue}% \tikzphysics@fluid@fraction\fl{\flvalue}% \tikzphysics@fluid@fraction\fll{\fllvalue}% \tikzphysics@fluid@fraction\frl{\frlvalue}% \tikzphysics@fluid@scalar\fb{\fbvalue}% \tikzphysics@fluid@scalar\fa{\favalue}% \tikzphysics@fluid@scalar\fs{\fsvalue}% \coordinate (-origin) at (0,0); \coordinate (-center) at (.5*\fw,.5*\fh); \coordinate (-bottom) at (.5*\fw,0); \coordinate (-top) at (.5*\fw,\fh); \coordinate (-left) at (0,.5*\fh); \coordinate (-right) at (\fw,.5*\fh); } \def\tikzphysics@fluid@tubecheck{% \pgfmathparse{min(\fw,\fh)/3>\ft?1:0}% \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Fluid tube width is too large}{Use a tube width below one third of both width and height.}\fi \pgfmathparse{min(\fll,\frl)*\fh>\fw/2?1:0}% \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{U-tube levels intersect the bend}{Increase both levels or height, or reduce width.}\fi} \def\tikzphysics@fluid@utube{% \tikzphysics@fluid@tubecheck \path[fluid liquid paint,every fluid liquid] (0,\fll*\fh)--(0,.5*\fw) arc[start angle=180,end angle=360,radius=.5*\fw cm] --(\fw,\frl*\fh)--(\fw-\ft,\frl*\fh)--(\fw-\ft,.5*\fw) arc[start angle=0,end angle=-180,radius={(.5*\fw-\ft)*1cm}] --(\ft,\fll*\fh)--cycle; \draw[every fluid outline] (0,\fh)--(0,.5*\fw) arc[start angle=180,end angle=360,radius=.5*\fw cm]--(\fw,\fh); \draw[every fluid outline] (\ft,\fh)--(\ft,.5*\fw) arc[start angle=180,end angle=360,radius={(.5*\fw-\ft)*1cm}]--(\fw-\ft,\fh); \draw[every fluid outline] (0,\fll*\fh)--(\ft,\fll*\fh) (\fw-\ft,\frl*\fh)--(\fw,\frl*\fh); \coordinate (-left-surface) at (.5*\ft,\fll*\fh); \coordinate (-right-surface) at (\fw-.5*\ft,\frl*\fh); \node[every fluid label,left] at (0,\fll*\fh) {\fleft}; \node[every fluid label,right] at (\fw,\frl*\fh) {\fright}; \node[every fluid label,below] at (-bottom) {\fbody}; } \def\tikzphysics@fluid@tank{% \path[fluid liquid paint,every fluid liquid] (0,\fll*\fh)--(0,.2) .. controls (0,0) and (.1,0) .. (.25,0) --(\fw-.25,0).. controls (\fw,0) and (\fw,.1)..(\fw,.25) --(\fw,\frl*\fh)--cycle; \draw[every fluid outline] (0,\fh)--(0,.2) .. controls (0,0) and (.1,0)..(.25,0) --(\fw-.25,0).. controls (\fw,0) and (\fw,.1)..(\fw,.25)--(\fw,\fh); \coordinate (-left-surface) at (0,\fll*\fh); \coordinate (-right-surface) at (\fw,\frl*\fh); \coordinate (-surface) at (.5*\fw,{.5*(\fll+\frl)*\fh}); \draw[every fluid outline] (-left-surface)--(-right-surface); \node[every fluid label,left] at (-left-surface) {\fleft}; \node[every fluid label,right] at (-right-surface) {\fright}; \node[every fluid label,below] at (-bottom) {\fbody}; } \tikzset{physics fluid width/.style={fluid width={#1}},fluid width/.value required} \tikzset{physics fluid height/.style={fluid height={#1}},fluid height/.value required} \tikzset{physics fluid tube width/.style={fluid tube width={#1}},fluid tube width/.value required} \tikzset{physics fluid level/.style={fluid level={#1}},fluid level/.value required} \tikzset{physics fluid left level/.style={fluid left level={#1}},fluid left level/.value required} \tikzset{physics fluid right level/.style={fluid right level={#1}},fluid right level/.value required} \tikzset{physics fluid bend/.style={fluid bend={#1}},fluid bend/.value required} \tikzset{physics fluid angle/.style={fluid angle={#1}},fluid angle/.value required} \tikzset{physics fluid sweep/.style={fluid sweep={#1}},fluid sweep/.value required} \tikzset{physics fluid body label/.style={fluid body label={#1}},fluid body label/.value required} \tikzset{physics fluid left label/.style={fluid left label={#1}},fluid left label/.value required} \tikzset{physics fluid right label/.style={fluid right label={#1}},fluid right label/.value required} \tikzset{physics fluid dimension label/.style={fluid dimension label={#1}},fluid dimension label/.value required} \tikzphysics@declarehook{u tube} \tikzset{pics/u tube/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=2cm,fluid height=4cm,fluid left level=.75,fluid right level=.55,every u tube,#1]% \tikzphysics@fluid@setup \tikzphysics@fluid@utube % An optional second liquid above the interface in the left arm. \pgfmathparse{\fl>\fll?1:0} \ifnum\pgfmathresult=1 \path[every fluid secondary liquid] (0,\fll*\fh) rectangle (\ft,\fl*\fh); \draw[every fluid outline] (0,\fl*\fh)--(\ft,\fl*\fh); \fi \coordinate (-interface) at (-left-surface); \coordinate (-upper-surface) at (.5*\ft,{max(\fl,\fll)*\fh}); \end{scope} }},pics/u tube/.default={}, pics/physics u tube/.style={/tikz/pics/u tube={#1}},pics/physics u tube/.default={}} \tikzphysics@registeranchors{physicsutube}{origin,center,bottom,top,left,right,left-surface,right-surface,interface,upper-surface} \tikzphysics@registerdisplayname{physicsutube}{u tube diagram} \tikzphysics@registerkeydefaults{physicsutube}{fluid width/2cm,fluid height/4cm,fluid tube width/.3cm,fluid left level/.75,fluid right level/.55,fluid level/.65} \tikzphysics@declarehook{gas manometer} \tikzset{pics/gas manometer/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=1.8cm,fluid height=3.8cm,fluid left level=.45,fluid right level=.8,fluid body label={gas},every gas manometer,#1]% \tikzphysics@fluid@setup \let\fgaslabel\fbody\def\fbody{}\tikzphysics@fluid@utube \draw[every fluid outline] (\ft,\fh)--(\ft,\fh+.3)--(-.6,\fh+.3) --(-.6,\fh+.8)--(-2,\fh+.8)--(-2,\fh-1.3)--(-.6,\fh-1.3) --(-.6,\fh)--(0,\fh); \coordinate (-gas) at (-1.3,\fh-.25); \node[every fluid label] at (-gas) {\fgaslabel}; \end{scope} }},pics/gas manometer/.default={}, pics/physics gas manometer/.style={/tikz/pics/gas manometer={#1}},pics/physics gas manometer/.default={}} \tikzphysics@registeranchors{physicsgasmanometer}{origin,center,bottom,top,left,right,left-surface,right-surface,gas} \tikzphysics@registerdisplayname{physicsgasmanometer}{gas manometer} \tikzphysics@registerkeydefaults{physicsgasmanometer}{fluid width/1.8cm,fluid height/3.8cm,fluid tube width/.3cm,fluid left level/.45,fluid right level/.8} \tikzphysics@declarehook{hydraulic press} \tikzset{pics/hydraulic press/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=4cm,fluid height=3.5cm,fluid left level=.4,fluid right level=.8,fluid left label={$L$},fluid right label={$S$},every hydraulic press,#1]% \tikzphysics@fluid@setup \pgfmathparse{\ft<.3*\fw && min(\fll,\frl)*\fh>\ft?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Invalid hydraulic press geometry}{Reduce tube width or increase piston levels.}\fi \pgfmathsetmacro\faA{.32*\fw} \path[fluid liquid paint,every fluid liquid] (0,\fll*\fh)--(0,0)--(\fw,0)--(\fw,\frl*\fh) --(\fw-\ft,\frl*\fh)--(\fw-\ft,\ft)--(\faA,\ft)--(\faA,\fll*\fh)--cycle; \draw[every fluid outline] (0,\fh*.65)--(0,0)--(\fw,0)--(\fw,\fh); \draw[every fluid outline] (\faA,\fh*.65)--(\faA,\ft)--(\fw-\ft,\ft)--(\fw-\ft,\fh); \draw[every fluid outline,fill=gray!45] (0,\fll*\fh) rectangle (\faA,\fll*\fh+.12); \draw[every fluid outline,fill=gray!45] (\fw-\ft,\frl*\fh) rectangle (\fw,\frl*\fh+.12); \coordinate (-large-piston) at (.5*\faA,\fll*\fh+.12); \coordinate (-small-piston) at (\fw-.5*\ft,\frl*\fh+.12); \draw[every fluid arrow,->] ($( -small-piston)+(0,.7)$)--(-small-piston) node[pos=0,above,every fluid label] {\fforce}; \node[every fluid label,above] at (-large-piston) {\fbody}; \node[every fluid label,left] at (0,\fll*\fh) {\fleft}; \node[every fluid label,right] at (\fw,\frl*\fh) {\fright}; \draw[dashed,every fluid outline] (\faA,\fll*\fh)--(\fw-\ft,\fll*\fh); \end{scope} }},pics/hydraulic press/.default={}, pics/physics hydraulic press/.style={/tikz/pics/hydraulic press={#1}},pics/physics hydraulic press/.default={}} \tikzphysics@registeranchors{physicshydraulicpress}{origin,center,bottom,top,left,right,large-piston,small-piston} \tikzphysics@registerdisplayname{physicshydraulicpress}{hydraulic press} \tikzphysics@registerkeydefaults{physicshydraulicpress}{fluid width/4cm,fluid height/3.5cm,fluid tube width/.3cm,fluid left level/.4,fluid right level/.8} \tikzphysics@declarehook{fluid cylinder} \tikzset{pics/fluid cylinder/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=1.6cm,fluid height=3.2cm,every fluid cylinder,#1]% \tikzphysics@fluid@setup \path[fluid liquid paint,every fluid liquid] (0,\fl*\fh)--(0,.2) arc[start angle=180,end angle=360,x radius=.5*\fw cm,y radius=.2cm] --(\fw,\fl*\fh) arc[start angle=0,end angle=180,x radius=.5*\fw cm,y radius=.2cm]; \draw[every fluid outline] (.5*\fw,\fh) ellipse[x radius=.5*\fw cm,y radius=.2cm]; \draw[every fluid outline] (0,\fh)--(0,.2) arc[start angle=180,end angle=360,x radius=.5*\fw cm,y radius=.2cm]--(\fw,\fh); \draw[every fluid outline] (.5*\fw,\fl*\fh) ellipse[x radius=.5*\fw cm,y radius=.2cm]; \coordinate (-surface) at (.5*\fw,\fl*\fh); \node[every fluid label] at (.5*\fw,.5*\fl*\fh) {\fbody}; \end{scope} }},pics/fluid cylinder/.default={}, pics/physics fluid cylinder/.style={/tikz/pics/fluid cylinder={#1}},pics/physics fluid cylinder/.default={}} \tikzphysics@registeranchors{physicsfluidcylinder}{origin,center,bottom,top,left,right,surface} \tikzphysics@registerdisplayname{physicsfluidcylinder}{fluid cylinder diagram} \tikzphysics@registerkeydefaults{physicsfluidcylinder}{fluid width/1.6cm,fluid height/3.2cm,fluid level/.65} \tikzphysics@declarehook{fluid tank} \tikzset{pics/fluid tank/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid left level=.7,fluid right level=.7,every fluid tank,#1]% \tikzphysics@fluid@setup \tikzphysics@fluid@tank \end{scope} }},pics/fluid tank/.default={}, pics/physics fluid tank/.style={/tikz/pics/fluid tank={#1}},pics/physics fluid tank/.default={}} \tikzphysics@registeranchors{physicsfluidtank}{origin,center,bottom,top,left,right,left-surface,right-surface,surface} \tikzphysics@registerdisplayname{physicsfluidtank}{fluid tank diagram} \tikzphysics@registerkeydefaults{physicsfluidtank}{fluid width/3cm,fluid height/3cm,fluid left level/.7,fluid right level/.7} \tikzphysics@declarehook{pressure element} \tikzset{pics/pressure element/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=2cm,fluid height=.65cm,fluid body label={$A$},fluid left label={$pA$},fluid right label={$(p+dp)A$},fluid dimension label={$dx$},every pressure element,#1]% \tikzphysics@fluid@setup \path[fluid liquid paint,every fluid liquid] (0,0) rectangle (\fw,\fh); \draw[every fluid outline] (0,.5*\fh) ellipse[x radius=.12cm,y radius=.5*\fh cm]; \draw[every fluid outline] (\fw,.5*\fh) ellipse[x radius=.12cm,y radius=.5*\fh cm]; \draw[every fluid outline] (0,0)--(\fw,0) (0,\fh)--(\fw,\fh); \draw[every fluid arrow,->] (-.7,.5*\fh)--(-.13,.5*\fh) node[pos=0,above left,every fluid label]{\fleft}; \draw[every fluid arrow,->] (\fw+.7,.5*\fh)--(\fw+.13,.5*\fh) node[pos=0,above right,every fluid label]{\fright}; \node[every fluid label] at (-center) {\fbody}; \draw[every fluid dimension,->|] (-.4,-.35)--(0,-.35); \draw[every fluid dimension,|<-] (\fw,-.35)--(\fw+.4,-.35); \node[every fluid label,below] at (.5*\fw,-.35) {\fdim}; \end{scope} }},pics/pressure element/.default={}, pics/physics pressure element/.style={/tikz/pics/pressure element={#1}},pics/physics pressure element/.default={}} \tikzphysics@registeranchors{physicspressureelement}{origin,center,bottom,top,left,right} \tikzphysics@registerdisplayname{physicspressureelement}{pressure element diagram} \tikzphysics@registerkeydefaults{physicspressureelement}{fluid width/2cm,fluid height/.65cm} \tikzphysics@declarehook{rotating tube} \tikzset{pics/rotating tube/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=5cm,fluid height=.5cm,fluid level=.48,fluid dimension label={$dx$},every rotating tube,#1]% \tikzphysics@fluid@setup \pgfmathparse{\fl*\fw+\ft<\fw?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Rotating tube element leaves the tube}{Reduce level or tube width.}\fi \path[fluid liquid paint,every fluid liquid] (0,0) rectangle (\fw,\fh); \draw[every fluid outline] (0,0) rectangle (\fw,\fh); \draw[every fluid outline,every fluid element] (\fl*\fw,0) rectangle (\fl*\fw+\ft,\fh); \coordinate (-element-left) at (\fl*\fw,.5*\fh); \coordinate (-element-right) at (\fl*\fw+\ft,.5*\fh); \draw[every fluid arrow,->] (0,-.3)--(0,\fh+.9); \draw[every fluid arrow,->] (.32,\fh+.65) arc[start angle=25,end angle=335,x radius=.35cm,y radius=.12cm] node[right,every fluid label] {\fomega}; \draw[every fluid arrow,->] ($( -element-left)+(-.8,0)$)--(-element-left) node[pos=0,above,every fluid label] {\fpressure}; \draw[every fluid arrow,->] ($( -element-right)+(.8,0)$)--(-element-right) node[pos=0,above,every fluid label] {\fdpressure}; \draw[every fluid dimension] (0,-.3)--(\fl*\fw,-.3) node[midway,below,every fluid label] {\fposition}; \draw[every fluid dimension,->|] (\fl*\fw-.4,\fh+.3)--(\fl*\fw,\fh+.3); \draw[every fluid dimension,|<-] (\fl*\fw+\ft,\fh+.3)--(\fl*\fw+\ft+.4,\fh+.3); \node[every fluid label,above=1.5mm] at (\fl*\fw+.5*\ft,\fh+.3) {\fdim}; \end{scope} }},pics/rotating tube/.default={}, pics/physics rotating tube/.style={/tikz/pics/rotating tube={#1}},pics/physics rotating tube/.default={}} \tikzphysics@registeranchors{physicsrotatingtube}{origin,center,bottom,top,left,right,element-left,element-right} \tikzphysics@registerdisplayname{physicsrotatingtube}{rotating tube} \tikzphysics@registerkeydefaults{physicsrotatingtube}{fluid width/5cm,fluid height/.5cm,fluid tube width/.3cm,fluid level/.48} \tikzphysics@declarehook{rotating fluid} \tikzset{pics/rotating fluid/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=3cm,fluid height=3.5cm,fluid level=.5,fluid bend=.35,every rotating fluid,#1]% \tikzphysics@fluid@setup \pgfmathparse{\fb>=0 && \fl+\fb<=1?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Rotating surface leaves the vessel}{Use bend >= 0 and level + bend <= 1.}\fi \path[fluid liquid paint,every fluid liquid] (0,0)--(\fw,0)--(\fw,{(\fl+\fb)*\fh}) --plot[domain=\fw:0,samples=41] (\x,{\fh*(\fl+\fb*(2*\x/\fw-1)^2)})--cycle; \draw[every fluid outline] (0,\fh)--(0,0)--(\fw,0)--(\fw,\fh); \draw[every fluid outline] plot[domain=0:\fw,samples=41] (\x,{\fh*(\fl+\fb*(2*\x/\fw-1)^2)}); \coordinate (-vertex) at (.5*\fw,\fl*\fh); \coordinate (-rim-surface) at (\fw,{(\fl+\fb)*\fh}); \draw[every fluid arrow,->] (-vertex)--(.5*\fw,\fh+.3) node[above,every fluid label] {\fyaxis}; \draw[every fluid arrow,->] (-vertex)--(\fw+.5,\fl*\fh) node[right,every fluid label] {\fxaxis}; \end{scope} }},pics/rotating fluid/.default={}, pics/physics rotating fluid/.style={/tikz/pics/rotating fluid={#1}},pics/physics rotating fluid/.default={}} \tikzphysics@registeranchors{physicsrotatingfluid}{origin,center,bottom,top,left,right,vertex,rim-surface} \tikzphysics@registerdisplayname{physicsrotatingfluid}{rotating fluid diagram} \tikzphysics@registerkeydefaults{physicsrotatingfluid}{fluid width/3cm,fluid height/3.5cm,fluid level/.5,fluid bend/.35} \tikzphysics@declarehook{buoyancy} \tikzset{pics/buoyancy/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid left level=.8,fluid right level=.8,fluid body label={},fluid right label={$\rho_L$},every buoyancy,#1]% \tikzphysics@fluid@setup \tikzphysics@fluid@tank \coordinate (-body) at (.5*\fw,.38*\fh); \begin{scope}[shift={(-body)}] \draw[every fluid outline,fill=white] (-.45,0) .. controls (-.55,.25) and (-.1,.35)..(0,.52) .. controls (.3,.65) and (.45,.25)..(.5,.05) .. controls (.55,-.2) and (.25,-.45)..(0,-.5) .. controls (-.25,-.55) and (-.25,-.15)..cycle; \node[every fluid label] at (0,0) {\fvolume}; \foreach \a in {0,60,120,180,240,300}{ \draw[every fluid arrow,->] (\a:.9)--(\a:.56);} \end{scope} \end{scope} }},pics/buoyancy/.default={}, pics/physics buoyancy/.style={/tikz/pics/buoyancy={#1}},pics/physics buoyancy/.default={}} \tikzphysics@registeranchors{physicsbuoyancy}{origin,center,bottom,top,left,right,left-surface,right-surface,surface,body} \tikzphysics@registerdisplayname{physicsbuoyancy}{buoyancy} \tikzphysics@registerkeydefaults{physicsbuoyancy}{fluid width/3cm,fluid height/3cm,fluid left level/.8,fluid right level/.8} \tikzphysics@declarehook{flow tube} \tikzset{pics/flow tube/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=5cm,fluid height=1.3cm,fluid bend=.45,fluid left label={$A_1$},fluid right label={$A_2$},every flow tube,#1]% \tikzphysics@fluid@setup \path[fluid liquid paint,every fluid liquid] (0,0).. controls (.35*\fw,\fb*\fh) and (.65*\fw,-\fb*\fh)..(\fw,\fb*\fh) --(\fw,\fb*\fh+.55*\fh).. controls (.65*\fw,.55*\fh-\fb*\fh) and (.35*\fw,\fh+\fb*\fh)..(0,\fh)--cycle; \draw[every fluid outline] (0,0).. controls (.35*\fw,\fb*\fh) and (.65*\fw,-\fb*\fh)..(\fw,\fb*\fh) (0,\fh).. controls (.35*\fw,\fh+\fb*\fh) and (.65*\fw,.55*\fh-\fb*\fh)..(\fw,\fb*\fh+.55*\fh); \draw[every fluid outline] (0,0)--(0,\fh) (\fw,\fb*\fh)--(\fw,\fb*\fh+.55*\fh); \coordinate (-inlet) at (0,.5*\fh); \coordinate (-outlet) at (\fw,\fb*\fh+.275*\fh); \draw[every fluid arrow,->] (-inlet)--++(.8,0) node[right,every fluid label] {\fvin}; \draw[every fluid arrow,->] (-outlet)--++(.8,0) node[right,every fluid label] {\fvout}; \node[every fluid label,below] at (0,0) {\fleft}; \node[every fluid label,below] at (\fw,\fb*\fh) {\fright}; \end{scope} }},pics/flow tube/.default={}, pics/physics flow tube/.style={/tikz/pics/flow tube={#1}},pics/physics flow tube/.default={}} \tikzphysics@registeranchors{physicsflowtube}{origin,center,bottom,top,left,right,inlet,outlet} \tikzphysics@registerdisplayname{physicsflowtube}{flow tube diagram} \tikzphysics@registerkeydefaults{physicsflowtube}{fluid width/5cm,fluid height/1.3cm,fluid bend/.45} \tikzphysics@declarehook{meniscus} \tikzset{pics/meniscus/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=1.2cm,fluid height=2.7cm,fluid level=.7,fluid bend=.2,every meniscus,#1]% \tikzphysics@fluid@setup \pgfmathparse{\fl-abs(\fb)>=0 && \fl+abs(\fb)<=1?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Meniscus leaves the vessel}{Reduce the absolute bend or move the level.}\fi \path[fluid liquid paint,every fluid liquid] (0,0)--(\fw,0)--(\fw,\fl*\fh) .. controls (.67*\fw,{(\fl-\fb)*\fh}) and (.33*\fw,{(\fl-\fb)*\fh})..(0,\fl*\fh)--cycle; \draw[every fluid outline] (0,\fh)--(0,0)--(\fw,0)--(\fw,\fh); \draw[every fluid outline] (0,\fl*\fh).. controls (.33*\fw,{(\fl-\fb)*\fh}) and (.67*\fw,{(\fl-\fb)*\fh})..(\fw,\fl*\fh); \coordinate (-contact-left) at (0,\fl*\fh); \coordinate (-contact-right) at (\fw,\fl*\fh); \coordinate (-surface) at (.5*\fw,{(\fl-.75*\fb)*\fh}); % Contact angle measured inside the liquid between downward wall and tangent. \pgfmathsetmacro\fangle{atan2(-\fb*\fh,.33*\fw)} \draw[dashed,every fluid outline] (-contact-left)--++(\fangle:.7); \draw[every fluid outline] ($( -contact-left)+(0,-.4)$) arc[start angle=-90,end angle=\fangle,radius=.4cm]; \node[every fluid label] at ($( -contact-left)+({(-90+\fangle)/2}:.58)$) {\ftheta}; \end{scope} }},pics/meniscus/.default={}, pics/physics meniscus/.style={/tikz/pics/meniscus={#1}},pics/physics meniscus/.default={}} \tikzphysics@registeranchors{physicsmeniscus}{origin,center,bottom,top,left,right,contact-left,contact-right,surface} \tikzphysics@registerdisplayname{physicsmeniscus}{meniscus diagram} \tikzphysics@registerkeydefaults{physicsmeniscus}{fluid width/1.2cm,fluid height/2.7cm,fluid level/.7,fluid bend/.2} \tikzphysics@declarehook{capillary} \tikzset{pics/capillary/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=4cm,fluid height=3cm,fluid level=.35,fluid left level=.7,fluid bend=.12,every capillary,#1]% \tikzphysics@fluid@setup \pgfmathparse{\fb>=0 && \fll-.75*\fb>=\fl?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Invalid capillary rise}{Use bend >= 0 and left level - 0.75*bend >= level.}\fi \pgfmathsetmacro\fcL{.4*\fw} \pgfmathsetmacro\fcR{.6*\fw} \path[fluid liquid paint,every fluid liquid] (0,\fl*\fh)--(0,.2) .. controls (0,0) and (.1,0)..(.3,0)--(\fw-.3,0) .. controls (\fw,0) and (\fw,.1)..(\fw,.2)--(\fw,\fl*\fh)--cycle; \path[fluid liquid paint,every fluid liquid] (\fcL,\fl*\fh)--(\fcR,\fl*\fh)--(\fcR,\fll*\fh) .. controls (.53333*\fw,{(\fll-\fb)*\fh}) and (.46667*\fw,{(\fll-\fb)*\fh})..(\fcL,\fll*\fh)--cycle; \draw[every fluid outline] (0,\fh)--(0,.2).. controls (0,0) and (.1,0)..(.3,0) --(\fw-.3,0).. controls (\fw,0) and (\fw,.1)..(\fw,.2)--(\fw,\fh); \draw[every fluid outline] (\fcL,\fl*\fh-.2)--(\fcL,\fh) (\fcR,\fl*\fh-.2)--(\fcR,\fh); \draw[every fluid outline] (\fcL,\fll*\fh).. controls (.46667*\fw,{(\fll-\fb)*\fh}) and (.53333*\fw,{(\fll-\fb)*\fh})..(\fcR,\fll*\fh); \coordinate (-contact-left) at (\fcL,\fll*\fh); \coordinate (-contact-right) at (\fcR,\fll*\fh); \coordinate (-reservoir) at (.2*\fw,\fl*\fh); \draw[every fluid dimension] (.2*\fw,\fl*\fh)--(.2*\fw,\fll*\fh) node[midway,left,every fluid label] {\frise}; \draw[every fluid arrow,->] (-contact-left)--++(0,.8) node[above left,every fluid label] {\ftension}; \draw[every fluid arrow,->] (-contact-right)--++(0,.8) node[above right,every fluid label] {\ftension}; \end{scope} }},pics/capillary/.default={}, pics/physics capillary/.style={/tikz/pics/capillary={#1}},pics/physics capillary/.default={}} \tikzphysics@registeranchors{physicscapillary}{origin,center,bottom,top,left,right,contact-left,contact-right,reservoir} \tikzphysics@registerdisplayname{physicscapillary}{capillary} \tikzphysics@registerkeydefaults{physicscapillary}{fluid width/4cm,fluid height/3cm,fluid level/.35,fluid left level/.7,fluid bend/.12} \tikzphysics@declarehook{surface tension ring} \tikzset{pics/surface tension ring/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=3cm,fluid height=1cm,every surface tension ring,#1]% \tikzphysics@fluid@setup \draw[every fluid outline] (-center) ellipse[x radius=.5*\fw cm,y radius=.5*\fh cm]; \draw[every fluid outline] (-center) ellipse[x radius=.46*\fw cm,y radius=.42*\fh cm]; \foreach \a in {20,70,120,170,220,270,320}{ \draw[every fluid arrow,->] ({.5*\fw+.48*\fw*cos(\a)},{.5*\fh+.46*\fh*sin(\a)})--++(0,.65);} \node[every fluid label,above] at (.5*\fw,\fh+.7) {\fringforce}; \end{scope} }},pics/surface tension ring/.default={}, pics/physics surface tension ring/.style={/tikz/pics/surface tension ring={#1}},pics/physics surface tension ring/.default={}} \tikzphysics@registeranchors{physicssurfacetensionring}{origin,center,bottom,top,left,right} \tikzphysics@registerdisplayname{physicssurfacetensionring}{surface tension ring} \tikzphysics@registerkeydefaults{physicssurfacetensionring}{fluid width/3cm,fluid height/1cm} \tikzphysics@declarehook{liquid ring} \tikzset{pics/liquid ring/.style args={#1}{code={% \begin{scope}[fluid pic base,fluid defaults,fluid width=3.5cm,fluid height=3.5cm,fluid tube width=.4cm,fluid angle=225,fluid sweep=70,fluid body label={$O$},every liquid ring,#1]% \tikzphysics@fluid@setup \pgfmathparse{\ft<.5*\fw && \fs>0 && \fs<=360?1:0} \ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Invalid liquid ring geometry}{Use tube width < width/2 and sweep in (0,360].}\fi \begin{scope}[shift={(-center)}] \path[fluid liquid paint,every fluid liquid] (\fa:{.5*\fw}) arc[start angle=\fa,delta angle=\fs,radius=.5*\fw cm] --({\fa+\fs}:{.5*\fw-\ft}) arc[start angle=\fa+\fs,delta angle=-\fs,radius={(.5*\fw-\ft)*1cm}]--cycle; \draw[every fluid outline] (0,0) circle[radius=.5*\fw cm] (0,0) circle[radius={(.5*\fw-\ft)*1cm}]; \draw[every fluid outline] (\fa:{.5*\fw-\ft})--(\fa:{.5*\fw}) ({\fa+\fs}:{.5*\fw-\ft})--({\fa+\fs}:{.5*\fw}); \draw[dashed,every fluid outline] (\fa:{.5*\fw-\ft})--(0,0)--({\fa+\fs}:{.5*\fw-\ft}); \draw[every fluid outline] (\fa:.4) arc[start angle=\fa,delta angle=\fs,radius=.4cm]; \node[every fluid label] at ({\fa+.5*\fs}:.65) {\ftheta}; \draw[every fluid arrow,->] (0,0)--(30:{.5*\fw-\ft}) node[midway,above,every fluid label] {\fradius}; \node[every fluid label,above left] at (0,0) {\fbody}; \coordinate (-liquid-start) at (\fa:{.5*\fw-.5*\ft}); \coordinate (-liquid-end) at ({\fa+\fs}:{.5*\fw-.5*\ft}); \end{scope} \end{scope} }},pics/liquid ring/.default={}, pics/physics liquid ring/.style={/tikz/pics/liquid ring={#1}},pics/physics liquid ring/.default={}} \tikzphysics@registeranchors{physicsliquidring}{origin,center,bottom,top,left,right,liquid-start,liquid-end} \tikzphysics@registerdisplayname{physicsliquidring}{liquid ring diagram} \tikzphysics@registerkeydefaults{physicsliquidring}{fluid width/3.5cm,fluid tube width/.4cm,fluid angle/225,fluid sweep/70} % Scoped geometry names do not redefine native TikZ keys. \tikzset{fluid/.code={\pgfqkeys{/tikz/fluid}{#1}},/tikz/fluid/.search also={/tikz}} \tikzset{/tikz/fluid/width/.style={/tikz/fluid width={#1}},/tikz/physics fluid width/.style={/tikz/fluid width={#1}},/tikz/fluid width/.value required} \tikzset{/tikz/fluid/height/.style={/tikz/fluid height={#1}},/tikz/physics fluid height/.style={/tikz/fluid height={#1}},/tikz/fluid height/.value required} \tikzset{/tikz/fluid/tube width/.style={/tikz/fluid tube width={#1}},/tikz/physics fluid tube width/.style={/tikz/fluid tube width={#1}},/tikz/fluid tube width/.value required} \tikzset{/tikz/fluid/level/.style={/tikz/fluid level={#1}},/tikz/physics fluid level/.style={/tikz/fluid level={#1}},/tikz/fluid level/.value required} \tikzset{/tikz/fluid/left level/.style={/tikz/fluid left level={#1}},/tikz/physics fluid left level/.style={/tikz/fluid left level={#1}},/tikz/fluid left level/.value required} \tikzset{/tikz/fluid/right level/.style={/tikz/fluid right level={#1}},/tikz/physics fluid right level/.style={/tikz/fluid right level={#1}},/tikz/fluid right level/.value required} \tikzset{/tikz/fluid/bend/.style={/tikz/fluid bend={#1}},/tikz/physics fluid bend/.style={/tikz/fluid bend={#1}},/tikz/fluid bend/.value required} \tikzset{/tikz/fluid/angle/.style={/tikz/fluid angle={#1}},/tikz/physics fluid angle/.style={/tikz/fluid angle={#1}},/tikz/fluid angle/.value required} \tikzset{/tikz/fluid/sweep/.style={/tikz/fluid sweep={#1}},/tikz/physics fluid sweep/.style={/tikz/fluid sweep={#1}},/tikz/fluid sweep/.value required} \tikzset{/tikz/fluid/body label/.style={/tikz/fluid body label={#1}},/tikz/physics fluid body label/.style={/tikz/fluid body label={#1}},/tikz/fluid body label/.value required} \tikzset{/tikz/fluid/left label/.style={/tikz/fluid left label={#1}},/tikz/physics fluid left label/.style={/tikz/fluid left label={#1}},/tikz/fluid left label/.value required} \tikzset{/tikz/fluid/right label/.style={/tikz/fluid right label={#1}},/tikz/physics fluid right label/.style={/tikz/fluid right label={#1}},/tikz/fluid right label/.value required} \tikzset{/tikz/fluid/dimension label/.style={/tikz/fluid dimension label={#1}},/tikz/physics fluid dimension label/.style={/tikz/fluid dimension label={#1}},/tikz/fluid dimension label/.value required} \tikzset{/tikz/fluid/force label/.style={/tikz/fluid force label={#1}},/tikz/physics fluid force label/.style={/tikz/fluid force label={#1}},/tikz/fluid force label/.value required} \tikzset{/tikz/fluid/volume label/.style={/tikz/fluid volume label={#1}},/tikz/physics fluid volume label/.style={/tikz/fluid volume label={#1}},/tikz/fluid volume label/.value required} \tikzset{/tikz/fluid/pressure label/.style={/tikz/fluid pressure label={#1}},/tikz/physics fluid pressure label/.style={/tikz/fluid pressure label={#1}},/tikz/fluid pressure label/.value required} \tikzset{/tikz/fluid/pressure increment label/.style={/tikz/fluid pressure increment label={#1}},/tikz/physics fluid pressure increment label/.style={/tikz/fluid pressure increment label={#1}},/tikz/fluid pressure increment label/.value required} \tikzset{/tikz/fluid/angular velocity label/.style={/tikz/fluid angular velocity label={#1}},/tikz/physics fluid angular velocity label/.style={/tikz/fluid angular velocity label={#1}},/tikz/fluid angular velocity label/.value required} \tikzset{/tikz/fluid/position label/.style={/tikz/fluid position label={#1}},/tikz/physics fluid position label/.style={/tikz/fluid position label={#1}},/tikz/fluid position label/.value required} \tikzset{/tikz/fluid/horizontal axis label/.style={/tikz/fluid horizontal axis label={#1}},/tikz/physics fluid horizontal axis label/.style={/tikz/fluid horizontal axis label={#1}},/tikz/fluid horizontal axis label/.value required} \tikzset{/tikz/fluid/vertical axis label/.style={/tikz/fluid vertical axis label={#1}},/tikz/physics fluid vertical axis label/.style={/tikz/fluid vertical axis label={#1}},/tikz/fluid vertical axis label/.value required} \tikzset{/tikz/fluid/inlet velocity label/.style={/tikz/fluid inlet velocity label={#1}},/tikz/physics fluid inlet velocity label/.style={/tikz/fluid inlet velocity label={#1}},/tikz/fluid inlet velocity label/.value required} \tikzset{/tikz/fluid/outlet velocity label/.style={/tikz/fluid outlet velocity label={#1}},/tikz/physics fluid outlet velocity label/.style={/tikz/fluid outlet velocity label={#1}},/tikz/fluid outlet velocity label/.value required} \tikzset{/tikz/fluid/contact angle label/.style={/tikz/fluid contact angle label={#1}},/tikz/physics fluid contact angle label/.style={/tikz/fluid contact angle label={#1}},/tikz/fluid contact angle label/.value required} \tikzset{/tikz/fluid/rise label/.style={/tikz/fluid rise label={#1}},/tikz/physics fluid rise label/.style={/tikz/fluid rise label={#1}},/tikz/fluid rise label/.value required} \tikzset{/tikz/fluid/tension label/.style={/tikz/fluid tension label={#1}},/tikz/physics fluid tension label/.style={/tikz/fluid tension label={#1}},/tikz/fluid tension label/.value required} \tikzset{/tikz/fluid/circumference force label/.style={/tikz/fluid circumference force label={#1}},/tikz/physics fluid circumference force label/.style={/tikz/fluid circumference force label={#1}},/tikz/fluid circumference force label/.value required} \tikzset{/tikz/fluid/radius label/.style={/tikz/fluid radius label={#1}},/tikz/physics fluid radius label/.style={/tikz/fluid radius label={#1}},/tikz/fluid radius label/.value required} \tikzset{every physics fluid outline/.style={},every fluid outline/.style={every physics fluid outline}} \tikzset{every physics fluid liquid/.style={},every fluid liquid/.style={every physics fluid liquid}} \tikzset{every physics fluid secondary liquid/.style={fill=gray!55},every fluid secondary liquid/.style={every physics fluid secondary liquid}} \tikzset{every physics fluid label/.style={inner sep=.12em},every fluid label/.style={every physics fluid label}} \tikzset{every physics fluid arrow/.style={>=latex},every fluid arrow/.style={every physics fluid arrow}} \tikzset{every physics fluid dimension/.style={every fluid arrow,<->},every fluid dimension/.style={every physics fluid dimension}} \tikzset{every physics fluid element/.style={fill=white,pattern=north east lines,pattern color=black},every fluid element/.style={every physics fluid element}} %% Native node primitives. Fill paints the liquid, not the whole vessel. %% The fill handler is local to a fluid node's option scope. \tikzset{fluid node base/.code={% \tikzset{fill/.code={\def\tikzphysics@fluid@nodefill{##1}\def\tikzphysics@fluid@nodepattern{none}},fill/.default=gray!25, pattern/.code={\def\tikzphysics@fluid@nodepattern{##1}\def\tikzphysics@fluid@none{none}\ifx\tikzphysics@fluid@nodepattern\tikzphysics@fluid@none\def\tikzphysics@fluid@nodefill{none}\else\def\tikzphysics@fluid@nodefill{gray!25}\fi},pattern/.default=dots}% \tikzset{draw,fluid defaults,inner sep=.2em,outer sep=.5\pgflinewidth, physics debug setup}}, every fluid node/.style={}} \def\tikzphysics@fluid@nodegeometry{% \tikzphysics@fluid@positive\fw{\fwvalue}% \tikzphysics@fluid@positive\fh{\fhvalue}% \tikzphysics@fluid@positive\ft{\ftvalue}% \tikzphysics@fluid@fraction\fl{\flvalue}% \tikzphysics@fluid@fraction\fll{\fllvalue}% \tikzphysics@fluid@fraction\frl{\frlvalue}% \tikzphysics@fluid@scalar\fb{\fbvalue}% \tikzphysics@fluid@scalar\fa{\favalue}% \tikzphysics@fluid@scalar\fs{\fsvalue}% \pgfmathsetmacro\fw{max(\fw,\pgfkeysvalueof{/pgf/minimum width}/1cm, (\wd\pgfnodeparttextbox+2*\pgfkeysvalueof{/pgf/inner xsep})/1cm)}% \pgfmathsetmacro\fh{max(\fh,\pgfkeysvalueof{/pgf/minimum height}/1cm, (\ht\pgfnodeparttextbox+\dp\pgfnodeparttextbox+2*\pgfkeysvalueof{/pgf/inner ysep})/1cm)}% \pgfmathsetmacro\fcap{min(.125*\fw,.15*\fh)}% \pgfmathsetmacro\fntextx{-.5*\wd\pgfnodeparttextbox/1cm}% \pgfmathsetmacro\fnbase{(-.5*\ht\pgfnodeparttextbox+.5*\dp\pgfnodeparttextbox)/1cm}% \pgfmathsetmacro\fnmid{\fnbase+.5ex/1cm}% \pgfmathsetmacro\fox{\pgfkeysvalueof{/pgf/outer xsep}/1cm}% \pgfmathsetmacro\foy{\pgfkeysvalueof{/pgf/outer ysep}/1cm}% } \def\tikzphysics@fluid@moveto#1#2{\pgfpathmoveto{\pgfpoint{(#1)*1cm}{(#2)*1cm}}} \def\tikzphysics@fluid@lineto#1#2{\pgfpathlineto{\pgfpoint{(#1)*1cm}{(#2)*1cm}}} \def\tikzphysics@fluid@curve#1#2#3#4#5#6{% \pgfpathcurveto{\pgfpoint{(#1)*1cm}{(#2)*1cm}}{\pgfpoint{(#3)*1cm}{(#4)*1cm}}{\pgfpoint{(#5)*1cm}{(#6)*1cm}}} \def\tikzphysics@fluid@ellipse#1#2#3#4{% \pgfpathellipse{\pgfpoint{(#1)*1cm}{(#2)*1cm}}{\pgfpoint{(#3)*1cm}{0pt}}{\pgfpoint{0pt}{(#4)*1cm}}} \def\tikzphysics@fluid@nodeorigin{% \tikzphysics@fluid@nodestate \pgftransformshift{\pgfpoint{-.5*\fw*1cm}{-.5*\fh*1cm}}} \def\tikzphysics@fluid@nodepaint{% \def\tikzphysics@fluid@none{none}% \ifx\tikzphysics@fluid@nodefill\tikzphysics@fluid@none \pgfusepath{discard}% \else \ifx\tikzphysics@fluid@nodepattern\tikzphysics@fluid@none \pgfsetfillcolor{\tikzphysics@fluid@nodefill}% \else \pgfsetfillpattern{\tikzphysics@fluid@nodepattern}{\tikz@pattern@color}% \fi \pgfusepath{fill}% \fi} \def\tikzphysics@fluid@tankoutline{% \tikzphysics@fluid@moveto{0}{\fh} \tikzphysics@fluid@lineto{0}{.08*\fh} \tikzphysics@fluid@curve{0}{0}{0}{0}{.08*\fw}{0} \tikzphysics@fluid@lineto{.92*\fw}{0} \tikzphysics@fluid@curve{\fw}{0}{\fw}{0}{\fw}{.08*\fh} \tikzphysics@fluid@lineto{\fw}{\fh}} %% Sample the real U outline by distance: left wall, bend, right wall. \def\tikzphysics@fluid@upoint#1{% \pgfmathsetmacro\ur{#1}% \pgfmathsetmacro\uwall{\fh-.5*\fw}% \pgfmathsetmacro\ud{\tikzphysics@percent*(2*\uwall+pi*\ur)}% \ifdim\ud pt<\uwall pt \pgfmathsetmacro\ux{-\ur}% \pgfmathsetmacro\uy{.5*\fh-\ud}% \else \pgfmathsetmacro\ubendend{\uwall+pi*\ur}% \ifdim\ud pt<\ubendend pt \pgfmathsetmacro\ua{180+(\ud-\uwall)*180/(pi*\ur)}% \pgfmathsetmacro\ux{\ur*cos(\ua)}% \pgfmathsetmacro\uy{.5*\fw-.5*\fh+\ur*sin(\ua)}% \else \pgfmathsetmacro\ux{\ur}% \pgfmathsetmacro\uy{.5*\fw-.5*\fh+\ud-\ubendend}% \fi \fi} \pgfdeclareshape{physicsfluidtanknode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{left-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw)*1cm}{((\fll-.5)*\fh)*1cm}} \anchor{right-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw)*1cm}{((\frl-.5)*\fh)*1cm}} \anchor{surface}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{((.5*(\fll+\frl)-.5)*\fh)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@fluid@nodestate}{((\tikzphysics@percent-.5)*\fw)*1cm}{(((1-\tikzphysics@percent)*\fll+\tikzphysics@percent*\frl-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{((-.42+.84*\tikzphysics@percent)*\fw)*1cm}{(-.5*\fh)*1cm} \tikzphysics@declarepercentanchors{right}{\tikzphysics@fluid@nodestate}{(.5*\fw)*1cm}{((-.42+.92*\tikzphysics@percent)*\fh)*1cm} \tikzphysics@declarepercentanchors{left}{\tikzphysics@fluid@nodestate}{(-.5*\fw)*1cm}{((.5-.92*\tikzphysics@percent)*\fh)*1cm} \tikzphysics@declarepercentanchors{bottom-left}{\tikzphysics@fluid@nodestate}{((-.5+.08*\tikzphysics@percent^3)*\fw)*1cm}{((-.5+.08*(1-\tikzphysics@percent)^3)*\fh)*1cm} \tikzphysics@declarepercentanchors{bottom-right}{\tikzphysics@fluid@nodestate}{((.5-.08*(1-\tikzphysics@percent)^3)*\fw)*1cm}{((-.5+.08*\tikzphysics@percent^3)*\fh)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fll*\fh}\tikzphysics@fluid@lineto{0}{.08*\fh}\tikzphysics@fluid@curve{0}{0}{0}{0}{.08*\fw}{0}\tikzphysics@fluid@lineto{.92*\fw}{0}\tikzphysics@fluid@curve{\fw}{0}{\fw}{0}{\fw}{.08*\fh}\tikzphysics@fluid@lineto{\fw}{\frl*\fh}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@tankoutline \tikzphysics@fluid@moveto{0}{\fll*\fh}\tikzphysics@fluid@lineto{\fw}{\frl*\fh} \endpgfscope} } \tikzset{fluid tank/.style={fluid node base,fluid left level=.7,fluid right level=.7,shape=physicsfluidtanknode,physics logical shape=physicsfluidtanknode,every physics object,every fluid node,every fluid tank},physics fluid tank/.style={fluid tank}} \tikzphysics@registerdisplayname{physicsfluidtanknode}{fluid tank} \tikzphysics@registeranchors{physicsfluidtanknode}{center,north,south,east,west,north east,north west,south east,south west,left-surface,right-surface,surface} \tikzphysics@registerkeydefaults{physicsfluidtanknode}{fluid width/3cm,fluid height/3cm,fluid left level/.7,fluid right level/.7} \tikzset{pics/fluid tank diagram/.style={/tikz/pics/fluid tank={#1}},pics/fluid tank diagram/.default={}, pics/physics fluid tank diagram/.style={/tikz/pics/fluid tank={#1}},pics/physics fluid tank diagram/.default={}} \pgfdeclareshape{physicsmeniscusnode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \pgfmathparse{\fl-abs(\fb)>=0 && \fl+abs(\fb)<=1?1:0}\ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Meniscus leaves the vessel}{Reduce bend.}\fi \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{left-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw)*1cm}{((\fl-.5)*\fh)*1cm}} \anchor{right-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw)*1cm}{((\fl-.5)*\fh)*1cm}} \anchor{surface}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{((\fl-.75*\fb-.5)*\fh)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{((\tikzphysics@percent-.5)*\fw)*1cm}{(-.5*\fh)*1cm} \tikzphysics@declarepercentanchors{right}{\tikzphysics@fluid@nodestate}{(.5*\fw)*1cm}{((\tikzphysics@percent-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{left}{\tikzphysics@fluid@nodestate}{(-.5*\fw)*1cm}{((.5-\tikzphysics@percent)*\fh)*1cm} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@fluid@nodestate}{((-.5+(1-\tikzphysics@percent)^3*(0)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.33)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(.67)+\tikzphysics@percent^3*(1))*\fw)*1cm}{((\fl-.5-3*\fb*\tikzphysics@percent*(1-\tikzphysics@percent))*\fh)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{0}\tikzphysics@fluid@lineto{\fw}{0}\tikzphysics@fluid@lineto{\fw}{\fl*\fh}\tikzphysics@fluid@curve{.67*\fw}{(\fl-\fb)*\fh}{.33*\fw}{(\fl-\fb)*\fh}{0}{\fl*\fh}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fh}\tikzphysics@fluid@lineto{0}{0}\tikzphysics@fluid@lineto{\fw}{0}\tikzphysics@fluid@lineto{\fw}{\fh}\tikzphysics@fluid@moveto{0}{\fl*\fh}\tikzphysics@fluid@curve{.33*\fw}{(\fl-\fb)*\fh}{.67*\fw}{(\fl-\fb)*\fh}{\fw}{\fl*\fh} \endpgfscope} } \tikzset{meniscus/.style={fluid node base,fluid width=1.2cm,fluid height=2.7cm,fluid level=.7,fluid bend=.2,shape=physicsmeniscusnode,physics logical shape=physicsmeniscusnode,every physics object,every fluid node,every meniscus},physics meniscus/.style={meniscus}} \tikzphysics@registerdisplayname{physicsmeniscusnode}{meniscus} \tikzphysics@registeranchors{physicsmeniscusnode}{center,north,south,east,west,north east,north west,south east,south west,left-surface,right-surface,surface} \tikzphysics@registerkeydefaults{physicsmeniscusnode}{fluid width/1.2cm,fluid height/2.7cm,fluid level/.7,fluid bend/.2} \tikzset{pics/meniscus diagram/.style={/tikz/pics/meniscus={#1}},pics/meniscus diagram/.default={}, pics/physics meniscus diagram/.style={/tikz/pics/meniscus={#1}},pics/physics meniscus diagram/.default={}} \pgfdeclareshape{physicsrotatingfluidnode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \pgfmathparse{\fb>=0 && \fl+\fb<=1?1:0}\ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Rotating surface leaves the vessel}{Reduce bend.}\fi \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{left-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw)*1cm}{((\fl+\fb-.5)*\fh)*1cm}} \anchor{right-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw)*1cm}{((\fl+\fb-.5)*\fh)*1cm}} \anchor{surface}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{((\fl-.5)*\fh)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{((\tikzphysics@percent-.5)*\fw)*1cm}{(-.5*\fh)*1cm} \tikzphysics@declarepercentanchors{right}{\tikzphysics@fluid@nodestate}{(.5*\fw)*1cm}{((\tikzphysics@percent-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{left}{\tikzphysics@fluid@nodestate}{(-.5*\fw)*1cm}{((.5-\tikzphysics@percent)*\fh)*1cm} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@fluid@nodestate}{((\tikzphysics@percent-.5)*\fw)*1cm}{((\fl-.5+\fb*(2*\tikzphysics@percent-1)^2)*\fh)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{0}\tikzphysics@fluid@lineto{\fw}{0}\tikzphysics@fluid@lineto{\fw}{(\fl+\fb)*\fh}\tikzphysics@fluid@curve{.6666667*\fw}{(\fl-\fb/3)*\fh}{.3333333*\fw}{(\fl-\fb/3)*\fh}{0}{(\fl+\fb)*\fh}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fh}\tikzphysics@fluid@lineto{0}{0}\tikzphysics@fluid@lineto{\fw}{0}\tikzphysics@fluid@lineto{\fw}{\fh}\tikzphysics@fluid@moveto{0}{(\fl+\fb)*\fh}\tikzphysics@fluid@curve{.3333333*\fw}{(\fl-\fb/3)*\fh}{.6666667*\fw}{(\fl-\fb/3)*\fh}{\fw}{(\fl+\fb)*\fh} \endpgfscope} } \tikzset{rotating fluid/.style={fluid node base,fluid width=3cm,fluid height=3.5cm,fluid level=.5,fluid bend=.35,shape=physicsrotatingfluidnode,physics logical shape=physicsrotatingfluidnode,every physics object,every fluid node,every rotating fluid},physics rotating fluid/.style={rotating fluid}} \tikzphysics@registerdisplayname{physicsrotatingfluidnode}{rotating fluid} \tikzphysics@registeranchors{physicsrotatingfluidnode}{center,north,south,east,west,north east,north west,south east,south west,left-surface,right-surface,surface} \tikzphysics@registerkeydefaults{physicsrotatingfluidnode}{fluid width/3cm,fluid height/3.5cm,fluid level/.5,fluid bend/.35} \tikzset{pics/rotating fluid diagram/.style={/tikz/pics/rotating fluid={#1}},pics/rotating fluid diagram/.default={}, pics/physics rotating fluid diagram/.style={/tikz/pics/rotating fluid={#1}},pics/physics rotating fluid diagram/.default={}} \pgfdeclareshape{physicsfluidcylindernode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{left-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw)*1cm}{((\fl-.5)*(\fh-2*\fcap))*1cm}} \anchor{right-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw)*1cm}{((\fl-.5)*(\fh-2*\fcap))*1cm}} \anchor{surface}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{((\fl-.5)*(\fh-2*\fcap))*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@fluid@nodestate}{((\tikzphysics@percent-.5)*\fw)*1cm}{((\fl-.5)*(\fh-2*\fcap))*1cm} \tikzphysics@declarepercentanchors{surface-rim}{\tikzphysics@fluid@nodestate}{(.5*\fw*cos(360*\tikzphysics@percent))*1cm}{((\fl-.5)*(\fh-2*\fcap)+\fcap*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@fluid@nodestate}{(.5*\fw*cos(360*\tikzphysics@percent))*1cm}{(.5*\fh-\fcap+\fcap*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{(.5*\fw*cos(360*\tikzphysics@percent))*1cm}{(-.5*\fh+\fcap+\fcap*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{right}{\tikzphysics@fluid@nodestate}{(.5*\fw)*1cm}{(-.5*\fh+\fcap+\tikzphysics@percent*(\fh-2*\fcap))*1cm} \tikzphysics@declarepercentanchors{left}{\tikzphysics@fluid@nodestate}{(-.5*\fw)*1cm}{(.5*\fh-\fcap-\tikzphysics@percent*(\fh-2*\fcap))*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fcap}\tikzphysics@fluid@curve{0}{0}{\fw}{0}{\fw}{\fcap}\tikzphysics@fluid@lineto{\fw}{\fl*(\fh-2*\fcap)+\fcap}\tikzphysics@fluid@curve{\fw}{\fl*(\fh-2*\fcap)+2*\fcap}{0}{\fl*(\fh-2*\fcap)+2*\fcap}{0}{\fl*(\fh-2*\fcap)+\fcap}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@ellipse{.5*\fw}{\fh-\fcap}{.5*\fw}{\fcap}\tikzphysics@fluid@moveto{0}{\fh-\fcap}\tikzphysics@fluid@lineto{0}{\fcap}\pgfpatharc{180}{360}{.5*\fw*1cm and \fcap*1cm}\tikzphysics@fluid@lineto{\fw}{\fh-\fcap}\tikzphysics@fluid@ellipse{.5*\fw}{\fl*(\fh-2*\fcap)+\fcap}{.5*\fw}{\fcap} \endpgfscope} } \tikzset{fluid cylinder/.style={fluid node base,fluid width=1.6cm,fluid height=3.2cm,shape=physicsfluidcylindernode,physics logical shape=physicsfluidcylindernode,every physics object,every fluid node,every fluid cylinder},physics fluid cylinder/.style={fluid cylinder}} \tikzphysics@registerdisplayname{physicsfluidcylindernode}{fluid cylinder} \tikzphysics@registeranchors{physicsfluidcylindernode}{center,north,south,east,west,north east,north west,south east,south west,left-surface,right-surface,surface} \tikzphysics@registerkeydefaults{physicsfluidcylindernode}{fluid width/1.6cm,fluid height/3.2cm,fluid level/.65} \tikzset{pics/fluid cylinder diagram/.style={/tikz/pics/fluid cylinder={#1}},pics/fluid cylinder diagram/.default={}, pics/physics fluid cylinder diagram/.style={/tikz/pics/fluid cylinder={#1}},pics/physics fluid cylinder diagram/.default={}} \pgfdeclareshape{physicspressureelementnode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{inlet}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw+\fcap)*1cm}{(0)*1cm}} \anchor{outlet}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw-\fcap)*1cm}{(0)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{inlet}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\fcap)*1cm}{((\tikzphysics@percent-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{outlet}{\tikzphysics@fluid@nodestate}{(.5*\fw-\fcap)*1cm}{((\tikzphysics@percent-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{inlet-rim}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\fcap+\fcap*cos(360*\tikzphysics@percent))*1cm}{(.5*\fh*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{outlet-rim}{\tikzphysics@fluid@nodestate}{(.5*\fw-\fcap+\fcap*cos(360*\tikzphysics@percent))*1cm}{(.5*\fh*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{axis}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\fcap+\tikzphysics@percent*(\fw-2*\fcap))*1cm}{(0)*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@fluid@nodestate}{(.5*\fw-\fcap-\tikzphysics@percent*(\fw-2*\fcap))*1cm}{(.5*\fh)*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\fcap+\tikzphysics@percent*(\fw-2*\fcap))*1cm}{(-.5*\fh)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{\fcap}{0}\tikzphysics@fluid@lineto{\fw-\fcap}{0}\tikzphysics@fluid@lineto{\fw-\fcap}{\fh}\tikzphysics@fluid@lineto{\fcap}{\fh}\pgfpathclose\tikzphysics@fluid@ellipse{\fcap}{.5*\fh}{\fcap}{.5*\fh}\tikzphysics@fluid@ellipse{\fw-\fcap}{.5*\fh}{\fcap}{.5*\fh} \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@ellipse{\fcap}{.5*\fh}{\fcap}{.5*\fh}\tikzphysics@fluid@ellipse{\fw-\fcap}{.5*\fh}{\fcap}{.5*\fh}\tikzphysics@fluid@moveto{\fcap}{0}\tikzphysics@fluid@lineto{\fw-\fcap}{0}\tikzphysics@fluid@moveto{\fcap}{\fh}\tikzphysics@fluid@lineto{\fw-\fcap}{\fh} \endpgfscope} } \tikzset{pressure element/.style={fluid node base,fluid width=2cm,fluid height=.65cm,shape=physicspressureelementnode,physics logical shape=physicspressureelementnode,every physics object,every fluid node,every pressure element},physics pressure element/.style={pressure element}} \tikzphysics@registerdisplayname{physicspressureelementnode}{pressure element} \tikzphysics@registeranchors{physicspressureelementnode}{center,north,south,east,west,north east,north west,south east,south west,inlet,outlet} \tikzphysics@registerkeydefaults{physicspressureelementnode}{fluid width/2cm,fluid height/.65cm} \tikzset{pics/pressure element diagram/.style={/tikz/pics/pressure element={#1}},pics/pressure element diagram/.default={}, pics/physics pressure element diagram/.style={/tikz/pics/pressure element={#1}},pics/physics pressure element diagram/.default={}} \pgfdeclareshape{physicsflowtubenode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{inlet}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw)*1cm}{(0)*1cm}} \anchor{outlet}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw)*1cm}{((\fb-.225)*\fh)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{inlet}{\tikzphysics@fluid@nodestate}{(-.5*\fw)*1cm}{((\tikzphysics@percent-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{outlet}{\tikzphysics@fluid@nodestate}{(.5*\fw)*1cm}{((\fb-.5+.55*\tikzphysics@percent)*\fh)*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@fluid@nodestate}{((-.5+(1-\tikzphysics@percent)^3*(0)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.35)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(.65)+\tikzphysics@percent^3*(1))*\fw)*1cm}{((-.5+(1-\tikzphysics@percent)^3*(0)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(\fb)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(-\fb)+\tikzphysics@percent^3*(\fb))*\fh)*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@fluid@nodestate}{((-.5+(1-\tikzphysics@percent)^3*(1)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.65)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(.35)+\tikzphysics@percent^3*(0))*\fw)*1cm}{((-.5+(1-\tikzphysics@percent)^3*(\fb+.55)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.55-\fb)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(1+\fb)+\tikzphysics@percent^3*(1))*\fh)*1cm} \tikzphysics@declarepercentanchors{axis}{\tikzphysics@fluid@nodestate}{((-.5+(1-\tikzphysics@percent)^3*(0)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.35)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(.65)+\tikzphysics@percent^3*(1))*\fw)*1cm}{((-.5+(1-\tikzphysics@percent)^3*(.5)+3*(1-\tikzphysics@percent)^2*\tikzphysics@percent*(.5+\fb)+3*(1-\tikzphysics@percent)*\tikzphysics@percent^2*(.275-\fb)+\tikzphysics@percent^3*(.275+\fb))*\fh)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{0}\tikzphysics@fluid@curve{.35*\fw}{\fb*\fh}{.65*\fw}{-\fb*\fh}{\fw}{\fb*\fh}\tikzphysics@fluid@lineto{\fw}{(\fb+.55)*\fh}\tikzphysics@fluid@curve{.65*\fw}{(.55-\fb)*\fh}{.35*\fw}{(1+\fb)*\fh}{0}{\fh}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{0}\tikzphysics@fluid@curve{.35*\fw}{\fb*\fh}{.65*\fw}{-\fb*\fh}{\fw}{\fb*\fh}\tikzphysics@fluid@moveto{0}{\fh}\tikzphysics@fluid@curve{.35*\fw}{(1+\fb)*\fh}{.65*\fw}{(.55-\fb)*\fh}{\fw}{(\fb+.55)*\fh}\tikzphysics@fluid@moveto{0}{0}\tikzphysics@fluid@lineto{0}{\fh}\tikzphysics@fluid@moveto{\fw}{\fb*\fh}\tikzphysics@fluid@lineto{\fw}{(\fb+.55)*\fh} \endpgfscope} } \tikzset{flow tube/.style={fluid node base,fluid width=5cm,fluid height=1.3cm,fluid bend=.45,shape=physicsflowtubenode,physics logical shape=physicsflowtubenode,every physics object,every fluid node,every flow tube},physics flow tube/.style={flow tube}} \tikzphysics@registerdisplayname{physicsflowtubenode}{flow tube} \tikzphysics@registeranchors{physicsflowtubenode}{center,north,south,east,west,north east,north west,south east,south west,inlet,outlet} \tikzphysics@registerkeydefaults{physicsflowtubenode}{fluid width/5cm,fluid height/1.3cm,fluid bend/.45} \tikzset{pics/flow tube diagram/.style={/tikz/pics/flow tube={#1}},pics/flow tube diagram/.default={}, pics/physics flow tube diagram/.style={/tikz/pics/flow tube={#1}},pics/physics flow tube diagram/.default={}} \pgfdeclareshape{physicsliquidringnode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \pgfmathparse{\ft<.5*\fw && \fs>0 && \fs<=360?1:0}\ifnum\pgfmathresult=0 \PackageError{tikzphysics}{Invalid liquid ring geometry}{Reduce thickness or sweep.}\fi \pgfmathsetmacro\fh{\fw} \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{liquid-start}{\tikzphysics@fluid@nodestate\pgfpoint{((.5*\fw-.5*\ft)*cos(\fa))*1cm}{((.5*\fw-.5*\ft)*sin(\fa))*1cm}} \anchor{liquid-end}{\tikzphysics@fluid@nodestate\pgfpoint{((.5*\fw-.5*\ft)*cos(\fa+\fs))*1cm}{((.5*\fw-.5*\ft)*sin(\fa+\fs))*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{outer}{\tikzphysics@fluid@nodestate}{(.5*\fw*cos(360*\tikzphysics@percent))*1cm}{(.5*\fw*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{inner}{\tikzphysics@fluid@nodestate}{((.5*\fw-\ft)*cos(360*\tikzphysics@percent))*1cm}{((.5*\fw-\ft)*sin(360*\tikzphysics@percent))*1cm} \tikzphysics@declarepercentanchors{liquid}{\tikzphysics@fluid@nodestate}{((.5*\fw-.5*\ft)*cos(\fa+\tikzphysics@percent*\fs))*1cm}{((.5*\fw-.5*\ft)*sin(\fa+\tikzphysics@percent*\fs))*1cm} \tikzphysics@declarepercentanchors{start}{\tikzphysics@fluid@nodestate}{((.5*\fw-\ft+\tikzphysics@percent*\ft)*cos(\fa))*1cm}{((.5*\fw-\ft+\tikzphysics@percent*\ft)*sin(\fa))*1cm} \tikzphysics@declarepercentanchors{end}{\tikzphysics@fluid@nodestate}{((.5*\fw-\ft+\tikzphysics@percent*\ft)*cos(\fa+\fs))*1cm}{((.5*\fw-\ft+\tikzphysics@percent*\ft)*sin(\fa+\fs))*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderellipse{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{.5*\fw+.5*\fw*cos(\fa)}{.5*\fh+.5*\fw*sin(\fa)}\pgfpatharc{\fa}{\fa+\fs}{.5*\fw*1cm}\tikzphysics@fluid@lineto{.5*\fw+(.5*\fw-\ft)*cos(\fa+\fs)}{.5*\fh+(.5*\fw-\ft)*sin(\fa+\fs)}\pgfpatharc{\fa+\fs}{\fa}{(.5*\fw-\ft)*1cm}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@ellipse{.5*\fw}{.5*\fh}{.5*\fw}{.5*\fw}\tikzphysics@fluid@ellipse{.5*\fw}{.5*\fh}{.5*\fw-\ft}{.5*\fw-\ft}\tikzphysics@fluid@moveto{.5*\fw+(.5*\fw-\ft)*cos(\fa)}{.5*\fh+(.5*\fw-\ft)*sin(\fa)}\tikzphysics@fluid@lineto{.5*\fw+.5*\fw*cos(\fa)}{.5*\fh+.5*\fw*sin(\fa)}\tikzphysics@fluid@moveto{.5*\fw+(.5*\fw-\ft)*cos(\fa+\fs)}{.5*\fh+(.5*\fw-\ft)*sin(\fa+\fs)}\tikzphysics@fluid@lineto{.5*\fw+.5*\fw*cos(\fa+\fs)}{.5*\fh+.5*\fw*sin(\fa+\fs)} \endpgfscope} } \tikzset{liquid ring/.style={fluid node base,fluid width=3.5cm,fluid height=3.5cm,fluid tube width=.4cm,fluid angle=225,fluid sweep=70,shape=physicsliquidringnode,physics logical shape=physicsliquidringnode,every physics object,every fluid node,every liquid ring},physics liquid ring/.style={liquid ring}} \tikzphysics@registerdisplayname{physicsliquidringnode}{liquid ring} \tikzphysics@registeranchors{physicsliquidringnode}{center,north,south,east,west,north east,north west,south east,south west,liquid-start,liquid-end} \tikzphysics@registerkeydefaults{physicsliquidringnode}{fluid width/3.5cm,fluid tube width/.4cm,fluid angle/225,fluid sweep/70} \tikzset{pics/liquid ring diagram/.style={/tikz/pics/liquid ring={#1}},pics/liquid ring diagram/.default={}, pics/physics liquid ring diagram/.style={/tikz/pics/liquid ring={#1}},pics/physics liquid ring diagram/.default={}} \pgfdeclareshape{physicsutubenode}{ \savedmacro\tikzphysics@fluid@nodestate{% \tikzphysics@fluid@nodegeometry \tikzphysics@fluid@tubecheck \addtosavedmacro\fw \addtosavedmacro\fh \addtosavedmacro\ft \addtosavedmacro\fl \addtosavedmacro\fll \addtosavedmacro\frl \addtosavedmacro\fb \addtosavedmacro\fa \addtosavedmacro\fs \addtosavedmacro\fcap \addtosavedmacro\fntextx \addtosavedmacro\fnbase \addtosavedmacro\fnmid \addtosavedmacro\fox \addtosavedmacro\foy \addtosavedmacro\tikzphysics@fluid@nodefill \addtosavedmacro\tikzphysics@fluid@nodepattern \addtosavedmacro\tikz@pattern@color } \anchor{center}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(0)*1cm}} \anchor{north}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south}{\tikzphysics@fluid@nodestate\pgfpoint{(0)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(0)*1cm}} \anchor{west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(0)*1cm}} \anchor{north east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{north west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(.5*\fh+\foy)*1cm}} \anchor{south east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{south west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{(-.5*\fh-\foy)*1cm}} \anchor{left-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw+.5*\ft)*1cm}{((\fll-.5)*\fh)*1cm}} \anchor{right-surface}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw-.5*\ft)*1cm}{((\frl-.5)*\fh)*1cm}} \anchor{surface}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw+.5*\ft)*1cm}{((\fll-.5)*\fh)*1cm}} \anchor{text}{\tikzphysics@fluid@nodestate\pgfpoint{\fntextx*1cm}{\fnbase*1cm}} \anchor{base}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnbase*1cm}} \anchor{base east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnbase*1cm}} \anchor{base west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnbase*1cm}} \anchor{mid}{\tikzphysics@fluid@nodestate\pgfpoint{0pt}{\fnmid*1cm}} \anchor{mid east}{\tikzphysics@fluid@nodestate\pgfpoint{(.5*\fw+\fox)*1cm}{\fnmid*1cm}} \anchor{mid west}{\tikzphysics@fluid@nodestate\pgfpoint{(-.5*\fw-\fox)*1cm}{\fnmid*1cm}} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\tikzphysics@percent*\ft)*1cm}{((\fll-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{left-surface}{\tikzphysics@fluid@nodestate}{(-.5*\fw+\tikzphysics@percent*\ft)*1cm}{((\fll-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{right-surface}{\tikzphysics@fluid@nodestate}{(.5*\fw-\ft+\tikzphysics@percent*\ft)*1cm}{((\frl-.5)*\fh)*1cm} \tikzphysics@declarepercentanchors{outer}{\tikzphysics@fluid@nodestate\tikzphysics@fluid@upoint{.5*\fw}}{(\ux)*1cm}{(\uy)*1cm} \tikzphysics@declarepercentanchors{inner}{\tikzphysics@fluid@nodestate\tikzphysics@fluid@upoint{.5*\fw-\ft}}{(\ux)*1cm}{(\uy)*1cm} \anchorborder{\edef\fluidborderx{\the\pgf@x}\edef\fluidbordery{\the\pgf@y}% \tikzphysics@fluid@nodestate \pgfpointborderrectangle{\pgfpoint{\fluidborderx}{\fluidbordery}}{\pgfpoint{(.5*\fw+\fox)*1cm}{(.5*\fh+\foy)*1cm}}} \behindbackgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fll*\fh}\tikzphysics@fluid@lineto{0}{.5*\fw}\pgfpatharc{180}{360}{.5*\fw*1cm}\tikzphysics@fluid@lineto{\fw}{\frl*\fh}\tikzphysics@fluid@lineto{\fw-\ft}{\frl*\fh}\tikzphysics@fluid@lineto{\fw-\ft}{.5*\fw}\pgfpatharc{0}{-180}{(.5*\fw-\ft)*1cm}\tikzphysics@fluid@lineto{\ft}{\fll*\fh}\pgfpathclose \tikzphysics@fluid@nodepaint\endpgfscope} \backgroundpath{\pgfscope\tikzphysics@fluid@nodeorigin \tikzphysics@fluid@moveto{0}{\fh}\tikzphysics@fluid@lineto{0}{.5*\fw}\pgfpatharc{180}{360}{.5*\fw*1cm}\tikzphysics@fluid@lineto{\fw}{\fh}\tikzphysics@fluid@moveto{\ft}{\fh}\tikzphysics@fluid@lineto{\ft}{.5*\fw}\pgfpatharc{180}{360}{(.5*\fw-\ft)*1cm}\tikzphysics@fluid@lineto{\fw-\ft}{\fh}\tikzphysics@fluid@moveto{0}{\fll*\fh}\tikzphysics@fluid@lineto{\ft}{\fll*\fh}\tikzphysics@fluid@moveto{\fw-\ft}{\frl*\fh}\tikzphysics@fluid@lineto{\fw}{\frl*\fh} \endpgfscope} } \tikzset{u tube/.style={fluid node base,fluid width=2cm,fluid height=4cm,fluid left level=.75,fluid right level=.55,shape=physicsutubenode,physics logical shape=physicsutubenode,every physics object,every fluid node,every u tube},physics u tube/.style={u tube}} \tikzphysics@registerdisplayname{physicsutubenode}{u tube} \tikzphysics@registeranchors{physicsutubenode}{center,north,south,east,west,north east,north west,south east,south west,left-surface,right-surface,surface} \tikzphysics@registerkeydefaults{physicsutubenode}{fluid width/2cm,fluid height/4cm,fluid tube width/.3cm,fluid left level/.75,fluid right level/.55} \tikzset{pics/u tube diagram/.style={/tikz/pics/u tube={#1}},pics/u tube diagram/.default={}, pics/physics u tube diagram/.style={/tikz/pics/u tube={#1}},pics/physics u tube diagram/.default={}} %% Percentage families listed by native debug cards. \tikzphysics@registerfamilies{physicsfluidtanknode}{surface,bottom,right,left,bottom-left,bottom-right} \tikzphysics@registerfamilies{physicsmeniscusnode}{surface,bottom,right,left} \tikzphysics@registerfamilies{physicsrotatingfluidnode}{surface,bottom,right,left} \tikzphysics@registerfamilies{physicsfluidcylindernode}{surface,surface-rim,top,bottom,right,left} \tikzphysics@registerfamilies{physicspressureelementnode}{inlet,outlet,inlet-rim,outlet-rim,axis,top,bottom} \tikzphysics@registerfamilies{physicsflowtubenode}{inlet,outlet,axis,bottom,top} \tikzphysics@registerfamilies{physicsliquidringnode}{outer,inner,liquid,start,end} \tikzphysics@registerfamilies{physicsutubenode}{surface,left-surface,right-surface,outer,inner} %% BEGIN NATIVE COMPONENT EXTENSIONS %% capillary tube \tikzset{ capillary width/.initial=.5cm, physics capillary width/.style={capillary width={#1}}, capillary height/.initial=3cm, physics capillary height/.style={capillary height={#1}}, capillary level/.initial=.6, physics capillary level/.style={capillary level={#1}}, capillary sag/.initial=.12cm, physics capillary sag/.style={capillary sag={#1}}, } \pgfdeclareshape{physicscapillarytubenode}{ \savedmacro\tikzphysics@component@physicscapillarytubenodestate{% \tikzphysics@component@length\cw{capillary width} \tikzphysics@component@length\ch{capillary height} \pgfmathsetmacro\cl{\pgfkeysvalueof{/tikz/capillary level}} \tikzphysics@component@length\cs{capillary sag} \tikzphysics@component@check{\cw>0 && \ch>0 && \cl>0 && \cl<1 && abs(\cs)0 && \ch>0 && \cb>0 && \cb<=\ch}{Flow dimensions must satisfy length > 0 and 0 < throat <= diameter} \addtosavedmacro\cw \addtosavedmacro\ch \addtosavedmacro\cb } \anchor{center}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{0}{0}} \anchor{north}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{0}{\ch/2}} \anchor{south}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{0}{-(\ch/2)}} \anchor{east}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{west}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{-(\cw/2)}{0}} \anchor{north east}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{\cw/2}{\ch/2}} \anchor{north west}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{-(\cw/2)}{\ch/2}} \anchor{south east}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{\cw/2}{-(\ch/2)}} \anchor{south west}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{-(\cw/2)}{-(\ch/2)}} \anchor{inlet}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{-\cw/2}{0}} \anchor{outlet}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{throat}{\tikzphysics@component@physicsnozzlenodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{text}{\pgf@x=-.5\wd\pgfnodeparttextbox\pgf@y=-.5\ht\pgfnodeparttextbox\advance\pgf@y by.5\dp\pgfnodeparttextbox} \tikzphysics@declarepercentanchors{axis}{\tikzphysics@component@physicsnozzlenodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{(0)*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@component@physicsnozzlenodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{((\cb+(\ch-\cb)*(1+cos(180*\tikzphysics@percent))/2)/2)*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@component@physicsnozzlenodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{(-(\cb+(\ch-\cb)*(1+cos(180*\tikzphysics@percent))/2)/2)*1cm} \tikzphysics@declarepercentanchors{inlet}{\tikzphysics@component@physicsnozzlenodestate}{(-\cw/2)*1cm}{((-.5+\tikzphysics@percent)*\ch)*1cm} \tikzphysics@declarepercentanchors{outlet}{\tikzphysics@component@physicsnozzlenodestate}{(\cw/2)*1cm}{((-.5+\tikzphysics@percent)*\cb)*1cm} \tikzphysics@declarepercentanchors{throat}{\tikzphysics@component@physicsnozzlenodestate}{(\cw/2)*1cm}{((-.5+\tikzphysics@percent)*\cb)*1cm} \anchorborder{\edef\cpx{\the\pgf@x}\edef\cpy{\the\pgf@y}\tikzphysics@component@physicsnozzlenodestate\pgfpointborderrectangle{\pgfpoint{\cpx}{\cpy}}{\tikzphysics@component@point{\cw/2}{\ch/2}}} \backgroundpath{\tikzphysics@component@physicsnozzlenodestate \tikzphysics@component@move{-\cw/2}{\ch/2} \foreach \ci in {0,...,100}{\pgfmathsetmacro\cu{\ci/100}\tikzphysics@component@line{(-.5+\cu)*\cw}{(\cb+(\ch-\cb)*(1+cos(180*\cu))/2)/2} } \tikzphysics@component@move{-\cw/2}{-\ch/2} \foreach \ci in {0,...,100}{\pgfmathsetmacro\cu{\ci/100}\tikzphysics@component@line{(-.5+\cu)*\cw}{-(\cb+(\ch-\cb)*(1+cos(180*\cu))/2)/2} } } } \tikzphysics@declarehook{nozzle} \tikzphysics@registerdisplayname{physicsnozzlenode}{nozzle} \tikzphysics@registeranchors{physicsnozzlenode}{center,north,south,east,west,inlet,outlet,throat} \tikzphysics@registerfamilies{physicsnozzlenode}{axis,top,bottom,inlet,outlet,throat} \tikzphysics@registerkeys{physicsnozzlenode}{nozzle length,nozzle diameter,nozzle throat diameter} \tikzphysics@registerkeydefaults{physicsnozzlenode}{nozzle length/4cm,nozzle diameter/1.4cm,nozzle throat diameter/.55cm} \tikzset{physicsnozzlenode/.style={shape=physicsnozzlenode,physics logical shape=physicsnozzlenode,anchor=center,draw=black,fill=none,inner sep=0pt,outer sep=0pt,physics debug setup,every physics object,every nozzle},nozzle/.style={physicsnozzlenode}} %% venturi \tikzset{ venturi length/.initial=4cm, physics venturi length/.style={venturi length={#1}}, venturi diameter/.initial=1.4cm, physics venturi diameter/.style={venturi diameter={#1}}, venturi throat diameter/.initial=.55cm, physics venturi throat diameter/.style={venturi throat diameter={#1}}, } \pgfdeclareshape{physicsventurinode}{ \savedmacro\tikzphysics@component@physicsventurinodestate{% \tikzphysics@component@length\cw{venturi length} \tikzphysics@component@length\ch{venturi diameter} \tikzphysics@component@length\cb{venturi throat diameter} \tikzphysics@component@check{\cw>0 && \ch>0 && \cb>0 && \cb<=\ch}{Flow dimensions must satisfy length > 0 and 0 < throat <= diameter} \addtosavedmacro\cw \addtosavedmacro\ch \addtosavedmacro\cb } \anchor{center}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{0}{0}} \anchor{north}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{0}{\ch/2}} \anchor{south}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{0}{-(\ch/2)}} \anchor{east}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{west}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{-(\cw/2)}{0}} \anchor{north east}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{\cw/2}{\ch/2}} \anchor{north west}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{-(\cw/2)}{\ch/2}} \anchor{south east}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{\cw/2}{-(\ch/2)}} \anchor{south west}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{-(\cw/2)}{-(\ch/2)}} \anchor{inlet}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{-\cw/2}{0}} \anchor{outlet}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{throat}{\tikzphysics@component@physicsventurinodestate\tikzphysics@component@point{0}{0}} \anchor{text}{\pgf@x=-.5\wd\pgfnodeparttextbox\pgf@y=-.5\ht\pgfnodeparttextbox\advance\pgf@y by.5\dp\pgfnodeparttextbox} \tikzphysics@declarepercentanchors{axis}{\tikzphysics@component@physicsventurinodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{(0)*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@component@physicsventurinodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{((\cb+(\ch-\cb)*(1+cos(360*\tikzphysics@percent))/2)/2)*1cm} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@component@physicsventurinodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{(-(\cb+(\ch-\cb)*(1+cos(360*\tikzphysics@percent))/2)/2)*1cm} \tikzphysics@declarepercentanchors{inlet}{\tikzphysics@component@physicsventurinodestate}{(-\cw/2)*1cm}{((-.5+\tikzphysics@percent)*\ch)*1cm} \tikzphysics@declarepercentanchors{outlet}{\tikzphysics@component@physicsventurinodestate}{(\cw/2)*1cm}{((-.5+\tikzphysics@percent)*\ch)*1cm} \tikzphysics@declarepercentanchors{throat}{\tikzphysics@component@physicsventurinodestate}{(0)*1cm}{((-.5+\tikzphysics@percent)*\cb)*1cm} \anchorborder{\edef\cpx{\the\pgf@x}\edef\cpy{\the\pgf@y}\tikzphysics@component@physicsventurinodestate\pgfpointborderrectangle{\pgfpoint{\cpx}{\cpy}}{\tikzphysics@component@point{\cw/2}{\ch/2}}} \backgroundpath{\tikzphysics@component@physicsventurinodestate \tikzphysics@component@move{-\cw/2}{\ch/2} \foreach \ci in {0,...,100}{\pgfmathsetmacro\cu{\ci/100}\tikzphysics@component@line{(-.5+\cu)*\cw}{(\cb+(\ch-\cb)*(1+cos(360*\cu))/2)/2} } \tikzphysics@component@move{-\cw/2}{-\ch/2} \foreach \ci in {0,...,100}{\pgfmathsetmacro\cu{\ci/100}\tikzphysics@component@line{(-.5+\cu)*\cw}{-(\cb+(\ch-\cb)*(1+cos(360*\cu))/2)/2} } } } \tikzphysics@declarehook{venturi} \tikzphysics@registerdisplayname{physicsventurinode}{venturi} \tikzphysics@registeranchors{physicsventurinode}{center,north,south,east,west,inlet,outlet,throat} \tikzphysics@registerfamilies{physicsventurinode}{axis,top,bottom,inlet,outlet,throat} \tikzphysics@registerkeys{physicsventurinode}{venturi length,venturi diameter,venturi throat diameter} \tikzphysics@registerkeydefaults{physicsventurinode}{venturi length/4cm,venturi diameter/1.4cm,venturi throat diameter/.55cm} \tikzset{physicsventurinode/.style={shape=physicsventurinode,physics logical shape=physicsventurinode,anchor=center,draw=black,fill=none,inner sep=0pt,outer sep=0pt,physics debug setup,every physics object,every venturi},venturi/.style={physicsventurinode}} %% layered tank \tikzset{ layered tank width/.initial=3cm, physics layered tank width/.style={layered tank width={#1}}, layered tank height/.initial=2.5cm, physics layered tank height/.style={layered tank height={#1}}, layered tank interface/.initial=.35, physics layered tank interface/.style={layered tank interface={#1}}, layered tank level/.initial=.75, physics layered tank level/.style={layered tank level={#1}}, } \pgfdeclareshape{physicslayeredtanknode}{ \savedmacro\tikzphysics@component@physicslayeredtanknodestate{% \tikzphysics@component@length\cw{layered tank width} \tikzphysics@component@length\ch{layered tank height} \pgfmathsetmacro\ci{\pgfkeysvalueof{/tikz/layered tank interface}} \pgfmathsetmacro\cl{\pgfkeysvalueof{/tikz/layered tank level}} \tikzphysics@component@check{\cw>0 && \ch>0 && \ci>0 && \ci<\cl && \cl<1}{Tank dimensions must be positive and 0 < interface < level < 1} \addtosavedmacro\cw \addtosavedmacro\ch \addtosavedmacro\ci \addtosavedmacro\cl } \anchor{center}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{0}{0}} \anchor{north}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{0}{\ch/2}} \anchor{south}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{0}{-(\ch/2)}} \anchor{east}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{\cw/2}{0}} \anchor{west}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{-(\cw/2)}{0}} \anchor{north east}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{\cw/2}{\ch/2}} \anchor{north west}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{-(\cw/2)}{\ch/2}} \anchor{south east}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{\cw/2}{-(\ch/2)}} \anchor{south west}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{-(\cw/2)}{-(\ch/2)}} \anchor{lower-center}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{0}{(-.5+\ci/2)*\ch}} \anchor{upper-center}{\tikzphysics@component@physicslayeredtanknodestate\tikzphysics@component@point{0}{(-.5+(\ci+\cl)/2)*\ch}} \anchor{text}{\pgf@x=-.5\wd\pgfnodeparttextbox\pgf@y=-.5\ht\pgfnodeparttextbox\advance\pgf@y by.5\dp\pgfnodeparttextbox} \tikzphysics@declarepercentanchors{bottom}{\tikzphysics@component@physicslayeredtanknodestate}{(-\cw/2+\tikzphysics@percent*\cw)*1cm}{(-\ch/2)*1cm} \tikzphysics@declarepercentanchors{right}{\tikzphysics@component@physicslayeredtanknodestate}{(\cw/2)*1cm}{(-\ch/2+\tikzphysics@percent*\ch)*1cm} \tikzphysics@declarepercentanchors{top}{\tikzphysics@component@physicslayeredtanknodestate}{(\cw/2-\tikzphysics@percent*\cw)*1cm}{(\ch/2)*1cm} \tikzphysics@declarepercentanchors{left}{\tikzphysics@component@physicslayeredtanknodestate}{(-\cw/2)*1cm}{(\ch/2-\tikzphysics@percent*\ch)*1cm} \tikzphysics@declarepercentanchors{interface}{\tikzphysics@component@physicslayeredtanknodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{((-.5+\ci)*\ch)*1cm} \tikzphysics@declarepercentanchors{surface}{\tikzphysics@component@physicslayeredtanknodestate}{((-.5+\tikzphysics@percent)*\cw)*1cm}{((-.5+\cl)*\ch)*1cm} \anchorborder{\edef\cpx{\the\pgf@x}\edef\cpy{\the\pgf@y}\tikzphysics@component@physicslayeredtanknodestate\pgfpointborderrectangle{\pgfpoint{\cpx}{\cpy}}{\tikzphysics@component@point{\cw/2}{\ch/2}}} \backgroundpath{\tikzphysics@component@physicslayeredtanknodestate \tikzphysics@component@move{-\cw/2}{\ch/2} \tikzphysics@component@line{-\cw/2}{-\ch/2} \tikzphysics@component@line{\cw/2}{-\ch/2} \tikzphysics@component@line{\cw/2}{\ch/2} \tikzphysics@component@move{-\cw/2}{(-.5+\ci)*\ch} \tikzphysics@component@line{\cw/2}{(-.5+\ci)*\ch} \tikzphysics@component@move{-\cw/2}{(-.5+\cl)*\ch} \tikzphysics@component@line{\cw/2}{(-.5+\cl)*\ch} } } \tikzphysics@declarehook{layered tank} \tikzphysics@registerdisplayname{physicslayeredtanknode}{layered tank} \tikzphysics@registeranchors{physicslayeredtanknode}{center,north,south,east,west,lower-center,upper-center} \tikzphysics@registerfamilies{physicslayeredtanknode}{bottom,right,top,left,interface,surface} \tikzphysics@registerkeys{physicslayeredtanknode}{layered tank width,layered tank height,layered tank interface,layered tank level} \tikzphysics@registerkeydefaults{physicslayeredtanknode}{layered tank width/3cm,layered tank height/2.5cm,layered tank interface/.35,layered tank level/.75} \tikzset{physicslayeredtanknode/.style={shape=physicslayeredtanknode,physics logical shape=physicslayeredtanknode,anchor=center,draw=black,fill=none,inner sep=0pt,outer sep=0pt,physics debug setup,every physics object,every layered tank},layered tank/.style={physicslayeredtanknode}} %% END NATIVE COMPONENT EXTENSIONS \makeatother \endinput .