It’s a fluid mechanics model.
If you are outside B31.1 scope, you can follow your own model using software like AFT Arrow. Inside B31.1 scope it’s better to follow the appendix.

Just few words.
You may consider a famous work on this subject “75-WA/FE-23 Steam Flow through Safety Valve Vent Pipes by H. E. Brandmaier and M. E. Knebel”. Please see

http://www.coade.com/ubbthreads/ubbthreads.php?ubb=showflat&Board=1&Number=21607

I second Mr. G.S. Liao criticism developed in "Discussion" section of the above article. Arrow software solves the problem just as Mr. Liao hoped.

I’ve tried to make some comments on this subject at:

http://www.coade.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=21000
It would be "informative" or not, it’s not more than my opinion.

regards