\documentclass[12pt]{article}
\usepackage{url}
%\usepackage[dvips]{graphicx}
\usepackage[pdftex]{graphicx}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{fancyhdr}
\usepackage{bm}
\usepackage{float}
\usepackage{listings}
\usepackage{color}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
  language=Fortran,
  aboveskip=3mm,
  belowskip=3mm,
  showstringspaces=false,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=none,
  numberstyle=\tiny\color{gray},
  keywordstyle=\color{blue},
  commentstyle=\color{dkgreen},
  stringstyle=\color{mauve},
  breaklines=true,
  breakatwhitespace=true,
  tabsize=3,
  frame=none
}\usepackage[dvipsnames]{xcolor}
\usepackage{wrapfig}
\usepackage{multicol}
\usepackage[colorlinks=true,
		linkcolor=red,
		citecolor=blue,
		urlcolor=blue]{hyperref}

\usepackage{titlesec}
\usepackage[titletoc]{appendix}
%\usepackage{appendix}
\setcounter{secnumdepth}{4}

\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\setlength {\parindent} { 10mm}
\setlength{\textheight}{230mm}
\setlength{\textwidth}{160mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\topmargin}{-10mm}
% newcommands
\newcommand{\p}{\partial}
\newcommand{\g}[1]{\mbox{\boldmath $#1$}}
\newcommand{\vi}{\g V_{\! \! i}}
\newcommand{\ps}{Pfirsch-Schl\"{u}ter}
\newcommand{\lp}{\left(}
\newcommand{\rp}{\right)}
\newcommand{\ca}[1]{\mbox{\cal $#1$}}
\newcommand{\be}{\begin{displaymath}}
\newcommand{\ee}{\end{displaymath}}
\newcommand{\bn}{\begin{equation}}
\newcommand{\en}{\end{equation}}
\newcommand{\mygtrsim}{\mathrel{\mbox{\raisebox{-1mm}{$\stackrel{>}{\sim}$}}}}
\newcommand{\mylsim}{\mathrel{\mbox{\raisebox{-1mm}{$\stackrel{<}{\sim}$}}}}
\newcommand{\vek}{\bf}
\newcommand{\ten}{\sf}
\newcommand{\bfm}[1]{\mbox{\boldmath$#1$}}
\newcommand{\lang}{\left\langle}
\newcommand{\rang}{\right\rangle}
\newcommand{\vo}[1]{\left|\begin {array}{l} \mbox{} \\ \mbox{} \\$#1$ \end
{array}\right .}
\newcommand{\von}[2]{\left |\begin {array}{l}
\mbox{}\\$#1$\\$#2$ \end {array}\right .}
\newcommand{\simgt}{\:{\raisebox{-1.5mm}{$\stackrel
{\textstyle{>}}{\sim}$}}\:}
\newcommand{\simlt}{\:{\raisebox{-1.5mm}{$\stackrel
{\textstyle{<}}{\sim}$}}\:}
%\renewcommand {\baselinestretch} {1.67}
%\pagestyle{empty}
\newcommand{\todo}[1]{\textbf{\textcolor{red}{TODO: #1}}}
\newcommand{\remark}[1]{\textbf{\textcolor{red}{REMARK: #1}}}

\usepackage{siunitx}

\title{Implementation of poloidal density variation in collision operator}
\author{Aylwin Iantchenko}

\pagestyle{fancy}
\fancyhead{}
\chead{Aylwin Iantchenko %850227-2019
\\ Implementation of poloidal density variation in collision operator}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\setlength{\headheight}{28pt}
\setlength{\footskip}{25pt}

\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\mE}{\mathcal{E}}
\newcommand{\energy}{\mathcal{E}}
\newcommand{\mK}{\mathcal{K}}
\newcommand{\mN}{\mathcal{N}}
\newcommand{\mD}{\mathcal{D}}
\newcommand{\ord}{\mathcal{O}}
\newcommand{\Tpe}{T_\perp}
\newcommand{\Tpa}{T_\|}
\newcommand{\vpe}{v_\perp}
\newcommand{\vpa}{v_\|}
\newcommand{\kpe}{k_\perp}
\newcommand{\kpa}{k_\|}
\newcommand{\Bv}{\mathbf{B}}
\newcommand{\Ev}{\mathbf{E}}
\newcommand{\bv}{\mathbf{b}}
\newcommand{\vv}{\mathbf{v}}
\newcommand{\cd}{\cdot}
\newcommand{\na}{\nabla}
\newcommand{\btheta}{\bar{\theta}}
\newcommand{\phit}{\tilde{\phi}}
\newcommand{\oert}{\tilde{\omega}_{Er}}

% Simplify equations
\newcommand{\eq}[1]{\begin{align*}\begin{gathered}#1\end{gathered}\end{align*}}
\newcommand{\eqre}[1]{\begin{align}\begin{gathered}#1\end{gathered}\end{align}}

\usepackage{tikzPackages}

\begin{document}
\titlepage

\maketitle

The aim of this document is to explain the modifications in \texttt{SFINCS} that have been done, in order to include poloidal density variation in the collision operator (in both full Fokker-Planck and pure pitch angle scattering operator options).

As is explained in Ref.~\cite{ref:PolVarColl_stefan} poloidal density variation can be included by modifying the lowest order distribution function
\eq{
f_{Ms}(\psi) \rightarrow f_{0s} = f_{Ms}(\psi)e^{-Z_se\Phi_1(\theta,\zeta)/T_s},
}
where $f_M(\psi)$ is the flux-function Maxwellian, $\Phi_1$ is first order variation of the electrostatic potential, and $Z_s,T_s$ are the charge and temperature of species $s$ respectively. To implement this change one may simply modify the species density accordingly
\eqre{
\label{eq:densMod}
n_s \rightarrow n_se^{-Ze\Phi_1(\theta,\zeta)/T},
}
in the original equations for the various terms in the collision operator, which are described in Ref.~\cite{ref:Coll1}. The linearised collision operator takes the new form
\eqre{
C_{ab}^{L:f0} =  C_{ab}\left\{f_{aM},f_{bM}\right\}e^{-\left(Z_a/T_a + Z_b/T_b\right)e\Phi_1(\theta,\zeta)} + C_{ab}\left\{f_{a1},f_{bM}\right\}e^{-Z_b/T_be\Phi_1(\theta,\zeta)} + \\ + C_{ab}\left\{f_{aM},f_{b1}\right\}e^{-Z_a/T_ae\Phi_1(\theta,\zeta)},
}
which describes collisions between species $a$ and $b$. In normalised \texttt{SFINCS} units this becomes
\eqre{
\label{eq:CollMod}
\hat C_{ab}^{L:f0} = \hat C_{ab}\left\{f_{aM},f_{bM}\right\}e^{-\left(\hat Z_a/\hat T_a + \hat Z_b/\hat T_b\right) \alpha\hat\Phi_1(\theta,\zeta)} + \hat C_{ab}\left\{f_{a1},f_{bM}\right\}e^{-\hat Z_b/\hat T_b \alpha\hat\Phi_1(\theta,\zeta)} + \\ + \hat C_{ab}\left\{f_{aM},f_{b1}\right\}e^{-\hat Z_a/\hat T_a\alpha\hat\Phi_1(\theta,\zeta)}.
}

\noindent
The first term on the RHS of Eq.~\eqref{eq:CollMod} is the \textit{temperature equilibration term}. Since this term does not include $f_{1s}$ it has to be treated differently compared to the other two cases, as will be seen shortly. In the code, the calculation of the residual (see Ref.~\cite{ref:Phi1Implem} for definition of the residual and Jacobian in this context) has to be modified to include the factors specified in Eq.~\eqref{eq:CollMod}.

The contribution to the Jacobian are $\delta \hat C_{ab}^{L:f0}/\delta \hat f_{1s}$ and $\delta \hat C_{ab}^{L:f0}/\delta\hat \Phi_1$. The first contribution is the same as in Eq.~\eqref{eq:CollMod} (without the temperature equilibration term) except that the collision operator does not act on the distribution function. In the second case we get

\eqre{
\label{eq:Jac1}
\frac{\delta \hat C_{ab}^{L:f0}}{\delta \hat \Phi_1} = -\left(\hat Z_a/\hat T_a + \hat Z_b/\hat T_b\right) \alpha \hat C_{ab}\left\{f_{aM},f_{bM}\right\}e^{-\left(\hat Z_a/\hat T_a + \hat Z_b/\hat T_b\right) \alpha\hat\Phi_1(\theta,\zeta)}  \\ -\hat Z_b/\hat T_b \alpha\ \hat C_{ab}\left\{f_{a1},f_{bM}\right\}e^{-\hat Z_b/\hat T_b \alpha\hat\Phi_1(\theta,\zeta)}  - \hat Z_a/\hat T_a\alpha\hat\Phi_1(\theta,\zeta) \hat C_{ab}\left\{f_{aM},f_{b1}\right\}e^{-\hat Z_a/\hat T_a\alpha\hat\Phi_1(\theta,\zeta)}.
}

\noindent
Apart from the different pre-factor, the term in Eq.~\eqref{eq:Jac1} differs from the term in $\delta \hat C_{ab}^{L:f0}/\delta \hat f_{1s}$ by acting on the first order distribution function $f_{1s}$. For example, in the first case, terms such as $\partial f_{1s}/\partial x_s$ become
\eq{
\frac{\partial}{\partial f_{1s}}\frac{\partial f_{1s}}{\partial x_s} = \frac{\partial}{\partial x_s},
}
whereas in the second case, when we take the derivative with respect to $\Phi_1$, we have to include the derivative $\partial f_{1s}/\partial x_s$ (and $\partial f_{0s}/\partial x_s$ for temperature equilibration, which again is not present in the first contribution), as well.

%We will now go through the various changes in the code that have been done to implement Eq.~\eqref{eq:CollMod}.

\section*{Implementation in the Code}
To implement Eq.~\eqref{eq:CollMod} and Eq.~\eqref{eq:Jac1} we need to modify the evaluation of the residual and the Jacobian. The residual is evaluated in \texttt{evaluateResidual.F90} and the Jacobian in \texttt{evaluateJacobian.F90}. Both these two routines call the functions in \texttt{PopulateMatrix.F90}, where the actual assembly of the matrices used to compute the residual (by multiplying the matrix with the state-vector) and Jacobian, is done. As a consequence of this structure, we only need to modify \texttt{PopulateMatrix.F90} in order to include poloidal density variation in the collision operator.

\subsection*{Residual}
\label{sec:Res}
In the residual we have to include the extra pre-factor appearing in Eq.~\eqref{eq:CollMod}. Since this factor is species specific, we have to keep track of which species density is appearing in the equations. The pitch-angle scattering and the $\hat C^E_{ab}\left \{f_{a1}\right \}$ parts of the collision operator (see Ref. ~\cite{ref:Coll1}) both uses the density $\texttt{nHats(iSpeciesB)}$ while the other contributions to the total collision operator \texttt{CHat} uses \texttt{nHats(iSpeciesA)} instead.

Rather than creating many if-statements in the current implementation of the collision operator, for sake of clarity we separate the two implementations with one if-statement directly before the various contributions to the collision operator are calculated. If \texttt{Phi1} is included and \texttt{poloidalVariationInCollisionOperator = .true.} the contribution from the collision operator is calculated taking poloidal density variation into account.

\begin{lstlisting}
 if (poloidalVariationInCollisionOperator .and. includePhi1 .and. includePhi1InKineticEquation) then
\end{lstlisting}

Otherwise the second block is executed, which contains the original code.

\noindent
Since we now will have a \texttt{Phi1Hat} dependence in the various terms of the collision operator we will have to iterate over \texttt{itheta} and \texttt{izeta} when calculating the various contributions. Before calculating each term, we define a pre-factor (\texttt{PreFactor}) as is specified in Eq.~\eqref{eq:CollMod}, taking the correct species index into account.

\begin{lstlisting}
 do itheta=ithetaMin,ithetaMax
    do izeta=izetaMin,izetaMax
       ! Generate preFactor for nHats(iSpeciesA) terms
       preFactor =  exp(-Zs(iSpeciesA)*alpha*Phi1Hat(itheta,izeta)/Thats(iSpeciesA))
\end{lstlisting}

\noindent
When required, this pre-factor is overwritten using the charge and temperature of \texttt{iSpeciesB} instead.
Because of the \texttt{itheta}, \texttt{izeta} dependence we have replaced \texttt{CECD} and \texttt{nuDHat} to their equivalents \texttt{CECDpol} and \texttt{nuDHatpol} with space for their \texttt{itheta} and \texttt{izeta} components.

The rest of this block is the same as in the original code, except that we do the second iteration over \texttt{itheta}, \texttt{izeta} slightly earlier, and include the appropriate \texttt{PreFactor} in front of additional contributions to the total collision operator \texttt{CHat}.

\subsubsection*{Temperature equilibration term}
In the original version of the code, the temperature equilibration term is calculated in \\ \texttt{evaluateResidual.F90} by using \texttt{whichMatrix = 2} when calling \texttt{PopulateMatrix.F90}. The output is then multiplied with $f_{0s}$. Since the original version of \texttt{SFINCS} already includes $\Phi_1$ in the definition of $f_{0s}$ (in the subroutine \texttt{init\_f0()} inside \texttt{PopulateMatrix.F90}), the same routines as were presented above can be used also if\\ \texttt{includeTemperatureEquilibrationTerm = .true.}.

\subsection*{Jacobian}
 If the modifications explained in the previous section are implemented, the $\delta C/\delta f_{1s}$ contribution to the Jacobian is at this point already taking the density variation into account. We need to add the calculation of $\delta C/\delta \Phi_1$.

\subsubsection*{The $\delta C/\delta \Phi_1$ term}
\label{sec:Jac1}
We begin with treating the two latter terms appearing in Eq.~\eqref{eq:Jac1} and will then look at the temperature equilibration term.

To implement the derivative with respect to $\Phi_1$ we need to redo the calculation of the various contributions to the collision operator, but including a new pre-factor, \texttt{PreFactorJ} as specified in Eq.~\eqref{eq:Jac1}. This should only be done when the Jacobian (\texttt{whichmatrix =1}) or the preconditioner (\texttt{whichmatrix =0}) is calculated.

\begin{lstlisting}
 if (whichMatrix == 1 .or. whichMatrix == 0) then
    ! Generate preFactorJ for nHats(iSpeciesB) terms
    preFactorJ =  (-Zs(iSpeciesA)*alpha/Thats(iSpeciesA)) &
    *exp(-Zs(iSpeciesA)*alpha*Phi1Hat(itheta,izeta)/Thats(iSpeciesA))
\end{lstlisting}

\noindent
Again, the same is done using the charge and temperature of \texttt{iSpeciesB} instead, whenever required.
The result is saved in the new matrices \texttt{nuDHatpolJ}, \texttt{CECDpolJ} etc. Same calculations are then repeated for these terms (except for the different pre-factor), and the result is saved in \texttt{CHatJ}.

In contrary to the residual (and the $\delta C/\delta f_{1s}$ terms ), when calculating $\delta C/\delta \Phi_1$ we have to include the first order distribution function before saving the result into the main matrix. For this purpose we first have to initiate this distribution function, by reading the appropriate terms in the current state vector.

\begin{lstlisting}
 do ix= max(ixMinCol,min_x_for_L(L)),Nx
    ! Generate f1b from state vector
    index = getIndex(iSpeciesB,ix,L+1,itheta,izeta,BLOCK_F)
    f1b(ix) = stateArray(index + 1)
\end{lstlisting}

\noindent
We multiply the terms in the collision operator with this distribution function.

 \begin{lstlisting}
  CHatTimesf = matmul(CHatJ,f1b)
 \end{lstlisting}
\noindent
The result is then saved into the $\delta \Hat C/\delta \hat \Phi_1$ block of the main matrix,

 \begin{lstlisting}
do ix_row=max(ixMin,min_x_for_L(L)),Nx
   rowIndex=getIndex(iSpeciesA,ix_row,L+1,itheta,izeta,BLOCK_F)
   ! Get column index for the d/dPhi1 terms
   colIndex=getIndex(1,1,1,itheta,izeta,BLOCK_QN)
   ! Save into the main matrix, note that here we only use ix_row since CHatTimesf is now a vector
   call MatSetValue(matrix, rowIndex, colIndex, &
   -nu_n*CHatTimesf(ix_row), ADD_VALUES, ierr)
   ! need to use MatSetValue, otherwise petsc gives error
end do ! ix_row
\end{lstlisting}
\noindent

\subsubsection*{Temperature equilibration}
\label{sec:Jac2}
If the temperature equilibration terms should be included, we have to add additional terms into the main matrix, when calculating  $\delta \Hat C/\delta \hat \Phi_1$. These terms are different from the other contributions since now we need to multiply the output with $f_{0s} = f_{Ms}(\psi)e^{-Z_se\Phi_1(\theta,\zeta)/T_s}$ (instead of the first order distribution function $f_{1s}$). Because of this, we need to generate the Maxwellian distribution function for \texttt{iSpeciesB}.

\begin{lstlisting}
if (includeTemperatureEquilibrationTerm .and. L==0) then
   fM(ix) = sqrt(mhats(iSpeciesB)/Thats(iSpeciesB))*mhats(iSpeciesB)/Thats(iSpeciesB)&
   * nhats(iSpeciesB)/(pi*sqrtpi)*expxb2(ix)
end if
\end{lstlisting}

\noindent
Because of the \texttt{Phi1Hat} dependence in the zeroth order distribution function we get a different contribution to the Jacobian, as specified in the first term of Eq.~\eqref{eq:Jac1}. In the code, we need to use both the residual term \texttt{CHat} and the Jacobian terms \texttt{CHatJ} to obtain the correct result.

\begin{lstlisting}
  CHatTimesf = matmul((CHatJ + CHat*(-Zs(iSpeciesB)*alpha/Thats(iSpeciesB))&
   )*exp(-Zs(iSpeciesB)*alpha*Phi1Hat(itheta,izeta)/Thats(iSpeciesB)),fM)
\end{lstlisting}

\noindent
Written in terms of operators we have that \texttt{CHat} is  $\hat C_{ab}\left\{f_{aM},\cdot\right\}e^{-\hat Z_a/\hat T_a \alpha\hat\Phi_1(\theta,\zeta)}$ and \texttt{CHatJ} is $\hat C_{ab}\left\{f_{aM},\cdot\right\}\left ( -\hat Z_a/\hat T_a \alpha \right ) e^{-\hat Z_a/\hat T_a \alpha\hat\Phi_1(\theta,\zeta)}$. Here $\cdot$ means that the operator does not act on anything. What is left is to add this term into the main matrix, using the the same procedure as was explained in the previous section.

\subsection*{Pure pitch angle scattering operator}
The implementation of poloidal density variation in the case the pure pitch angle scattering collision operator is used (corresponding to the case \texttt{collisionoperator = 1}), is slightly easier because of the existing loop over \texttt{itheta}, \texttt{izeta} and since we are working with a scalar \texttt{CHat\_element}. Also, since $L > 0$ always for this term, no temperature equilibration has to be included. The only block we need to change is when we save the collision operator into the main matrix.

We introduce the factor \texttt{preFactor} which is in normal cases equal to one, but when \texttt{poloidalVariationInCollisionOperator = .true.} it is equal to the exponential pre-factor containing $\Phi_1$ in Eq.~\eqref{eq:CollMod}.

Before saving into the main matrix, we multiply the collision operator with this factor.

 \begin{lstlisting}
 call MatSetValue(matrix, index, colIndex, &
   -nu_n*CHat_element*preFactor, ADD_VALUES, ierr)
  \end{lstlisting}

\subsection*{Jacobian, the $\delta C/\delta \Phi_1$ term}
Just as before, the   $\delta C/\delta f_1$ terms are the same as in the residual. What is different is the $\delta C/\delta \Phi_1$  term. The procedure to calculate this term is however very similar, to the case with the residual. The only difference is the different pre-factor which now also is multiplied with the distribution function from the state vector.

 \begin{lstlisting}
  preFactor = -Zs(iSpeciesA)*alpha/Thats(iSpeciesA)*exp(-Zs(iSpeciesA) &
            *alpha*Phi1Hat(itheta,izeta)/Thats(iSpeciesA))*stateArray(index + 1)
  \end{lstlisting}

\section*{Current state of the project}
Presently, the modifications discussed in the previous section have been implemented into the ``poloidalVariationInCollisionOperator'' branch of \texttt{SFINCS}. What remains is to verify that the new implementation is correct. First, we try to make simple tests and compare the output from the new code (with poloidal density variation included in the collision operator), with the original code (without poloidal density variation in the collision operator). This is discussed in the first subsection below. Next, we attempt to benchmark the output from the code with theoretical predictions. This is done in the second subsection.

Tokamak geometry has been used in all cases considered here.

\subsection*{Tests of new code}
First, for simple scenarios (such as one species cases, or two species but with low impurity charge, $Z \le 4$), comparison between the new and old version of the code gives exactly the same results. The time it takes to run a simulation is practically the same.

Next, we try to increase the effect of poloidal density variation in the collision operator, by increasing the impurity charge. For $Z \le 16$ this leads to a much longer computation time, but eventually the solver converges and we get a solution. When attempting to run with $Z = 17$, the nonlinear solver diverges. It is possible to get a solution by using \texttt{reusePreconditioner = .false.} in the input to \texttt{SFINCS} and by changing the relative and absolute tolerances used in the iterations. This can be done by providing the flags \texttt{-ksp\_atol} and \texttt{-snes\_rtol} when running the \texttt{SFINCS} simulation. Example of values that can be used are $1e-8$ for \texttt{-ksp\_atol} and $1.0e-6$ for \texttt{-snes\_rtol}. With these options, the nonlinear solver should eventually converge. Note that the other input parameters, such as geometry, species and resolution parameters, all have a strong impact on whether the solver will converge or not. Typical input parameters used here will be presented in the next subsection, further below.

Even for these more complicated cases, with high impurity charge, there is still practically no difference between using the new code and the original version. This is demonstrated in Fig.~\ref{fig:0} where the perturbed impurity density is shown for $Z=1$ and $Z=17$ respectively. Both cases have been computed using the new and original version of the code. As is seen in the figure, the output from the old and new version of the code is almost identical.

\begin{figure}
 \setlength\figureheight{0.4\textheight}
 \setlength\figurewidth{0.9\textwidth}
    \centering
    \input{figures/outdn.tex}
    \caption{Normalised perturbed impurity density for impurity charge $Z = 1$ (orange) and $Z = 17$ (violet) respectively. The result is shown for the case when the original code is used (solid lines) and  when the new code is used instead, with poloidal density variation included in the collision operator(dashed line with circles).}
            \label{fig:0}
      \end{figure}

Other cases, when changing for example impurity density, have also been studied. All have the same conclusion that poloidal density variation does not seem to matter in the collision operator, at least when Tokamak geometry is considered. Further work with Stellarators might be more interesting and should be done.

%Note that depending on the other input parameters used, the value of the charge
%First we test the new version of the code for simple scenarios, such as plasmas with only one species, or with two species but with low impurity charge ($Z \le 6$). For such cases, the new version of the code successfully generates an output which is almost identical to the output from the original code. The time it takes to run a simulation is practically the same.

%Next, in order to increase the effect of poloidal density variation in the collision operator, we try to increase the impurity charge. Now the code runs much slower (compared to when running the same cases with the original code) and it is much more difficult for the (nonlinear) solver to find a solution, which divereges. It is possible to make the nonlinear solver converge by using specific input. First, set the parameters \texttt{reusePreconditione = .false.} in the input file to \texttt{SFINCS}. Secondly, you should modify the relative and absolute tolerance used in the solver-iterations. This can be done by running \texttt{SFINCS} with the flags \texttt{-ksp\_atol} and \texttt{-snes\_rtol}. Good values are $1e-8$ and $1.0e-6$. By playing around with these input parameters it is eventually possible to make the code converge, although at a significant increased computation time. Still, even at higher charge number is is practically no difference between using the new version of the code and the old. This is demonstrated in Fig.~\ref{fig:0} where we show the perturbed impurity density as a function of poloidal angle, for two cases. One has impurity charge $z = 1$ while the other has $z = 17$. Both cases have been run using the original code and the new implementation, where poloidal density variation has been included.

%Other simulations, for example when increasing the impurity density while maintaining high impurity charge also take time to run, and in the end does not show any particular difference when compared with running the simulation with the original code. This shows that poloidal density varation seems to play a small role in simple Tokamak scenarious. Perhaps, Stellarator cases may be required to observe a bigger difference.

\subsection*{Comparing with model}
The second approach we take to validate the code, is to benchmark the \texttt{SFINCS} output with theoretical predictions, using for example the model described in Ref.~\cite{ref:Fulop}\footnote{Note that in this model the collision operator is not linearised around a poloidally varying zeroth order distribution function (as is done here), but the poloidal variation enters through the perturbed distribution function in the ion-impurity collision operator, when computing the parallel friction force.}.

%Note that in this case only Tokamak cases are considered.

The first step is to test the model with the output from the original \texttt{SFINCS} code, without including poloidal density variation. By setting the temperature gradient to zero we remove the effect from the collision operator and expect therefore the output from \texttt{SFINCS} to agree reasonably well with the predictions from the model. Example of typical \texttt{SFINCS}-input used to get the best agreement so far is:
\newpage
 \begin{lstlisting}
 &speciesParameters
 Zs = 1.0, 20.0
 mHats = 1.0, 20.0
 nHats = 4.0, 0.012
 THats = 2.0, 2.0
 dnHatdrNs = -40.0, -0.12
 dTHatdrNs = -0.0, -0.0

 &geometryParameters
 inputRadialCoordinate = 3
 inputRadialCoordinateForGradients = 3

 rN_wish = 0.3

 geometryScheme = 1
 B0OverBBar = 60.0
 GHat = 180.0
 IHat = 0.9
 iota = 0.5
 epsilon_t = 0.1
 epsilon_h = 0
 epsilon_antisymm = 0
 helicity_l = 1
 helicity_n = 1

 psiAHat = 30.0
 aHat = 1.0
/
  \end{lstlisting}
\noindent
For this input, the orderings of various parameters described in Ref.~\cite{ref:Fulop} are reasonably satisfied (we have $\Delta\sim 0.3, \delta \sim 0.15, \epsilon \sim 0.1, n_zZ^2/n_i \sim 1.2$ and $\nu^*\sim 0.11$). If we use this input for varying magnetic field strength $B_0$ (as an example) and calculate the sine and cosine parts of the perturbed impurity density, we get Fig.~\ref{fig:1} and Fig.~\ref{fig:2} respectively. Solid lines correspond to the case when \texttt{SFINCS} output is used to calculate the perturbed density while dashed lines correspond to the analytical model. The two outputs show good agreement for the cosine parts while the sine is slightly deviating.

\begin{figure}[H]
 \setlength\figureheight{0.3\textheight}
 \setlength\figurewidth{0.9\textwidth}
    \centering
    \input{figures/out.tex}
    \caption{Sine part of the perturbed density for a scan in the magnetic field strength $B_0$. Solid line shows result calculated from \texttt{SFINCS} output while the dashed line is the prediction from the model.}
            \label{fig:1}
      \end{figure}

  \begin{figure}[H]
 \setlength\figureheight{0.3\textheight}
 \setlength\figurewidth{0.9\textwidth}
    \centering
        \input{figures/out2.tex}
       \caption{Cosine part of the perturbed density for a scan in the magnetic field strength $B_0$. Solid line shows result calculated from \texttt{SFINCS} output while the dashed line is the prediction from the model.}
                  \label{fig:2}
  \end{figure}

Scans in $\epsilon$ shows a similar result, but a scan in impurity charge and density show more disagreement between model predictions and output from \texttt{SFINCS}. Similar tests using the new version of the code (with nonzero temperature gradients) show the same result.

It appears to be challenging to get good agreement between the model and \texttt{SFINCS}. A possible explanation is the difficulty to get asymptotic in the various quantities required for the model to be valid, while maintaining a sufficiently large density perturbation to make a meaningful comparison. As mentioned, here we use $\Delta\sim 0.3, \delta \sim 0.15, \epsilon \sim 0.1, n_zZ^2/n_i \sim 1.2$ and $\nu^*\sim 0.11$ which might not be good enough for the theoretical model to be valid.

Comparison between \texttt{SFINCS} and the model has been done using a series of python scripts available on \href{https://github.com/landreman/sfincs/commit/520091f6b9ed06cf0b7b1caaa7e0fcfc477f906f}{GitHub}. Further work is required and welcome.

%Scan in other parameters, such as impurity density or $\epsilon$ show even worse disagreement.

%It seems to be very difficult to get a proper agreement between this model and \texttt{SFINCS} which might be because it is difficult to get asymptotic in the various quantities, such as for example $\epsilon \ll 1$, while maintaining sufficiently large density perturbations.

%For vaious scans, the result is a good agreement between the cosine parts of the perturbed density, while the sine part deviates somewhat. Below is an example of input parameters used for a scan in "X". As sen in Fig.

%Test with the code using the new implementation, when poloidal density varation is included gives identical results as when poloidal density variations are neglected. The new code has a problem converging for large impurity charge.

 %Using the new implementation, for ``reasonable'' input values of impurity charge and main ion temperature gradient, no particular poloidal asymmetries have been observed, and the result is fairly similar if the original code is used instead. Attempts to benchmark with the model described in Ref.~\cite{ref:Fulop} suggests that much larger ion temperature gradients and impurity charge has to be used, in order to observe poloidal asymmetries in the perturbed density. The problem is, at this high gradients and impurity charge, it becomes difficult to converge. In general, it seems that a slightly higher \texttt{Ntheta} has to be used, when including poloidal variations in the collision operator.

 % a test comment

\newpage

\begin{thebibliography}{99}

\bibitem{ref:PolVarColl_stefan} S.~Buller, \href{https://github.com/landreman/sfincs/blob/poloidalVariationInCollisionOperator/doc/poloidal_variation_in_collision_operator_2017-09-08.pdf}{ \em Poloidal variation in collision operator} (2017).

\bibitem{ref:Phi1Implem} A.~Moll\'en, \href{https://github.com/landreman/sfincs/blob/master/doc/Phi1_implementation_2016-01.pdf}{ \em Implementation of $\Phi_1$ in SFINCS} (2016).

\bibitem{ref:Coll1} M.~Landreman, \href{https://github.com/landreman/sfincs/blob/poloidalVariationInCollisionOperator/doc/20150507-01\%20Technical\%20documentation\%20for\%20version\%203\%20of\%20SFINCS.pdf}{\em Technical Documentation for version 3 of SFINCS} (2014).

\bibitem{ref:Fulop} T.~F\"{u}l\"{o}p, P.~Helander \href{http://aip.scitation.org/doi/abs/10.1063/1.873593}{\em Phys. Plasmas}{ \bf 6}, 3066 (1999) % fix this

.

%\bibitem{simakov} A.~N.~Simakov, P.~Helander,
%  {\em Phys. Plasmas} {\bf 16}, 042503 (2009).

%\bibitem{nonAxis} P.~Helander, Theory of plasma confinement in non-axisymmetric magnetic fields (2013).

%\bibitem{MH} L.~Råde and B.~Westergren, Mathematics Handbook for Science and Engineering, $5^{\mathrm{th}}$ edition, 2004. %\vspace{-5mm}

%\bibitem{Abra} M.~Abramowitz and I.~A.~Stegun, Handbook of Mathematical Functions, $10^{\mathrm{th}}$ printing, 1972.

\end{thebibliography}

\end{document}

% Some notes:
Basically the structure is the following: the densoty might not always be corresponding to the row index (since we might have cross terms) but the distribution function is ALWAYS the column index, which is SpeciesB, that is why we use  f1b in the end


% Lecture for ph2a Caltech 2017: Vibrations and Waves
\documentclass[pdf, handout, hideothersubsections]{beamer}
\usepackage{beamerthemeshadow}
\mode<presentation>
  {
    \usefonttheme{structuresmallcapsserif}
    \usetheme{CambridgeUS}
    \usecolortheme{seahorse}
    %\useinnertheme{circles}
%    \useoutertheme{tree}
  }

\usepackage{svg}
\usepackage{xmpmulti}
\usepackage{bm}
\usepackage{mathtools}
%\usepackage{enumitem}
\usepackage{hyperref}
\hypersetup{
    pdffitwindow=true,     % window fit to page when opened
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=orange,      % color of internal links
    citecolor=green,       % color of links to bibliography
    filecolor=magenta,     % color of file links
    urlcolor=blue,         % color of external links
    pdfstartview={Fit}
}

% Fonts/encoding
\renewcommand{\UrlFont}{\tiny}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage[sc,medium,raggedright]{titlesec}
\usepackage{newtxmath}
%\usepackage{libertine}
\usepackage[osf]{ebgaramond}

\graphicspath{{Figures/}}

\begin{document}
\title{Fourier Analysis}
\author{Caltech: ph2a}
\date{19 - Oct - 2017}

\frame{\titlepage}

\frame{\frametitle{Table of Contents}\tableofcontents}

\setbeamerfont{footnote}{size=\tiny}

\section{Summary}
\begin{frame}
\frametitle{Last Time:}
\begin{enumerate}
  \pause
\item Matrix methods can be used to analyzed eigenmodes of linear systems.
  \pause
\item The case of $N$ springs and $N$ masses can be analyzed as a
  straightforward extension of the methods used for $N = 2, 3$.
  \pause
\item Strings are an extension of this method to $N \rightarrow \infty$.
  \pause
\item The Bode plot for systems with finite $N$, and then
  infinite $N$, illustrates the phenomena of \emph{dispersion} and the
  \emph{cut-off} frequency.
\pause
\item The rest of this course is the study of waves. This week we make
  the gradual transition between vibrations of discrete elements to
  waves: vibrations in continuous systems.
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{Overview}
\pause
\begin{itemize}
\item Fourier Analysis: decompose solutions into sinusoidal components
  of different frequencies
  (French pp. 189\,--\,196)
  \pause
\item $y(x, t) \rightarrow \tilde{y}(f, t)$
  \pause
\item The \emph{Fourier Transform} converts a function from the
  time-domain into the frequency-domain.
  \pause
\item The inverse Fourier Transform does the inverse and returns to us
  the time domain signal.
  \pause
\item Functions which are made up primarily of sinusoids are
  efficiently described in the frequency domain (e.g. harmonic
  oscillators) using tools like the Bode Plot and Power Spectrum.
  \pause
\item We know the SHO solutions are just sinusoids, so \emph{any}
  arbitrary shape, $y(x,t)$, can be decomposed into these Fourier
  components and then evolved in time.
\pause
\item Fourier analysis is a specific case of the general method of
  Hilbert space analysis where the basis functions can be anything,
  not just sine waves. (e.g. Laplace is for SHO + damping)
\end{itemize}
\end{frame}

\section{Fourier Analysis of Waves}

\begin{frame}
  \frametitle{Fourier Analysis of String}
  \pause
  \begin{itemize}
  \item General Solution: $y(x, t) = \sum_{n=1}^{\infty} A_n cos(\omega_n t - \phi_0) sin(\frac{n \pi x}{L})$
    \pause
  \item Step \#1: Applying boundary conditions -
    \pause
  \item $y(x, 0) = \sum_{n=1}^{\infty} A_n cos(\phi_0) sin(\frac{n \pi x}{L})$
    \pause
  \item $\dot{y}(x, 0) = \sum_{n=1}^{\infty} A_n \omega_n sin(\phi_0)
    sin(\frac{n \pi x}{L})$
    \pause
  \item Since $A_n$ and $\phi_0$ are constants (not dependent on
    time), we now have $y(x, t)$; just need to find $A_n$ and $\phi_0$.
    \pause
  \item For compactness of notation, let $B_n \equiv A_n cos(\phi_0)$
    and $C_n \equiv A_n sin(\phi_0)$.
  \end{itemize}

\end{frame}

\begin{frame}
\frametitle{Waves of Different Frequencies are like unit vectors}
\begin{itemize}
\item We want to compute the $B_n, C_n$, since that completely determines $y(x,t)$.
\pause
\item But how to do this? We can try to guess and check, but that's
  tedious...
\pause

\end{itemize}

\centering
\includegraphics[width=0.5\textwidth]{../../Simulations/FourierSquareWave.pdf}

\end{frame}

\subsection{Compute the Fourier Coefficients}
\begin{frame}
\frametitle{Analogy with Vectors}
\begin{itemize}
\item How to find $B_n$ in $y(x, 0) = \sum_{n=1}^{\infty} B_n
  sin(\frac{n \pi x}{L})$ ?
  \pause
\item When we have a 3D vector ($\vec{z} = a_1 \vec{x_1} + a_2 \vec{x_2} +
  a_3 \vec{x_3}$), we know that we can find the coefficients by using
  the \emph{dot product}: $a_i = \vec{z} \cdot \vec{x_i}$.
  \pause
\item This gives the correct
  answer because the Cartesian basis vectors are \emph{orthonormal}:
  \pause
\item \begin{equation}
        \vec{x_i} \cdot \vec{x_j} = \begin{cases}
          1, & i = j \\
          0, & i \ne j
          \end{cases}
      \label{eq:orthovec}
      \end{equation}
      \pause
\item This works in this straightforward way for any number of spatial dimensions.

\end{itemize}

\end{frame}

\begin{frame}
\frametitle{Orthogonality of Sine waves}
\begin{itemize}
\item This works in the same way for sine, cosine, and complex
  exponentials.
  \pause
\item \begin{equation}
    \frac{2}{L} \int_{0}^{L} sin(n \frac{\pi x}{L}) sin(m \frac{\pi x}{L}) dx
    = \begin{cases}
      0, & m \ne n \\
      1, & m = n
      \end{cases}
      \label{eq:orthosines}
    \end{equation}
    \pause
\item Eq.~\ref{eq:orthosines} exploits the same orthogonality property as
  Eq.~\ref{eq:orthovec}, but over the frequency domain instead of
  space. We can, therefore, use the same technique to get the coefficients.
  \pause
\item Instead of the 'dot product', we'll use the \emph{inner
    product} which is a more generalized kind of dot product.

\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Integrate to find the Fourier Coefficients}
  \pause
We would like to find coefficients $B_n$ and $C_n$:
\begin{align}
  y(x, 0) &= \sum_{n=1}^{\infty} B_n sin(\frac{n \pi x}{L}) \\
  \dot{y}(x, 0) &= \sum_{n=1}^{\infty} \omega_n C_n sin(\frac{n \pi x}{L})
\end{align}
  \pause
Integrating the functions $y$ and $\dot{y}$ with each of the sine waves:
  \pause
\begin{align}
B_n &= \frac{2}{L} \int_{0}^{L} y(x,0) sin(n \frac{\pi x}{L}) dx \\
C_n &= \frac{2}{L} \int_{0}^{L} \dot{y}(x,0) sin(n \frac{\pi x}{L}) dx
\end{align}
\pause
this recipe can now be applied to find the Fourier frequencies of any\footnotemark
function on the domain that respects the boundary conditions.

\footnotetext[1]{See, however, the \href{http://mathworld.wolfram.com/GibbsPhenomenon.html}{Gibb's Phenomenon}}
\end{frame}

\begin{frame}
\frametitle{Example: The Square Wave}
The Square Wave:
\begin{equation}
y(x,0) = \begin{cases}
+1, 0 < x < L/2 \\
-1, L/2 < x < L
\end{cases}
\end{equation}
plot square wave

Integrating the functions $y$ and $\dot{y}$ with each of the sine waves:
  \pause
\begin{align}
B_n &= \frac{2}{L} \int_{0}^{L} y(x,0) sin(n \frac{\pi x}{L}) dx \\
C_n &= \frac{2}{L} \int_{0}^{L} \dot{y}(x,0) sin(n \frac{\pi x}{L}) dx
\end{align}
table of coefficients...
\end{frame}

\begin{frame}
\frametitle{Decomposed Square Wave}

\centering
\includegraphics[width=0.9\textwidth]{../../Simulations/FourierSquareWave50.pdf}

\end{frame}

\begin{frame}
\frametitle{Decomposed Square Wave}
\begin{columns}
\begin{column}{0.5\textwidth}
  \centering
  \includegraphics[width=1\textwidth]{../../Simulations/FourierSquareWave50.pdf}
\end{column}
\begin{column}{0.5\textwidth}
  \centering
  \includegraphics[width=1\textwidth]{../../Simulations/FourierSquareWavePSD.pdf}
\end{column}
\end{columns}

\url{https://github.com/rxa254/VibrationsAndWaves}

\end{frame}

\section{Normal Modes}
\begin{frame}
\frametitle{Normal Modes of a String}
\begin{columns}

  \begin{column}{0.4\textwidth}
    \centering
    \includegraphics[width=0.85\textwidth]{StringForceDiagram.pdf}

  \end{column}

  \begin{column}{0.6\textwidth}
\begin{block}{The Wave Equation}
\centering
$ \frac{\partial^2 y}{\partial t^2} = \frac{T}{\mu} \frac{\partial^2 y}{\partial x^2}$
\end{block}
\pause
\begin{alignat}{2}
\frac{d^2 g}{dt^2} &= \omega^2 g  &\quad g(t) &= C_1 cos(\omega t) \\
\frac{d^2 f}{dx^2} &= -k^2 f &\quad f(x) &= A cos(k x) + B
sin(k x)
\end{alignat}
\pause
where the velocity of the wave, $v \equiv \sqrt{\frac{T}{\mu}}$,
$\frac{\omega}{2 \pi}$ is the frequency, and $k \equiv \omega / v$ is
called the 'wave number'. For the wavelength of the wave, we use the
symbol $\lambda \equiv \frac{2 \pi}{k}$.

  \end{column}

\end{columns}

\end{frame}

\begin{frame}
\frametitle{Normal Modes of a String}
\begin{columns}

  \begin{column}{0.4\textwidth}
    \centering
    \includegraphics[width=0.85\textwidth]{StringForceDiagram.pdf}

  \end{column}

  \begin{column}{0.6\textwidth}
    \begin{enumerate}
    \item $f(x) = 0$ for $x \in \{0, L\} \implies$ \\
      \pause
    \item $sin(k L) = 0$ for any and all t, and $A = 0$\\
      \pause
    \item so $k_n L = n \pi$ or $k_n = n \frac{\pi}{L}$ \\
      \pause
    \item and $y(x, t) = A_n cos(\omega_n t) sin(k_n x)$ \\
    \end{enumerate}

  \end{column}

\end{columns}
\pause
In this case, the boundary conditions preclude cosine terms, but
for strings without fixed ends we would include both sine and cosine.

\end{frame}

\section{Summary}
\begin{frame}
\frametitle{Summary}
\pause
\begin{itemize}
\item Fourier Analysis: decompose solutions into sinusoidal components
  of different frequencies
  (French pp. 189\,--\,196)

\item $y(x, t) \rightarrow \tilde{y}(f, t)$

\item The \emph{Fourier Transform} converts a function from the
  time-domain into the frequency-domain.

\item Functions which are made up primarily of sinusoids are
  efficiently described in the frequency domain (e.g. harmonic
  oscillators) using tools like the Bode Plot and Power Spectrum.

\item We know the SHO solutions are just sinusoids, so \emph{any}
  arbitrary shape, $y(x,t)$, can be decomposed into these Fourier
  components and then evolved in time.

\item The most general solution is an infinite sum over the
  eigenfunctions: \\
  $y(x, t) = \sum_{n=1}^{\infty} A_n cos(\omega_n t) sin(k_n x)$

\end{itemize}

\end{frame}

\end{document}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Paper A
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Paper A}\label{chap3:paperA}
\section*{Finite Element solution of the fiber/matrix interface crack problem: convergence properties and mode mixity of the Virtual Crack Closure Technique}

The analysis of bi-material interface cracks, such as the fiber/matrix interface crack or debond, in the context of Linear Elastic Fracture Mechanics hides some peculiar complexities due to the nature of the solution at the crack tip. The solution to the fiber/matrix interface crack problem can be classified into two different regimes~\cite{Paris1996,Varna1997a}: the \emph{open crack} and \emph{closed crack} solution. The distinction between the two lies in the existence of a region of contact between crack faces (contact zone) at the crack tip: if it exists, we talk about a \emph{closed crack} solution, otherwise of an \emph{open crack} solution.\\
The \emph{open crack} solution to the straight bi-material interface crack problem was first proposed by Williams~\cite{Williams1959}, who found the existence of an oscillatory singularity in the stress field at the crack tip of the form

\begin{equation}\label{chap3:paperA:eq:singularitywilliams}
r^{-\frac{1}{2}}\sin\left(\varepsilon\log r\right)\quad\text{with}\quad\varepsilon=\frac{1}{2\pi}\log\left(\frac{1-\beta}{1+\beta}\right),
\end{equation}

in both Mode I and Mode II. In Eq.~\ref{chap3:paperA:eq:singularitywilliams}, $\beta$ is one of the two parameters introduced by Dundurs~\cite{Dundurs1969} to characterize bi-material interfaces:

\begin{equation}\label{chap3:paperA:eq:dundursbeta}
\beta=\frac{\mu_{2}\left(\kappa_{1}-1\right)-\mu_{1}\left(\kappa_{2}-1\right)}{\mu_{2}\left(\kappa_{1}+1\right)+\mu_{1}\left(\kappa_{2}+1\right)}
\end{equation}

where $\kappa=3-4\nu$ in plane strain and $\kappa=\frac{3-4\nu}{1+\nu}$ in plane stress, $\mu$ is the shear modulus, $\nu$ Poisson's coefficient, and indexes $1,2$ refer to the two bulk materials joined at the interface. Due to the nature of singular solution at the crack tip in the \emph{open crack} case, the definition of Stress Intensity Factor (SIF) $\lim_{r\rightarrow 0}\sqrt{2\pi r}\sigma$ diverges and is not anymore valid~\cite{Comninou1990}. The mismatch in the value of the elastic properties at the bi-material interface makes the configuration a mixed-mode one, but the Mode mixity problem at the crack tip is ill-posed. For the same reason, Mode I and Mode II Energy Release Rate do not converge. A way to circumvent the problem is to evaluate the ERR over a finite instead of an infinitesimal crack increment, which leads naturally to the application of the Virtual Crack Closure Technique (VCCT)~\cite{Rybicki1977,Krueger2004}.\\
The introduction of a finite crack increment makes the ERR sensitive to the mesh. Several authors have investigated the mesh sensitivity of the VCCT used in conjunction with the Finite Element Method (FEM) in the context of the straight bi-material interface crack~\cite{Krueger2013,Sun1987,Sun1989,Manoharan1990,Raju1988,Agrawal2006,Wang2013} and found that: the total Energy Release Rate $G_{TOT}$ does not depend on the mesh size; for a crack under mixed-mode behavior (\emph{open crack} case), Mode I and Mode II depend on the size of the mesh at the crack tip and do not show convergence. The purpose of this first paper is to analyze the mesh dependency of Energy Release Rate in the case of the fiber/matrix interface crack.

\begin{figure}[!h]
\centering
\includegraphics[width=0.9\textwidth]{paperA/RUC.pdf}
\caption{Schematic of the model with its main parameters.}\label{chap3:paperA:fig:modelschem}
\end{figure}

The 1-step VCCT in the force-displacement formulation~\cite{Krueger2004} is considered and applied to the evaluation of the ERR of a debond located on a single fiber placed in a square matrix cell, as shown in Figure~\ref{chap3:paperA:fig:modelschem}. The cell has a size of $2L\times2L$, where

\begin{equation}\label{chap3:paperA:eq:LVf}
L=\frac{R_{f}}{2}\sqrt{\frac{\pi}{V_{f}}},
\end{equation}

$V_{f}$ is the fiber volume fraction and $R_{f}$ is the fiber radius, assumed to be equal to $1\ \mu m$. Conditions of plane strain are assumed. The occurrence of a contact zone after a critical size of the debond is considered and a contact pair interaction is established between crack faces. The interaction is considered frictionless. As the model is symmetric with respect to the $x$-axis (see Figure~\ref{chap3:paperA:fig:modelschem}), only half of it is explicitly modeled and symmetry conditions are applied to the lower boundary. A constant $x$-strain of $1\%$ is applied to the right and left boundary. Glass fiber and epoxy are considered and their properties are reported in Table~\ref{chap3:paperA:tab:phaseprop}.

\begin{table}[!htbp]
 \centering
 \caption{Summary of the mechanical properties of fiber and matrix. $E$ stands for Young's modulus, $\mu$ for shear modulus and $\nu$ for Poisson's ratio.}
 \begin{tabular}{cccc}
\\
\textbf{Material} & \textbf{$E\left[GPa\right]$}\ & \textbf{$\mu\left[GPa\right]$} & \textbf{$\nu\left[-\right]$} \\
\midrule
Glass fiber    & 70.0  & 29.2   & 0.2  \\
Epoxy    & 3.5    & 1.25   & 0.4
\end{tabular}
\label{chap3:paperA:tab:phaseprop}
\end{table}

The main parameter of the mesh sensitivity study is the angular size $\delta$ of the elements at the crack tip, as shown in Figure~\ref{chap3:paperA:fig:vcctmesh}.

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.6\textwidth}
        \includegraphics[width=\textwidth]{paperA/VCCT-linear.pdf}
       \caption{\added{Elements with $1^{st}$ order shape functions: $m=1$ and $p,q=1$.}}
    \end{subfigure}

    \begin{subfigure}[b]{0.6\textwidth}
        \includegraphics[width=\textwidth]{paperA/VCCT-quadratic.pdf}
       \caption{\added{Elements with $2^{nd}$ order shape functions: $m=2$ and $p,q=1,2$.}}
    \end{subfigure}

\caption{\added{Schematic of the mesh at the fiber/matrix interface crack tip.}}\label{chap3:paperA:fig:vcctmesh}
\end{figure}

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf0_1-free-1st-semilogvsDelta-GI.pdf}
       \caption{$V_{f}=0.1\%$, $1^{st}$ order elements.}
    \end{subfigure}
    ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf0_1-free-2nd-semilogvsDelta-GI.pdf}
       \caption{$V_{f}=0.1\%$, $2^{nd}$ order elements.}
    \end{subfigure}

    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf40-free-1st-semilogvsDelta-GI.pdf}
       \caption{$V_{f}=40\%$, $1^{st}$ order elements.}
    \end{subfigure}
    ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf40-free-2nd-semilogvsDelta-GI.pdf}
       \caption{$V_{f}=40\%$, $2^{nd}$ order elements.}
    \end{subfigure}

\caption{Logarithmic dependence on $\delta$ of Mode I ERR: interpolation of numerical results.}\label{chap3:paperA:fig:gIinterp}
\end{figure}

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf0_1-free-1st-semilogvsDelta-GII.pdf}
       \caption{$V_{f}=0.1\%$, $1^{st}$ order elements.}
    \end{subfigure}
    ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf0_1-free-2nd-semilogvsDelta-GII.pdf}
       \caption{$V_{f}=0.1\%$, $2^{nd}$ order elements.}
    \end{subfigure}

    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf40-free-1st-semilogvsDelta-GII.pdf}
       \caption{$V_{f}=40\%$, $1^{st}$ order elements.}
    \end{subfigure}
    ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperA/Vf40-free-2nd-semilogvsDelta-GII.pdf}
       \caption{$V_{f}=40\%$, $2^{nd}$ order elements.}
    \end{subfigure}

\caption{Logarithmic dependence on $\delta$ of Mode II ERR: interpolation of numerical results.}\label{chap3:paperA:fig:gIIinterp}
\end{figure}

The most important contributions of Paper A are summarized below.
\begin{itemize}
\item The total Energy Release Rate is found to invariant to rotations of the crack tip reference frame.
\item The total Energy Release Rate does not depend on the size $\delta$ of the elements at the debond tip, at least for reasonably small elements, i.e. $\delta\leq1.0^{\circ}$. Thus, in \emph{closed crack} case, Mode II ERR does not depend on $\delta$, as $G_{II}=G_{TOT}$ as soon as contact zone onset occurs.
\item In \emph{open crack} case, Mode I and Mode II ERR depend on the element size $\delta$ at the debond tip. The dependence is described by a logarithmic law of the type $A\left(\Delta\theta\right)\ln\delta+B\left(\Delta\theta\right)$, as shown in Figure~\ref{chap3:paperA:fig:gIinterp} and Figure~\ref{chap3:paperA:fig:gIIinterp}. It is found that the sign of the logarithm is always positive for $G_{I}$ (see Figure~\ref{chap3:paperA:fig:gIinterp}), i.e. it decreases when $\delta$ decreases, and negative for $G_{II}$ (see Figure~\ref{chap3:paperA:fig:gIIinterp}), i.e. it increases when $\delta$ decreases.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Paper B
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Paper B}\label{chap3:paperB}
\section*{Energy release rate of the fiber/matrix interface crack in UD composites under transverse loading: effect of the fiber volume fraction and of the distance to the free surface and to non-adjacent debonds}

In Paper B, fiber/matrix interface crack growth is studied in Representative Volume Elements of UD composites subjected to transverse tensile loading. A unit cell constituted by one fiber and the surrounding matrix, shown in Figure~\ref{chap3:paperB:fig:modelschem}, represents the basic element of the RVE.

\begin{figure}[!h]
    \includegraphics[width=0.9\textwidth]{paperB/RUC.pdf}
    \caption{Schematic of the reference unit cell with its main parameters.}\label{chap3:paperB:fig:modelschem}
\end{figure}

The unit cell has a size of $2L\times2L$, where

\begin{equation}\label{chap3:paperB:eq:LVf}
L=\frac{R_{f}}{2}\sqrt{\frac{\pi}{V_{f}}},
\end{equation}

$R_{f}$ is the fiber radius, assumed to be equal to $1\ \mu m$, and $V_{f}$ is the fiber volume fraction. Notice that the value of $1\ \mu m$ for the fiber radius is arbitrary and chosen for simplicity: in the context of Linear Elastic Fracture Mechanics (LEFM), the Energy Release Rate (ERR) is directly proportional to the fiber radius, thus evaluation of the ERR for another value requires simply a multiplication.\\
The RVE is made up by $n$ unit cells as the one of Figure~\ref{chap3:paperB:fig:modelschem} in the horizontal (loading) direction and $k$ unit cells in the vertical (through-the-thickness) direction (see Figure~\ref{chap3:paperB:fig:thickply}). The fiber of the unit cell placed in the center of the RVE is always partially debonded, and the debond has an angular size $\Delta\theta$ which can vary between $10^{\circ}$ and $150^{\circ}$.

\begin{figure}[!h]
    \includegraphics[width=0.9\textwidth]{paperB/thickPly.pdf}
    \caption{Multiple rows of fibers with a debond appearing every $n$ fibers within the central row: model $n\times k-free$ ($n=3$ and $k=3$ in the figure).}\label{chap3:paperB:fig:thickply}
\end{figure}

The RVE is assumed to belong to a central cross-section (i.e. not on the laminate edge) in a slender laminate, i.e. laminate length and width are much greater than the thickness. The debond is assumed to be much more developed in the fiber longitudinal direction than in the arc direction. Thus, conditions of plane strain are adopted.\\
The RVE is symmetric with respect to the horizontal axis ($x$-axis), thus only half of it is explicitly modelled and conditions of symmetry are applied on the lower boundary of the RVE. On the left and right boundaries, conditions of coupling of the $x$-displacement (horizontal displacement) are applied. This implies that the computed solution corresponds to the RVE repeating an infinite number of times to the left and to the right symmetrically with the respect to the side boundary, i.e. if the debond in the central unit cell is placed on the right side of the fiber, then the next one to the right and to the left is on the left side, the successive one is on the right, and so on. As a consequence, the number $n$ of unit cells in the horizontal direction determines the distance between consecutive debonds in the horizontal direction, which corresponds to $n-1$ fully bonded fibers. The upper and lower boundaries (but, given the symmetry with respect to the $x$-axis, only the upper one is explicitly modeled) are left free. Thus, the family of RVEs studied in this paper is called $n\times k-free$.\\
A constant $x$-strain equal to $1\%$ is applied to the left and right boundary. The selected value of $1\%$ is arbitrary, as in LEFM the ERR is proportional to the square of the strain. Thus, the value of the ERR for another level of applied strain can calculated with a multiplication. Contact between debond faces is considered frictionless. The fiber and matrix phases, respectively glass fiber and epoxy, are considered to be homogeneous, isotropic and linear elastic. Their material properties are reported in Table~\ref{chap3:paperB:tab:phaseprop}.

\begin{table}[!htbp]
 \centering
 \caption{Summary of the mechanical properties of fiber and matrix. $E$ stands for Young's modulus, $\mu$ for shear modulus and $\nu$ for Poisson's ratio.}
 \begin{tabular}{cccc}
\\
\textbf{Material} & \textbf{$E\left[GPa\right]$}\ & \textbf{$\mu\left[GPa\right]$} & \textbf{$\nu\left[-\right]$} \\
\midrule
Glass fiber    & 70.0  & 29.2   & 0.2  \\
Epoxy    & 3.5    & 1.25   & 0.4
\end{tabular}
\label{chap3:paperB:tab:phaseprop}
\end{table}

The model is meshed with second order quadrilateral and triangular elements, while at the crack tip only second order quadrilateral elements are used with unitary aspect ratio, determined by the arc size $R_{f}\delta$ where $\delta$ is the angular size. Given the results on convergence of Paper A, the angular size $\delta$ of the elements at the crack tip is determined here by comparison with the Boundary Element Method (BEM) results provided in~\cite{Paris2007,Sandino2016} for a single debonded fiber in an infinite matrix. The comparison is conducted using the $1\times1-free$ RVE with $V_{f}=0.0079$, which corresponds to $L\sim100 R_{f}$. A trade-off between accuracy and computational cost (time and memory required for the solution) is found for $\delta=0.05^{\circ}$. A comparison between the ERR computed with $\delta=0.05^{\circ}$ and the BEM results is shown in Figure~\ref{chap3:paperB:fig:validation}. The error between FEM and BEM solution does not exceed $5\%$ for any value of $\Delta\theta$. This provides a measure of the accuracy of the results proposed here: differences between values of ERR smaller than $5\%$ should not be taken into consideration.

\begin{figure}[!h]
\centering
\includegraphics[width=0.9\textwidth]{paperB/validation-VCCT.pdf}
\caption{Validation of the single fiber model for the infinite matrix case with respect to the BEM solution in \cite{Sandino2016}.}\label{chap3:paperB:fig:validation}
\end{figure}

The most important observations and conclusions of the paper are summarized below.

\begin{enumerate}
\item The Energy Release Rate, both Mode I and Mode II, decreases with a decreasing number of fully bonded fibers between two consecutive partially debonded fibers in the central row, as shown in Figure~\ref{chap3:paperB:fig:sidefibersMI} for Mode I and Figure~\ref{chap3:paperB:fig:sidefibersMI} for Mode II in the case of $n\times1-free$ RVE. Furthermore, it seems that a characteristic distance between debonds exits that defines the transition between an interactive and a non-interactive solution. However, this distance appears to depend on the thickness of the UD, i.e. on the number $k$ of fiber rows in the vertical direction, and also on the fiber volume fraction. An estimate of such distance provides: around $100$ fully bonded fibers for a 1-fiber-row thick UD with $V_{f}=30\%$; around $200$ fibers for a 1-fiber-row thick UD with $V_{f}=60\%$; around $100$ fibers for a 5-fibers-row thick UD with $V_{f}=60\%$.
\item When the free surface is close to the debond, higher Mode I and Mode II ERRs are obtained and the peak $G$ values are shifted to larger debonds (Figure~\ref{chap3:paperB:fig:sidefibersMI} and Figure~\ref{chap3:paperB:fig:sidefibersMI}). However, the effect of the composite free surface on the ERR declines very fast: the presence of at least $2$ fully bonded fibers below and above the central row results in stable constant values of ERR.
\item An increase in the fiber volume fraction, which corresponds to a decrease in the inter-fiber distance, leads in general to a magnification of the effects previously described.
\end{enumerate}

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperB/sidefibers-vf30-GI.pdf}
        \caption{$V_{f}=30\%$.}\label{chap3:paperB:subfig:sidefiber30MI}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperB/sidefibers-vf60-GI.pdf}
        \caption{$V_{f}=60\%$.}\label{chap3:paperB:subfig:sidefiber60MI}
    \end{subfigure}

\caption{Effect of the interaction between debonds appearing at regular intervals on Mode I ERR in an UD with a single row of fibers at different levels of fiber volume fraction $V_{f}$, subject to an applied transverse strain $\varepsilon_{x}$ of $1\%$.}\label{chap3:paperB:fig:sidefibersMI}
\end{figure}

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperB/sidefibers-vf30-GII.pdf}
        \caption{$V_{f}=30\%$.}\label{chap3:paperB:subfig:sidefiber30MII}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperB/sidefibers-vf60-GII.pdf}
        \caption{$V_{f}=60\%$.}\label{chap3:paperB:subfig:sidefiber60MII}
    \end{subfigure}

\caption{Effect of the interaction between debonds appearing at regular intervals on Mode II ERR in an UD with a single row of fibers at different levels of fiber volume fraction $V_{f}$, subject to an applied transverse strain $\varepsilon_{x}$ of $1\%$.}\label{chap3:paperB:fig:sidefibersMII}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Paper C
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Paper C}\label{chap3:paperC}
\section*{Effect of the proximity to the $\mathbf{0^{\circ}/90^{\circ}}$ interface on Energy Release Rate of fiber/matrix interface crack growth in the  $\mathbf{90^{\circ}}$-ply of a cross-ply laminate under tensile loading}

In Paper C, fiber/matrix interface crack growth is studied in Representative Volume Elements of cross-ply laminates subjected to tensile loading. Similarly to Paper B, the unit cell constituted by one fiber and the surrounding matrix, shown in Figure~\ref{chap3:paperB:fig:modelschem}, represents the basic element of the RVE. The unit cell has a size of $2L\times2L$, where

\begin{equation}\label{chap3:paperC:eq:LVf}
L=\frac{R_{f}}{2}\sqrt{\frac{\pi}{V_{f}}},
\end{equation}

$R_{f}$ is the fiber radius, assumed again to be equal to $1\ \mu m$, and $V_{f}$ is the fiber volume fraction.\\
The RVE is constituted by $n$ unit cells in the horizontal (loading) direction and $k$ unit cells in the vertical (through-the-thickness) direction (see Figure~\ref{chap3:paperC:fig:laminateModelsB}). The fiber of the unit cell placed in the center of the RVE is always partially debonded, and the debond has an angular size $\Delta\theta$ which can vary between $10^{\circ}$ and $150^{\circ}$.

\begin{figure}[!htb]
\centering
        \includegraphics[width=0.9\textwidth]{paperC/ThickPly.pdf}
   %    \caption{Mutiple rows of fibers with a debond appearing every $n$ fibers within the central row: model $n\times k-free$ ($n=3$ and $k=3$ in the figure).}\label{paperC:subfig:thickply}
\caption{Models of $\left[0_{m\cdot k\cdot2L}^{\circ},90_{k\cdot2L}^{\circ},0_{m\cdot k\cdot2L}^{\circ}\right]$ laminates with a $90^{\circ}$ layer of variable thickness, determined by the number $k$ of ``rows'' of fibers along the vertical direction.  Debonds are repeating at different distances along the horizontal direction, measured in terms of the number $n-1$ of fully bonded fibers appearing between two consecutive debonds. $2L$ is the thickness of one-fiber row.}\label{chap3:paperC:fig:laminateModelsB}
\end{figure}

On top and below these $n\times k$ fibers, a homogenized $0^{\circ}$ ply is explicitly modelled, as shown in Figure~\ref{chap3:paperC:fig:laminateModelsB}. The thickness of these $0^{\circ}$ plies is defined as $m$ times the thickness $t_{90^{\circ}}$ of the central $90^{\circ}$ ply, where

\begin{equation}\label{chap3:paperC:eq:90thickness}
t_{90^{\circ}}=k2L.
\end{equation}

Similarly to Paper B, the RVE is assumed to be extracted from a central cross-section (i.e. not on the laminate edge) in a slender laminate, i.e. such that laminate length and width are much greater than the thickness. The debond is further assumed to be much more developed in the fiber longitudinal direction than in the arc direction. Thus, conditions of plane strain are adopted.\\
The RVE is symmetric with respect to the $x$-axis (horizontal axis), thus only half of it is explicitly modelled and conditions of symmetry are applied on the lower boundary of the RVE. On the left and right boundaries, conditions of coupling of the $x$-displacement (horizontal displacement) are applied, which implies that, as for the RVEs of paper A, the computed solution corresponds to the RVE repeating an infinite number of times to the left and to the right in a symmetric way with the respect to the side. Thus, the number $n$ of unit cells in the horizontal direction determines the distance between consecutive debonds in the horizontal direction, equal to $n-1$ fully bonded fibers. This family of RVEs is called $n\times k-m\cdot t_{90^{\circ}}$.\\
In order to understand the mechanisms influencing debond ERR by comparison with known conditions at the boundary, an additional family of RVEs is treated in which the $0^{\circ}$ layer is not present. In its place, different combinations of displacement boundary conditions are applied to the upper boundary. When the upper boundary is free, the $1\times 1-free$ RVE is defined, as in Paper A. The $1\times 1-coupling$ RVE is instead obtained when coupling of the vertical displacements $u_{z}$ is applied to the upper boundary (coupling condition). In the case a linear distribution of the horizontal displacement $u_{x}$ is applied to the upper boundary (H-condition), the RVE is refered to as $1\times 1-H$. Finally, when the linear distribution of the horizontal displacement $u_{x}$ is superimposed to the condition of coupling of the vertical displacements $u_{z}$ on the upper boundary, the $1\times 1-coupling+H$ RVE is obtained.\\
A constant $x$-strain equal to $1\%$ is applied to the left and right boundary. Contact between debond faces is considered frictionless. The fiber and matrix phases, respectively glass fiber and epoxy, are considered to be homogeneous, isotropic and linear elastic. The elastic properties of the $0^{\circ}$ ply are computed using Hashin's Concentric Cylinder Assembly model~\cite{Hashin1983} with the self-consistency scheme for the out-of-plane shear modulus of Christensen~\cite{Christensen1979}. The elastic properties of the three phases are reported in Table~\ref{chap3:paperC:tab:phaseprop}.

\begin{table}[!h]
 \centering
 \caption{Summary of mechanical properties of fiber, matrix and UD layer (GF: glass fiber; EP: epoxy; UD: glass-fiber/epoxy uni-directional properties).}%$E$ stands for Young's modulus, $\mu$ for shear modulus and $\nu$ for Poisson's ratio. Indexes $L$ and $T$ stand respectively for \emph{longitudinal} and \emph{transverse}.}
 \begin{tabular}{ccccccc}
\\
\small& \small\textbf{$V_{f}\left[\%\right]$}\  &\small \textbf{$E_{L}\left[GPa\right]$}\ & \small\textbf{$E_{T}\left[GPa\right]$}\  & \small\textbf{$G_{LT}\left[GPa\right]$} &\small\textbf{$\nu_{LT}\left[-\right]$} &\small \textbf{$\nu_{TT}\left[-\right]$} \\
\midrule
\small GF &\small-   &\small 70.0 &\small 70.0  &\small 29.2 &\small 0.2  &\small 0.2\\
\small EP    &-&\small 3.5 &\small 3.5   &\small 1.25 &\small  0.4&\small 0.4\\
\small UD&\small60.0&\small43.442&\small13.714&\small 4.315&\small 0.273&\small0.465\\
\end{tabular}
\label{chap3:paperC:tab:phaseprop}
\end{table}

The model is meshed with second order quadrilateral and triangular elements, while at the crack tip only second order quadrilateral elements are used with unitary aspect ratio, determined by the arc size $R_{f}\delta$ where $\delta$ is the angular size. The angular size $\delta$ of the elements at the crack tip is assumed as equal to $0.05^{\circ}$ based on the comparison with the Boundary Element Method (BEM) results provided in~\cite{Paris2007,Sandino2016} conducted in Paper A. Thus, the same level of accuracy of $5\%$ on ERR applies here.

\begin{figure}[!htb]
\centering
\includegraphics[width=0.9\textwidth]{paperC/nx1-1-vf60-GI.pdf}
\caption{Effect of the presence of the $0^{\circ}$ layer on Mode I ERR: models $21\times 1-free$, $21\times 1-H$, $21\times 1-coupling$, $21\times 1-coupling+H$, $21\times 1-1\cdot t_{90^{\circ}}$ and $21\times 1-10\cdot t_{90^{\circ}}$. $V_{f}=60\%$, $\bar{\varepsilon}_{x}=1\%$.}\label{chap3:paperC:fig:debonddebondGI}
\end{figure}

\begin{figure}[!htb]
\centering
\includegraphics[width=0.9\textwidth]{paperC/nx1-1-vf60-GII.pdf}
\caption{Effect of the presence of the $0^{\circ}$ layer on Mode II ERR: models $21\times 1-free$, $21\times 1-H$, $21\times 1-coupling$, $21\times 1-coupling+H$, $21\times 1-1\cdot t_{90^{\circ}}$ and $21\times 1-10\cdot t_{90^{\circ}}$. $V_{f}=60\%$, $\bar{\varepsilon}_{x}=1\%$.}\label{chap3:paperC:fig:debonddebondGII}
\end{figure}

\begin{figure}[!htb]
\centering
\includegraphics[width=0.9\textwidth]{paperC/1xk-1-vf60-GI.pdf}
\caption{Effect of the presence of undamaged fiber rows in the $90^{\circ}$ layer on debond-$0^{\circ}/90^{\circ}$ interface interaction for Mode I ERR: models $1\times k-1\cdot t_{90^{\circ}}$. $V_{f}=60\%$, $\bar{\varepsilon}_{x}=1\%$.}\label{chap3:paperC:fig:1kGI}
\end{figure}

\begin{figure}[!htb]
\centering
\includegraphics[width=0.9\textwidth]{paperC/1xk-1-vf60-GII.pdf}
\caption{Effect of the presence of undamaged fiber rows in the $90^{\circ}$ layer on debond-$0^{\circ}/90^{\circ}$ interface interaction for Mode II ERR: models $1\times k-1\cdot t_{90^{\circ}}$. $V_{f}=60\%$, $\bar{\varepsilon}_{x}=1\%$.}\label{chap3:paperC:fig:1kGII}
\end{figure}

The relevant results of Paper C are summarized in the following.

\begin{itemize}
\item Comparison between $n\times k-1\cdot t_{90^{\circ}}$ on one side and $n\times k-free$, $n\times k-H$, $n\times k-coupling$, $n\times k-coupling+H$ on the other (Figure~\ref{chap3:paperC:fig:debonddebondGI} and Figure~\ref{chap3:paperC:fig:debonddebondGII}) shows that the presence of the $0^{\circ}$ layer forces the $0^{\circ}/90^{\circ}$ interface to remain approximately straight and controls the uniformity of the horizontal displacement field in the composite, and thus in the $90^{\circ}$ ply. The presence of the $0^{\circ}$ layer thus causes a more homogeneous strain field, which reduces the Energy Release Rate at the debond tip.
\item Increasing the thickness of the $0^{\circ}$ layer, such that $\nicefrac{t_{0^{\circ}}}{t_{90^{\circ}}}$, does not lead to any significant change in debond ERR.
\item No effect of the $90^{\circ}$ layer thickness, measured in terms of number $k$ of fiber rows, is observed, as shown in Figure~\ref{chap3:paperC:fig:1kGI} and Figure~\ref{chap3:paperC:fig:1kGII}. Only if the thickness is reduced to only one fiber row, the Energy Release Rate decreases in value.
\item These results strengthen the claim that the ply-thickness effect does not influence the growth of individual debonds, as observed previously in the literature~\cite{Saito2012,Herraez2015,Velasco2018, Paris2018}.
\end{itemize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Paper D
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Paper D}\label{chap3:paperD}
\section*{Growth of interface cracks on consecutive fibers: on the same or on the opposite sides?}

In Paper D, fiber/matrix interface crack growth is studied in Representative Volume Elements of thick UD composites subjected to transverse tensile loading. Similarly to PAper A and Paper B, the unit cell of one fiber and its surrounding matrix, shown in Figure~\ref{chap3:paperB:fig:modelschem}, represents the basic element of the RVE. The unit cell has a size of $2L\times2L$, where

\begin{equation}\label{chap3:paperC:eq:LVf}
L=\frac{R_{f}}{2}\sqrt{\frac{\pi}{V_{f}}},
\end{equation}

$R_{f}$ is the fiber radius, assumed again to be equal to $1\ \mu m$, and $V_{f}$ is the fiber volume fraction.\\
The RVE is formed by $n$ unit cells in the horizontal (loading) direction and $k$ unit cells in the vertical (through-the-thickness) direction (see Figure~\ref{chap3:paperD:fig:coupling-rve} and Figure~\ref{chap3:paperD:fig:asymm-rve}). The fiber of the unit cell placed in the center of the RVE is always partially debonded, and the debond has an angular size $\Delta\theta$ which can vary between $10^{\circ}$ and $150^{\circ}$.

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/coupling.pdf}
\caption{Representative Volume Element $n \times k-symm$ of a UD composite with debonds appearing after $n-1$ and after $k-1$ undamaged fibers respectively in the horizontal and vertical direction. In the vertical direction, on fibers belonging to the same ´´column", debonds are located always on the same side.}\label{chap3:paperD:fig:coupling-rve}
\end{figure}

The same assumptions made in Paper B and Paper C on laminate and debond geometry hold, and conditions of plane strain are assumed.\\
The RVE is symmetric with respect to the $x$-axis (horizontal axis), thus only half of it is explicitly modelled and conditions of symmetry are applied on the lower boundary of the RVE. On the left and right boundaries, conditions of coupling of the $x$-displacement (horizontal displacement) are applied, which implies that, as for the RVEs of Paper A and Paper B, the computed solution corresponds to the RVE repeating an infinite number of times to the left and to the right in a symmetric way with the respect to the side. Thus, the number $n$ of unit cells in the horizontal direction determines the distance between consecutive debonds in the horizontal direction, equal to $n-1$ fully bonded fibers. On the top boundary, two different sets of boundary conditions are applied. The first are conditions of coupling of the vertical displacement $u_{z}$, expressed as

\begin{equation}
u_{z}\left(x,h\right)=u_{z}^{\nu},
\end{equation}

where $h=kL$ corresponds to the height of the RVE and $u_{z}^{\nu}$ represents the unknown constant vertical displacement of the upper boundary due to Poisson's effect, which is calculated as part of the elastic solution. This set of conditions implies that the computed solution is that of the RVE repeating an infinite number of times in the vertical direction in a symmetric way as shown in Figure~\ref{chap3:paperD:fig:coupling-rve}, i.e. if the debond in the central unit cell appears on the right, all the debonds in the vertical direction aligned with it will be placed on the right half of their respective fiber. This family of RVEs is referred to as $n\times k-symm$.

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/asymm.pdf}
\caption{Representative Volume Element $n \times k-asymm$ of a UD composite with debonds appearing after $n-1$ and after $k-1$ undamaged fibers respectively in the horizontal and vertical direction. In the vertical direction, on fibers belonging to the same ´´column", debonds are located on the opposite sides of consecutive fibers.}\label{chap3:paperD:fig:asymm-rve}
\end{figure}

The second set of conditions represents instead anti-symmetric coupling conditions, expressed as

\begin{equation}
u_{z}\left(x,h\right)-u_{z}\left(0,h\right)=-\left(u_{z}\left(-x,h\right)-u_{z}\left(0,h\right)\right),
\end{equation}

\begin{equation}
u_{x}\left(x,h\right)=-u_{x}\left(-x,h\right),
\end{equation}

where $h$ represents the height of the RVE and $u_{z}\left(0,h\right)$ stands for the unknown vertical displacement of the upper boundary's mid-point caused by Poisson's effect, which is evaluated as part of the elastic solution. Similarly to $n\times k-symm$, this set of conditions implies that the RVE is repeating infinite times in the vertical direction. However, the unit cell is repeated anti-symmetrically this time: if a debond is placed on the right side of its fiber, the next one aligned in the vertical direction will appear on the left side (Figure~\ref{chap3:paperD:fig:asymm-rve}). This second set of RVEs is named $n\times k-asymm$.\\
A constant horizontal strain ($x$-strain) equal to $1\%$ is applied to the left and right boundary. Frictionless contact is considered between debond faces. The fiber and matrix phases, respectively glass fiber and epoxy, are considered to be homogeneous, isotropic and linear elastic. The elastic properties of the two phases are reported in Table~\ref{chap3:paperC:tab:phaseprop}.

\begin{table}[!h]
 \centering
 \caption{Material properties of glass fiber and epoxy adopted in the present study.}
 \begin{tabular}{cccc}
\\
\textbf{Material} & \textbf{$E\left[GPa\right]$}\ & \textbf{$\mu\left[GPa\right]$} & \textbf{$\nu\left[-\right]$} \\
\midrule
Glass fiber    & 70.0  & 29.2   & 0.2  \\
Epoxy    & 3.5    & 1.25   & 0.4
\end{tabular}
\label{chap3:paperD:tab:phaseprop}
\end{table}

The model is meshed with second order quadrilateral and triangular elements, while at the crack tip only second order quadrilateral elements are used with unitary aspect ratio, determined by the arc size $R_{f}\delta$ where $\delta$ is the angular size. The angular size $\delta$ of the elements at the crack tip is assumed as equal to $0.05^{\circ}$ based on the comparison with the Boundary Element Method (BEM) results provided in~\cite{Paris2007,Sandino2016} conducted in Paper A. Thus, the same level of accuracy of $5\%$ on ERR applies here.

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/nx1-coupling-vf60-GI.pdf}
\caption{Comparison of Mode I ERR between $n \times 1-symm$ and $n \times 1-asymm$ RVEs, $V_{f}=60\%$, $\varepsilon_{x}=1\%$.}\label{chap3:paperD:fig:nx1-GI}
\end{figure}

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/nx1-coupling-vf60-GII.pdf}
\caption{Comparison of Mode II ERR between $n \times 1-symm$ and $n \times 1-asymm$ RVEs, $V_{f}=60\%$, $\varepsilon_{x}=1\%$.}\label{chap3:paperD:fig:nx1-GII}
\end{figure}

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/nxk-coupling-vf60-GI.pdf}
\caption{Comparison of Mode I ERR between $n \times 3-symm$ and $n \times 1-asymm$ RVEs, $V_{f}=60\%$, $\varepsilon_{x}=1\%$.}\label{chap3:paperD:fig:nxk-GI}
\end{figure}

