\subsection{The {\tt SPH:} module}\label{sect:SPHData}

The \moc{SPH:} module perform a {\sl superhomog\'en\'eisation} (SPH) equivalence calculation using
information recovered in a macrolib and apply SPH factors to the corresponding \dds{edition} ({\tt L\_EDIT}),
\dds{microlib} ({\tt L\_LIBRARY}), \dds{macrolib} ({\tt L\_MACROLIB}) or \dds{saphyb} ({\tt L\_SAPHYB}) object. This module is also useful
to extract a corrected or non-corrected \dds{microlib} or \dds{macrolib} from the first RHS object. The calling specification is:

\begin{DataStructure}{Structure \dstr{SPH:}}
$\{$ \dusa{EDINEW} $|$ \dusa{LIBNEW} $|$ \dusa{MACNEW} $|$ \dusa{SAPNEW} $|$ \dusa{CPONEW} $|$ \dusa{EDINAM} $|$ \dusa{LIBNAM} $|$ \dusa{MACNAM} \\
~~~~~$|$ \dusa{SAPNAM} $|$ \dusa{CPONAM} $\}~[$ \dusa{FLUNAM} $]$ \\
~~~~~\moc{:=} \moc{SPH:} $\{$ \dusa{EDINAM} $|$ \dusa{LIBNAM}
$|$ \dusa{MACNAM} $|$ \dusa{SAPNAM} $|$ \dusa{CPONAM} $\}$ \\
~~~~~$[$ \dusa{TRKNAM} $[$ \dusa{TRKFIL} $]~]$ \\
~~~~~\moc{::} \dstr{descsph}
\end{DataStructure}

\noindent
where
\begin{ListeDeDescription}{mmmmmmmm}

\item[\dusa{EDINEW}] {\tt character*12} name of the new \dds{edition} data
structure containing SPH-corrected information (see \Sect{EDIData}). In this
case, an existing \dds{edition} data structure must appear on the RHS.

\item[\dusa{LIBNEW}] {\tt character*12} name of the new \dds{microlib} data
structure containing SPH-corrected information (see \Sect{LIBData}). In this
case, an existing \dds{edition}, \dds{microlib} or \dds{multicompo} data structure
must appear on the RHS.

\item[\dusa{MACNEW}] {\tt character*12} name of the new \dds{macrolib} data
structure containing SPH-corrected information (see \Sect{MACData}).

\item[\dusa{SAPNEW}] {\tt character*12} name of the new \dds{saphyb} data
structure containing SPH information (see \Sect{SAPHYBData}). In this
case, data structure \dusa{SAPNAM} must appear on the RHS.

\item[\dusa{CPONEW}] {\tt character*12} name of the new \dds{multicompo} data
structure containing SPH-corrected information (see \Sect{COMPOData}). In this
case, data structure \dusa{CPONAM} must appear on the RHS.

\item[\dusa{EDINAM}] {\tt character*12} name of the existing \dds{edition} data
structure where the edition information is recovered (see \Sect{EDIData}).

\item[\dusa{LIBNAM}] {\tt character*12} name of the existing \dds{microlib} data
structure where the edition information is recovered (see \Sect{LIBData}).

\item[\dusa{MACNAM}] {\tt character*12} name of the existing \dds{macrolib} data
structure where the edition information is recovered (see \Sect{MACData}).

\item[\dusa{SAPNAM}] {\tt character*12} name of the existing \dds{saphyb} data
structure where the edition information is recovered (see \Sect{SAPHYBData}).

\item[\dusa{CPONAM}] {\tt character*12} name of the existing \dds{multicompo} data
structure where the edition information is recovered (see \Sect{COMPOData}).

\item[\dusa{TRKNAM}] {\tt character*12} name of the existing \dds{tracking} data
structure containing the tracking of the macro-geometry (see \Sect{TRKData}). This object
is compulsory only if a macro-calculation is to be performed by module {\tt SPH:}.

\item[\dusa{TRKFIL}] {\tt character*12} name of the existing sequential binary tracking
file used to store the tracks lengths of the macro-geometry. This file is given if and only if it was
required in the previous tracking module call (see \Sect{TRKData}).

\item[\dusa{FLUNAM}] {\tt character*12} name of an initialization flux used to start SPH iterations (see \Sect{FLUData}). By
default, a flat estimate of the flux is used.

\item[\dstr{descsph}] structure containing the input data to this module
(see \Sect{descsph}).

\end{ListeDeDescription}

Note: Saphyb files generated by APOLLO2 don't have a signature. If such a Saphyb is given as input
to module {\tt SPH:}, a signature must be included before using it. The following instruction
can do the job:
\begin{verbatim}
Saphyb := UTL: Saphyb :: CREA SIGNATURE 3 = 'L_SA' 'PHYB' ' ' ;
\end{verbatim}

\subsubsection{Data input for module {\tt SPH:}}\label{sect:descsph}

This structure is used to specify the type of equivalence calculation where the
flux and the condensed and/or homogenized cross sections are corrected by SPH
factors, in such a way as to respect a specified transport-transport or
transport-diffusion equivalence criteria.\cite{ALSB1,ALSB3} This
structure is defined as:

\begin{DataStructure}{Structure \dstr{descsph}}
$[$ \moc{EDIT} \dusa{iprint} $]$ \\
$[[$ \moc{STEP} $\{$ \moc{UP} \dusa{NOMDIR} $|$ \moc{AT} \dusa{index} $\}~]]$ \\
$[~\{$ \moc{IDEM} $|$ \moc{MACRO} $|$ \moc{MICRO} $\}~]$ \\
$[~\{$ \moc{OFF} $|$ \moc{ON} $|$ \moc{SPRD} $[$ \dusa{nmerge} \dusa{ngcond} (\dusa{sph}($i$), $i$=1, \dusa{nmerge}$\times$\dusa{ngcond}) $]~|$ \moc{HOMO} $|$ \moc{ALBS} $\}~]$  \\
$[~\{$ \moc{STD} $|$ \moc{SELE\_ALB} $|$ \moc{SELE\_FD} $|$ \moc{EDF} $|$ \moc{ASYM} \dusa{mixs} $\}~]~~[$ \moc{ARM} $]$ \\
$[$ \moc{ITER}  $[$ \dusa{maxout} $]$  $[$ \dusa{epsout} $]~]$ \\
$[$ \moc{MAXNB} \dusa{maxnb} $]~~[~\{$ \moc{BELL} $|$ \moc{NOBELL} $\}~]$ \\
$[~\{$ \moc{P0W} $|$ \moc{P1W} $\}~]$ \\
$[$ \moc{EQUI} \dusa{TEXT80} $]$ \\
$[$~\moc{LEAK}~\dusa{b2}~$]$ \\
\end{DataStructure}

\noindent where

\begin{ListeDeDescription}{mmmmmmmm}

\item[\moc{EDIT}] keyword used to modify the print level \dusa{iprint}.

\item[\dusa{iprint}] index used to control the printing of this module. The
\dusa{iprint} parameter is important for adjusting the amount of data that is
printed by this calculation step.

\item[\moc{STEP}] keyword used to set a specific elementary calculation from the first RHS.

\item[\moc{UP}] keyword used to select an elementary calculation located in a subdirectory of \dusa{EDINAM} or \dusa{CPONAM}. By default,
\begin{itemize}
\item the sub-directory name stored in record \moc{'LAST-EDIT'} is selected if \dusa{EDINAM} is defined at RHS.
\item the sub-directory \moc{'default'} is selected if \dusa{CPONAM} is defined at RHS.
\end{itemize}

\item[\dusa{NOMDIR}] name of an existing sub-directory of \dusa{EDINAM} or \dusa{CPONAM}.

\item[\moc{AT}] keyword used to select the \dusa{index}--th elementary calculation in \dusa{SAPNAM} or \dusa{CPONAM}.

\item[\dusa{index}] index of the elementary calculation.

\item[\moc{IDEM}] keyword to force the production of a LCM object of the same type as the RHS.

\item[\moc{MACRO}] keyword to force the production of a macrolib at LHS.

\item[\moc{MICRO}] keyword to force the production of a microlib at LHS.

\item[\moc{OFF}] keyword to specify the SPH factors are all set to 1.0,
meaning no correction. This keyword is useful to get rid of a SPH correction which have been set previously. 

\item[\moc{ON}] keyword to activate a calculation of heterogeneous SPH factors based on a converging series of
macro-calculations (default option). A normalization condition must be set if the macro-geometry has no boundary
leakage ({\sl fundamental mode} condition). If boundary leakage is present, no normalization condition is used but the
SPH iterations are difficult to converge in this case.

\item[\moc{SPRD}] keyword to specify that the SPH factors are read from input  (if \dusa{nmerge}, \dusa{ngcond} and \dusa{sph}
are set) or recovered from a RHS object (otherwise).

\item[\dusa{nmerge}] number of regions.

\item[\dusa{ngcond}] number of energy groups.

\item[\dusa{sph}($i$)] initial value of each SPH factor in each mixture (inner loop) and each group (outer loop).

\item[\moc{HOMO}] keyword to specify that the SPH factors are uniform over the complete
macro-geometry. This option is generally used with a complete homogenization of the
reference geometry, obtained using option \moc{MERG} \moc{COMP}. In this case the
neutron flux  (transport or diffusion) will be
uniform, which allows the SPH factors to be obtained (one per macro-group) using
a non-iterative strategy. For a given macro-group the SPH factor will be equal
to the ratio between the average flux of the region and the surface flux if the
\moc{SELE} option is used otherwise the SPH factor are all set equal to 1.0 (no
correction). The \moc{SELE} option allows an SPH factor equal to the inverse of
the discontinuity factor to be calculated.

\item[\moc{ALBS}] keyword to specify that the albedo of the geometry are to be
taken into account in the complete homogenization process. Thus the \moc{MERG}
and \moc{COMP} options must be specified. The SPH factors are obtained using a
transport-transport equivalence based on a calculation using the collision
probabilities. This option requires a geometry with \moc{VOID} (see
\Sect{descBC}) external boundary conditions to be closed using \moc{ALBS} in
modules \moc{ASM:} and \moc{FLU:} (see
\Sectand{descasm}{descflu}).\cite{ALSB2} 

\item[\moc{STD}] keyword to specify the use of flux-volume normalization for the SPH factors (default option). In each macro-group, the macro-fluxes in macro regions $i$ are normalized using
$$
\tilde\phi_i=\phi_i\,{\bar\phi_{\rm ref}\over \bar\phi_{\rm mc}}
$$
\noindent where $\bar\phi_{\rm ref}$ is the averaged volumic flux of the reference calculation and $\bar\phi_{\rm mc}$ is the averaged volumic flux of the macro-calculation. Using this definition, the averaged SPH factor is equal to one.

\item[\moc{SELE\_ALB}] keyword to specify the use of Selengut normalization for the SPH factors. It is necessary to know the averaged surfacic flux of the reference calculation. In this case, we define the reference geometry with \moc{VOID}
external boundary conditions (see \Sect{descBC}) and to close the region for the collision probability calculations using the \moc{ALBS} 
option (see \Sect{descasm}).

\item[\moc{SELE\_FD}] keyword to specify the use of Selengut normalization for the SPH factors. It is necessary to know the averaged surfacic flux of the reference calculation. This value can be obtained by defining
a small region near boundary in the reference geometry and use the \moc{ADF FD\_B} data structure in \Sect{descedi}.

\noindent In each macro-group, the macro-fluxes in macro regions $i$ are normalized using
$$
\tilde\phi_i=\phi_i\,{\phi_{\rm ref}^{\rm gap}\over \bar\phi_{\rm mc}}
$$
\noindent where $\phi_{\rm ref}^{\rm gap}$ is the averaged surfacic flux of the reference calculation. Using this definition, the averaged SPH factor is equal to
$$
\bar\mu={\bar\phi_{\rm ref}\over \phi_{\rm ref}^{\rm gap} } \ \ .
$$

\item[\moc{EDF}] keyword to specify the use of generalized Selengut normalization for the SPH factors.\cite{sphedf} It is necessary to know the averaged surfacic flux and the
averaged volumic flux in a row of cells of the reference calculation. The surfacic flux is obtained as with the \moc{SELE} option. The  value of the volumic flux in a row of
cells is computed using index information from the \moc{ADF FD\_H} data structure in \Sect{descedi}.

\noindent In each macro-group, the macro-fluxes in macro regions $i$ are normalized using
$$
\tilde\phi_i=\phi_i\,{\bar\phi_{\rm ref} \, \phi_{\rm ref}^{\rm gap}\over \bar\phi_{\rm mc} \, \phi_{\rm ref}^{\rm row} }
$$
\noindent where $\phi_{\rm ref}^{\rm row}$ is the averaged volumic flux in a row of cells of the reference calculation. Using this definition, the averaged SPH factor is equal to
$$
\bar\mu={\phi_{\rm ref}^{\rm row}\over \phi_{\rm ref}^{\rm gap} } \ \ .
$$

\item[\moc{ASYM}] keyword to specify the use of asymptotic normalization of the
SPH factors. The SPH factors in homogenized mixture \dusa{mixs} are set to one
in all macro-energy groups.

\item[\dusa{mixs}] index of the homogenized mixture where asymptotic normalization
is performed.

\item[\moc{ARM}] keyword to activate a solution technique other than the collision probability method. Used with the Eurydice
solution technique within \moc{SYBILT:} to activate the current iteration method.

\item[\moc{ITER}] keyword to specify the main convergence parameters used to control SPH iterations.

\item[\dusa{maxout}] user-defined maximum number of SPH iterations (default value: $200$).

\item[\dusa{epsout}] user-defined convergence criterion (default value: $1.0 \times 10^{-4}$).

\item[\moc{MAXNB}] keyword to specify an auxiliary convergence parameter used to control SPH iterations.

\item[\dusa{maxnb}] acceptable number of SPH iterations with an increase in convergence error before
aborting (default value: $10$).

\item[\moc{BELL}] set Bell factor acceleration of the SPH iterations.

\item[\moc{NOBELL}] unset Bell factor acceleration of the SPH iterations (default value).

\item[\moc{P0W}] all cross sections are corrected using $P_0$ SPH factors (default option).

\item[\moc{P1W}]  Both $P_0$ and $P_1$ SPH factors will be computed. $P_0$ cross sections
are corrected using $P_0$ SPH factors. Higher order
cross sections are corrected using $P_1$ SPH factors obtained from the fundamental current
equation, i.e., recovered from a consistent $P_1$ or from a consistent heterogeneous $B_1$ model.
Option \moc{P1W} must be previously set in \Sect{descedi}. This option is experimental.

\item[\moc{EQUI}] keyword used to select an existing set of SPH factors in \dusa{SAPNAM} or to store
a new set of SPH factors in \dusa{SAPNEW} or \dusa{SAPNAM}.

\item[\dusa{TEXT80}] character*80 name of a set of SPH factors.

\item[\moc{LEAK}] keyword used to introduce leakage in the embedded {\sc macrolib}. This option should only be used for non-regression tests.

\item[\dusa{b2}] the imposed buckling corresponding to the leakage.

\end{ListeDeDescription}
\eject
