# Thermodynamic Modeling for adiabatic Real-Gas Supply Tank Blowdown

I am working on a program which allows our university team to size our inert-gas supply tank and how much inert gas we will need to buy for rocket engine development, and hopefully a rocket launch. The program is a time-step simulation, which takes inputs on how much mass flow is required to maintain the specific volume of the propellant tanks which the supply-tank feeds.

The equations that I am using to model the expansion of the gasses are:
$$P=P_0\frac{\rho}{\rho_0}^\gamma$$ and $$T=T_0\frac{\rho}{\rho_0}^{\gamma -1}$$

While I do not expect perfection, I need to do better than assuming constant $$\gamma$$ since I want to spend as little on this system as I can, and to use the code to understand the temperature and pressure of the tank at any time to assess minimum flow instrument diameters to prevent choked flow and to ensure there will be enough pressurization authority at all stages in the launch.

The tool that I am using is the CoolProp wrapper for python, which is causing, what I would call, EXTREME funny business which I think is due to the way I modeled changes in $$\gamma$$. While Helium seems to behave relativity nicely, Nitrogen causes some wack errors, like negative enthalpys to be reported by cool-prop and massively fluctuating temperatures as the tank blows down. I think this might be because I am updating the $$\gamma$$ of the time step and then using the equations I have above, which are explicitly for constant $$\gamma$$s

Is there any suggested way to improve this model?
One way I was thinking was to calculate the $$\gamma$$ at every timestep again but instead use the average $$\gamma$$ over the simulation time for the above equations.

Another way I am thinking of would be to take the derivative of the above equations in some way and implement some numerical method, to solve the DE to find the $$P$$ and $$T$$ over time.

Any thoughts or insight would be greatly appreciated.

• Did you think that, for a real gas, the only difference is the effect of temperature on the heat capacities? Or do you also want to include non-ideal equation of state effects? Dec 19, 2019 at 13:35
• @ChetMiller, I would like to be as accurate as possible, but I do have to consider how long the implementation would take me, since we need to start moving on a tank soon if we want to make it to the test stand before the end of the semester. Dec 19, 2019 at 17:04
• Well, what you do is a judgment call on your part, but I'll provide you with an approach. Dec 19, 2019 at 17:12
• Enthalpies require a reference temperature. Are you sure that your reference temperature for nitrogen is absolute zero? If not, negative enthalpies are a possibility. Dec 19, 2019 at 19:49
• @WhisperingShiba, a common standard state is a gas at atmospheric pressure and 0 K. If you ask CoolProp for several evenly spaced gas enthalpies approaching 0 K, they should all be positive. If they are, the negative enthalpies are probably clues that you are below a condensation temperature in your model. Good luck with the data. Dec 19, 2019 at 22:56

If you neglect the heat transfer between the tank metal and the gas, then the gas remaining within the tank at any time has expanded adiabatically and reversibly. So, for this gas, the change in entropy per unit mass is constant. The variation in entropy per unit mass is given as a function of temperature and specific volume by $$ds=\frac{C_v}{T}dT+\left(\frac{\partial P}{\partial T}\right)_vdv$$where $$C_v$$ is the heat capacity at constant volume. In general, Cv is a function of temperature and specific volume, but, usually we will only know its behavior in the ideal gas region $$C_v^{IG}(T)$$where its value is a function only of temperature (i.e., at very large specific volume). Therefore, to use this equation in practice, one will have to integrate the equation relative to a reference state in the ideal gas region (i.e., high specific volume): $$s(T,v)=s(T_{ref},v_{ref})+\int_{T_{ref}}^T{\frac{C_v^{IG}(T')}{T'}dT'}-\int_v^{v_{ref}}{\left[\left(\frac{\partial P}{\partial T}\right)_v\right]_{T,v'}dv'}$$I suggest generating a 2D table of s as a function of T and v, and, for any given value of v, interpolating to get T for which there is no change in s from the initial state.
Another thing you could do is to approximate the real gas behavior by the van der Waals equation of state. For this equation of state, Cv is a function only of temperature, but not specific volume. So Cv is the same as the ideal gas heat capacity at all specific. In addition, for this equation of state, $$\left(\frac{\partial P}{\partial T}\right)_v=\frac{R}{v-b}$$. So, $$ds=\frac{C_v^{IG}(T)}{T}dT+\frac{R}{v-b}dv$$which can immediately be integrated analytically.