%-------------------------------------------------------------------------------

% This file is part of Code_Saturne, a general-purpose CFD tool.
%
% Copyright (C) 1998-2018 EDF S.A.
%
% This program is free software; you can redistribute it and/or modify it under
% the terms of the GNU General Public License as published by the Free Software
% Foundation; either version 2 of the License, or (at your option) any later
% version.
%
% This program is distributed in the hope that it will be useful, but WITHOUT
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
% details.
%
% You should have received a copy of the GNU General Public License along with
% this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
% Street, Fifth Floor, Boston, MA 02110-1301, USA.

%-------------------------------------------------------------------------------

\section*{Calling tree}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
Each sub-section of this document is associated with an important
subroutine. The full list of the subroutines described here is the
following: \fort{bilsc2} \fort{clptur} \fort{clsyvt} \fort{codits} %
\fort{condli} \fort{covofi} \fort{gradmc} \fort{gradrc} \fort{inimas} %
\fort{itrmas} \fort{matrix} \fort{navstv} \fort{predvv} %
\fort{resopv} \fort{turbke} \fort{turrij} \fort{viscfa} \fort{visort} %
\fort{visecv}.

The table~\ref{Base_Introd_simple_calling_tree} presents their sequence within a time
step. This calling tree is only partial. In particular, it does not account
for the number of calls to each subroutine. Also, for the sake of clarity,
no reference has been made to the subroutines dedicated to the gradient
calculation (\fort{gradmc}, \fort{gradrc}), which are called very often. For
the same reason, the calls to \fort{bilsc2} (advection fluxes) and %
\fort{matrix} (matrix calculation) which are made from within \fort{codits}
(treatment of an advection equation with source terms) have not been
reported.

The sub-sections where important information can be found are indicated
below:\newline
\newline
\nl \newline
\textbf{Calculation of gradients}\newline
\hspace*{1cm}\fort{gradrc}\newline
\hspace*{1cm}\fort{gradmc}\newline
\textbf{Least square method}\newline
\hspace*{1cm}\fort{gradmc}\newline
\textbf{Convective schemes}\newline
\hspace*{1cm}\fort{bilsc2}\newline
\textbf{Wall-laws} (for velocity and temperature)\newline
\hspace*{1cm}\fort{clptur}\newline
\hspace*{1cm}\fort{condli}\newline
\textbf{System solve} (incremental method)\newline
\hspace*{1cm}\fort{codits}\newline
\textbf{Calculation of the values at the faces} (not exhaustive)\newline
\hspace*{1cm}\fort{viscfa}\newline
\hspace*{1cm}\fort{visort}\newline

Finally, for the reader wishing to become more familiar with the methods
implemented in \CS, it is recommended to begin with the study of the
advection equation for a scalar (\fort{covofi}) which is solved iteratively
using an incremental method (\fort{codits}). It will then be useful to look
at \fort{navstv} which briefly presents the solution of the system made up
of the mass and momentum equations.

\begin{table}[htp]
\underline{\textbf{Calculation of the physical properties}}\newline
\underline{\textbf{Boundary Conditions}}\newline
\hspace*{1cm}\fort{condli} \newline
\hspace*{1,5cm}\fort{clptur} \hspace*{1cm} ``turbulent'' conditions at the
wall\newline
\hspace*{1,5cm}\fort{clsyvt} \hspace*{1cm} symmetry conditions for the
vectors and the tensors\newline
\underline{\textbf{Navier-Stokes solution}}\newline
\hspace*{1cm}\fort{navstv}\newline
\hspace*{1,5cm}\textbf{Velocity prediction}\newline
\hspace*{2,0cm}\fort{predvv} \newline
\hspace*{2,5cm}\fort{visecv} \hspace*{1cm} momentum source terms related to
the \newline
\hspace*{4,5cm} \hspace*{1cm} transposed gradient of the velocity\newline
\hspace*{2,5cm}\fort{viscfa} \hspace*{1cm} calculation of the viscosity at
the faces\newline
\hspace*{2,5cm}\fort{codits} \hspace*{1cm} iterative solution of the system
using an incremental method\newline
\hspace*{1,5cm}\textbf{Pressure correction}\newline
\hspace*{2,0cm}\fort{resopv} \newline
\hspace*{2,5cm}\fort{viscfa} \hspace*{1cm}calculation of the time step at
the faces...\newline
\hspace*{2,5cm}\fort{visort} \hspace*{1,5cm} ...according to the selected
options\newline
\hspace*{2,5cm}\fort{matrix} \hspace*{1cm}calculation of the Poisson
equation matrix\newline
\hspace*{2,5cm}\fort{inimas} \hspace*{1cm}initialisation of the mass flow
rate\newline
\hspace*{2,5cm}\fort{itrmas} \hspace*{1cm}update of the mass flow rate%
\newline
\hspace*{1,5cm} \textbf{Velocity correction}\newline
\hspace*{3,2cm} \hspace*{1cm}standard method\newline
\underline{\textbf{$k-\varepsilon$ model}}\newline
\hspace*{1cm}\fort{turbke}\newline
\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}preliminary steps before...\newline
\hspace*{1,5cm}\fort{bilsc2} \hspace*{1,5cm}...source terms coupling\newline
\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}calculation of the viscosity at
the faces\newline
\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
using an incremental method\newline
\underline{\textbf{Reynolds stress model}}\newline
\hspace*{1cm}\fort{turrij}\newline
\hspace*{1,5cm}\fort{visort} \hspace*{1cm}calculation of the viscosity at
the faces\newline
\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
using an incremental method\newline
\underline{\textbf{Equations for the scalars}}\newline
\hspace*{1cm}\fort{covofi}\newline
\hspace*{1,5cm}\fort{viscfa} \hspace*{1cm}calculation of the viscosity at
the faces\newline
\hspace*{1,5cm}\fort{codits} \hspace*{1cm}iterative solution of the systems
using an incremental method\newline
\caption{Partial and simplified calling tree associated with the successive
stages within a time step.}
\label{Base_Introd_simple_calling_tree}
\end{table}
