\documentclass[11pt]{article}
\usepackage[a4paper,margin=18mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{tikzphysics.thermodynamics}
\pagestyle{empty}
\begin{document}
\section*{Piston--cylinder: a movable closed-system boundary}
\begin{center}
\begin{tikzpicture}[>=latex,font=\small]
 \pic (E) {piston cylinder diagram={piston position=.7,
  piston gas label={$P_2,V_2,T_2$},piston work label={$W_{\rm out}$}}};
 \pic (C) at (6,0) {piston cylinder diagram={piston position=.4,
  piston gas label={$P_1,V_1,T_1$},piston heat direction=out,
  piston work direction=in,piston heat label={$Q_{\rm out}$},
  piston work label={$W_{\rm in}$}}};
 \node[below=10pt] at (E-cylinder.south) {Expansion: heat in, work out};
 \node[below=10pt] at (C-cylinder.south) {Compression: heat out, work in};
 \draw[densely dashed] (E-cylinder.gas-left-25)--(E-cylinder.gas-right-25);
 \node[right=4pt] at (E-cylinder.gas-right-25) {initial face};
\end{tikzpicture}
\end{center}
The trapped gas occupies the space below the piston. Position is a fraction of
cylinder height, measured upward from the bottom to the lower piston face.
The dashed line marks a lower initial piston position. The piston face and rod
move together; heat and work arrows connect to the gas boundary and rod tip.

\medskip
These are illustrative states and independently specified energy directions.
Heating need not cause expansion, and compression need not reject heat.
The diagram does not solve an equation of state or infer a process from position.
For constant cross-sectional area $A$, gas volume is $V=A h_g$ and boundary work
in a quasistatic process is $W_{\rm by}=\int P\,dV$.

\bigskip
\begin{center}
\begin{tikzpicture}[>=latex,font=\small]
 \pic (A) {piston cylinder diagram={piston position=.55,
  piston heat direction=none,piston work direction=in,
  piston gas label={gas},piston work label={$W_{\rm in}$}}};
 \draw[<->] ($(A-cylinder.south)+(1.3,0)$)--($(A-cylinder.piston)+(1.3,0)$)
  node[midway,right] {$h_g$};
 \draw[densely dashed] (A-cylinder.south)--++(1.3,0);
 \draw[densely dashed] (A-cylinder.piston)--++(1.3,0);
 \node[below=10pt] at (A-cylinder.south) {Adiabatic compression: heat arrow omitted};
\end{tikzpicture}
\end{center}
Suppressing a flow retains its percentage coordinates for later author-supplied
annotations. No special stroke thickness is applied by the module.

\clearpage
\section*{Percentage anchors and native TikZ composition}
\begin{center}
\begin{tikzpicture}[>=latex,font=\small]
 \node[piston cylinder,piston cylinder width=24mm,
  piston cylinder height=4cm,piston position=.6] (P) {};
 \node at (P.gas-center) {gas};
 \foreach \p in {0,25,50,75,100}{
  \fill (P.piston-\p) circle (1.2pt);
  \fill (P.rod-\p) circle (1.2pt);
  \fill (P.gas-left-\p) circle (1.2pt);
 }
 \node[left=5pt] at (P.gas-left-50) {gas-left: bottom to face};
 \node[right=8pt] at (P.rod-50) {rod: face top to tip};
 \node[right=8pt] at (P.piston-100) {piston: left to right};
 \node[below=10pt] at (P.south) {Samples at 0, 25, 50, 75 and 100 percent};
\end{tikzpicture}
\end{center}
Gas-region anchors track the actual gas height. The full-height axis and wall
families retain their original geometry. The top boundary family spans the open
mouth, so it is a virtual guide rather than a drawn cap.

\bigskip
\begin{center}
\begin{tikzpicture}[>=latex,font=\small]
 \pic[rotate=-90,transform shape] (R) {piston cylinder diagram={
  piston gas label={gas},piston heat direction=none}};
 \fill (R-cylinder.gas-axis-50) circle (1.5pt);
 \fill (R-work-50) circle (1.5pt);
\end{tikzpicture}
\end{center}
A rotated apparatus carries its gas, piston, rod, flow endpoints and percentage
coordinates with it. Author-provided labels remain ordinary TikZ nodes.

\bigskip
\begin{center}
\begin{tikzpicture}[>=latex,font=\small,line width=1.1pt,
 every thermo flow/.append style={dashed}]
 \pic (S) {piston cylinder diagram={piston cylinder height=2.4cm,
  piston cylinder width=2cm,piston gas label={gas}}};
\end{tikzpicture}
\end{center}
The final system demonstrates a document-selected line width and dashed flows.
The package itself inherits the surrounding native TikZ width and draws in
black and white. Style hooks allow the document to choose other appearances.
\end{document}
