# Diff of /trunk/doc/user/Models.tex

revision 2104 by jfenwick, Thu Nov 27 05:36:47 2008 UTC revision 2252 by gross, Fri Feb 6 07:51:28 2009 UTC
# Line 13  Line 13
13
14
15  \chapter{Models}  \chapter{Models}
16    \label{MODELS CHAPTER}
17
18  The following sections give a breif overview of the model classes and their corresponding methods.  The following sections give a breif overview of the model classes and their corresponding methods.
19
# Line 60  with sufficient accuracy we check for Line 61  with sufficient accuracy we check for
61
62  \|v\hackscore{k,k}\| \hackscore \le  \epsilon  \|v\hackscore{k,k}\| \hackscore \le  \epsilon
63  \|\sqrt{v\hackscore{j,k}v\hackscore{j,k}}\|  \|\sqrt{v\hackscore{j,k}v\hackscore{j,k}}\|
64    \label{STOKES STOP}
65
66  where $\epsilon$ is the desired relative accuracy and  where $\epsilon$ is the desired relative accuracy and
67
68  \|p\|^2= \int\hackscore{\Omega} p^2 \; dx  \|p\|^2= \int\hackscore{\Omega} p^2 \; dx
69  \label{PRESSURE NORM}  \label{PRESSURE NORM}
70
71  defines the $L^2$-norm.  defines the $L^2$-norm. We use the Uzawa scheme \index{Uzawa scheme} to solve the problem.
72  There are two approaches to solve this problem. The first approach, called the Uzawa scheme \index{Uzawa scheme}
73  eliminates the velocity $v$ from the problem. The second approach solves the equation in coupled form after the application of a preconditioner.  In fact the first equation in~\ref{SADDLEPOINT} gives for a known pressure
74
75  \subsubsection{Uzawa scheme}  v=A^{-1}(G-B^{*}p)
76  The first eqution in~\ref{SADDLEPOINT} gives $v=A^{-1}(G-B^{*}p)$ assuming $p$ is known. This is inserted into the  \label{V CALC}
77  second eqution which leads to
78    which is inserted into the second equation leading to
79
80  S p =  B A^{-1} G  S p =  B A^{-1} G
81
82  with the Schur complement \index{Schur complement} $S=BA^{-1}B^{*}$. This problem can be solved iteratively using the reconditioned Conjugate Gradient Method (PCG)~\index{PCG!Preconditioned Conjugate Gradient Method}  with the Schur complement \index{Schur complement} $S=BA^{-1}B^{*}$. This problem can be solved iteratively
83  with the preconditioner $\hat{S}$ defined as $q=\hat{S}^{-1}p$ by solving  with the preconditioner $\hat{S}$ defined as $q=\hat{S}^{-1}p$ by solving
84
85  \frac{1}{\eta}q = p  \frac{1}{\eta}q = p
86
87  see~\cite{ELMAN} for more details. The evaluation of $w=Sp$ is done in the form  see~\cite{ELMAN} for more details. Note that the residual for the current approximation $p$ is given as
88
89  \begin{array}{rcl}  r=B A^{-1} (G - B^* p) = Bv
A v & = & B^{*}p \\
w & = & Bv \\
\end{array}
\label{EVAL PCG}
90
91  The residual \index{residual}  $r=B A^{-1} G - S p$ is given as  where $v$ is given by~\ref{V CALC}.
92
93    If one uses the generalized minimal residual method (GMRES) \index{generalized minimal residual method!GMRES}
94    the method is directly applied to the preconditioned system
95
96  r=B A^{-1} (G - B^* p) = Bv \mbox{ with } v = A^{-1}(G-B^{*}p)  \hat{S}^{-1} S p =  \hat{S}^{-1} B A^{-1} G
97
98  Therefore one uses the tuple $(v,Bv)$ to represent the residual of the current pressure $p$. Notice that before the iteration is started the right hand side $B A^{-1} G$ needs to be calculated. The bilinear form $(.,.)$ used is defined as  We use the norm
99
100  (p,(v,Bv))=\int\hackscore{\Omega} p \cdot Bv \; dx  \|p\|\hackscore{GMRES} = \|\hat{S} p \|
101
102  where $p$ is the pressure increment and $(v,Bv)$ represents an increment in the residual.  Notice that for the residual $\hat{r}=\hat{S}^{-1} r$ one has