\begin{figure}[!htb]
\centering
  \includegraphics[width=0.9\textwidth]{paperD/nxk-coupling-vf60-GII.pdf}
\caption{Comparison of Mode II ERR between $n \times 3-symm$ and $n \times 1-asymm$ RVEs, $V_{f}=60\%$, $\varepsilon_{x}=1\%$.}\label{chap3:paperD:fig:nxk-GII}
\end{figure}

The main findings of Paper D are summarized below.

\begin{enumerate}
\item The relative position of debonds, i.e. same or opposite sides of their respective fiber, has an effect on the Energy Release Rate only if debonds are located on consecutive fibers, as shown in Figure~\ref{chap3:paperD:fig:nx1-GI} and Figure~\ref{chap3:paperD:fig:nx1-GII}. The sensitivity of the ERR to debonds' relative position disappears with presence of just two fully bonded fiber rows between rows containing debonds (Figure~\ref{chap3:paperD:fig:nxk-GI} and Figure~\ref{chap3:paperD:fig:nxk-GII}) and neither configuration (debonds on the same or opposite sides of the debonded fibers) is favored from an energy point of view.
\item In the case of debonds located on consecutive vertically aligned fibers, the values of $G_{I}$ are higher and contact zone onset is delayed to larger debonds when debonds are on the same side of their respective fibers (Figure~\ref{chap3:paperD:fig:nx1-GI}). As debond growth is likelier when the Mode Ratio is Mode I dominated, it thus seems reasonable to expect that the growth of consecutive vertically aligned debonds (with no fully bonded fiber in between) is favored when they are located on the same side of their respective fibers.
\item No significant difference in $G_{II}$ between the two RVE families is observed except in the range $\Delta\theta=80^{\circ}-100^{\circ}$. In this range, the largest values of $G_{II}$ are obtained and $G_{II}$ is higher when debonds are located on opposite sides of consecutive vertically aligned fibers. This means that, assuming the applied strain is high enough to cause debond growth in Mode II with the onset of a contact zone, larger debond sizes will likely be reached when debonds are on opposite sides.
\end{enumerate}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      Paper E
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Paper E}\label{chap3:paperE}
\section*{Estimating the average size of fiber/matrix interface cracks in UD and cross-ply laminates}

