User:Frode54/sandboxunits

Morris Muskat et al developed the governing equation for multiphase flow in porous media as a generalisation of Darcy's equation (or Darcy's law) for water flow in porous media. The porous media are usually sedimentary rocks such as clastic rocks or carbonate rocks. In 1940 M.C. Leverett pointed out that in order to include capillary pressure effects in the flow equation, the pressure must be phase dependent. The flow equation then becomes


 * $$\mathbf{u}_a = -\mu_a^{-1} \mathbf{K}_{ra} \mathbf{K} \cdot \left( \nabla P_a - \rho_a \mathbf{g} \right) $$ where a = w, o, g


 * $$Q_a = -\mu_a^{-1} \mathbf{A} \cdot \mathbf{K}_{ra} \cdot \mathbf{K} \cdot \left( \nabla P_a - \rho_a \mathbf{g} \right) $$ where a = w, o, g

The present fluid phases are water, oil and gas, and they are represented by the subscript a = w,o,g respectively. The gravitational acceleration with direction is represented as $$ \mathbf{g} $$ or $$ g\nabla z $$ and its only non-zero element is $$ g{e_z}{^{3}} $$. Notice that in petroleum engineering the spacial co-ordinate system is right-hand-oriented with z-axis pointing downward. The flow equation in component form is


 * $$u{_a}^\sigma = -\mu_a^{-1} K_{ra}{^\sigma}_{\beta}  K{^\beta}_{\gamma}  \left( \nabla^{\gamma} P_a - \rho_a g {e_z}{^{\gamma}} \right) $$  where a = w, o, g where $$\sigma$$ = 1,2,3


 * $$Q{_a} = -\mu_a^{-1} A{_{\sigma}} K_{ra}{^\sigma}_{\beta} K{^\beta}_{\gamma}  \left( \nabla^{\gamma} P_a - \rho_a g {e_z}{^{\gamma}} \right) $$  where a = w, o, g

Conversion of units
The above equations are written in SI units (short SI) surpressing that the unit D (darcy) for the absolute permerability is defined in non-SI units. That is way there are no unit-related constants. The petroleum industry don't use the base SI units. Instead they use a special version of SI units that we will call Applied SI units, or they use another set of units called Field units which has its origin from USA and UK. Temperature is not included in the equations, so we can use the unit-factor-method which says that if we have a variable/parameter with unit H, we multiply this variable/parameter by a conversion constant C and then the variable gets the unit G that we want. This means that we apply the transformation H*C = G, and the non-SI effect of the definition of permeability is included in the conversion factor C for permeability. The transformation H*C = G apply for every spatial dimension so we consentrate on the main terms, negleting the signes, and then complete the parentesis with the gravity term. Before we start conversion, we notice that both the original (single phase) the flow equation of Darcy and the generalized (or extended) multiphase flow equations of Muskat et al are using reservoir velocity (volume flux), volume rate and densities. The units of these quantities are given a prefix r (or R) in order to distinguish them from their conterparts at standard surface conditions which gets a presfix s (or S). This is especially important when we convert the equations to Field units. The reason for going into details in the seemingly simple topic of unit conversion, is that many people make mistakes when doing unit conversions.

Now we are ready to start the conversion work. First we take the flux version of the equation and rewrite it as


 * $$1 = \frac {K \nabla_{\gamma} P_a}{\mu_a u{_a}}  $$  where a = w, o, g