\subsubsection{Coupled Solver}
An alternative approach to solve the saddle point problem~\ref{SADDLEPOINT} directly using an iterative such as
the generalized minimal residual method (GMRES) \index{generalized minimal residual method!GMRES} with a suitable
preconditioner. Here we use the operator
103
104  \left[ \begin{array}{cc}  \
105  A^{-1}     & 0 \\
106  S^{-1} B A^{-1}  & -S^{-1} \\  If $p^{0}$ provides an initial guess for the pressure we use~\ref{V CALC} to get a first initial guess for the
107  \end{array} \right]  velocity $v^{0}$ which we use to set an absolute tolerance $ATOL =\epsilon \|\sqrt{v^{0}\hackscore{j,k}v^{0}\hackscore{j,k}}\|$.
108  \label{SADDLEPOINT PRECODITIONER}  The GMRES is terminated when

where again $S$ is the Schur complement~\cite{ELMAN}. In partice we will use an approximation $\hat{S}$ for $S$. The evaluation $(w,q)$ of the iteration operator for a given $(v,p)$ is done as
109
110  \begin{array}{rcl}  \|\hat{r}\|\hackscore{GMRES} \le ATOL
111  A w & = & Av+B^{*}p \\
112  \hat{S} q & = & B(w-v) \\  Notice that $\|\hat{r}\|\hackscore{GMRES}= \|r \| = \|Bv\| = \|v\hackscore{k,k}\|$ so we we can expect that
113  \end{array}  the target stopping criterion~\ref{STOKES STOP} is fullfilled. However, if $v$ is very different from the
114  \label{COUPLES SADDLEPOINT iteration}  initial choice of $v^{0}$ the value of $ATOL$ is corrected and GMRES is restarted with a new tolerance. For time dependend problems this apprach works well as value for $p$ form a previous time step provides a good initial guess.
115
116  We use the inner product induced by the norm  Alternatively, as $S$ is symmetric and positive definite one can apply the preconditioned conjugate gradient method (PCG) \index{preconditioned conjugate gradient method!PCG}. PCG use the norm
117
118  \|(v,p)\|^2= \int\hackscore{\Omega}  v\hackscore{i,j}  v\hackscore{i,j} + \left( \frac{p}{\eta}\right)^2\; dx  \|r\|\hackscore{PCG}^2 = \int\hackscore{\Omega} r \hat{S}^{-1}r \; dx = \int\hackscore{\Omega}  \eta r^2 \; dx
119  \label{COUPLES NORM}
120    To take the extra factor $\eta$ into consideration when checking the stopping criterion we use the following
121  In PDE form~\ref{COUPLES SADDLEPOINT iteration} takes the form  definition for $ATOL$:
122
123  \begin{array}{rcl}  ATOL = \epsilon \frac{\|\sqrt{v^{0}\hackscore{j,k}v^{0}\hackscore{j,k}}\|  }{\|v^{0}\hackscore{k,k}\|}
124  -\left(\eta(w\hackscore{i,j}+ w\hackscore{i,j})\right)\hackscore{,j} & = & -\left(\eta(v\hackscore{i,j}+ v\hackscore{i,j})\right)\hackscore{,j}+p\hackscore{,i} \\  \|v^{0}\hackscore{k,k}\|\hackscore{PCG}
125  \frac{1}{\eta}  q & = & - (w-v)\hackscore{i,i} \\
126  \end{array}