In Paper E, initiation and propagation of debonds are studied in Representative Volume Elements of UD composites and cross-ply laminates. The objective in particular is to estimate initial flaw size after debond initiation and the final maximum size after debond propagation. The RVE considered are $n\times k-free$ (see Section~\ref{chap3:paperB} for details), $n\times k-m\cdot t_{90^{\circ}}$ (Section~\ref{chap3:paperC}), $n\times k-symm$ and $n\times k-asymm$ (see Section~\ref{chap3:paperD}).\\
Debond initiation at the undamaged fiber/matrix interface is assumed to be governed by the stress and thus determined by a stess-based criterion. The distribution of stresses at the fiber/matrix interface is thus analyzed in models $1\times k-free$ and $1\times k-1\cdot t_{90^{\circ}}$ with $k=1,3,11,201$, $\Delta\theta=0^{\circ}$ (i.e. the undamaged case) and $\bar{\varepsilon}_{x}=1\%$. Selected stress components are presented, on the basis of their relevance in previous studies on debond initiation and growth available in the literature: the radial $\sigma_{rr}$ and shear $\tau_{r\psi}$ stress~\cite{Mantic2009} (Fig.~\ref{chap3:paperE:fig:stress-a} and Fig.~\ref{chap3:paperE:fig:stress-b}), the Local Hydrostatic Stress (LHS, following ~\cite{Carraro2016}) $\sigma_{LHS}$~\cite{Asp1996a,Asp1996b} (Fig.~\ref{chap3:paperE:fig:stress-c} and Fig.~\ref{chap3:paperE:fig:stress-d}), the local von Mises stress $\sigma_{vM}$~\cite{Canal2012}  (Fig.~\ref{chap3:paperE:fig:stress-e} and Fig.~\ref{chap3:paperE:fig:stress-f}), the Local Maximum Principal Stress (LMPS, notation of~\cite{Carraro2016}) $\sigma_{LMPS}$~\cite{Carraro2014}  (Fig.~\ref{chap3:paperE:fig:stress-g} and Fig.~\ref{chap3:paperE:fig:stress-h}). Conditions of plane strain, considered here in all RVEs, imply the existence of an out-of-plane axial component of the stress ($\sigma_{yy}$ in the notation of the paper): to study the effect of the out-of-plane component (tri-axial stress state, see~\cite{Asp1995}), $\sigma_{LHS}$, $\sigma_{vM}$ and $\sigma_{LMPS}$ are evaluated both neglecting (index $2D$) and considering it (index $3D$).

