%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Juha Ruokolainen, Thomas Zwinger                           %
%    Olivier Gagliardini, Fabien Gillet                         %
%                                                               %
%                                                               %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%\newcommand{\Matg}[2]{{^{#2}\!{\boldsymbol{#1}}}}
%\newcommand{\Mat}[1]{{{\boldsymbol{#1}}}}
%\newcommand{\Matgb}[2]{{^{#2}\!\bar{{\boldsymbol{#1}}}}}
%\newcommand{\sur}[2]{\frac{\textstyle{\strut #1}}{\textstyle{\strut #2}}}
%\newcommand{\Matb}[1]{{\bar{{\boldsymbol{#1}}}}}
%\newcommand{\tr}{\operatorname{tr}}
%\newcommand{\bphi}{\bar \varphi}
%\newcommand{\btheta}{\bar \theta}
%\newcommand{\bomega}{\bar \omega}
\newcommand{\ak}[1]{\Mat{a^{(#1)}}}
\newcommand{\vect}[1]{{\boldsymbol{#1}}}
%--------------------------------------------------------------
\chapter{Fabric Solver }

\modinfo{Module name}{FabricSolve}
\modinfo{Module subroutines~:}{FabricSolve}
\modinfo{Module authors~:}{Juha Ruokolainen}
\modinfo{Documentation by~:}{Olivier Gagliardini and Fabien Gillet}
\modinfo{Document edited~:}{\date{\today}}

\section{Introduction}
The Fabric Solver solve the equation for the evolution of the second order orientation tensor
$\ak{2}$,  given by~:
\begin{equation}
\label{eqn:da/dt}
\sur{\partial \ak{2}}{\partial t}+\sur{\partial \ak{2}}{\partial \vect{x}}.\vect{\bar{u}} 
 =  \Mat{w}.\ak{2} - \ak{2}.\Mat{w} - (\Mat{D}.\ak{2}+\ak{2}.\Mat{D})+
  2\ak{4}:\Mat{D} + \lambda D_{eq} (\Mat{I} -3 \ak{2}) \ \textrm{,}
\end{equation}
where:
\begin{itemize}
\item $\vect{\bar{u}}$ is the velocity vector (calculated by AIFlowSolve),
\item $\Mat{D}$ is defined as $\Mat{D}=\rho \psi \Mat{s}/2 + (1-\rho) \Mat{d}$,
with $\Mat{s}$ and $\Mat{d}$ the stresses and strain-rates tensors and $\psi$
the grain basal fluidity . The interaction 
parameter $\rho$ allows to take into account some interactions of the grain with the 
polycrystal. The case $\rho=0$ assumes uniform strain-rates and $\rho=1$ uniform stresses.
\item $D_{eq}$ is an equivalent strain-rate defines as $D_{eq}=(2\Mat{D}:\Mat{D}/3)^{1/2}$ and
$\lambda$ a diffusion parameter.
\item This equation is not closed because it depends on the fourth order orientation tensor
$\ak{4}$. To close this equation an assumption is made to calculate $\ak{4}$ as a function
of $\ak{2}$. This "closure approximation" is based on the Invariant Based Optimal Fitting
closure approximation of Chung et al. (2002).
\end{itemize}


 \section{Keywords}

 \sifbegin \sifitemnt{Constants}{} \sifbegin \sifitem{Gas Constant}{Real }
 To specify the value of the Gas constant ($R=8.314\,Joule.K/mol$)
%
 \sifend

 \sifitemnt{Material}{mat id}
%

 The following material parameters may be set in FabricSolve equations~:
%
 \sifbegin
%
 \sifitem{Fluidity Parameter}{Real} The value of the fluidity parameter $B(T_0)$ of isotropic ice given for the
 Reference Temperature $T_0$. Can be different for each node.
%
 \sifitem{Powerlaw Exponent}{Real} The power law exponent in the viscoplastic law ($=1$).
%
 \sifitem{Activation Energy 1}{Real} The activation energy (Joule/mol) used if the temperature is lower than the Limit
 Temperature.
%
 \sifitem{Activation Energy 2}{Real} The activation energy (Joule/mol) used if the temperature is larger than the Limit
 Temperature.
%
 \sifitem{Reference Temperature}{Real} The reference temperature $T_0$ is the temperature corresponding to the  fluidity
 parameter $B(T_0)$.
%
 \sifitem{Limit Temperature}{Real} If the temperature is lower than the limit temperature, the value of the activation
 energy~1 is used, else the value of the energy activation~2.
%
 \sifitem{Viscosity File}{String} Gives the name of the file which contains the $813 \times 6$ relative viscosities
 calculated on the fabric grid and the optimal interaction parameter $\rho$.
%
 \sifitem{Interaction Parameter}{Real} The interaction parameter $\rho$. If this option is not given the 
 interaction parameter is the optimal interaction parameter contained in the Viscosity File.
%
 \sifitem{Difusion Parameter}{Real} The diffusion parameter $\lambda$. If this option is not given the 
 diffusion parameter is set to 0.
 \sifend
%
 \sifitemnt{Fabric Solver}{}
 \sifbegin
 \sifitem{Discontinuous Galerkin}{= Logical  [True]}
 \sifend
%
\sifitemnt{In the AIFlow Solver}{} The following variables must be exported~:
%
 \sifbegin
 \sifitemnt{Exported Variable 1}{= String  [Fabric]}
 \sifitem{Exported Variable 1 DOFS}{= Integer [ 5 ]}
 The coefficients of the second order orientation tensor ($[a_{11}, a_{22}, a_{12}, a_{23}, a_{13}]$).
 In 2D only the three first coefficients evolve but all the coefficients must be
 defined.
 \sifend

The eigenvalues of the second order orientation tensor are computed if the variable EigenV is exported:
\sifbegin
 \sifitemnt{Exported Variable 2}{= String  [EigenV]}
 \sifitem{Exported Variable 2 DOFS}{= Integer [ 6 ]}
The three eigenvalues and the three euler angles ($[a_{1}, a_{2}, a_{3}, \varphi , \theta, \omega]$)
 \sifend

