%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This file has been autogenerated from the LaTeX part of the   %
% doxygen documentation; DO NOT EDIT IT! Change the model's .hh %
% file instead!!                                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A generic compositional multi-\/phase model using primary-\/variable switching.

This model assumes a flow of $M \geq 1$ fluid phases $\alpha$, each of which is assumed to be a mixture $N \geq M$ chemical species (denoted by the upper index $\kappa$).

By default, the standard multi-\/phase Darcy approach is used to determine the velocity, i.\-e. \[ \mathbf{v}_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K} \left(\text{grad}\, p_\alpha - \varrho_{\alpha} \mathbf{g} \right) \;, \] although the actual approach which is used can be specified via the {\ttfamily Velocity\-Module} property. For example, the velocity model can by changed to the Forchheimer approach by
\begin{lstlisting}[style=eWomsCode]
 SET_TYPE_PROP(MyProblemTypeTag, VelocityModule,
      Ewoms::BoxForchheimerVelocityModule<TypeTag>);
\end{lstlisting}


The core of the model is the conservation mass of each component by means of the equation \[ \sum_\alpha \frac{\partial\;\phi c_\alpha^\kappa S_\alpha }{\partial t} - \sum_\alpha \text{div} \left\{ c_\alpha^\kappa \mathbf{v}_\alpha \right\} - q^\kappa = 0 \;. \]

To determine the quanties that occur in the equations above, this model uses {\itshape flash calculations}. A flash solver starts with the total mass or molar mass per volume for each component and, calculates the compositions, saturations and pressures of all phases at a given temperature. For this the flash solver has to use some model assumptions internally. (Often these are the same primary variable switching or N\-C\-P assumptions as used by the other fully implicit compositional multi-\/phase models provided by e\-Woms.)

Using flash calculations for the flow model has some disadvantages\-:
\begin{itemize}
\item The accuracy of the flash solver needs to be sufficient to calculate the parital derivatives using numerical differentiation which are required for the Newton scheme.
\item Flash calculations tend to be quite computationally expensive and are often numerically unstable.
\end{itemize}

It is thus adviced to increase the target tolerance of the Newton scheme or a to use type for scalar values which exhibits higher precision than the standard {\ttfamily double} (e.\-g. {\ttfamily quad}) if this model ought to be used.

The model uses the following primary variables\-:
\begin{itemize}
\item The total molar concentration of each component\-: $c^\kappa = \sum_\alpha S_\alpha x_\alpha^\kappa \rho_{mol, \alpha}$
\item The absolute temperature \$\-T\$ in Kelvins if the energy equation enabled.
\end{itemize}