\begin{figure}[!hp]
\centering
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-sigmar.pdf}
        \caption{Radial stress $\sigma_{rr}$.}\label{chap3:paperE:fig:stress-a}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-taurt.pdf}
        \caption{Shear stress $\tau_{r\psi}$.}\label{chap3:paperE:fig:stress-b}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-p2D.pdf}
        \caption{Local Hydrostatic Stress (LHS), neglecting $\sigma_{yy}$, $\sigma_{LHS,2D}$.}\label{chap3:paperE:fig:stress-c}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-p3D.pdf}
        \caption{Local Hydrostatic Stress (LHS), considering $\sigma_{yy}$, $\sigma_{LHS,3D}$.}\label{chap3:paperE:fig:stress-d}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-vM2D.pdf}
        \caption{Local von Mises stress, neglecting $\sigma_{yy}$, $\sigma_{vM,2D}$.}\label{chap3:paperE:fig:stress-e}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-vM3D.pdf}
        \caption{Local von Mises stress, considering $\sigma_{yy}$, $\sigma_{vM,3D}$.}\label{chap3:paperE:fig:stress-f}
    \end{subfigure}

    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-sigmaI2D.pdf}
        \caption{Local Maximum Principal Stress (LMPS), neglecting $\sigma_{yy}$, $\sigma_{LMPS,2D}$.}\label{chap3:paperE:fig:stress-g}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-nodamage-sigmaI3D.pdf}
        \caption{Local Maximum Principal Stress (LMPS), considering $\sigma_{yy}$, $\sigma_{LMPS,3D}$.}\label{chap3:paperE:fig:stress-h}
    \end{subfigure}