127
128
129  \subsection{Functions}  \subsection{Functions}
# Line 150  the values of \var{fixed_u_mask}. The me Line 143  the values of \var{fixed_u_mask}. The me
143  \end{methoddesc}  \end{methoddesc}
144
145  \begin{methoddesc}[StokesProblemCartesian]{solve}{v,p,  \begin{methoddesc}[StokesProblemCartesian]{solve}{v,p,
146  \optional{max_iter=20, \optional{verbose=False, \optional{useUzawa=True}}}}  \optional{max_iter=20, \optional{verbose=False, \optional{usePCG=True}}}}
147  solves the problem and return approximations for velocity and pressure.  solves the problem and return approximations for velocity and pressure.
148  The arguments \var{v} and \var{p} define initial guess. The values of \var{v} marked  The arguments \var{v} and \var{p} define initial guess. The values of \var{v} marked
150  If \var{useUzawa} is set to \True  If \var{usePCG} is set to \True
151  the Uzawa\index{Uszwa} scheme is used. Otherwise the problem is solved in coupled form. In most cases  reconditioned conjugate gradient method (PCG) \index{preconditioned conjugate gradient method!PCG}  scheme is used. Otherwise the problem is solved generalized minimal residual method (GMRES) \index{generalized minimal residual method!GMRES}. In most cases
152  the Uzawa scheme is more efficient.  the PCG scheme is more efficient.
153  \var{max_iter} defines the maximum number of iteration steps.  \var{max_iter} defines the maximum number of iteration steps.
154  If \var{verbose} is set to \True informations on the progress of of the solver are printed.  If \var{verbose} is set to \True informations on the progress of of the solver are printed.
155  \end{methoddesc}  \end{methoddesc}
156
157
158  \begin{methoddesc}[StokesProblemCartesian]{setTolerance}{\optional{tolerance=1.e-8}}  \begin{methoddesc}[StokesProblemCartesian]{setTolerance}{\optional{tolerance=1.e-4}}
159  sets the tolerance in an appropriate norm relative to the right hand side. The tolerance must be non-negative and less than 1.  sets the tolerance in an appropriate norm relative to the right hand side. The tolerance must be non-negative and less than 1.
160  \end{methoddesc}  \end{methoddesc}
161  \begin{methoddesc}[StokesProblemCartesian]{getTolerance}{}  \begin{methoddesc}[StokesProblemCartesian]{getTolerance}{}
# Line 175  absolute talerance is set to 0. Line 168  absolute talerance is set to 0.
168  \begin{methoddesc}[StokesProblemCartesian]{getAbsoluteTolerance}{}  \begin{methoddesc}[StokesProblemCartesian]{getAbsoluteTolerance}{}
169  sreturns the current absolute tolerance.  sreturns the current absolute tolerance.
170  \end{methoddesc}  \end{methoddesc}
171  \begin{methoddesc}[StokesProblemCartesian]{setSubToleranceReductionFactor}{\optional{reduction=None}}  \begin{methoddesc}[StokesProblemCartesian]{setSubProblemTolerance}{\optional{rtol=None}}
172  sets the reduction factor for the tolerance used to solve the PDEs. A reduction factor  sets the tolerance to solve the involved PDEs. The subtolerance \var{rtol} should not be choosen to large
173  in the order of one will minimize compute time per iteration step but my slow down convergence or even lead to  in order to avoid feed back of errors in the subproblem solution into the outer iteration.
174  divergency. On the other hand a very small value for the PDE tolerance could result in a wast of compute time.  On the otherhand is choosen to small compute time is wasted.
175  If \var{reduction} is set to \var{None} the sub-tolerance is solved adaptively but  If \var{rtol} is set to \var{None} the sub-tolerance is set automatically depending on the
176  in cases a very small tolerance is set ($<10^{-6}$) it is recommended to set the  tolerance choosen for the oter iteration.
reduction factor by hand. This may require some experiments.
177  \end{methoddesc}  \end{methoddesc}
178  \begin{methoddesc}[StokesProblemCartesian]{getSubToleranceReductionFactor}{}  \begin{methoddesc}[StokesProblemCartesian]{getSubProblemTolerance}{}
179  return the current reduction factor for the sub-problem tolerance.  return the tolerance for the involved PDEs.
180  \end{methoddesc}  \end{methoddesc}
181
182  \subsection{Example: Lit Driven Cavity}  \subsection{Example: Lit Driven Cavity}
# Line 211  saveVTK("u.xml",velocity=v,pressure=p) Line 203  saveVTK("u.xml",velocity=v,pressure=p)
203  \end{python}  \end{python}
204
205  \section{Darcy Flux}  \section{Darcy Flux}
206  We want to calculate the velocity $u$ and pressure $p$ on a domain $\Omega$ such that  We want to calculate the velocity $u$ and pressure $p$ on a domain $\Omega$ solving
207    the Darcy flux problem \index{Darcy flux}\index{Darcy flow}
208  \label{DARCY PROBLEM}  \label{DARCY PROBLEM}
209  \begin{array}{rcl}  \begin{array}{rcl}
210  u\hackscore{i} + \kappa\hackscore{ij} p\hackscore{,j} & = & g\hackscore{i} \\  u\hackscore{i} + \kappa\hackscore{ij} p\hackscore{,j} & = & g\hackscore{i} \\
# Line 233  for all $x\hackscore{i}$. Line 226  for all $x\hackscore{i}$.
226
227
228  \subsection{Solution Method \label{DARCY SOLVE}}  \subsection{Solution Method \label{DARCY SOLVE}}
229  Without loss of generality we can assume that $u^{N}\hackscore{i} \; n\hackscore{i}=0$ and  In practical applications it is an advantage to calculate the pressure $p$ as a correction of a 'static' pressure $p^{ref}$ which is the solution of
230  $p^{D}$. Otherewise one solves for $u-u^{N}$ and $p-p^{D}$ and sets
231    -(\kappa\hackscore{ki}\kappa\hackscore{kj} p\hackscore{,j}^{ref})\hackscore{,i} =  - (\kappa\hackscore{ki} (g\hackscore{k}- u^{N}\hackscore{k}))\hackscore{,i}
232    \mbox{ with }
233    p^{ref} = p^{D} \mbox{ on } \Gamma\hackscore{D}
234
235    With setting $u \leftarrow u-u^{N}$ and $p \leftarrow p-p^{ref}$ and
236
237  \begin{array}{rcl}  \begin{array}{rcl}
238  g\hackscore{i} & \leftarrow & g\hackscore{i} - u^{N}\hackscore{i} -  \kappa\hackscore{ij} p^{D}\hackscore{,j }\\  g\hackscore{i} & \leftarrow & g\hackscore{i} - u^{N}\hackscore{i} -  \kappa\hackscore{ij} p^{ref}\hackscore{,j }\\
239  f & \leftarrow & f - u^{N}\hackscore{k,k}  f & \leftarrow & f - u^{N}\hackscore{k,k}
240  \end{array}  \end{array}
241
242    we can assume that $u^{N}\hackscore{i} \; n\hackscore{i}=0$ and
243    $p^{D}=0$.
244  We set  We set
245
246  V = \{ q \in H^{1}(\Omega) : q=0 \mbox{ on } \Gamma\hackscore{D} \}  V = \{ q \in H^{1}(\Omega) : q=0 \mbox{ on } \Gamma\hackscore{D} \}
# Line 277  for all $v\in W$ and $q \in V$.which tra Line 277  for all $v\in W$ and $q \in V$.which tra
277
278  \begin{array}{rcl}  \begin{array}{rcl}
279  (I+D^*D)u + Qp & = & D^*f + g \\  (I+D^*D)u + Qp & = & D^*f + g \\
280  Q^*u  + Q^*Q p & = & Q^* g \\  Q^*u  + Q^*Q p & = & Q^*g \\
281  \end{array}  \end{array}
282
283  where $D^*$ and $Q^*$ denote the adjoint operators.  where $D^*$ and $Q^*$ denote the adjoint operators.
# Line 290  v= (I+D^*D)^{-1} (D^*f + g - Qp) Line 290  v= (I+D^*D)^{-1} (D^*f + g - Qp)
290
291  (notice that $(I+D^*D)$ is coercive in $W$) which is inserted into the second equation  (notice that $(I+D^*D)$ is coercive in $W$) which is inserted into the second equation
292
293  Q^* (I+D^*D)^{-1} (D^*f + g - Qp) + Q^* Q p = Q^* g  Q^* (I+D^*D)^{-1} (D^*f + g - Qp) + Q^* Q p = Q^*g
294
295  which is  which is
296
297  Q^* ( I - (I+D^*D)^{-1} ) Q p = Q^* ( g -(I+D^*D)^{-1} (D^*f + g) )  Q^* ( I - (I+D^*D)^{-1} ) Q p = Q^* (g-(I+D^*D)^{-1} (D^*f + g) )
298
299  We use the PCG method to solve this. The residual $r$ ($\in V^*$) is given as  We use the PCG \index{linear solver!PCG}\index{PCG} method to solve this. The residual $r$ ($\in V^*$) is given as
300
301  \begin{array}{rcl}  \begin{array}{rcl}
302  r & = & Q^* ( g -(I+D^*D)^{-1} (D^*f + g) - Qp + (I+D^*D)^{-1}Q p \\  r & = & Q^*  \left( g -(I+D^*D)^{-1} (D^*f + g) - Qp + (I+D^*D)^{-1}Q p \right)\\
303  & =&  Q^* \left( (g-Qp) - (I+D^*D)^{-1} (D^*f + g - Qp) \right) \\  & =&  Q^* \left( - Qp - (I+D^*D)^{-1} (D^*f + g - Qp) \right) \\
304  & =&  Q^* \left( (g-Qp) - v \right)  & =&  Q^* \left( g - Qp - v \right)
305  \end{array}  \end{array}
306
307  So in a partical implementation we use the pair $(g-Qp,v)$ to represent the residual. This will save the  So in a partical implementation we use the pair $(Qp,v)$ to represent the residual. This will save the
308  reconstruction of the velocity $v$. In this notation the right hand side is given as  reconstruction of the velocity $v$. In this notation the right hand side is given as
309  $(g,(I+D^*D)^{-1} (D^*f + g))$. The evaluation of the iteration operator for a given $p$ is then  $(0,(I+D^*D)^{-1} (D^*f + g))$. The evaluation of the iteration operator for a given $p$ is then
310  returning $(Qp,w)$ where $w$ is the solution of  returning $(Qp,w)$ where $w$ is the solution of
311  \label{UPDATE W}  \label{UPDATE W}
312  (I+D^*D)w = Qp  (I+D^*D)w = Qp
313
314  We use $Q^*Q$ as a a preconditioner for the iteration operator $Q^* ( I - (I+D^*D)^{-1} ) Q$.  We use $Q^*Q$ as a a preconditioner for the iteration operator $Q^* ( I - (I+D^*D)^{-1} ) Q$.
315
316  \subsection{Functions}  The iteration PCG \index{linear solver!PCG}\index{PCG} is terminated if
317    \label{DARCY STOP}
318    \int r \cdot (Q^*Q)^{-1} r \; dx \le \mbox{ATOL}^2
319
320    where ATOL is a given absolute tolerance.
321    The initial residual $r\hackscore{0}$ is
322    \label{DARCY STOP 2}
323    r\hackscore{0}=Q^* \left( g - v\hackscore{ref} \right) \mbox{ with } v\hackscore{ref} = (I+D^*D)^{-1} (D^*f + g)
324
325    so the
326    \label{DARCY NORM 0}
327    \int r\hackscore0 \cdot (Q^*Q)^{-1} r\hackscore0 \; dx = \int \left( g - v\hackscore{ref} \right)  \cdot  Q  p\hackscore{ref} \; dx \mbox{ with }p\hackscore{ref} = (Q^*Q)^{-1} Q^* \left( g - v\hackscore{ref} \right)
328
329    So we set
330    \label{DARCY NORM 1}
331    ATOL = atol + rtol \cdot \max(|g - v\hackscore{ref}|\hackscore{0}, |Q p\hackscore{ref} |\hackscore{0} )
332
333    where atol and rtol a given absolute and relative tolerances, respectively. The reference flux $v\hackscore{ref}$
334    and reference pressure $p\hackscore{ref}$ may be calcualated from their definition which would require to solve to
335    PDEs but in a practical application estimates can be used for instance solutions from previous time steps or for simplified scenarious (e.g. constant permability).
336
337  \subsection{Example: Gravity Flow}  \subsection{Functions}
338    \begin{classdesc}{DarcyFlow}{domain}
339  %================================================  opens the Darcy flux problem\index{Darcy flux} on the \Domain domain.

\rho c\hackscore{p} \left (\frac{\partial T}{\partial t} + \vec{v} \cdot \nabla T \right ) = k \nabla^{2}T
\label{HEAT EQUATION}

where $\vec{v}$ is the velocity vector, $T$ is the temperature, $\rho$ is the density, $\eta$ is the viscosity, $c\hackscore{p}$ is the specific heat at constant pressure and $k$ is the thermal conductivity.

\subsection{Description}

\subsection{Method}

\begin{classdesc}{TemperatureCartesian}{dom,theta=THETA,useSUPG=SUPG}
340  \end{classdesc}  \end{classdesc}
341    \begin{methoddesc}[DarcyFlow]{setValue}{\optional{f=None, \optional{g=None, \optional{location_of_fixed_pressure=None, \optional{location_of_fixed_flux=None, \optional{permeability=None}}}}}}
342    assigns values to the model parameters. Values can be assigned using various calls - in particular
343    in a time dependend problem only values that change over time needs to be reset. The permability can be defined as scalar (isotropic), a vector (orthotropic) or a matrix (anisotropic).
344    \var{f} and \var{g} are the corresponding parameters in~\ref{DARCY PROBLEM}.
345    The locations and compontents where the flux is prescribed are set by positive values in
346    \var{location_of_fixed_flux}.
347    The locations where the pressure is prescribed are set by
348    by positive values of \var{location_of_fixed_pressure}.
349    The values of the pressure and flux are defined by the initial guess.
350    Notice that at any point on the boundary of the domain the pressure or the normal component of
351    the flux must be defined. There must be at least one point where the pressure is prescribed.
352    The method will try to cast the given values to appropriate
353    \Data class objects.
354    \end{methoddesc}
355
356  \subsection{Benchmark Problem}  \begin{methoddesc}[DarcyFlow]{setTolerance}{\optional{atol=0,\optional{rtol=1e-8,\optional{p_ref=None,\optional{v_ref=None}}}}}
357  %===============================================================================================================  sets the absolute tolerance ATOL according to~\ref{DARCY NORM 1}. If \var{p_ref} is not present $0$ is used.
358    If \var{v_ref} is not present $0$ is used. If the final result ATOL is not positive an exception is thrown.
359    \end{methoddesc}
360
%=========================================================
% \section{Level Set Method}
361
%\subsection{Description}
362
363  %\subsection{Method}  \begin{methoddesc}[DarcyFlow]{solve}{u0,p0, \optional{max_iter=100, \optional{verbose=False \optional{sub_rtol=1.e-8}}}}
364    solves the problem. and returns approximations for the flux $v$ and the pressure $p$.
365    \var{u0} and \var{p0} define initial guess for flux and pressure. Values marked
366    by positive values \var{location_of_fixed_flux} and \var{location_of_fixed_pressure}, respectively, are kept unchanged.
367    \var{sub_rtol} defines the tolerance used to solve the involved PDEs. \var{sub_rtol} needs to be choosen sufficiently small to ensure convergence but users need to keep in mind that a very small value for \var{sub_rtol} will result in a long compute time. Typically  $\var{sub_rtol}=\var{rtol}^2$ is a good choice if $\var{rtol}$ is not choosen too small.
368    \end{methoddesc}
369
370
371  %\begin{classdesc}{LevelSet}{mesh, func\_new, reinit\_max, reinit\_each, tolerance, smooth}  \subsection{Example: Gravity Flow}
372  %\end{classdesc}  later
373
374  %example usage:  %================================================
376
377  %levelset = LevelSet(mesh, func\_new, reinit\_max, reinit\_each, tolerance, smooth)  %
378    % \rho c\hackscore{p} \left (\frac{\partial T}{\partial t} + \vec{v} \cdot \nabla T \right ) = k \nabla^{2}T
379    % \label{HEAT EQUATION}
380    %
381
382  %\begin{methoddesc}[LevelSet]{update\_parameter}{parameter}  % where $\vec{v}$ is the velocity vector, $T$ is the temperature, $\rho$ is the density, $\eta$ is the viscosity, % % $c\hackscore{p}$ is the specific heat at constant pressure and $k$ is the thermal conductivity.
%Update the parameter.
%\end{methoddesc}
383
384  %\begin{methoddesc}[LevelSet]{update\_phi}{paramter}{velocity}{dt}{t\_step}  % \subsection{Description}
%Update level set function; advection and reinitialization
%\end{methoddesc}
385
386  %\subsection{Benchmark Problem}  % \subsection{Method}
387    %
388    % \begin{classdesc}{TemperatureCartesian}{dom,theta=THETA,useSUPG=SUPG}
389    % \end{classdesc}
390
391  %Rayleigh-Taylor instability problem  % \subsection{Benchmark Problem}
392    %===============================================================================================================
393
394    %=========================================================
395    \input{levelsetmodel}
396
397  % \section{Drucker Prager Model}  % \section{Drucker Prager Model}
398
# Line 376  D\hackscore{ij}=D\hackscore{ij}^{el}+D\h Line 404  D\hackscore{ij}=D\hackscore{ij}^{el}+D\h
404
405  with the elastic strain given as  with the elastic strain given as
406  \label{IKM-EQU-3}  \label{IKM-EQU-3}
407  D\hackscore{ij}'^{el}=\frac{1}{2 \mu} \dot{\sigma}\hackscore{ij}'  D\hackscore{ij}^{el'}=\frac{1}{2 \mu} \dot{\sigma}\hackscore{ij}'
408
409  where $\sigma'\hackscore{ij}$ is the deviatoric stress (Notice that $\sigma'\hackscore{ii}=0$).  where $\sigma'\hackscore{ij}$ is the deviatoric stress (Notice that $\sigma'\hackscore{ii}=0$).
410  If the material is composed by materials $q$ the visco-plastic strain can be decomposed as  If the material is composed by materials $q$ the visco-plastic strain can be decomposed as
411  \label{IKM-EQU-4}  \label{IKM-EQU-4}
412  D\hackscore{ij}'^{vp}=\sum\hackscore{q} D\hackscore{ij}'^{q}  D\hackscore{ij}^{vp'}=\sum\hackscore{q} D\hackscore{ij}^{q'}
413
414  where $D\hackscore{ij}^{q}$ is the strain in material $q$ given as  where $D\hackscore{ij}^{q}$ is the strain in material $q$ given as
415  \label{IKM-EQU-5}  \label{IKM-EQU-5}
416  D\hackscore{ij}'^{q}=\frac{1}{2 \eta^{q}} \sigma'\hackscore{ij}  D\hackscore{ij}^{q'}=\frac{1}{2 \eta^{q}} \sigma'\hackscore{ij}
417
418  where $\eta^{q}$ is the viscosity of material $q$. We assume the following  where $\eta^{q}$ is the viscosity of material $q$. We assume the following
419  betwee the the strain in material $q$  betwee the the strain in material $q$
# Line 393  betwee the the strain in material $q$ Line 421  betwee the the strain in material $q$
421  \eta^{q}=\eta^{q}\hackscore{N} \left(\frac{\tau}{\tau\hackscore{t}^q}\right)^{\frac{1}{n^{q}}-1}  \eta^{q}=\eta^{q}\hackscore{N} \left(\frac{\tau}{\tau\hackscore{t}^q}\right)^{\frac{1}{n^{q}}-1}
422  \mbox{ with } \tau=\sqrt{\frac{1}{2}\sigma'\hackscore{ij} \sigma'\hackscore{ij}}  \mbox{ with } \tau=\sqrt{\frac{1}{2}\sigma'\hackscore{ij} \sigma'\hackscore{ij}}
423
424  for a given power law coefficients $n^{q}$ and transition stresses $\tau\hackscore{t}^q$, see~\ref{POERLAW}.  for a given power law coefficients $n^{q}\ge1$ and transition stresses $\tau\hackscore{t}^q$, see~\ref{POERLAW}.
425  Notice that $n^{q}=1$ gives a constant viscosity.  Notice that $n^{q}=1$ gives a constant viscosity.
426  After inserting equation~\ref{IKM-EQU-5} into equation \ref{IKM-EQU-4} one gets:  After inserting equation~\ref{IKM-EQU-5} into equation \ref{IKM-EQU-4} one gets:
427  \label{IKM-EQU-6}  \label{IKM-EQU-6}
# Line 456  After inserting~\ref{IKM-EQU-10} into~\r Line 484  After inserting~\ref{IKM-EQU-10} into~\r
484  \right)\hackscore{,j}+p\hackscore{,i}=F\hackscore{i}+  \right)\hackscore{,j}+p\hackscore{,i}=F\hackscore{i}+
485  \frac{\eta\hackscore{eff}}{\mu dt } \sigma\hackscore{ij,j}^{'-}  \frac{\eta\hackscore{eff}}{\mu dt } \sigma\hackscore{ij,j}^{'-}
486
487  Together with the incomressibilty condition~\ref{IKM-EQU-2} we need to solve a problem with a form almost identical  Combining this with the incomressibilty condition~\ref{IKM-EQU-2} we need to solve a
488  to the Stokes problem discussed in section~\ref{STOKES SOLVE} but with the difference that $\eta\hackscore{eff}$ is depending on the solution. Analog to the iteration scheme~\ref{SADDLEPOINT iteration 2} we can run  Stokes problem as discussed in section~\ref{STOKES SOLVE} in each time step.
489    In oder to perform step~\ref{IKM iteration 2} we need to calculate the $\eta\hackscore{eff}$ which
490  \begin{array}{rcl}  is a function of $\sigma\hackscore{ij}$ via $\tau$.  To get $\tau$ and $\eta\hackscore{eff}$ we need to solve the
491  -\left(\eta\hackscore{eff}(dv\hackscore{i,j}+ dv\hackscore{i,j}  non-linear equation
)\right)\hackscore{,j} & = & F\hackscore{i}+ \sigma\hackscore{ij,j}'-p\hackscore{,i} \\
\frac{1}{\eta\hackscore{eff}} dp & = & - v\hackscore{i,i}^+
\end{array}
\label{IKM iteration 2}

