I'm getting myself confused on when to use $h = c_p \Delta T$ or $u=c_v \Delta T$, where $c_p$ is the specific heat at constant pressure and $c_v$ is the specific heat at constant volume.
It's in relation to thermodynamic processes such as expanding volumes with pistons and the likes.
Here's what I know (in relation to this):
First law for a closed system (per unit mass) $$q-w = \Delta u$$ First law for an open system (per unit mass) $$q-w_s = \Delta (h+\frac12c^2 +gz)$$
Example
Say I've got a piston expanding - causing an ideal gas to expand at constant pressure.
I can say that $\mathrm{d} w = p\mathrm dv$ as well as $\mathrm du = c_v\mathrm dT$ ─ is this correct?
Subbing this in I get $$\mathrm dq = p\mathrm dv + c_v \mathrm dT,$$ whereas if I decide I want to use \begin{align} h & = u+ pv \\ \mathrm dh & = \mathrm du + p \mathrm dv + v \mathrm dp \\ \mathrm du & = \mathrm dh - p \mathrm dv - v \mathrm dp \end{align} giving \begin{align} \mathrm dq & = p\mathrm dv + \mathrm dh +- p \mathrm dv - v \mathrm dp \\ \mathrm dq & = c_p \mathrm dT - v \mathrm dp . \end{align} Which (if any) expression for $\mathrm dq$ is correct? I feel like there's some flaws in my fundamental understanding of whats happening here. Is it to do with open/closed systems?