\caption{Stress distribution at the fiber/matrix interface in the absence of damage with respect to angular coordinate $\psi$; applied strain $\bar{\varepsilon}_{x}=1\%$.}\label{chap3:paperE:fig:stress}
\end{figure}

Observing Figure~\ref{chap3:paperE:fig:stress}, it seems reasonable to conclude that a stress-based criterion would predict, irrespectively of the specific criterion chosen, debond onset to occur at $0^{\circ}$ (or $180^{\circ}$, given the symmetry of the geometry considered) with an initial size at least in the range $2^{\circ}-8^{\circ}$, corresponding to a $1\%$ margin on the value of the stress to satisfy the criterion, and likely in the range $6^{\circ}-12^{\circ}$, corresponding to a $5\%$ margin on the satisfaction of the criterion.\\
Assuming now that, as in~\cite{Correa2016}, once an initial debond of a size $\Delta\theta_{0}\sim2^{\circ}-12^{\circ}$) is formed, the debond will grow unstably at the same level of global applied strain $\bar{\varepsilon}_{x}$, according to an energy-based criterion of the form~\cite{Hutchinson1991,Mantic2009}:

\begin{equation}\label{chap3:paperE:eq:propcrit}
G_{TOT}\geq G_{c}=G_{Ic}\left(1+\tan^{2}\left(\left(1-\lambda\right)\Psi_{G}\right)\right),\quad\Psi_{G}=tan^{-1}\left(\sqrt{\frac{G_{II}}{G_{I}}}\right),
\end{equation}

