When to use $h = c_p\Delta T$ or $u = c_v\Delta T$ 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?
 A: Fundamentally there's a simple difference: When you are working with a perfect gas at constant volume you can take the variation of inside energy equal to the heat absorbed in the transformation. In this case you must use $C_v$, obviously. In the other side, where the pressure is constant you can't consider the equality defined previously. In fact you must consider that ONLY the heat absorbed is equal to your equation (which is correct in his procedure) with Cp. All of that remembering the values of $C_p$ and $C_v$, also knowing that $C_p - C_v=R$ for an ideal gas.
A: Yes, your concern has to do with the difference between open/closed systems.  A closed system is one of constant mass (but the boundaries of the systems can change).  An open system is one with mass flow in/out of the system.  For a fixed mass of gas that expands, this is a closed system.  For a closed system enthalpy due to mass flow does not contribute.  The enthalpy for an open system is associated with mass flow in/out of an open system.  See a good test on thermodynamics; for example one of the Sonntag and Van Wylen thermodynamics texts.
So, for this case the first law for a closed system applies; not the first law for an open system. Neither T nor P is constant for a gas that expands against an external pressure, but the change in internal energy of the gas is equal to the negative of the work done by the gas assuming no time for heat transfer, and you can calculate the change in internal energy of the gas from the work.  For an ideal gas, internal energy is a function of temperature only, and you can use the ideal gas law.
(Incidentally, both your first law equations as stated are not complete.  For example, your equation for the open system assumes steady state and does not account for changes in internal energy of the system in addition to  mass flow in/out. And neither equation accounts for changes in kinetic and potential energy of the center of mass of the system.  See a thermodynamics textbook.)
