# Contents of /trunk/doc/user/darcyflux.tex

Revision 3502 - (show annotations)
Thu Apr 28 05:06:24 2011 UTC (8 years, 4 months ago) by gross
File MIME type: application/x-tex
File size: 10391 byte(s)
Darcy flow solver is now supporting 4 solvers

 1 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 % 4 % Copyright (c) 2003-2010 by University of Queensland 5 % Earth Systems Science Computational Center (ESSCC) 6 7 % 8 % Primary Business: Queensland, Australia 9 % Licensed under the Open Software License version 3.0 10 11 % 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 14 \section{Darcy Flux} 15 \label{DARCY FLUX} 16 We want to calculate the velocity $u$ and pressure $p$ on a domain $\Omega$ 17 solving the Darcy flux problem\index{Darcy flux}\index{Darcy flow} 18 \begin{equation}\label{DARCY PROBLEM} 19 \begin{array}{rcl} 20 u_{i} + \kappa_{ij} p_{,j} & = & g_{i} \\ 21 u_{k,k} & = & f 22 \end{array} 23 \end{equation} 24 with the boundary conditions 25 \begin{equation}\label{DARCY BOUNDARY} 26 \begin{array}{rcl} 27 u_{i} \; n_{i} = u^{N}_{i} \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 28 p = p^{D} & \mbox{ on } & \Gamma_{D} \\ 29 \end{array} 30 \end{equation} 31 where $\Gamma_{N}$ and $\Gamma_{D}$ are a partition of the boundary of 32 $\Omega$ with $\Gamma_{D}$ non-empty, $n_{i}$ is the outer normal field of the 33 boundary of $\Omega$, $u^{N}_{i}$ and $p^{D}$ are given functions on $\Omega$, 34 $g_{i}$ and $f$ are given source terms and $\kappa_{ij}$ is the given 35 permeability. 36 We assume that $\kappa_{ij}$ is symmetric (which is not really required) and 37 positive definite, i.e. there are positive constants $\alpha_{0}$ and 38 $\alpha_{1}$ which are independent from the location in $\Omega$ such that 39 \begin{equation} 40 \alpha_{0} \; x_{i} x_{i} \le \kappa_{ij} x_{i} x_{j} \le \alpha_{1} \; x_{i} x_{i} 41 \end{equation} 42 for all $x_{i}$. 43 44 45 \subsection{Solution Method \label{DARCY SOLVE}} 46 Unfortunate equation~\ref{DARCY PROBLEM} can not solved directly in an easy way and requires mixed FEM. 47 We consider a few options to solve equation~\ref{DARCY PROBLEM} 48 \subsubsection{Simple Solver}\label{SEC DARCY SIMPLE} 49 The first equation of equation~\ref{DARCY PROBLEM} is inserted into the second one: 50 \begin{equation}\label{DARCY PROBLEM SIMPLE} 51 - (\kappa_{ij} p_{,j})_{,i} = f - (g_{i})_{,i} 52 \end{equation} 53 with boundary conditions 54 \begin{equation}\label{DARCY BOUNDARY SIMPLE} 55 \begin{array}{rcl} 56 \kappa_{ij} p_{,j} \; n_{i} = ( g_{i} - u^{N}_{i} ) \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 57 p = p^{D} & \mbox{ on } & \Gamma_{D} \\ 58 \end{array} 59 \end{equation} 60 Then the flux field is recovred by solving 61 \begin{equation}\label{DARCY PROBLEM SIMPLE FLUX} 62 u_{j} = g_j - \kappa_{ij} p_{,j} 63 \end{equation} 64 with boundary conditions 65 \begin{equation}\label{DARCY SIMPLE BOUNDARY FLUX} 66 u_{i} = u^{N}_{i} \mbox{ on } \Gamma_{N} 67 \end{equation} 68 69 \subsubsection{Global Postprocessing \label{SEC DARCY POST}} 70 An improved flux recovery can be achieved by solving a modified version of equation~\ref{DARCY PROBLEM SIMPLE FLUX} 71 adding the the gradient of the divergence of the flux: 72 \begin{equation}\label{DARCY PROBLEM POST FLUX} 73 \kappa^{-1}_{ij} u_{j} - 74 (\lambda \cdot u_{k,k} )_{,i}= 75 \kappa^{-1}_{ij} g_j- p_{,i} 76 - (\lambda \cdot f )_{,i} 77 \end{equation} 78 where 79 \begin{equation}\label{DARCY PROBLEM POST FLUX A} 80 \lambda = \omega \cdot |\kappa^{-1}| \cdot vol(\Omega)^{1/d} \cdot h 81 \end{equation} 82 with a non-negative factor $\omega$, $d$ is the spatial dimension and $h$ is the local element size. 83 \begin{equation}\label{DARCY PROBLEM POST FLUX BOUNDARY} 84 \begin{array}{rcl} 85 u_{i} \; n_{i} = u^{N}_{i} \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 86 u_{k,k} = f & \mbox{ on } & \Gamma_{D} \\ 87 \end{array} 88 \end{equation} 89 Notice that the second condition is a natural boundray condition. 90 91 \subsubsection{Stabilization \label{SEC DARCY STAB}} 92 Stabilization term can be added to the original problem~\ref{DARCY PROBLEM SIMPLE FLUX}, see~\cite{MasudHughes2002a}. 93 Firstly we subtract half of the first equation from the first eqaution 94 \begin{equation}\label{DARCY STAB PROBLEM A} 95 \kappa^{-1}_{ij} u_{j} + (p)_{,i} - \frac{1}{2} \left( \kappa^{-1}_{ij} u_{j} + p_{,i} \right) = \kappa^{-1}_{ij} g_j -\frac{1}{2} \kappa^{-1}_{ij} g_j 96 \end{equation} 97 and then subtract half of the dievregence of the first equation from the second equation: 98 \begin{equation}\label{DARCY STAB PROBLEM} 99 \begin{array}{rcl} 100 \frac{1}{2} \kappa^{-1}_{ij} u_{j} + (p)_{,i} - \frac{1}{2} p_{,i} & = & \frac{1}{2} \kappa^{-1}_{ij} g_j \\ 101 u_{i,i} - \frac{1}{2} \left(u_{i} + \kappa_{ij} p_{,j} \right)_{,i} & = & f - \frac{1}{2} \left(g_{i} \right)_{,i} 102 \end{array} 103 \end{equation} 104 We apply the boundary conditions: 105 \begin{equation}\label{DARCY SYM STAB PROBLEM BOUNDARY} 106 \begin{array}{rcl} 107 u_{i} \; n_{i} = u^{N}_{i} \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 108 p = p^{D} & \mbox{ on } & \Gamma_{D} \\ 109 \frac{1}{2} \left( u_{i} + \kappa^{-1}_{ij} p_{,j} - g_{i} \right ) \; n_{i} = 0 & \mbox{ on } & \Gamma_{N} \\ 110 \end{array} 111 \end{equation} 112 Notice that due to the term $(p)_{,i}$ boundary condition $p = p^{D}$ acts as a natural boundary condition for the 113 first equation of~\ref{DARCY STAB PROBLEM} (in the form $p \; n_i = p^{D} \; n_i$ while the last two boundary conditions act as constraint and natural boundary conditions for the second equation. 114 115 \subsubsection{Symmetric Stabilization \label{SEC DARCY SYM STAB}} 116 Symmetric stabilization term can be added to the original problem~\ref{DARCY PROBLEM SIMPLE FLUX}, see~\cite{LoulaCorrea2006a}. In this approach divergence of the first equation 117 is subtracted from $2 \times$ the second equation 118 \begin{equation}\label{DARCY SYM STAB PROBLEM A} 119 - (u_{i})_{,i} + \frac{1}{2} \left( u_{i} + \kappa_{ij} p_{,j} \right)_{,i} = - f + \frac{1}{2} \left( g_{i}\right)_{,i} 120 \end{equation} 121 The first equation is rescaled by the factor $\frac{1}{2}$ to maintain symmetry. This leads to 122 \begin{equation}\label{DARCY SYM STAB PROBLEM} 123 \begin{array}{rcl} 124 \frac{1}{2} \kappa^{-1}_{ij} u_{j} + \frac{1}{2} p_{,i}& = & \frac{1}{2} \kappa^{-1}_{ij} g_{j} \\ 125 \frac{1}{2} \left( \kappa_{ij} p_{,j} - u_{i} \right)_{,i} & = & - f + \frac{1}{2} \left(g_{i}\right)_{,i} 126 \end{array} 127 \end{equation} 128 We add the boundary conditions 129 \begin{equation}\label{DARCY SYM STAB PROBLEM BOUNDARY} 130 \begin{array}{rcl} 131 u_{i} \; n_{i} = u^{N}_{i} \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 132 p = p^{D} & \mbox{ on } & \Gamma_{D} \\ 133 \frac{1}{2} \left( \kappa_{ij} p_{,j} - g_{i} - u_{i} \right ) \; n_{i} 134 = - u^{N}_{i} \; n_{i} & \mbox{ on } & \Gamma_{N} \\ 135 \end{array} 136 \end{equation} 137 Notice that the last contion provides natural boundary conditons for the last eqaution of~\ref{DARCY SYM STAB PROBLEM}. 138 139 140 141 \subsection{Functions} 142 \begin{classdesc}{DarcyFlow}{domain, \optional{w=1., \optional{solver=\member{DarcyFlow.SYMSTAB}, \optional{ 143 useReduced=\True, \optional{ verbose=\True} } }}} 144 opens the Darcy flux problem\index{Darcy flux} on the \Domain domain. 145 Reduced approximations for pressure and flux are used if \var{useReduced} is set. 146 Argument \var{solver} defines the solver method. 147 If \var{verbose} is set some information are printed. 148 \var{w} defines the weighting factor $\omega$ for global postprocessing pf the flux (see equation~\ref{DARCY PROBLEM POST FLUX A}.) 149 \end{classdesc} 150 151 \begin{memberdesc}[DarcyFlow]{SIMPLE} 152 simple solver, see section~\ref{SEC DARCY SIMPLE}. 153 \end{memberdesc} 154 155 \begin{memberdesc}[DarcyFlow]{POST} 156 solver using global postprocessing of flux, see section~\ref{SEC DARCY POST}. 157 \end{memberdesc} 158 159 \begin{memberdesc}[DarcyFlow]{STAB} 160 solver uses (non-symmetric) stabilization, see section~\ref{SEC DARCY STAB}. 161 \end{memberdesc} 162 163 \begin{memberdesc}[DarcyFlow]{SYMSTAB} 164 solver uses symmetric stabilization, see section~\ref{SEC DARCY SYM STAB}. 165 \end{memberdesc} 166 167 \begin{methoddesc}[DarcyFlow]{setValue}{\optional{f=None, \optional{g=None, \optional{location_of_fixed_pressure=None, \optional{location_of_fixed_flux=None, 168 \\\optional{permeability=None}}}}}} 169 assigns values to the model parameters. Values can be assigned using various 170 calls -- in particular in a time dependent problem only values that change 171 over time need to be reset. The permeability can be defined as a scalar 172 (isotropic), or a symmetrix matrix (anisotropic). 173 \var{f} and \var{g} are the corresponding parameters in~\ref{DARCY PROBLEM}. 174 The locations and components where the flux is prescribed are set by positive 175 values in \var{location_of_fixed_flux}. 176 The locations where the pressure is prescribed are set by by positive values 177 of \var{location_of_fixed_pressure}. 178 The values of the pressure and flux are defined by the initial guess. 179 Notice that at any point on the boundary of the domain the pressure or the 180 normal component of the flux must be defined. There must be at least one point 181 where the pressure is prescribed. 182 The method will try to cast the given values to appropriate \Data class objects. 183 \end{methoddesc} 184 185 \begin{methoddesc}[DarcyFlow]{setTolerance}{\optional{rtol=1e-4}} 186 sets the relative tolerance \var{rtol} for the pressure in the stabilized solvers. 187 \end{methoddesc} 188 189 190 \begin{methoddesc}[DarcyFlow]{getSolverOptionsFlux}{} 191 returns the solver options used to solve the flux problems. 192 Use this \SolverOptions object to control the solution algorithms. 193 \end{methoddesc} 194 195 \begin{methoddesc}[DarcyFlow]{getSolverOptionsPressure}{} 196 returns a \SolverOptions object with the options used to solve the pressure 197 problems. 198 Use this object to control the solution algorithms. 199 \end{methoddesc} 200 201 \begin{methoddesc}[DarcyFlow]{solve}{u0,p0, \optional{ iter_restart=20, \optional{max_iter=100}}} 202 solves the problem and returns approximations for the flux $v$ and the pressure $p$. 203 \var{u0} and \var{p0} define initial guesses for flux and pressure. 204 Values marked by positive values \var{location_of_fixed_flux} and 205 \var{location_of_fixed_pressure}, respectively, are kept unchanged. 206 \var{max_iter} sets the maximum number of outer iteration steps allowed for solving the stabilzed 207 problems. \var{iter_restart} sets the number of iteration after which the 208 iteration is restarted\footnote{the larger \var{iter_restart} the more memory is required. The smaller 209 \var{iter_restart} the more iteration steps are required.}. 210 \end{methoddesc} 211 212 \begin{methoddesc}[DarcyFlow]{getFlux}{p, \optional{ u0 = None}} 213 returns the flux for a given pressure \var{p} where the flux is equal to \var{u0} 214 on locations where \var{location_of_fixed_flux} is positive, see \member{setValue}. 215 Notice that \var{g} and \var{f} are used. 216 \end{methoddesc} 217 218 219 220 %\subsection{Example: Gravity Flow} 221 %later 222