where $\Psi_{G}$ represents the energy-based phase angle, $G_{TOT}$ is the total ERR, $G_{c}$ is the critical ERR, $G_{Ic}$ is the Mode I critical ERR (material property) and $\lambda$ the mode mixity sensitivity parameter (material property, usually $0.2\leq\lambda\leq0.35$). Given that in the present model debond propagation starts as soon as an initial debond is formed, the propagation criterion in Equation~\ref{chap3:paperE:eq:propcrit} is satisfied for the initial debond size $\Delta\theta_{0}$. Thus, by calculating $G_{I}$, $G_{II}$ and $G_{TOT}$ and equating $G_{c}$ to $G_{TOT}$ in Eq.~\ref{chap3:paperE:eq:propcrit}, it is possible to evaluate $G_{Ic}$ for different values of the initial debond size $\Delta\theta_{0}$ and of the parameter $\lambda$ (Figure~\ref{chap3:paperE:fig:GIc}).

\begin{figure}[!h]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-GIc-model.pdf}
        \caption{$\lambda=0.3$.}\label{chap3:paperE:fig:GIc-a}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-GIc-lambda.pdf}
        \caption{$11\times 11-1\cdot t_{90^{\circ}}$.}\label{chap3:paperE:fig:GIc-b}
    \end{subfigure}