We want to place the composite conversion factor together with the permeability parameter. Here we note that our equation is written in SI units, and that the group of variables/parameters (hereafter called parameters for short) on the right hand side constitute a dimensioneless group. Now we convert each parameter and collect these conversions into a single conversion constant. Now we note that our list with conversion constants (the C's) goes from applied unit to SI units, and this very common for such conversion lists. We therefore assume that our parameters are entered in applied units and convert them (back) to SI units.


 * $$ \frac {C_{k}K C_{\nabla}\nabla^{\gamma} C_{p}P_a}{C_{\mu}\mu_a C_{u}u{_a}} = C_f \frac  {K \nabla^{\gamma} P_a}{\mu_a u{_a}} = \left( \frac  {K \nabla^{\gamma} P_a}{\mu_a u{_a}} \right)_{SI} = 1$$  where a = w, o, g

Notice that we have removed relative permeability which is a dimensionless parameter. This composite conversion factor is called Darcy's constant for the flux formulated equation, and it is


 * $$C_f = \frac {C_{k} C_{\nabla} C_{p}}{C_{\mu} C_{u}} = \frac  {C_{k} C_{\nabla}}{C_{\mu}C_{u}/C_{p}} $$

Since our parameter group is dimensionless in base SI units, we don't need to include the SI units in the units for our composite conversion factor as you can see in the second table. Next we take the rate version of the equation and rewrite it as


 * $$1 = \frac {A K \nabla_{\gamma} P_a}{\mu_a Q{_a}}  $$  where a = w, o, g

Now we convert each parameter and collect these conversions into a single conversion constant.


 * $$ \frac {C_{A}A C_{k}K C_{\nabla}\nabla^{\gamma} C_{p}P_a}{C_{\mu}\mu_a C_{Q}Q{_a}} = C_r \frac  {A K \nabla^{\gamma} P_a}{\mu_a Q{_a}} = \left( \frac  {A K \nabla^{\gamma} P_a}{\mu_a Q{_a}} \right)_{SI} = 1$$  where a = w, o, g

Notice that we have removed relative permeability which is a dimensionless parameter. This composite conversion factor is called Darcy's constant for the flux formulated equation, and it is


 * $$C_r = \frac {C_A C_{k} C_{\nabla} C_{p}}{C_{\mu} C_{Q}} = \frac  {C_{k} C_{\nabla} C_A}{C_{\mu}C_{Q}/C_{p}} $$

The pressure gradient and the gravity term are identical for the flux and the rate equations, and will therefore be discussed only once. The task here is to have a gravity term that is consistent with the applied units ("H-units") for the pressure gradient. We must therefore place our conversion factor together with the gravity parameters. We write "the parentesis" in SI units as


 * $$ \nabla^{\gamma} P_a = \rho_a g $$ where a = w, o, g

and rewrite it as


 * $$ 1= \frac {\rho_a g} {\nabla^{\gamma} P_a} $$ where a = w, o, g

Now we convert each parameter and collect these conversions into a single conversion constant. First we note that our equation is written in SI units, and that the group of parameters on the right hand side constitute a dimensioneless group. We therefore assume that our parameters are entered in applied units and convert them (back) to SI units.


 * $$ \frac {C_{\rho}\rho_a C_{g}g} {C_{\nabla}\nabla^{\gamma} C_{p}P_a} = C_{pdg}\frac {\rho_a g} {\nabla^{\gamma} P_a} =\left( \frac {\rho_a g} {\nabla^{\gamma} P_a} \right)_{SI} = 1$$ where a = w, o, g

This gives the composite conversion factor for the consistency-conversion as


 * $$ C_{pdg} = \frac {C_{\rho}C_{g}} {C_{\nabla} C_{p}} $$

Since our parameter group is dimensionless in SI units, we don't need to include the SI units in the units for our composite conversion factor as you can see in the second table.

This is it for the analytical equations, but when the programmerer transform the flow equation into a finite difference equtation and further into a numerical algorithm, they are eager to minimize the number of computational operations. Here is an example with two constants that can be reduced to one by the fusion


 * $$ C_{cg} = C_{pdg} \cdot g $$

Using industry units, the flux version of the flow equation in vector form becomes


 * $$\mathbf{u}_a = -C_{f} \mu_a^{-1} \mathbf{K}_{ra} \mathbf{K} \cdot \left( \nabla P_a - C_{pdg} \rho_a \mathbf{g} \right) $$ where a = w, o, g

and in component form it becomes


 * $$u{_a}^\sigma = -C_{f}\mu_a^{-1} K_{ra}{^\sigma}_{\beta}  K{^\beta}_{\gamma}  \left( \nabla^{\gamma} P_a - C_{pdg}\rho_a g {e_z}{^{\gamma}} \right) $$  where a = w, o, g where $$\sigma$$ = 1,2,3

Using industry units, the rate version of the flow equation in vector form becomes


 * $$Q_a = -C_{r} \mu_a^{-1} \mathbf{A} \cdot \mathbf{K}_{ra} \cdot \mathbf{K} \cdot \left( \nabla P_a - C_{pdg}\rho_a \mathbf{g} \right) $$ where a = w, o, g

and in component form it becomes


 * $$Q{_a} = -C_{r} \mu_a^{-1} A{_{\sigma}} K_{ra}{^\sigma}_{\beta} K{^\beta}_{\gamma}  \left( \nabla^{\gamma} P_a - C_{pdg}\rho_a g {e_z}{^{\gamma}} \right) $$  where a = w, o, g