Adiabatic temperature increase given work done on (ideal) gas I'm playing around with a Euler's method simulation of an adiabatic compression/decompression process on an ideal gas.
If I have a volume of gas and I contract its volume slightly, I will be doing work on it.  For very small time steps the work is approximately the product of the pressure and the change in volume.
As I understand it, because the system is adiabatic, all of the work done on the gas will increase it's temperature.  The combined increase in temperature and the decrease in volume will increase the pressure of the gas according to the Ideal Gas Law.
The majority of my question pertains to the specific heat (Cv or Cp) of the gas in question.  This process is neither constant volume or constant pressure so neither of the specific heats seem to apply.  The answer to this question suggests that Cv still applies in this case when dealing with an ideal gas:  Work done in adiabatic process
Does Cv also apply in my case?
 A: $dU = C_v \, dT$ applies regardless of the type of process. Whether it's isobaric, isochoric, adiabatic, or anything, it still applies.
The reason for this is, $U$ is a function of state, so it depends only on the temperature $T$ of the gas. It is independent of the path taken by the gas in the process. And it so happens, by considering a constant-volume process where $dQ = C_v \, dT$ (by definition) and $dW=0$, that $dU = C_v \, dT$. Thus, since $U$ is only dependent on state variable $T$ as previously explained, this relation will always generally be the case for all processes!
In contrast, $dQ = C_v \, dT$ only applies for constant-volume processes. It doesn't hold for all other processes, e.g. if the process maintains constant pressure, then $C_p$ should be used instead.
A: 
The combined increase in temperature and the decrease in volume will
increase the pressure of the gas according to the Ideal Gas Law.

This is true during the process if the process is carried out reversibly (quasi-statically, without friction). Otherwise, the ideal gas law only applies to the initial and final equilibrium states.

This process is neither constant volume or constant pressure so
neither of the specific heats seem to apply

It is correct that they do not apply to the process since it is adiabatic involving no heat transfer. But $C_v$ and $C_p$ are system properties defined in terms of changes in internal energy and enthalpy, respectively, and not in terms of heat transfer processes. For $C_v$ it is defined as
$$C_{v}=\biggl(\frac{\partial U}{\partial T }\biggr)_v$$
Finally, since the internal energy of an ideal gas is purely kinetic, the internal energy of an ideal gas depends only on temperature for any process. Thus
$$dU=C_{v}dT$$
Hope this helps.