\caption{Estimated values of $G_{Ic}$ assuming different values of initial debond size, for different RUCs and varying $\lambda$, with global applied strain $\bar{\varepsilon}_{x}$ equal to $1\%$.}\label{chap3:paperE:fig:GIc}
\end{figure}

It is possible to observe in Figure~\ref{chap3:paperE:fig:GIc} that neither RUC configuration nor $\lambda$ affects $G_{Ic}$ significantly for $\Delta\theta_{0}<10^{\circ}$, which corresponds to the range of initial debond size previously determined. Thus, we can assume a value of $G_{Ic}$ in the range $2-4.5\ \left[\frac{J}{m^{2}}\right]$, with $0.2\leq\lambda\leq0.35$ and $\bar{\varepsilon}_{x}=1\%$.

\begin{figure}[!htbp]
\centering
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A0.pdf}
        \caption{$21\times 1-free$.}\label{chap3:paperE:fig:debondsize-a}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A0T1.pdf}
        \caption{$21\times 1-1\cdot t_{90^{\circ}}$.}\label{chap3:paperE:fig:debondsize-b}
    \end{subfigure}

    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A3.pdf}
        \caption{$21\times 3-free$.}\label{chap3:paperE:fig:debondsize-c}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A3T1.pdf}
        \caption{$21\times 3-1\cdot t_{90^{\circ}}$.}\label{chap3:paperE:fig:debondsize-d}
    \end{subfigure}

    \begin{subfigure}[b]{0.475\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A10.pdf}
        \caption{$21\times 21-free$.}\label{chap3:paperE:fig:debondsize-e}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A10T1.pdf}
        \caption{$21\times 21-1\cdot t_{90^{\circ}}$.}\label{chap3:paperE:fig:debondsize-f}
    \end{subfigure}

    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A0vk.pdf}
        \caption{$21\times 1-coupling$.}\label{chap3:paperE:fig:debondsize-g}
    \end{subfigure} ~
    \begin{subfigure}[b]{0.45\textwidth}
        \includegraphics[width=\textwidth]{paperE/vf60-dsize-S10A0asymm.pdf}
        \caption{$21\times 1-asymm$.}\label{chap3:paperE:fig:debondsize-h}
    \end{subfigure}

