This document explains the design of the McSimAPN FLUX modules for the Square root law mode and the Choked flow mode
The square root law mode is intended to imitate the behaviour of the flow created in a pipe or duct when the pressure drop is big enough to induce turbulent flow. However, since any model may come into a condition where pressures at the ends of the duct (pipe) are the same, provision is made for the model to be adjusted for low and reversed flow.
The choked flow mode is intended to imitate adiabatic expansion of a perfect gas through an orifice with any pressure ratio across the orifice. Again, provision is made for low pressure drop and reversal of direction.
Turbulent fluid flow: Square Root and Linear Law
The intention is to model the effect of turbulent flow in which the pressure drop is pretty well determined by the square of the flow rate. In the case of using this for a flux model the result is to calculate flux as being proportional to the square root of pressure drop.
This will serve as a very simple model, but suffers from a problem of realism in that the sensititvity to small changes of pressure drop near zero is very large even though we know that no system has zero resistance to flow. This generates a corresponding problem computationally because differential equations for the transfer of material become extremely stiff. To overcome both these problems a small modification is possible, that is to include a linear term in the underlying resistance vs pressure drop equation.
by including a linear term so that at very small pressure drops, some sort of linear (laminar) flow regime provides some resistance, D, to flow.
From the graphs it can also be seen that the net flux, when this pseudo pressure drop (linear resistance) term is included, is always less than either the linear value or the simple square root value alone.
Another way to look at it and give some convenient numerical perspective to to see that Po is one quarter of the pressure drop at which the linear and square root law terms would be equal.
Applications. For use with real numbers some link to the literature is helpful. Wikipedia has a useful link to the Friction Factors
L length of pipe, D diameter (or hydraulic dia), V avg vel of fluid, g accn due to gravity, f is dimensionless Darcy friction factor.
The Darcy factor is 4 times the Fanning factor. Check by looking at the value given at Reynolds Number =1000. Darcy is 0.064, Fanning is 0.016
Of course the friction factor is itself a function of Reynold Number so the results are only approximate. The range of Fanning Friction factors goes roughly logarithmically from 0.01 at Re =5,000 to 0.0025 at Re = 2,000,000. The laminar flow values are in the range 0.015 down to 0.0075. The model above doesn't really cover the laminar to turbulent transition, but it does give a means of creating a model that is robust enough to operate over a wide range.When used in McSim, the relative pressures are compared to see which direction the flow is to go.
Starting with the basic perfect gas laws and a bit of algebra a version of the calculation for flow through an orifice driven by a pressure difference can be made to give mass flow as a function of upstream pressure and temperature and downstream pressure. As most gases have γ (gamma) close to 1.4, but may have widely different molecular masses, molecular mass is also included as a parameter. That fits in with the MacSimAPN structure.
The flow velocity through the orifice will become sonic if the upstream pressure is bigger than about 1.89 times the downstream pressure. So above this level the flow is essentially choked at that level.
The following calculation shows the algebraic route to calculating the flow and then an approximation trick that will make computation faster and give an answer that also avoids the same problem as is described above for the Fanning/Darcy friction model, i.e. apparent infinite sensitivity to pressure changes around the zero differential level.
Start with stagnant conditions at the high pressure side where Po, To, and ρo are related by the equation of state:
Let the gas expand adiabatically to a new pressure, P with corresponding lower temperature T. We make no assumption yet that the flow is choked, but since there is no energy lost, the difference in internal energy between the two states is made up by kinetic energy at velocity U..
But ρ can be expressed in terms of ρo, itself calculable from the stagnant conditions, equation of state. Making these substitutions:
For the upstream pressure being larger, (lower values of f), the flow is choked and is virtually constant at this maximum value.
By experimentation I have a computationally simple model for the mass flow that takes this choked flow limitation into account and also provides a less than infinite gradient of flow vs pressure at very low pressure differential (f near unity). The other numerical values are reduced to a single constant giving:
This model can be used in the McSim Flux component framework by using the Avalue as the upstream pressure, the Bvalue as the downstream pressure, the Cvalue for the area and the Dvalue for the upstream temperature, with the Pvalue for the molecular mass.
This will be inaccurate for very different values of gamma. To make the computations robust in the case of the downstream pressure being specified bigger than the upstream pressure (Bvalue >Avalue) the roles will be reversed, but without a downstream temperature being specified for this implied new source the same Dvalue will be used.
Application
Consider a vessel, with volume 2.5m3 at pressure 200kPa, and 350 degK. The contained mass of air is