Hi hashback,
I’ll get you started. Up to you to ask questions.
Since you don’t have a database, I don’t know of any way to apply the first law directly so you’ll have to do it differently than I’d normally do it. That said, I’ll have to poke around for the right answer for you, so bear with me.
First, you have to set the initial conditions in the tank.
- Pressure
- Temp
- Density
- Total mass
- Vessel volume
- Vessel mass
- Vessel internal area
- Vessel external area
I’d suggest doing numerous iterations using time steps. Make the time steps as small as needed to get a result that converges. By that I mean, try some course time steps (get a pressure/temperature curve for the vessel) then try finer time steps (get a pressure/temperature curve for the vessel). As you go to finer and finer time steps you should find the pressure/temperature curves all start to match which is when you know you’ve got convergence.
Calculate the flow out of the vessel using your initial conditions. Use flow equations for valves (gas) given here:
http://www.idealvalve.com/flowcal.htm
About half way down are equations for critical and sub critical flow.
If flow is controlled not by a wide open valve but by some other criteria, explain what that criteria is and I’ll try to help.
If flow is controlled by an orifice, such as a relief valve, explain and we can change the flow equations.
Given a time step, dt, you now have mass out, mo.
Here’s the tricky part. Normally, I’d apply the first law: dU = Hout. But you don’t have a prop database. So we can calculate P after removing the mass (mo), we can use the fact that the gas that remains inside the vessel is expanding isentropically, not isenthalpically such as you are implying by referencing the Joule Thompson effect. The JT effect regards the isenthalpic expansion of a gas across a restriction in a pipe.
Anyway, getting back to the isentropic part. You might be able to apply P2 = P1 (V1/V2)^gamma as shown here:
http://www.grc.nasa.gov/WWW/K-12/airplane/compexp.html
Note that you have the initial volume (it’s always the vessel volume) and the initial pressure (it’s always the pressure at the start of your time step). Final volume, V2 is the volume determined by removing the volume determined by calulating the density of the gas initially and multiplying times mass removed after the gas flows out the valve during the time step.
You now have P2 so use the equations on the NASA page to also determine T2.
You now have some lower pressure and temperature, but you now need to consider what heat transfer you have from the vessel walls. You said you have no trouble modeling heat transfer, but the trouble is always in determining the convective heat transfer on the inner wall. You have a wall temp and a new gas temp, so you’ll need to model the convective heat transfer at this point. This requires vessel temp and vessel internal area.
Once you have the heat transfer from the vessel to the wall, you need to consider the change in temp of the vessel. For now, I’ll assume you know how to do this. Note that we can make the simplifying assumption that there is no thermal gradient across the vessel wall. If blowdown of the vessel is very quick, this may be a poor assumption. You tell me.
Once you have the vessel temp, you can calculate the heat transfer from ambient. Again, this is another convective heat transfer problem. You need vessel temp, ambient temp and vessel external area.
After you’ve done all this, you can start over and perform the next time step.
Side note: You mentioned you’re going up to 700 bar. At atmospheric temp, compressibility Z for hydrogen is 1.38 so you should take that into account when determining mass and density. Luckily, there’s no significant affect on gamma, so I think the isentropic expansion calculations are still good without alteration.
Let me know where you need more detail as I realize this is very top level. Note the above is basically an integration using the Simpson rule. You can modify this using the Trapezoid rule by simply predicting the conditions at the end of the time step and then using an average where applicable. That’s a bit more trouble, and generally not worth the effort since your errors due to unknowns and aproximations are generally much larger than using a constant for each time step.
Also, it’s always nice to actually instrument a test setup and see how accurately your model actually predicts things so you can improve the model next time. Generally however, the chance to actually do the instrumentation is a real blessing but at least it can’t hurt to ask the powers that be.