\caption{$G_{TOT}$ and $G_{c}$ for several RUCs and different values of $G_{Ic}$ and $\lambda$, computed for $\bar{\varepsilon}_{x}=1\%$. Each intersection point of $G_{TOT}$ and $G_{c}$ curves such that $G_{TOT}\left(\Delta\theta\geq\Delta\theta_{intersection}\right)\leq G_{c}\left(\Delta\theta\geq\Delta\theta_{intersection}\right)$ determines an estimate of $\Delta\theta_{max}$.}\label{chap3:paperE:fig:debondsize}
\end{figure}

Finally, by calculating $G_{c}$ according to Equation~\ref{chap3:paperE:eq:propcrit}, the expected maximum debond size $\Delta\theta_{max}$ is the value of $\Delta\theta$ such that

\begin{equation}\label{paperE:eq:debmax}
G_{TOT}\left(\Delta\theta\geq\Delta\theta_{max}\right)\leq G_{c}\left(\Delta\theta\geq\Delta\theta_{max}\right).
\end{equation}

The following ranges of maximum debond size are obtained (see Figure~\ref{chap3:paperE:fig:debondsize}): for a 1-fiber row UD composite, $30^{\circ}-105^{\circ}$; for a 1-fiber row $90^{\circ}$ ply in a cross-ply laminate, $30^{\circ}-45^{\circ}$; for a multiple fiber-rows UD composite and a multiple fiber-rows $90^{\circ}$ ply in a cross-ply laminate , $40^{\circ}-60^{\circ}$; for consecutive debonds along the vertical direction in a UD composite, $80^{\circ}-110^{\circ}$ when debonds are on the same sides and $60^{\circ}-115^{\circ}$ when on opposite sides. The estimate for the RVE of a cross-ply laminate ($n\times k-1\cdot t_{90^{\circ}}$ RVE, $k\geq3$) is in good agreeement with the debond size distribution estimated in~\cite{Correa2018} through microscopic observations of $\left[0^{\circ}_{3},90^{\circ}_{3}\right]_{S}$ specimens loaded in tension.