From 7deaf5040266e21d5c9bbbb6ef5563bd7f574f27 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Fri, 19 Oct 2012 13:41:26 +0200 Subject: [PATCH] box model descriptions: syncronize them with the doxygen versions the descriptions of the semi-implicit models are imported from dumux because I suppose that these have been modified manually and the differences should be negligible anyway... --- .../ModelDescriptions/1p2cboxmodel.tex | 16 ------ doc/handbook/ModelDescriptions/1pboxmodel.tex | 8 --- .../ModelDescriptions/1pdecoupledmodel.tex | 2 +- .../ModelDescriptions/2p2cboxmodel.tex | 19 ------- .../ModelDescriptions/2p2cniboxmodel.tex | 17 ------- doc/handbook/ModelDescriptions/2pboxmodel.tex | 14 ----- .../2pdecoupledpressuremodel.tex | 17 ++----- .../2pdecoupledsaturationmodel.tex | 15 ++---- .../ModelDescriptions/2pniboxmodel.tex | 16 ------ .../ModelDescriptions/3p3cboxmodel.tex | 26 ---------- .../ModelDescriptions/3p3cniboxmodel.tex | 26 ---------- .../ModelDescriptions/blackoilmodel.tex | 41 +++++++++++++++ doc/handbook/ModelDescriptions/flashmodel.tex | 35 +++++++++++++ .../ModelDescriptions/immisciblemodel.tex | 24 +++++++++ .../ModelDescriptions/mpncboxmodel.tex | 32 ------------ doc/handbook/ModelDescriptions/ncpmodel.tex | 37 ++++++++++++++ doc/handbook/ModelDescriptions/pvsmodel.tex | 51 +++++++++++++++++++ .../ModelDescriptions/richardsboxmodel.tex | 12 ----- .../ModelDescriptions/richardsmodel.tex | 12 +++++ .../ModelDescriptions/stokes2cmodel.tex | 16 ------ .../ModelDescriptions/stokes2cnimodel.tex | 18 ------- .../ModelDescriptions/stokesmodel.tex | 6 +-- doc/handbook/designpatterns.tex | 2 +- doc/handbook/models.tex | 44 +++++----------- doc/handbook/tutorial-coupled.tex | 2 +- doc/handbook/tutorial-decoupled.tex | 3 +- 26 files changed, 228 insertions(+), 283 deletions(-) delete mode 100644 doc/handbook/ModelDescriptions/1p2cboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/1pboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/2p2cboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/2p2cniboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/2pboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/2pniboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/3p3cboxmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/3p3cniboxmodel.tex create mode 100644 doc/handbook/ModelDescriptions/blackoilmodel.tex create mode 100644 doc/handbook/ModelDescriptions/flashmodel.tex create mode 100644 doc/handbook/ModelDescriptions/immisciblemodel.tex delete mode 100644 doc/handbook/ModelDescriptions/mpncboxmodel.tex create mode 100644 doc/handbook/ModelDescriptions/ncpmodel.tex create mode 100644 doc/handbook/ModelDescriptions/pvsmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/richardsboxmodel.tex create mode 100644 doc/handbook/ModelDescriptions/richardsmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/stokes2cmodel.tex delete mode 100644 doc/handbook/ModelDescriptions/stokes2cnimodel.tex diff --git a/doc/handbook/ModelDescriptions/1p2cboxmodel.tex b/doc/handbook/ModelDescriptions/1p2cboxmodel.tex deleted file mode 100644 index 37e324311..000000000 --- a/doc/handbook/ModelDescriptions/1p2cboxmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-This model implements a one-\/phase flow of a compressible fluid, that consists of two components, using a standard \-Darcy approach as the equation for the conservation of momentum\-: \[ v_{D} = - \frac{\textbf K}{\mu} \left(\text{grad} p - \varrho {\textbf g} \right) \] - -\-Gravity can be enabled or disabled via the property system. \-By inserting this into the continuity equation, one gets \[ \Phi \frac{\partial \varrho}{\partial t} - \text{div} \left\{ \varrho \frac{\textbf K}{\mu} \left(\text{grad}\, p - \varrho {\textbf g} \right) \right\} = q \;, \] - -\-The transport of the components is described by the following equation\-: \[ \Phi \frac{ \partial \varrho x}{\partial t} - \text{div} \left( \varrho \frac{{\textbf K} x}{\mu} \left( \text{grad}\, p - \varrho {\textbf g} \right) + \varrho \tau \Phi D \text{grad} x \right) = q. \] - -\-All equations are discretized using a fully-\/coupled vertex-\/centered finite volume (box) scheme as spatial and the implicit \-Euler method as time discretization. - -\-The primary variables are the pressure $p$ and the mole or mass fraction of dissolved component $x$. - diff --git a/doc/handbook/ModelDescriptions/1pboxmodel.tex b/doc/handbook/ModelDescriptions/1pboxmodel.tex deleted file mode 100644 index a677a9a2f..000000000 --- a/doc/handbook/ModelDescriptions/1pboxmodel.tex +++ /dev/null @@ -1,8 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-Single-\/phase, isothermal flow model, which solves the mass continuity equation \[ \phi \frac{\partial \varrho}{\partial t} + \text{div} (- \varrho \frac{\textbf K}{\mu} ( \textbf{grad}\, p -\varrho {\textbf g})) = q, \] discretized using a vertex-\/centered finite volume (box) scheme as spatial and the implicit \-Euler method as time discretization. \-The model supports compressible as well as incompressible fluids. - diff --git a/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex b/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex index 85dba748d..32f35ad1c 100644 --- a/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex +++ b/doc/handbook/ModelDescriptions/1pdecoupledmodel.tex @@ -4,6 +4,6 @@ % file instead!! % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\-This model solves equations of the form \[ \textbf{div}\, \boldsymbol v = q. \] \-The velocity $ \boldsymbol v $ is the single phase \-Darcy velocity\-: \[ \boldsymbol v = -\frac{1}{\mu} \boldsymbol K \left(\textbf{grad}\, p + \rho \, g \, \textbf{grad}\, z\right), \] where $ p $ is the pressure, $ \boldsymbol K $ the absolute permeability, $ \mu $ the viscosity, $ \rho $ the density, and $ g $ the gravity constant, and $ q $ is the source term. \-At the boundary, $ p = p_D $ on $ \Gamma_{Dirichlet} $, and $ \boldsymbol v \cdot \boldsymbol n = q_N$ on $ \Gamma_{Neumann} $. +This model solves equations of the form \[ \textbf{div}\, \boldsymbol v = q. \] The velocity $ \boldsymbol v $ is the single phase Darcy velocity\-: \[ \boldsymbol v = -\frac{1}{\mu} \boldsymbol K \left(\textbf{grad}\, p + \rho \, g \, \textbf{grad}\, z\right), \] where $ p $ is the pressure, $ \boldsymbol K $ the absolute permeability, $ \mu $ the viscosity, $ \rho $ the density, and $ g $ the gravity constant, and $ q $ is the source term. At the boundary, $ p = p_D $ on $ \Gamma_{Dirichlet} $, and $ \boldsymbol v \cdot \boldsymbol n = q_N$ on $ \Gamma_{Neumann} $. diff --git a/doc/handbook/ModelDescriptions/2p2cboxmodel.tex b/doc/handbook/ModelDescriptions/2p2cboxmodel.tex deleted file mode 100644 index 23d1ad2f8..000000000 --- a/doc/handbook/ModelDescriptions/2p2cboxmodel.tex +++ /dev/null @@ -1,19 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-This model implements two-\/phase two-\/component flow of two compressible and partially miscible fluids $\alpha \in \{ w, n \}$ composed of the two components $\kappa \in \{ w, a \}$. \-The standard multiphase \-Darcy approach is used as the equation for the conservation of momentum\-: \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} \left(\text{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g} \right) \] - -\-By inserting this into the equations for the conservation of the components, one gets one transport equation for each component \begin{eqnarray*} && \phi \frac{\partial (\sum_\alpha \varrho_\alpha X_\alpha^\kappa S_\alpha )} {\partial t} - \sum_\alpha \text{div} \left\{ \varrho_\alpha X_\alpha^\kappa \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} (\text{grad}\, p_\alpha - \varrho_{\alpha} \mbox{\bf g}) \right\} \nonumber \\ \nonumber \\ &-& \sum_\alpha \text{div} \left\{{\bf D}_{\alpha, pm}^\kappa \varrho_{\alpha} \text{grad}\, X^\kappa_{\alpha} \right\} - \sum_\alpha q_\alpha^\kappa = 0 \qquad \kappa \in \{w, a\} \, , \alpha \in \{w, g\} \end{eqnarray*} - -\-This is discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit \-Euler method as temporal discretization. - -\-By using constitutive relations for the capillary pressure $p_c = p_n - p_w$ and relative permeability $k_{r\alpha}$ and taking advantage of the fact that $S_w + S_n = 1$ and $X^\kappa_w + X^\kappa_n = 1$, the number of unknowns can be reduced to two. \-The used primary variables are, like in the two-\/phase model, either $p_w$ and $S_n$ or $p_n$ and $S_w$. \-The formulation which ought to be used can be specified by setting the {\ttfamily \-Formulation} property to either \-Two\-P\-Two\-C\-Indices\-::p\-Ws\-N or \-Two\-P\-Two\-C\-Indices\-::p\-Ns\-W. \-By default, the model uses $p_w$ and $S_n$. \-Moreover, the second primary variable depends on the phase state, since a primary variable switch is included. \-The phase state is stored for all nodes of the system. \-Following cases can be distinguished\-: -\begin{itemize} -\item \-Both phases are present\-: \-The saturation is used (either $S_n$ or $S_w$, dependent on the chosen {\ttfamily \-Formulation}), as long as $ 0 < S_\alpha < 1$. -\item \-Only wetting phase is present\-: \-The mass fraction of, e.\-g., air in the wetting phase $X^a_w$ is used, as long as the maximum mass fraction is not exceeded $(X^a_w); +\end{lstlisting} + + +The primary variables used by this model are\-: +\begin{itemize} +\item The pressure of the phase with the lowest index +\item The two saturations of the phases with the lowest indices +\end{itemize} + diff --git a/doc/handbook/ModelDescriptions/flashmodel.tex b/doc/handbook/ModelDescriptions/flashmodel.tex new file mode 100644 index 000000000..e37bd5208 --- /dev/null +++ b/doc/handbook/ModelDescriptions/flashmodel.tex @@ -0,0 +1,35 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 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, + Dumux::BoxForchheimerVelocityModule); +\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} + diff --git a/doc/handbook/ModelDescriptions/immisciblemodel.tex b/doc/handbook/ModelDescriptions/immisciblemodel.tex new file mode 100644 index 000000000..1687b48f3 --- /dev/null +++ b/doc/handbook/ModelDescriptions/immisciblemodel.tex @@ -0,0 +1,24 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This file has been autogenerated from the LaTeX part of the % +% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % +% file instead!! % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This model multi-\/phase flow of $M > 0$ immiscible fluids $\alpha$. 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, + Dumux::BoxForchheimerVelocityModule); +\end{lstlisting} + + +The core of the model is the conservation mass of each component by means of the equation \[ \frac{\partial\;\phi S_\alpha \rho_\alpha }{\partial t} - \text{div} \left\{ \rho_\alpha \mathbf{v}_\alpha \right\} - q_\alpha = 0 \;. \] + +These equations are discretized by a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit Euler method as time discretization. + +The model uses the following primary variables\-: +\begin{itemize} +\item The pressure $p_0$ in Pascal of the phase with the lowest index +\item The saturations $S_\alpha$ of the $M - 1$ phases that exhibit the lowest indices +\item The absolute temperature $T$ in Kelvin if energy is conserved via the energy equation +\end{itemize} + diff --git a/doc/handbook/ModelDescriptions/mpncboxmodel.tex b/doc/handbook/ModelDescriptions/mpncboxmodel.tex deleted file mode 100644 index b47e9c9c9..000000000 --- a/doc/handbook/ModelDescriptions/mpncboxmodel.tex +++ /dev/null @@ -1,32 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-This model implements a $M$-\/phase flow of a fluid mixture composed of $N$ chemical species. \-The phases are denoted by lower index $\alpha \in \{ 1, \dots, M \}$. \-All fluid phases are mixtures of $N \geq M - 1$ chemical species which are denoted by the upper index $\kappa \in \{ 1, \dots, N \} $. - -\-The standard multi-\/phase \-Darcy law is used as the equation for the conservation of momentum\-: \[ v_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \boldsymbol{K} \left( \text{grad}\left(p_\alpha - \varrho_{\alpha} g\right) \right) \] - -\-By inserting this into the equations for the conservation of the mass of each component, one gets one mass-\/continuity equation for each component $\kappa$ \[ \sum_{\kappa} \left( \phi \frac{\partial \varrho_\alpha x_\alpha^\kappa S_\alpha}{\partial t} - \mathrm{div}\; \left\{ \frac{\varrho_\alpha}{\overline M_\alpha} x_\alpha^\kappa \frac{k_{r\alpha}}{\mu_\alpha} \boldsymbol{K} \text{grad}\left( p_\alpha - \varrho_{\alpha} g\right) \right\} \right) = q^\kappa \] with $\overline M_\alpha$ being the average molar mass of the phase $\alpha$\-: \[ \overline M_\alpha = \sum_\kappa M^\kappa \; x_\alpha^\kappa \] - -\-For the missing $M$ model assumptions, the model assumes that if a fluid phase is not present, the sum of the mole fractions of this fluid phase is smaller than $1$, i.\-e. \[ \forall \alpha: S_\alpha = 0 \implies \sum_\kappa x_\alpha^\kappa \leq 1 \] - -\-Also, if a fluid phase may be present at a given spatial location its saturation must be positive\-: \[ \forall \alpha: \sum_\kappa x_\alpha^\kappa = 1 \implies S_\alpha \geq 0 \] - -\-Since at any given spatial location, a phase is always either present or not present, one of the strict equalities on the right hand side is always true, i.\-e. \[ \forall \alpha: S_\alpha \left( \sum_\kappa x_\alpha^\kappa - 1 \right) = 0 \] always holds. - -\-These three equations constitute a non-\/linear complementarity problem, which can be solved using so-\/called non-\/linear complementarity functions $\Phi(a, b)$ which have the property \[\Phi(a,b) = 0 \iff a \geq0 \land b \geq0 \land a \cdot b = 0 \] - -\-Several non-\/linear complementarity functions have been suggested, e.\-g. the \-Fischer-\/\-Burmeister function \[ \Phi(a,b) = a + b - \sqrt{a^2 + b^2} \;. \] \-This model uses \[ \Phi(a,b) = \min \{a, b \}\;, \] because of its piecewise linearity. - -\-These equations are then discretized using a fully-\/implicit vertex centered finite volume scheme (often known as 'box'-\/scheme) for spatial discretization and the implicit \-Euler method as temporal discretization. - -\-The model assumes local thermodynamic equilibrium and uses the following primary variables\-: -\begin{itemize} -\item \-The component fugacities $f^1, \dots, f^{N}$ -\item \-The pressure of the first phase $p_1$ -\item \-The saturations of the first $M-1$ phases $S_1, \dots, S_{M-1}$ -\item \-Temperature $T$ if the energy equation is enabled -\end{itemize} - diff --git a/doc/handbook/ModelDescriptions/ncpmodel.tex b/doc/handbook/ModelDescriptions/ncpmodel.tex new file mode 100644 index 000000000..4577d62a6 --- /dev/null +++ b/doc/handbook/ModelDescriptions/ncpmodel.tex @@ -0,0 +1,37 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This file has been autogenerated from the LaTeX part of the % +% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % +% file instead!! % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This model implements a $M$-\/phase flow of a fluid mixture composed of $N$ chemical species. The phases are denoted by lower index $\alpha \in \{ 1, \dots, M \}$. All fluid phases are mixtures of $N \geq M - 1$ chemical species which are denoted by the upper index $\kappa \in \{ 1, \dots, N \} $. + +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, + Dumux::BoxForchheimerVelocityModule); +\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 \;. \] + +For the missing $M$ model assumptions, the model uses non-\/linear complementarity functions. These are based on the observation that if a fluid phase is not present, the sum of the mole fractions of this fluid phase is smaller than $1$, i.\-e. \[ \forall \alpha: S_\alpha = 0 \implies \sum_\kappa x_\alpha^\kappa \leq 1 \] + +Also, if a fluid phase may be present at a given spatial location its saturation must be non-\/negative\-: \[ \forall \alpha: \sum_\kappa x_\alpha^\kappa = 1 \implies S_\alpha \geq 0 \] + +Since at any given spatial location, a phase is always either present or not present, one of the strict equalities on the right hand side is always true, i.\-e. \[ \forall \alpha: S_\alpha \left( \sum_\kappa x_\alpha^\kappa - 1 \right) = 0 \] always holds. + +These three equations constitute a non-\/linear complementarity problem, which can be solved using so-\/called non-\/linear complementarity functions $\Phi(a, b)$. Such functions have the property \[\Phi(a,b) = 0 \iff a \geq0 \land b \geq0 \land a \cdot b = 0 \] + +Several non-\/linear complementarity functions have been suggested, e.\-g. the Fischer-\/\-Burmeister function \[ \Phi(a,b) = a + b - \sqrt{a^2 + b^2} \;. \] This model uses \[ \Phi(a,b) = \min \{a, b \}\;, \] because of its piecewise linearity. + +These equations are then discretized using a fully-\/implicit vertex centered finite volume scheme (often known as 'box'-\/scheme) for spatial discretization and the implicit Euler method as temporal discretization. + +The model assumes local thermodynamic equilibrium and uses the following primary variables\-: +\begin{itemize} +\item The pressure of the first phase $p_1$ +\item The component fugacities $f^1, \dots, f^{N}$ +\item The saturations of the first $M-1$ phases $S_1, \dots, S_{M-1}$ +\item Temperature $T$ if the energy equation is enabled +\end{itemize} + diff --git a/doc/handbook/ModelDescriptions/pvsmodel.tex b/doc/handbook/ModelDescriptions/pvsmodel.tex new file mode 100644 index 000000000..7740744f7 --- /dev/null +++ b/doc/handbook/ModelDescriptions/pvsmodel.tex @@ -0,0 +1,51 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This file has been autogenerated from the LaTeX part of the % +% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % +% file instead!! % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +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 $\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, + Dumux::BoxForchheimerVelocityModule); +\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 close the system mathematically, $M$ model equations are also required. This model uses the primary variable switching assumptions, which are given by\-: \[ 0 \stackrel{!}{=} f_\alpha = \left\{ \begin{array}{cl} S_\alpha & \quad \text{if phase }\alpha\text{ is not present} \\ 1 - \sum_\kappa x_\alpha^\kappa & \quad \text{else} \end{array} \right. \] + +To make this approach applicable, a pseudo primary variable {\itshape phase presence} has to be introduced. Its purpose is to specify for each phase whether it is present or not. It is a {\itshape pseudo} primary variable because it is not directly considered when linearizing the system in the Newton method, but after each Newton iteration, it gets updated like the \char`\"{}real\char`\"{} primary variables. The following rules are used for this update procedure\-: + + +\begin{itemize} +\item If phase $\alpha$ is present according to the pseudo primary variable, but $S_\alpha < 0$ after the Newton update, consider the phase $\alpha$ disappeared for the next iteration and use the set of primary variables which correspond to the new phase presence. + + +\item If phase $\alpha$ is not present according to the pseudo primary variable, but the sum of the component mole fractions in the phase is larger than 1, i.\-e. $\sum_\kappa x_\alpha^\kappa > 1$, consider the phase $\alpha$ present in the the next iteration and update the set of primary variables to make it consistent with the new phase presence. + + +\item In all other cases don't modify the phase presence for phase $\alpha$. + + +\end{itemize} + +The model always requires $N$ primary variables, but their interpretation is dependent on the phase presence\-: + + +\begin{itemize} +\item The first primary variable is always interpreted as the pressure of the phase with the lowest index $PV_0 = p_0$. + + +\item Then, $M - 1$ \char`\"{}switching primary variables\char`\"{} follow, which are interpreted depending in the presence of the first $M-1$ phases\-: If phase $\alpha$ is present, its saturation $S_\alpha = PV_i$ is used as primary variable; if it is not present, the mole fraction $PV_i = x_{\alpha^\star}^\alpha$ of the component with index $\alpha$ in the phase with the lowest index that is present $\alpha^\star$ is used instead. + + +\item Finally, the mole fractions of the $N-M$ components with the largest index in the phase with the lowest index that is present $x_{\alpha^\star}^\kappa$ are used as primary variables. + + +\end{itemize} + +This model is then discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit Euler method as temporal discretization. + diff --git a/doc/handbook/ModelDescriptions/richardsboxmodel.tex b/doc/handbook/ModelDescriptions/richardsboxmodel.tex deleted file mode 100644 index e3324048d..000000000 --- a/doc/handbook/ModelDescriptions/richardsboxmodel.tex +++ /dev/null @@ -1,12 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-In the unsaturated zone, \-Richards' equation is frequently used to approximate the water distribution above the groundwater level. \-It can be derived from the two-\/phase equations, i.\-e. \[ \frac{\partial\;\phi S_\alpha \rho_\alpha}{\partial t} - \text{div} \left\{ \rho_\alpha \frac{k_{r\alpha}}{\mu_\alpha}\; \mathbf{K} \textbf{grad}\left[ p_\alpha - g\rho_\alpha \right] \right\} = q_\alpha, \] where $\alpha \in \{w, n\}$ is the fluid phase, $\rho_\alpha$ is the fluid density, $S_\alpha$ is the fluid saturation, $\phi$ is the porosity of the soil, $k_{r\alpha}$ is the relative permeability for the fluid, $\mu_\alpha$ is the fluid's dynamic viscosity, $\mathbf{K}$ is the intrinsic permeability, $p_\alpha$ is the fluid pressure and $g$ is the potential of the gravity field. - -\-In contrast to the full two-\/phase model, the \-Richards model assumes gas as the non-\/wetting fluid and that it exhibits a much lower viscosity than the (liquid) wetting phase. (\-For example at atmospheric pressure and at room temperature, the viscosity of air is only about $1\%$ of the viscosity of liquid water.) \-As a consequence, the $\frac{k_{r\alpha}}{\mu_\alpha}$ term typically is much larger for the gas phase than for the wetting phase. \-For this reason, the \-Richards model assumes that $\frac{k_{rn}}{\mu_n}$ is infinitly large. \-This implies that the pressure of the gas phase is equivalent to the static pressure distribution and that therefore, mass conservation only needs to be considered for the wetting phase. - -\-The model thus choses the absolute pressure of the wetting phase $p_w$ as its only primary variable. \-The wetting phase saturation is calculated using the inverse of the capillary pressure, i.\-e. \[ S_w = p_c^{-1}(p_n - p_w) \] holds, where $p_n$ is a given reference pressure. \-Nota bene, that the last step is assumes that the capillary pressure-\/saturation curve can be uniquely inverted, so it is not possible to set the capillary pressure to zero when using the \-Richards model! - diff --git a/doc/handbook/ModelDescriptions/richardsmodel.tex b/doc/handbook/ModelDescriptions/richardsmodel.tex new file mode 100644 index 000000000..bee994cd1 --- /dev/null +++ b/doc/handbook/ModelDescriptions/richardsmodel.tex @@ -0,0 +1,12 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% This file has been autogenerated from the LaTeX part of the % +% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % +% file instead!! % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +In the unsaturated zone, Richards' equation is frequently used to approximate the water distribution above the groundwater level. It can be derived from the two-\/phase equations, i.\-e. \[ \frac{\partial\;\phi S_\alpha \rho_\alpha}{\partial t} - \text{div} \left\{ \rho_\alpha \frac{k_{r\alpha}}{\mu_\alpha}\; \mathbf{K}\; \textbf{grad}\left[ p_\alpha - g\rho_\alpha \right] \right\} = q_\alpha, \] where $\alpha \in \{w, n\}$ is the index of the fluid phase, $\rho_\alpha$ is the fluid density, $S_\alpha$ is the fluid saturation, $\phi$ is the porosity of the soil, $k_{r\alpha}$ is the relative permeability for the fluid, $\mu_\alpha$ is the fluid's dynamic viscosity, $\mathbf{K}$ is the intrinsic permeability tensor, $p_\alpha$ is the fluid phase pressure and $g$ is the potential of the gravity field. + +In contrast to the \char`\"{}full\char`\"{} two-\/phase model, the Richards model assumes that the non-\/wetting fluid is gas and that it thus exhibits a much lower viscosity than the (liquid) wetting phase. (This assumption is quite realistic in many applications\-: For example, at atmospheric pressure and at room temperature, the viscosity of air is only about $1\%$ of the viscosity of liquid water.) As a consequence, the $\frac{k_{r\alpha}}{\mu_\alpha}$ term typically is much larger for the gas phase than for the wetting phase. Using this reasoning, the Richards model assumes that $\frac{k_{rn}}{\mu_n}$ is infinitely large compared to the same term of the liquid phase. This implies that the pressure of the gas phase is equivalent to the static pressure distribution and that therefore, mass conservation only needs to be considered for the liquid phase. + +The model thus choses the absolute pressure of the wetting phase $p_w$ as its only primary variable. The wetting phase saturation is calculated using the inverse of the capillary pressure, i.\-e. \[ S_w = p_c^{-1}(p_n - p_w) \] holds, where $p_n$ is a reference pressure given by the problem's {\ttfamily reference\-Pressure()} method. Nota bene, that the last step assumes that the capillary pressure-\/saturation curve can be uniquely inverted, i.\-e. it is not possible to set the capillary pressure to zero if the Richards model ought to be used! + diff --git a/doc/handbook/ModelDescriptions/stokes2cmodel.tex b/doc/handbook/ModelDescriptions/stokes2cmodel.tex deleted file mode 100644 index 9e9dd9d58..000000000 --- a/doc/handbook/ModelDescriptions/stokes2cmodel.tex +++ /dev/null @@ -1,16 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-This model implements an isothermal two-\/component \-Stokes flow of a fluid solving a momentum balance, a mass balance and a conservation equation for one component. - -\-Momentum \-Balance\-: \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] - -\-Mass balance equation\-: \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 \] - -\hyperlink{a00047}{\-Component} mass balance equation\-: \[ \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa - D^\kappa_g \varrho_g \boldsymbol{\nabla} X_g^\kappa \right) - q_g^\kappa = 0 \] - -\-This is discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit \-Euler method as temporal discretization. - diff --git a/doc/handbook/ModelDescriptions/stokes2cnimodel.tex b/doc/handbook/ModelDescriptions/stokes2cnimodel.tex deleted file mode 100644 index ef8c8cc4a..000000000 --- a/doc/handbook/ModelDescriptions/stokes2cnimodel.tex +++ /dev/null @@ -1,18 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% This file has been autogenerated from the LaTeX part of the % -% doxygen documentation; DO NOT EDIT IT! Change the model's .hh % -% file instead!! % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\-This model implements a non-\/isothermal two-\/component \-Stokes flow of a fluid solving a momentum balance, a mass balance, a conservation equation for one component, and one balance equation for the energy. - -\-Momentum \-Balance\-: \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] - -\-Mass balance equation\-: \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 \] - -\hyperlink{a00047}{\-Component} mass balance equation\-: \[ \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa - D^\kappa_g \varrho_g \boldsymbol{\nabla} X_g^\kappa \right) - q_g^\kappa = 0 \] - -\-Energy balance equation\-: \[ \frac{\partial (\varrho_g u_g)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \varrho_g h_g {\boldsymbol{v}}_g - \lambda_g \boldsymbol{\nabla} T - q_T = 0 \] - -\-This is discretized using a fully-\/coupled vertex centered finite volume (box) scheme as spatial and the implicit \-Euler method as temporal discretization. - diff --git a/doc/handbook/ModelDescriptions/stokesmodel.tex b/doc/handbook/ModelDescriptions/stokesmodel.tex index b855afa3b..fd841d069 100644 --- a/doc/handbook/ModelDescriptions/stokesmodel.tex +++ b/doc/handbook/ModelDescriptions/stokesmodel.tex @@ -4,9 +4,9 @@ % file instead!! % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\-This model implements laminar \-Stokes flow of a single fluid, solving a momentum balance\-: \[ \frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} + \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} - \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g + \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) - \varrho_g {\bf g} = 0, \] +This model implements Navier-\/\-Stokes flow of a single fluid. By default, it solves the momentum balance of the time-\/dependent Stokes equations, i.\-e. \[ \frac{\partial \left(\varrho\,\mathbf{v}\right)}{\partial t} + \boldsymbol{\nabla} p - \nabla \cdot \left( \mu \left(\boldsymbol{\nabla} \mathbf{v} + \boldsymbol{\nabla} \mathbf{v}^T\right) \right) - \varrho\,\mathbf{g} = 0\;, \] and the mass balance equation \[ \frac{\partial \varrho}{\partial t} + \nabla \cdot\left(\varrho\,\mathbf{v}\right) - q = 0 \;. \] -and the mass balance equation\-: \[ \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 \] +If the property {\ttfamily Enable\-Navier\-Stokes} is set to {\ttfamily true}, an additional convective momentum flux term (Navier term) gets included into the momentum conservation equations which allows to capture turbolent flow regimes. This additional term is given by \[ \varrho \left(\mathbf{v} \cdot \boldsymbol{\nabla} \right) \mathbf{v} \;. \] -\-This is discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and by the implicit \-Euler method in time. +These equations are discretized by a fully-\/coupled vertex-\/centered finite volume (box) scheme in space and using the implicit Euler method in time. Be aware, that this discretization scheme is quite unstable for the Navier-\/\-Stokes equations and quickly leads to unphysical oscillations in the calculated solution. We intend to use a more appropriate discretization scheme in the future, though. diff --git a/doc/handbook/designpatterns.tex b/doc/handbook/designpatterns.tex index b4b9ad7fb..a24e3d428 100644 --- a/doc/handbook/designpatterns.tex +++ b/doc/handbook/designpatterns.tex @@ -122,7 +122,7 @@ executed is dynamically determined at run time. \begin{example} \label{example:DynPoly} A class called \texttt{Car} may feature the methods - \texttt{gasUsage} (on line \ref{designpatterns:virtual-usage), which + \texttt{gasUsage} (on line \ref{designpatterns:virtual-usage}, which by default roughly corresponds to the current $CO_2$ emission goal of the European Union, but can be changed by classes representing actual cars. Also, a method called \texttt{fuelTankSize} makes diff --git a/doc/handbook/models.tex b/doc/handbook/models.tex index e9ddf92e5..a39f61fba 100644 --- a/doc/handbook/models.tex +++ b/doc/handbook/models.tex @@ -152,45 +152,27 @@ scheme as described in Section \ref{box} for spatial and the implicit Euler method as temporal discretization. The models themselves are located in subdirectories of \texttt{dumux/boxmodels} of the \eWoms distribution. -\subsubsection{The single-phase model: OnePBoxModel} -\input{ModelDescriptions/1pboxmodel} +\subsubsection{The immiscible multi-phase model} +\input{ModelDescriptions/immisciblemodel} -\subsubsection{The single-phase, two-component model: OnePTwoCBoxModel} -\input{ModelDescriptions/1p2cboxmodel} +\subsubsection{The miscible multi-phase NCP model} +\input{ModelDescriptions/pvsmodel} -\subsubsection{The two-phase model using the Richards assumption: RichardsBoxModel} -\input{ModelDescriptions/richardsboxmodel} +\subsubsection{The miscible multi-phase PVS model} +\input{ModelDescriptions/pvsmodel} -\subsubsection{The two-phase model: TwoPBoxModel} -\input{ModelDescriptions/2pboxmodel} +\subsubsection{The miscible multi-phase flash model} +\input{ModelDescriptions/flashmodel} -\subsubsection{The non-isothermal two-phase model: TwoPNIBoxModel} -\input{ModelDescriptions/2pniboxmodel} +\subsubsection{The Richards model} +\input{ModelDescriptions/richardsmodel} -\subsubsection{The two-phase, two-component model: TwoPTwoCBoxModel} -\input{ModelDescriptions/2p2cboxmodel} +\subsubsection{The black-oil model} +\input{ModelDescriptions/blackoilmodel} -\subsubsection{The non-isothermal two-phase, two-component model: TwoPTwoCNIBoxModel} -\input{ModelDescriptions/2p2cniboxmodel} - -\subsubsection{The three-phase, three-component model: ThreePThreeCBoxModel} -\input{ModelDescriptions/3p3cboxmodel} - -\subsubsection{The non-isothermal three-phase, three-component model: ThreePThreeCNIBoxModel} -\input{ModelDescriptions/3p3cniboxmodel} - -\subsubsection{The $M$-phase, $N$-component model: MpNcBoxModel} -\input{ModelDescriptions/mpncboxmodel} - -\subsubsection{The Stokes model: StokesModel} +\subsubsection{The (Navier-)Stokes model} \input{ModelDescriptions/stokesmodel} -\subsubsection{The isothermal two-component Stokes model: Stokes2cModel} -\input{ModelDescriptions/stokes2cmodel} - -\subsubsection{The non-isothermal two-component Stokes model: Stokes2cniModel} -\input{ModelDescriptions/stokes2cnimodel} - \subsection{Semi-implicit models} % The basic idea the so-called decoupled models have in common is to reformulate the equations of multi-phase flow (e.g. Eq. \ref{A3:eqmass1}) into one equation for pressure and equations for phase-/component-/etc. transport. The pressure equation is the sum of the mass balance equations and thus considers the total flow of the fluid system. The new set of equations is considered as decoupled (or weakly coupled) and can thus be solved sequentially. The most popular decoupled model is the so-called fractional flow formulation for two-phase flow which is usually implemented applying an IMplicit Pressure Explicit Saturation algorithm (IMPES). diff --git a/doc/handbook/tutorial-coupled.tex b/doc/handbook/tutorial-coupled.tex index ab13259cf..136a92a07 100644 --- a/doc/handbook/tutorial-coupled.tex +++ b/doc/handbook/tutorial-coupled.tex @@ -1,4 +1,4 @@ -\section[Fully-Implicit Model]{Solving a problem using a fully-implicit model} +\section{Solving problems using the fully-implicit models} \label{tutorial-coupled} The process of setting up a problem using \eWoms can be roughly diff --git a/doc/handbook/tutorial-decoupled.tex b/doc/handbook/tutorial-decoupled.tex index 243552fbc..f3ce93bca 100644 --- a/doc/handbook/tutorial-decoupled.tex +++ b/doc/handbook/tutorial-decoupled.tex @@ -1,4 +1,5 @@ -\section[Semi-implicit model]{Solving a problem using a Semi-implicit Model}\label{tutorial-decoupled} +\section{Solving problems using the semi-implicit models} +\label{tutorial-decoupled} In contrast to the last section, we now apply a semi-implicit solution procedure, a so-called \textit{IMPET} (\textit{IM}plicit \textit{P}ressure \textit{E}xplicit