I'm trying to get a deeper understanding of this particular form of the ideal gas law I have seen. That form is $P=\rho R T$. I believe this form is not valid when mass or volume is changing. Am I correct? Below, I put a derivation of $P=\rho R T$ and some of my reasoning as to why I think it doesn't hold under changing mass or volume.
Derivation
The ideal gas law equation is $PV=nR_1T$ where $R_1$ is $8.314 \frac{J}{mol \cdot K}$ . If we can convert from moles to $kg$ we get:
$$ R = 8.314 \frac{J}{mol \cdot K} \times \frac{1 mol}{0.02897 kg} = \frac{287 J }{kg \cdot K} $$
So we can change $nR$ where n is number of moles and $R$ is joules per mole-kelvin to $mR$ where m is mass and $R$ is Joules per kg-kelvin because $nR = \text{ joules } = mR$.
This gives $PV=mRT$
To get the density form, I believe we need to make these assumptions:
- Assume $m$ is the mass of 1 liter of air
- Assume V is 1 liter
Then we have $P=\rho RT$, where $\rho$ is the density of air.
When is it valid?
If I derived $P=\rho R T$ correctly, then it should not be valid if mass changes or if volume changes.
Proof:
$$\begin{align} P=\frac{mRT}{V} &= ρRT\\ \frac{m}{V} &= ρ \end{align} $$
If $m$ changes, but $V$ does not change, then $\rho$ must change. But $\rho$ is the density of air which is constant at STP. Thus the equation should not be valid if $m$ changes.
But people have told me this equation is valid and holds and that I am wrong. Am I wrong that the equation only holds under constant mass and volume? If so why am I wrong?