where $v^+=v+dv$. As this problem is non-linear the Jacobi-free Newton-GMRES method is used with the norm

\|(v, p)\|^2= \int\hackscore{\Omega} v\hackscore{i,j}^2 + \frac{1}{\bar{\eta}^2\hackscore{eff}} p^2 \; dx
\label{IKM iteration 3}

where  $\bar{\eta}\hackscore{eff}$ is the caracteristic viscosity, for instance:

\frac{1}{\bar{\eta}\hackscore{eff}} = \frac{1}{\tau^{-}}+\sum\hackscore{q}  \frac{1}{\eta^{q}\hackscore{N}}
\label{IKM iteration 4}

In oder to perform step~\ref{IKM iteration 2} we need to calculate the $\eta\hackscore{eff}$ as well as $\sigma\hackscore{ij}'$ while via $\tau$ the first is a function of the latter. The priority is the
calculation of $\eta\hackscore{eff}$ with the Newton-Raphson scheme. This value can then be used to calculate
$\sigma\hackscore{ij}'$ via~\ref{IKM-EQU-10}. We need to solve
492
493  \tau = \eta\hackscore{eff} \cdot \epsilon \mbox{ with }  \tau = \eta\hackscore{eff} \cdot \dot{\gamma}\hackscore{total} \mbox{ with }
494  \epsilon = \sqrt{ 2 \left( D\hackscore{ij}' +  \dot{\gamma}\hackscore{total} = \sqrt{ 2 \left( D\hackscore{ij}' +
495  \frac{1}{  2 \mu \; dt} \sigma\hackscore{ij}^{'-}\right)^2}  \frac{1}{  2 \mu \; dt} \sigma\hackscore{ij}^{'-}\right)^2}
496  \label{IKM iteration 5}  \label{IKM iteration 5}
497
498  The Newton scheme takes the form  The Newton scheme takes the form
499
500  \tau\hackscore{n+1} = \min(\tau\hackscore{n} - \frac{\tau\hackscore{n} - \eta\hackscore{eff}  \cdot \epsilon}{1 - \eta\hackscore{eff}'  \cdot  \epsilon}, \tau\hackscore{Y} + \beta \; p)  \tau\hackscore{n+1} = \min(\tau\hackscore{n} - \frac{\tau\hackscore{n} - \eta\hackscore{eff}  \cdot \dot{\gamma}\hackscore{total}}{1 - \eta\hackscore{eff}'  \cdot  \dot{\gamma}\hackscore{total}}, \tau\hackscore{Y} + \beta \; p)
= \min(\frac{\eta\hackscore{eff} - \tau\hackscore{n}  \eta\hackscore{eff}'}
{1 - \eta\hackscore{eff}'  \cdot  \epsilon}, \frac{\tau\hackscore{Y} + \beta \; p}{\epsilon}) \epsilon
501  \label{IKM iteration 6}  \label{IKM iteration 6}
502
503  where $\eta\hackscore{eff}'$ denotes the derivative of $\eta\hackscore{eff}$ with respect of $\tau$. The second term in $\min$ is droped of $\tau\hackscore{Y} + \beta \; p<0$ or $\epsilon=0$. In fact we have  where $\eta\hackscore{eff}'$ denotes the derivative of $\eta\hackscore{eff}$ with respect of $\tau$. The second term in $\min$ is droped of $\tau\hackscore{Y} + \beta \; p<0$ (?)). We have
504
505  \eta\hackscore{eff}' = - \eta\hackscore{eff}^2 \left(\frac{1}{\eta\hackscore{eff}}\right)'  \eta\hackscore{eff}' = - \eta\hackscore{eff}^2 \left(\frac{1}{\eta\hackscore{eff}}\right)'
506  \mbox{ with }  \mbox{ with }
# Line 502  where $\eta\hackscore{eff}'$ denotes the Line 510  where $\eta\hackscore{eff}'$ denotes the
510  \label{IKM-EQU-5XX}  \label{IKM-EQU-5XX}
511  \left(\frac{1}{\eta^{q}} \right)'  \left(\frac{1}{\eta^{q}} \right)'
512  = \frac{1-\frac{1}{n^{q}}}{\eta^{q}\hackscore{N}} \frac{\tau^{-\frac{1}{n^{q}}}}{(\tau\hackscore{t}^q)^{1-\frac{1}{n^{q}}}}  = \frac{1-\frac{1}{n^{q}}}{\eta^{q}\hackscore{N}} \frac{\tau^{-\frac{1}{n^{q}}}}{(\tau\hackscore{t}^q)^{1-\frac{1}{n^{q}}}}
513  = \frac{1-\frac{1}{n^{q}}}{ \tau \eta^{q}}  = \frac{1-\frac{1}{n^{q}}}{\tau}\frac{1}{\eta^{q}}
514
515  Notice that allways $\eta\hackscore{eff}'\le 0$ which makes the denomionator in~\ref{IKM iteration 6}  Notice that allways $\eta\hackscore{eff}'\le 0$ which makes the denomionator in~\ref{IKM iteration 6}
516  positive.  positive.

Legend:
 Removed from v.2104 changed lines Added in v.2252