~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to doc/user/saturne1.tex

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%-----------------------------------------------------------------------
2
 
%
3
 
%     This file is part of the Code_Saturne Kernel, element of the
4
 
%     Code_Saturne CFD tool.
5
 
%
6
 
%     Copyright (C) 1998-2009 EDF S.A., France
7
 
%
8
 
%     contact: saturne-support@edf.fr
9
 
%
10
 
%     The Code_Saturne Kernel is free software; you can redistribute it
11
 
%     and/or modify it under the terms of the GNU General Public License
12
 
%     as published by the Free Software Foundation; either version 2 of
13
 
%     the License, or (at your option) any later version.
14
 
%
15
 
%     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
%     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
%     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
%     GNU General Public License for more details.
19
 
%
20
 
%     You should have received a copy of the GNU General Public License
21
 
%     along with the Code_Saturne Kernel; if not, write to the
22
 
%     Free Software Foundation, Inc.,
23
 
%     51 Franklin St, Fifth Floor,
24
 
%     Boston, MA  02110-1301  USA
25
 
%
26
 
%-----------------------------------------------------------------------
 
1
%-------------------------------------------------------------------------------
 
2
 
 
3
% This file is part of Code_Saturne, a general-purpose CFD tool.
 
4
%
 
5
% Copyright (C) 1998-2011 EDF S.A.
 
6
%
 
7
% This program is free software; you can redistribute it and/or modify it under
 
8
% the terms of the GNU General Public License as published by the Free Software
 
9
% Foundation; either version 2 of the License, or (at your option) any later
 
10
% version.
 
11
%
 
12
% This program is distributed in the hope that it will be useful, but WITHOUT
 
13
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
14
% FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
15
% details.
 
16
%
 
17
% You should have received a copy of the GNU General Public License along with
 
18
% this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
19
% Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
20
 
 
21
%-------------------------------------------------------------------------------
 
22
 
27
23
\nopagebreak
28
24
%==================================
29
25
%==================================
40
36
for the treatment of Lagrangian particle tracking, semi-transparent radiative transfer,
41
37
gas combustion, pulverised coal combustion,
42
38
electricity effects (Joule effect and electric arcs) and compressible flows.
43
 
The code also includes an engineering module, Matisse, for the simulation of
44
 
nuclear waste surface storage.
45
39
 
46
40
\CS is free software; you can redistribute it
47
41
and/or modify it under the terms of the GNU General Public License
67
61
as shown on figure \ref{Fig_elements}:
68
62
\begin{itemize}
69
63
\item the Kernel module is the numerical solver
70
 
\item the Preprocessor module is in charge of mesh import,
71
 
mesh joining (arbitrary interfaces), and definition of periodicity
72
 
boundary conditions (translation and/or rotation)
 
64
\item the Preprocessor module is in charge of mesh import
73
65
\item the Partitioner is in charge of optimizing domain decomposition
74
66
for parallel computing (optional, but highly recommended for parallel
75
67
performance)\\
81
73
\caption{\CS elements}\label{Fig_elements}
82
74
\end{figure}
83
75
 
84
 
\indent\CS also relies on two libraries (by the same team, under LGPL licence),
 
76
\indent\CS also relies on one library (by the same team, under LGPL licence),
85
77
which can also be used independently:
86
78
\begin{itemize}
87
 
\item BFT (Base Functions and Types) for the management of memory and input/output
88
 
as well as specific utilities (estimation of time and memory usage for instance)
89
 
\item FVM (Finite Volume Mesh) for the post-processing output and the management
90
 
of code coupling
 
79
\item PLE (Parallel Location and Exchange) for the management of code coupling
91
80
\end{itemize}
92
81
 
93
82
The present document is a practical user's guide for \CS version \verscs.
115
104
based on their function. An alphabetical index list is also given at the end of
116
105
the document for easier consultation.
117
106
 
118
 
 
119
 
 
 
107
%==================================
 
108
\section{Quick start}
 
109
%==================================
 
110
%==================================
 
111
\subsection{Running a calculation}
 
112
%==================================
 
113
We assume in this section that the user has at his disposal the calculation data file (calculation set up) or already prepared it following for instance the step-by-step guidance provided in \CS tutorial. The steps described below are intended to provide the user a way to run quickly on a workstation a calculation through the Graphical User Interface (GUI).
 
114
 
 
115
The first thing to do before running \CS is to add in the user \textasciitilde\texttt{/.profile}, \textasciitilde\texttt{/.bashrc} or similar file the path
 
116
leading to the chosen \CS version, or define an alias to the \texttt{code\_saturne} script. For example:\
 
117
\begin{center}
 
118
\texttt{export PATH=\$\{prefix\}/bin:\$PATH}.\
 
119
\end{center}
 
120
The second thing is to prepare the computation directories. For instance, the study directory \texttt{T\_JUNCTION}, containing a single calculation directory CASE1, will be created by typing the command:\
 
121
\begin{center}
 
122
\texttt{code\_saturne create -s T\_JUNCTION}\
 
123
\end{center}
 
124
The mesh files should be copied in the directory \texttt{MESH}, and the Fortran user files necessary for the calculation in the directory \texttt{CASE1/SRC}.  Finally, the calculation data file \texttt{case\_name.xml} read by the GUI should be copied to the directory \texttt{CASE1/DATA}.
 
125
Once these steps completed, the user should go in the directory \texttt{CASE1/DATA} and type de command line \texttt{./SaturneGUI case\_name.xml} to load the calculation file into the interface. A window similar to fig.\ref{fig3_e1} will appear. Click on the heading ``Calculation management'', select the heading ``Prepare batch calculation'', see fig.\ref{fig43_e1}. After having chosen the number of processors, press ``start calculation'' to run the calculation.
 
126
 
 
127
\begin{figure}[!ht]
 
128
\begin{center}
 
129
\includegraphics[width=12cm]{gui_case_dir}
 
130
\caption{Identity and paths}
 
131
\label{fig3_e1}
 
132
\end{center}
 
133
\end{figure}
 
134
 
 
135
\begin{figure}[!ht]
 
136
\begin{center}
 
137
\includegraphics[width=12cm]{gui_prepare_execution}
 
138
\caption{Prepare execution}
 
139
\label{fig43_e1}
 
140
\end{center}
 
141
\end{figure}
 
142
 
 
143
If no problem arises, the simulation results can be found in the directory \texttt{CASE1/RESU} and be read directly by {\em ParaView} or {\em EnSight} in \texttt{CASE1/RESU/<YYYYMMDD-hhmm>/postprocessing}. Calculation history can be found in the file \texttt{<YYYYMMDD-hhmm>/listing}.
 
144
 
 
145
%==================================
 
146
\subsection{Troubleshooting}
 
147
%==================================
 
148
If the calculation does not run properly, the user is advised to check the
 
149
following points in\\
 
150
\texttt{CASE1/RESU/<YYYYMMDD-hhmm>}:
 
151
\begin{list}{$\bullet$}{}
 
152
\item  if the calculation stops in the pre-processor, the user should check for error messages in the file \texttt{preprocessor*.log}.
 
153
\item if the problem is related to boundary conditions, the user should visualise the file \texttt{error.ensight} with {\em EnSight} or {\em Paraview},
 
154
\item if the calculation stops in the \CS core, the user should look for messages at the end of the files \texttt{listing} and \texttt{error*}. In addition, the user can track the following keywords in the listing. They are specific error signals:
 
155
  \begin{list}{-}{}
 
156
  \item  \texttt{SIGFPE}: a floating point exception occurred. It happens when there is a division by 0, when the calculation did not converge, or when a real number reached a value over $10^{300}$. Depending on the architecture \CS is running
 
157
on, this type of execption may be caught or ignored.
 
158
  \item  \texttt{SIGSEGV}: a memory error such as a segmentation violation occurred. An array may have exceeded its allocated memory size and a memory location in use was overwritten.
 
159
  \end{list}
 
160
\end{list}
120
161
%==================================
121
162
%==================================
122
163
\section{Practical information about \CS}
133
174
\label{prg_environementCS}
134
175
 
135
176
In order to use \CS, every user must add the following line (in their
136
 
\texttt{.profile}, or equivalent, depending on the environment):
 
177
\texttt{.profile}, \texttt{.bashrc}, or equivalent,
 
178
depending on the environment):
137
179
 
138
 
\hspace*{1cm}\texttt{export PATH=\{prefix\}/bin:\$PATH}\\
 
180
\hspace*{1cm}\texttt{export PATH=\$\{prefix\}/bin:\$PATH}\\
139
181
 
140
182
or define the following alias (in their \texttt{.bashrc}, or
141
183
 equivalent, or \texttt{.alias} file, depending on the environment):
142
184
 
143
 
\hspace*{1cm}\texttt{alias cs='\{prefix\}/bin/cs'}\\
 
185
\hspace*{1cm}\texttt{alias cs='\$\{prefix\}/bin/cs'}\\
144
186
 
145
187
where \texttt{prefix} is the base directory where
146
188
\CS and its components have been installed\footnote{At EDF R\&D, \texttt{/home/saturne/Code\_Saturne/\verscs} is used}.
152
194
The standard architecture for the simulation studies is:
153
195
 
154
196
\noindent
155
 
A study directory containing:
 
197
An optional study directory containing:
156
198
\begin{list}{$\bullet$}{}
157
199
\item A directory \texttt{MESH} containing the mesh(es)
158
200
      necessary for the study
171
213
\item A directory \texttt{SCRIPTS} for the launch script
172
214
\item A directory \texttt{RESU} for the results\\
173
215
To improve the calculation traceability, the files and directories
174
 
sent to \texttt{RESU} after a calculation are given a suffix
175
 
identifying the calculation start date and time by an eight-digit
176
 
number (two digits for each month, day, hour and minute; the result of a
177
 
calculation started at 14h03 on December 31$^{\text{st}}$ will therefore be indexed
178
 
12311403)
 
216
sent to \texttt{RESU} after a calculation are  placed in a subdirectory
 
217
named after that run's ``id'', which is by default based on the run date
 
218
and time, using the format: \texttt{YYYYMMDD-hhmm}.
 
219
It is also possible to force a specific run id, using the \texttt{--id}
 
220
option to \texttt{code\_saturne run}.
179
221
\end{list}
180
222
 
181
223
\noindent
182
 
In the standard cases, \texttt{RESU} contains a directory
183
 
\texttt{CHR.ENSIGHT.mmddhhmm} with the post-processing files in {\em EnSight} format,
184
 
a directory \texttt{RESTART.mmddhhmm} for the calculation
185
 
      restart files,
186
 
a directory  \texttt{HIST.mmddhhmm} for the files of chronological
187
 
      record of the results at specific locations (probes),\\
188
 
\texttt{listpre.mmddhhmm} and \texttt{listing.mmddhhmm} files reporting the
189
 
Preprocessor and the Kernel execution. For an easier follow-up of the modifications
190
 
in former calculations, the user-subroutines used in a calculation are stored in
191
 
a directory \texttt{SRC.mmddhhmm} in the directory \texttt{RESU}. The {\em Xml}
 
224
In the standard cases, \texttt{RESU/<run\_id>} contains a
 
225
\texttt{postprocessing} directory with the post-processing
 
226
(visualization) files, a \texttt{restart} directory for the calculation
 
227
restart files, a \texttt{monitoring} directory for the files of chronological
 
228
record of the results at specific locations (probes),\\
 
229
\texttt{preprocessor.log} and \texttt{listing} files reporting the
 
230
Preprocessor and the Kernel execution. For an tracing of
 
231
the modifications in prior calculations, the user-subroutines used in
 
232
a calculation are stored in a \texttt{src\_saturne} subdirectory. The {\em Xml}
192
233
Interface data file, thermo-chemical data files and launch script are also
193
 
copied into the  directory \texttt{RESU} with the appropriate suffix (whatever
194
 
its name, the launch script appears in the directory \texttt{RESU} as
195
 
\texttt{runcase.mmddhhmm}). \texttt{compil.log.mmddhhmm} and
196
 
\texttt{summary.mmddhhmm} are respectively reports of the compilation phase and
197
 
general information on the calculation (which kind of machine, which user, which
198
 
version of the code, ...). Eventually, when the user subroutines produce
199
 
specific result files (extraction of 1D profiles for instance), a
200
 
directory \texttt{RES\_USERS.mmddhhmm} is created in the directory \texttt{RESU}
201
 
for these files\footnote{in order for the script to copy them properly, their
202
 
names have to be given in the variable \texttt{USER\_OUTPUT\_FILES}
203
 
of the launch script, see \S\ref{prg_runcase}}.
204
 
 
205
 
 
206
 
During calculations coupled with \syrthes (option specified in the launch
207
 
script of \CS or {\em via} the Interface) the same organisation is used for the
208
 
files related to \CS. For the files related
209
 
 to \syrthes, the location of the upstream files is specified in the
210
 
\texttt{syrthes.env} file. Yet, the launch script is built presuming that the
211
 
following organisation is applied:
212
 
\begin{list}{$\bullet$}{}
213
 
\item a directory \texttt{SRC\_SYR} for the potential \syrthes user subroutines
214
 
\item a directory \texttt{DATA\_SYR} containing the configuration file \texttt{syrthes.env}
215
 
(location of files specific to \syrthes). The file defining the \syrthes
216
 
calculation options (\texttt{syrthes.data}) and the potential restart files can
217
 
also be placed in this directory.
218
 
\end{list}
219
 
 
220
 
The \syrthes result files (geometry file, chronological result files, calculation
221
 
restart files and the historic file) are placed in a sub-directory
222
 
\texttt{RESU\_SYR.mmddhhmm} of the \texttt{RESU} directory, where
223
 
\texttt{mmddhhmm} corresponds to the calculation identification suffix.
224
 
 
225
 
\sloppy
226
 
 
227
 
\noindent
228
 
The \syrthes execution report file is placed in the \texttt{RESU} directory (same as
229
 
for the \CS review) under the name \texttt{listsyr.mmddhhmm} and the compilation
230
 
report file is under the name  \texttt{compil\_syrthes.log.mmddhhmm}.
231
 
For an easier follow-up of the modifications
232
 
in former calculations, the potential \syrthes user-subroutines used in a
233
 
calculation are stored in a directory \texttt{SRC\_SYR.mmddhhmm} in the
234
 
directory \texttt{RESU}.
235
 
 
236
 
\fussy
237
 
 
238
 
 
239
 
\begin{table}[!t]
 
234
copied into the results directory. \texttt{compil.log} and
 
235
\texttt{summary} are respectively reports of the compilation stage and
 
236
general information on the calculation (type of machine, user,
 
237
version of the code, ...).
 
238
 
 
239
\begin{table}[h!t]
240
240
\begin{tabular}{lll}
241
241
\multicolumn{3}{l}{Below are typical contents of a case directory CASE1 in a study STUDY} \\
242
 
\multicolumn{3}{l}{(\CS calculation coupled with \syrthes):}\\
243
242
\multicolumn{2}{l}{\texttt{STUDY/CASE1/DATA:}}&{\bf \CS data}\\
244
 
&        \texttt{SaturneGUI}                &Graphical User Interface launch script\\
245
 
&        \texttt{study.xml}                &Graphical User Interface parameter file\\
246
 
&        \texttt{THCH}                        &example of thermochemical files
247
 
                                         (used with the specific\\
248
 
&                                   & physics modules for gas combustion,
249
 
                                      pulverised coal \\
250
 
&                                   & or electric arcs)\\
251
 
 
252
 
\multicolumn{2}{l}{\texttt{STUDY/CASE1/DATA\_SYR:}}&{\bf \syrthes data}\\
253
 
&        \texttt{syrthes.data}                  &\syrthes data file \\
254
 
&        \texttt{syrthes.env}                &\syrthes configuration file\\
 
243
&        \texttt{SaturneGUI}        &Graphical User Interface launch script\\
 
244
&        \texttt{study.xml}         &Graphical User Interface parameter file\\
 
245
&        \texttt{REFERENCE}         &Example of user scripts and meteorological\\
 
246
&                                   &  or thermochemical date files (used with the\\
 
247
&                                   & specific physics modules)\\
255
248
\multicolumn{2}{l}{\texttt{STUDY/CASE1/SRC:}}&{\bf \CS user subroutines }\\
256
 
&        \texttt{REFERENCE}                   &        examples of a user subroutines\\
257
 
&        \texttt{usclim.f90}                 &user subroutines used for the present the calculation\\
 
249
&        \texttt{REFERENCE}         &  Examples of a user subroutines\\
 
250
&        \texttt{usclim.f90}        &  user subroutines used for the present calculation\\
258
251
&        \texttt{usini1.f90} &\\
259
 
\multicolumn{2}{l}{\texttt{STUDY/CASE1/RESU:}}&{\bf results}\\
260
 
&        \texttt{CHR.ENSIGHT.08211921}              &directory containing the \CS
261
 
                                           post-processing results\\
262
 
&                                         &in the {\em EnSight} format for the
263
 
                                          calculation 08211921\\
264
 
&                                        &(contains both volume and boundary results;\\
265
 
&                                        &the contents of the directory are user
266
 
                                          modifiable)\\
267
 
&        \texttt{SRC.08211921}              &\CS user subroutines
268
 
                                        used for the\\
269
 
&                                      &calculation 08211921\\
270
 
&        \texttt{SRC\_SYR.08211921}   &\syrthes user subroutines
271
 
                                     used in the calculation 08211921\\
272
 
&        \texttt{HIST.08211921}        &directory containing the chronological
273
 
                                      records for \CS\\
274
 
&        \texttt{RES\_USERS.08211921}  &optional directory containing the
275
 
                                     user results files\\
276
 
&        \texttt{RESTART.08211921}       &directory containing the \CS restart files \\
277
 
&        \texttt{compile.log.08211921}  &compilation report\\
278
 
&     \texttt{study.xml.08211921}   &Graphical User Interface parameter file
279
 
                                    used for the\\
280
 
&                                   &calculation 08211921\\
281
 
&        \texttt{runcase.08211921}       &launch script used for the calculation 08211921\\
282
 
&                                   &(whatever the name given to the file in the
283
 
                                     \texttt{SCRIPT} directory,\\
284
 
&                                   & the file will be referred as
285
 
                                      ``\texttt{runcase.*}'' in the
286
 
                                       \texttt{RESU} directory)\\
287
 
&        \texttt{listpre.08211921}     &execution report for the Preprocessor module of
288
 
                                    \CS\\
289
 
&        \texttt{listing.08211921}     &execution report for the Kernel module of \CS\\
290
 
&        \texttt{listsyr.08211921}     &execution report for \syrthes\\
291
 
&        \texttt{summary.08211921}      &general information (machine, user, version, ...)\\
292
 
&     \texttt{RESU\_SYR.08211921:}  &{\bf \syrthes results (file names given in
293
 
the
294
 
                                      \texttt{syrthes.env} file)}\\
295
 
&        \hspace*{0.3cm}\texttt{geoms} &\syrthes \ solid geometry file\\
296
 
&        \hspace*{0.3cm}\texttt{histos1}&\syrthes chronological records at
297
 
                                      specified probes\\
298
 
&        \hspace*{0.3cm}\texttt{resus1}&\syrthes calculation restart file (1
299
 
                                                     time step)\\
300
 
&        \hspace*{0.3cm}\texttt{resusc1}&\syrthes chronological solid
301
 
                                      post-processing file (may be transformed \\
302
 
&                                    &into the {\em EnSight} format with the
303
 
                                     {\em syrthes2ensight} utility)\\
 
252
\multicolumn{2}{l}{\texttt{STUDY/CASE1/RESU/20110509-1920:}}&{\bf results} for the
 
253
                                                             calculation 20110509-1920\\
 
254
&        \texttt{postprocessing}    &directory containing the \CS post-processing output\\
 
255
&                                   &in the {\em EnSight} format (both volume and boundary);\\
 
256
&        \texttt{src\_saturne}      &copy of the \CS user subroutines used for the calculation\\
 
257
&        \texttt{monitoring}        &directory containing the chronological records for \CS\\
 
258
&        \texttt{checkpoint}        &directory containing the \CS restart files \\
 
259
&        \texttt{compile.log}       &compilation log\\
 
260
&     \texttt{study.xml}            &Graphical User Interface parameter file used for the\\
 
261
&                                   &calculation\\
 
262
&        \texttt{runcase}           &copy of the launch script used for the calculation\\
 
263
&        \texttt{preprocessor.log}  &execution report for the \CS Preprocessor\\
 
264
&        \texttt{listing}           &execution report for the Kernel module of \CS\\
 
265
&        \texttt{summary}           &general information (machine, user, version, ...)\\
304
266
\multicolumn{2}{l}{\texttt{STUDY/CASE1/SCRIPTS:}}&{\bf launch script}\\
305
 
&        \texttt{runcase}                &launch script (compliant with all
306
 
                                     architectures on which \\
307
 
&                                   & \CS has been ported)\\
308
 
\end{tabular}
309
 
\end{table}
310
 
 
311
 
\clearpage
312
 
 
 
267
&        \texttt{runcase}           &launch script (which may contain batch
 
268
                                     system keywords)\\
 
269
\end{tabular}
 
270
\end{table}
 
271
 
 
272
Note that the code may be run directly in the final \texttt{RESU/<run\_id>}
 
273
directory, or in a scratch directory (which may be recommended if the
 
274
compute environment includes different filesystems, some better suited
 
275
to data storage, others to intensive I/O). When running, the code
 
276
may use additional files or directories inside its execution directory, set
 
277
by the execution script, which include a \texttt{mesh\_input} file or directory,
 
278
as well as a \texttt{restart} directory (which is a link or copy of a previous
 
279
run's \texttt{checkpoint} directory), as well as a \texttt{run\_solver.sh}
 
280
script.
 
281
 
 
282
For coupled calculations, whether with \CS or \syrthes, each coupled
 
283
calculation domain is defined by its own directory (bearing the same name
 
284
as the domain), but results are placed in a \texttt{RESU\_COUPLING}
 
285
directory, with a subdirectory for each run, itself containing one
 
286
subdirectory per coupled domain. Coupled cases are not run through
 
287
the standard {\texttt{STUDY/CASE1/SCRIPTS/runcase} script or through
 
288
the {\texttt{code\_saturne run} command, but through a
 
289
{\texttt{STUDY/runcase\_coupling} script.
 
290
 
 
291
So in the coupled case, calculation results would not be placed in
 
292
\texttt{STUDY/CASE1/RESU/20110509-1920}, but in
 
293
\texttt{STUDY/RESU\_COUPLING/20110509-1920/CASE1}, with the \texttt{summary}
 
294
file being directly placed in \texttt{STUDY/RESU\_COUPLING/20110509-1920}
 
295
(as it references all coupled domains).
 
296
 
 
297
\begin{table}[h!t]
 
298
\begin{tabular}{lll}
 
299
\multicolumn{3}{l}{Below are typical additional contents with a coupled \syrthes
 
300
  case SOLID1 in a study STUDY} \\
 
301
\multicolumn{2}{l}{\texttt{STUDY/runcase\_coupling}}&{coupled launch script}\\
 
302
\multicolumn{2}{l}{\texttt{STUDY/SOLID1/DATA:}}&{\bf \syrthes data}\\
 
303
&        \texttt{syrthes.data}                &\syrthes data file \\
 
304
&        \texttt{syrthes.env}                 &\syrthes configuration file\\
 
305
\multicolumn{2}{l}{\texttt{STUDY/RESU\_COUPLING/20110509-1920/SOLID1:}}&{\bf results
 
306
 (file names defined in \texttt{syrthes.env})}\\
 
307
&        \texttt{src}                &\syrthes user subroutines
 
308
                                     used in the calculation\\
 
309
&        \texttt{compile.log.08211921}  &\syrthes compilation report\\
 
310
&        \texttt{listsyr}            &execution log\\
 
311
&        \texttt{geoms}              &\syrthes \ solid geometry file\\
 
312
&        \texttt{histos1}            &\syrthes chronological records at
 
313
                                                  specified probes\\
 
314
&        \texttt{resus1}             &\syrthes calculation restart file (1 time step)\\
 
315
&        \texttt{resusc1}            &\syrthes chronological solid
 
316
                                      post-processing file\\
 
317
&                                    &(may be transformed into the {\em EnSight}
 
318
                                      format\\
 
319
&                                    &with the {\em syrthes2ensight} utility)\\
 
320
\end{tabular}
 
321
\end{table}
313
322
 
314
323
%==================================
315
324
\subsubsection{\CS Kernel library files}
342
351
\texttt{elec} (electric module),
343
352
\texttt{fuel} (heavy fuel oil combustion module),
344
353
\texttt{lagr} (Lagrangian module,
345
 
\texttt{mati} (Matisse module),
346
354
\texttt{pprt} (general specific physics routines) and
347
355
\texttt{rayt} (radiative heat transfer).
348
356
The case preparer command \texttt{code\_saturne~create} copies all these files
349
357
in the user directory \texttt{SRC/REFERENCE} during the case preparation.
350
358
 
351
 
The ``include'' files are available in the directory
352
 
\texttt{include}, under similar subdirectories corresponding to each module:
353
 
\texttt{base}, \texttt{cfbl}, \texttt{cogz}, \texttt{cplv}, \texttt{elec},
354
 
\texttt{fuel}, \texttt{lagr}, \texttt{mati}, \texttt{pprt} and \texttt{rayt}.
355
 
 
356
359
The directory \texttt{bin} contains an example of the launch script, the
357
360
compilation parameter files and various utility programs.
358
361
 
359
362
%==================================
360
 
\subsection{Setting up and running of a calculation}
 
363
\subsection{Setting up and running a calculation}
361
364
%==================================
362
365
 
363
366
%==================================
377
380
\S\ref{prg_environementCS}).
378
381
 
379
382
\item Prepare the different directories using the \texttt{code\_saturne~create}
380
 
command (see \S\ref{prg_cscreate}) and, when needed, add the directories
381
 
\texttt{DATA\_SYR} and \texttt{SRC\_SYR} which are required to accomodate the
382
 
\syrthes files.
 
383
command (see \S\ref{prg_cscreate}).
383
384
 
384
 
\item Place the mesh(es) in the directory \texttt{MESH}. Make sure they are
 
385
\item It is recommendned to place the mesh(es) in the directory \texttt{MESH},
 
386
but they may be selected from other directories. Make sure they are
385
387
in a format compliant with \CS (see \S\ref{prg_maillages}). There can be
386
388
several meshes in case of mesh joining or coupling with
387
 
\syrthes\footnote{\syrthes uses meshes composed of 10-node tetrahedra (vertices
388
 
and centers of edges)}.
 
389
\syrthes\footnote{\syrthes 3 uses meshes composed of 10-node tetrahedra (vertices
 
390
and centers of edges, \syrthes 4 uses meshes composed of 4-node tetrahedra}.
389
391
 
390
392
\item Go to the directory \texttt{DATA} and launch the
391
 
      Graphical User Interface using the command \texttt{./SaturneGUI} (see
392
 
\S\ref{prg_gui}).
 
393
      Graphical User Interface using the command \texttt{./SaturneGUI}.
 
394
 
 
395
\item If not using the GUI, copy the
 
396
  \texttt{DATA/REFERENCE/cs\_user\_scripts.py} file to \texttt{DATA} and
 
397
  edit it, so that the correct run options and paths may be set. For advanced
 
398
  uses, this file may also be used in conjunction with the GUI. Jus as with
 
399
  user Fortran subroutines below, settings defined in this file have priority
 
400
  over those defined in the GUI.
393
401
 
394
402
\item Place the necessary user subroutines in the directory \texttt{SRC} (see
395
403
\S\ref{prg_ssprgutilis}). When not using the Interface, some subroutines are
416
424
        \end{list}
417
425
    \end{list}
418
426
 
419
 
  \item{\bf For the specific physics ``gas combustion'':}
 
427
  \item{\bf For the ``gas combustion'' specific physics:}
420
428
 
421
429
(not accessible through the Graphical User Interface in version \verscs)
422
430
    \begin{list}{}{}
448
456
        \end{list}
449
457
    \end{list}
450
458
 
451
 
  \item{\bf For the specific physics ``coal combustion'':}
 
459
  \item{\bf For the ``coal combustion'' specific physics:}
452
460
 
453
461
    \begin{list}{}{}
454
462
        \item {\em compulsory without Graphical User Interface:}
475
483
        \end{list}
476
484
    \end{list}
477
485
 
478
 
     \item{\bf For the specific physics ``electric module''
 
486
     \item{\bf For the ``electric module'' specific physics
479
487
      (Joule effect and electric arcs):}
480
488
 
481
489
(not accessible through the Graphical User Interface in version \verscs)
507
515
        \end{list}
508
516
    \end{list}
509
517
 
510
 
     \item{\bf For the specific physics ``heavy fuel oil combustion module'':}
 
518
     \item{\bf For the ``heavy fuel oil combustion module'' specific physics:}
511
519
 
512
520
(not accessible through the Graphical User Interface in version \verscs)
513
521
    \begin{list}{}{}
588
596
      external data (input profiles, thermochemical data files, ...)
589
597
 
590
598
\item Prepare the launch script \texttt{runcase}, directly or through the
591
 
      Graphical Interface (see \S\ref{prg_runcase})
 
599
      Graphical Interface (see \S\ref{prg_runcase}), or prepare the
 
600
      \texttt{DATA/cs\_user\_scripts.py} file.
592
601
 
593
602
\item Run the calculation and analyse the results
594
603
 
595
 
\item Purge the temporary files (in the directory \texttt{RUN} defined
596
 
      in the launch script, see \S\ref{prg_runcase})
 
604
\item Purge the temporary files (in \texttt{RESU/<run\_id>} or
 
605
      \texttt{<scratch>/<run\_id>} directory).
597
606
\end{list}
598
607
 
599
608
 
601
610
\subsubsection{Temporary execution directory}
602
611
%==================================
603
612
\label{prg_temporarydirectory}%
604
 
During a calculation, \CS uses a temporary directory for the compilation and
605
 
the execution, the result files being only copied at the end in the directory
606
 
\texttt{RESU}. This temporary directory is defined in the variable \texttt{RUN}
607
 
of the launch script. This variable is set top a default value in the non-user
608
 
section of the launch script, depending on the architecture:\\
609
 
\texttt{RUN=\$HOME/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm} for stand-alone
610
 
workstations or for the Chatou cluster\\
611
 
\texttt{RUN=\$SCRATCHDIR/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm} for
612
 
Platine at the CCRT\\
613
 
where \texttt{\$STUDY} and \texttt{\$CASE} are the names of the study and the
614
 
case. The usual suffix with the date and time is added so that successive
615
 
calculations will not get mixed-up.
616
 
 
617
 
This default value might not always be the optimal choice. Indeed, on a
618
 
stand-alone machine, it might be useful to take advantage of large sized local
619
 
disks on a machine when the \texttt{\$HOME} account is on an NFS disk.
620
 
 
621
 
For this matter, the variable \texttt{CS\_TMP\_PREFIX} of the launch script (see
622
 
\S\ref{prg_runcase}) allows  the user to change this directory.
623
 
If the variable is empty, the default
624
 
\texttt{RUN} directory will be used. If it is not empty, the launch script will
625
 
set the \texttt{RUN} directory to
626
 
\texttt{\$CS\_TMP\_PREFIX/tmp\_Saturne/\$STUDY/\$CASE.mmddhhmm}.
 
613
During a calculation, \CS may use a temporary directory for the compilation and
 
614
the execution if such a ``scratch'' directory is defined. In that case, the
 
615
result files are only copied at the end in the directory
 
616
\texttt{RESU}. This is recommended if the compute environment includes different
 
617
filesystems, some better suited to data storage, others to intensive I/O.
 
618
If this is not the case, there is no point in running in a scratch directory
 
619
rather than the results directory, as this incurs additional file copies.
627
620
 
628
621
\noindent
629
 
{\em WARNING: in most cases, the temporary directories are not deleted
630
 
after a calculation. They will  accumulate and may hinder the correct running of
631
 
the machine.\\
 
622
{\em WARNING: in case of an error, the temporary directories are not deleted
 
623
after a calculation, so that they may be used for debugging. They may then
 
624
accumulate and may hinder the correct operation of the machine.\\
632
625
\centerline{\bf It is therefore essential to remove them regularly.}}
633
626
 
634
627
 
637
630
%==================================
638
631
\label{prg_executionmodes}%
639
632
As explained before, \CS is composed of two main modules, the Preprocessor and the
640
 
Kernel, and an optional Partitioner. The Preprocessor reads the meshes and
641
 
performs the necessary joinings. The Partitioner optimizes domain decomposition
642
 
for parallel runs. The resulting data is transfered to the Kernel through specific
643
 
files, named \texttt{preprocessor\_output} and \texttt{domain\_number\_*}, where
 
633
Kernel, and an optional Partitioner. The Preprocessor reads the meshes.
 
634
The Partitioner optimizes domain decomposition for parallel runs.
 
635
The resulting data is transfered to the Kernel through specific
 
636
files, named \texttt{mesh\_input} and \texttt{domain\_number\_*}, where
644
637
\texttt{*} is the number of processors used. In a standard calculation, the files
645
638
are not copied from the temporary execution directory to the results directory,
646
639
as they have no interest for data analysis, and are considered ``internal''
647
640
files, whose format or contents is not guaranteed not to change between \CS versions.
648
641
 
649
 
Yet, the Preprocessor and Partitioner do not work in parallel and may require a
650
 
large amount of memory. Hence it is sometimes useful to run them
 
642
Yet, the Preprocessor does not run in parallel and may require a
 
643
large amount of memory. Similarly, the Partitioner may be run on a
 
644
reduced number of processors to obtain a better partition quality, so it
 
645
is sometimes useful to run the Preprocessor and Partitioner
651
646
separately, on a machine or in batch queues with extended memory, and to run the
652
647
proper parallel calculation on another machine or in another batch
653
648
queue. The launch scripts therefore allows specifically choosing
654
 
which modules to run, using the variables \texttt{EXEC\_PREPROCESS},
655
 
\texttt{EXEC\_PARTITION}, and \texttt{EXEC\_KERNEL} (see \S\ref{prg_runcase}).
 
649
which modules to run, either through the GUI or through \texttt{cs\_user\_scripts.py}:
656
650
 
657
651
\sloppy
658
652
 
659
 
\hspace*{0.5cm} If \texttt{EXEC\_PREPROCESS=no}, the Partitioner and Kernel will
660
 
copy or link the file defined by the \texttt{PREPROCESSOR\_OUTPUT\_IN}
661
 
variable to \texttt{preprocessor\_output}.
662
 
 
663
 
\hspace*{0.5cm} If \texttt{EXEC\_PARTITION=no}, the Kernel will search for a
664
 
corresponding \texttt{domain\_number\_*} file in the directory defined by
665
 
\texttt{PARTITION\_OUTPUT\_IN}.
666
 
 
667
 
\hspace*{0.5cm} If \texttt{EXEC\_KERNEL=no}, the Preprocessor and Partitioner
668
 
output will be saved respectively to a
669
 
\texttt{\$RESU/preprocessor\_output.\$SUFFIX} file
670
 
and to a \texttt{\$RESU/PARTITION\_OUTPUT.\$SUFFIX} directory.
671
 
In this case, the number of processors for which partitioning is required
672
 
is given by the \texttt{PARTITION\_LIST} variable of the launch script
673
 
(multiple partitionings may be done in one run).
 
653
\hspace*{0.5cm} If a {mesh\_input} file or directory is defined (which may be
 
654
either a {mesh\_input} from a previous Preprocessor run or a {mesh\_output}
 
655
from a previous solver run), the script will copy or link it to
 
656
the execution directory, and the Preprocessor will not be run again.
 
657
 
 
658
\hspace*{0.5cm} If \texttt{domain.exec\_partition = False}, the Partitioner
 
659
will not be run. A previous partitioning may be used by defining the
 
660
\texttt{domain.partition\_input} path.
 
661
 
 
662
\hspace*{0.5cm} If \texttt{domain.exec\_kernel = False}, the Kernel will not
 
663
be run. This is useful when only the mesh import and optionnaly partitioning
 
664
stages are required.
674
665
 
675
666
\fussy
676
667
 
 
668
It is encouraged to separate the mesh import and calculation runs, as
 
669
this speeds up calculations by not re-importing meshes for each run.
 
670
For some configurations, such as IBM Blue Gene machines with different
 
671
front-end an compute nodes, mesh import may be impossible on the
 
672
compute nodes (as the Preprocessor does not run in parallel, and may require
 
673
too much memory), so mesh import (and serial partitioning) should be
 
674
run separately on the front-end nodes, while later calculation stages
 
675
should be run on compute nodes.
 
676
 
 
677
Note also that depending on its configuration, the Partitioner may
 
678
be run either or both in serial or parallel mode. By default, serial
 
679
mode is currently chosen (due to limited feedback on partitioning
 
680
quality in parallel mode), but setting \texttt{domain.partition\_n\_procs}
 
681
to a value greater than 1 in the user scripts allows running
 
682
the Partitioner in parallel.
 
683
 
677
684
%==================================
678
685
\subsubsection{Interactive modification of the target time step}
679
686
%==================================
714
721
\texttt{DEBIT3} and \texttt{DEBIT4}.
715
722
 
716
723
An option \texttt{--nogui} is available for the use of \CS
717
 
without Graphic Interface (see \S\ref{prg_gui}). This option must
 
724
without Graphic Interface. This option must
718
725
be either the first or the last argument and appear only once.
719
726
 
720
727
In the directory \texttt{DATA}, the \texttt{code\_saturne~create} command
763
770
 
764
771
\item \hyperref[fmtdesc:des]{\simail (NOPO)}
765
772
\item \hyperref[fmtdesc:unv]{\ideas universal}
766
 
\item \hyperref[fmtdesc:igghexa]{NUMECA IGG/Hexa}
767
773
\item \hyperref[fmtdesc:med]{\med}
768
774
\item \hyperref[fmtdesc:cgns]{CGNS}
769
775
\item \hyperref[fmtdesc:ensight6]{\ensight 6}
828
834
Volume elements:   & tetrahedra, prisms, hexahedra\\
829
835
\hline
830
836
Zone selection:    & element face references and volume sub-domains\\
831
 
                   & (interpreted as numbered colors)\\
 
837
                   & (interpreted as numbered groups)\\
832
838
\hline
833
839
Compatibility:     & all files of this type as long as the coordinate
834
840
                     system used is Cartesian and not cylindrical or
879
885
\hline
880
886
Volume elements:   & tetrahedra, prisms, hexahedra\\
881
887
\hline
882
 
Zone selection:    & colors (systematic) and named groups\\
 
888
Zone selection:    & colors (always) and named groups\\
883
889
\hline
884
890
Compatibility:     & \ideas (\emph{Master Series} 5 to 9, \emph{NX Series} 10 to 12)
885
891
                     at least\\
930
936
when considering definition of descriptions), so support for this format
931
937
is lightly tested.
932
938
 
933
 
Currently, geometric entity numbers are converted to ``color'' numbers.
934
 
This tends to lead to a large number of colors.
 
939
Currently, geometric entity numbers are converted to group numbers.
 
940
This tends to lead to a large number of groups.
935
941
 
936
942
\smallskip \noindent
937
943
\begin{tabular}[top]{|p{4.5cm}%
946
952
Volume elements:   & polyhedra\\
947
953
\hline
948
954
Zone selection:    & face and cell sets\\
949
 
                   & (interpreted as numbered colors)\\
 
955
                   & (interpreted as numbered groups)\\
950
956
\hline
951
957
Compatibility:     & all files of this type ? (tested on purely polyhedral meshes)\\
952
958
\hline
965
971
of ADF modified for performance, but also works with a standard version
966
972
from CGNS.
967
973
 
968
 
Currently, geometric entity numbers are converted to ``color'' numbers,
 
974
Currently, geometric entity numbers are converted to numbered groups,
969
975
with the corresponding names printed to the \pcs log. Depending on whether
970
976
the names were generated automatically or set by the user, it would be
971
 
preferable to interpret such sets as named ``groups'' rather than numbered
972
 
``colors''.
 
977
preferable to use the original group names rather than base their
 
978
names on their numbers.
973
979
 
974
980
The CCMIO library is distributed freely by CD-Adapco upon demand.
975
981
 
986
992
Volume elements:   & polyhedra\\
987
993
\hline
988
994
Zone selection:    & named face and cell sets\\
989
 
                   & (interpreted as numbered colors, with names appearing in log)\\
 
995
                   & (interpreted as numbered groups, with names appearing in log)\\
990
996
\hline
991
997
Compatibility:     & all files of this type ? (tested on purely polyhedral meshes)\\
992
998
\hline
1009
1015
mesh may also be separated into several \emph{parts} so as to identify
1010
1016
different zones. As \emph{part} names may contain up to 80 characters,
1011
1017
we do not transform them into groups (whose names could be unwieldy),
1012
 
so we simply interpret their number as a color.
 
1018
so we simply convert their numbers to group names.
1013
1019
 
1014
1020
Also note that files produced by \harpoon may contain badly oriented
1015
1021
prisms, so the \pcs orientation correction option
1016
1022
(\texttt{--reorient})may need to be used. Meshes built by this tool also
1017
1023
contain hanging nodes, with non-conforming elements sharing some vertices.
1018
 
The \texttt{--join --semi-conf} preprocessor option must thus be used.
1019
 
This option is not set automatically, as the user may prefer to specify
1020
 
which surfaces should be joined, and which ones should not (i.e. to
1021
 
conserve thin walls).
 
1024
Mesh joining must thus also be used, and is not activated automatically,
 
1025
as the user may prefer to specify which surfaces should be joined,
 
1026
and which ones should not (i.e. to conserve thin walls).
1022
1027
 
1023
1028
\smallskip \noindent
1024
1029
\begin{tabular}[top]{|p{4.5cm}%
1036
1041
\hline
1037
1042
Volume elements:   & tetrahedra, pyramids, prisms, hexahedra\\
1038
1043
\hline
1039
 
Zone selection:    & part numbers interpreted as color numbers\\
 
1044
Zone selection:    & part numbers interpreted as numbered groups\\
1040
1045
\hline
1041
1046
Compatibility:     & All files of this type\\
1042
1047
\hline
1043
1048
Documentation:     & online documentation, also available at:
1044
 
                     \url{http://www.ensight.com/Downloads/}\\
 
1049
                     \href{http://www.ensight.com/downloads/cat\_view-5.html}
 
1050
                          {http://www.ensight.com/downloads/cat\_view-5.html}\\
1045
1051
\hline
1046
1052
\end{tabular}
1047
1053
 
1062
1068
arbitrary number of labels with each element, but files produced
1063
1069
by \gmsh use 2 labels, with the same meanings as with version 1.
1064
1070
 
1065
 
We chose to convert physical entity numbers to colors. It is possible
 
1071
We chose to convert physical entity numbers to groups. It is possible
1066
1072
to build a mesh using \gmsh without defining any  physical entities
1067
 
(in which case all elements will have the same color, but the \gmsh
 
1073
(in which case all elements will belong to the same group, but the \gmsh
1068
1074
documentation clearly says that geometric entities are to be used
1069
1075
so as to group elementary entities having similar ``physical'' meanings.
1070
1076
 
1071
 
So as to obtain distinct colors with a mesh generated by \gmsh, it
 
1077
So as to obtain distinct groups with a mesh generated by \gmsh, it
1072
1078
is thus necessary for the user to define physical entities.
1073
1079
This requires an extra step, but allows for fine-grained control
1074
 
over the colors associated with the mesh, while using only elementary
1075
 
entities could lead to a high number of colors.
 
1080
over the groups associated with the mesh, while using only elementary
 
1081
entities could lead to a high number of groups.
1076
1082
 
1077
1083
\smallskip \noindent
1078
1084
\begin{tabular}[top]{|p{4.5cm}%
1086
1092
\hline
1087
1093
Volume elements:   & tetrahedra, pyramids, prisms, hexahedra\\
1088
1094
\hline
1089
 
Zone selection:    & physical entity numbers interpreted as color numbers\\
 
1095
Zone selection:    & physical entity numbers interpreted as numbered groups\\
1090
1096
\hline
1091
1097
Compatibility:     & all files of this type\\
1092
1098
\hline
1096
1102
\hline
1097
1103
\end{tabular}
1098
1104
 
1099
 
\subsubsubsection{IGG/Hexa (NUMECA)%
1100
 
\label{fmtdesc:igghexa}}
1101
 
 
1102
 
This format is quite peculiar in the sense that it defines a hierarchical mesh
1103
 
built exclusively of hexahedra, of quadrangular faces, and of edges, in which
1104
 
edges may be split in 2, faces in 2 or 4, and cells in 2, 4, or 8. Two
1105
 
neighboring elements are thus not always conforming. The \pcs only keeps the
1106
 
finest mesh level, and uses the hierarchical information so as to
1107
 
automatically build the appropriate conformal joining. CAD face
1108
 
information is transformed into color numbers.
1109
 
 
1110
 
\noindent
1111
 
\parbox[t]{.15\linewidth}{{\bf Remark}:}
1112
 
\parbox[t]{.85\linewidth}{
1113
 
  The reader is based on the IGG/Hexa format as it was defined at the end of
1114
 
  2001. Since that time, the mesher seems to have been renamed $HEXPRESS^{TM}$, and
1115
 
  we do not have any recent documentation or test file. For this reason,
1116
 
  support for this format is not directly included in the main \pcs executable,
1117
 
  but requires conversion using the \texttt{igghexa\_to\_med} tool.
1118
 
}
1119
 
 
1120
 
\smallskip \noindent
1121
 
\begin{tabular}[top]{|p{4.5cm}%
1122
 
                     |>{\PreserveBackslash\raggedright\hspace{0pt}}p{10.5cm}|}
1123
 
\hline
1124
 
Default extension: & {\tt .hex}\\
1125
 
\hline
1126
 
File type:         & portable binary by default
1127
 
                     (4-byte integers, 8-byte IEEE double-precision reals,
1128
 
                     big-endian), or text\\
1129
 
\hline
1130
 
Surface elements:  & quadrangles\\
1131
 
\hline
1132
 
Volume elements:   & hexahedra\\
1133
 
\hline
1134
 
Zone selection:    & no volume selection, CAD surface numbers interpreted as
1135
 
                     colors\\
1136
 
\hline
1137
 
Compatibility:     & unknown (at least files from late 2001 are readable)\\
1138
 
\hline
1139
 
Documentation:     & elements provided by NUMECA (\href{http://www.numeca.be}
1140
 
                                                       {http://www.numeca.be})
1141
 
                     in 2001.\\
1142
 
\hline
1143
 
\end{tabular}
1144
 
 
1145
1105
%==================================
1146
1106
\subsubsection{Formats supported for input or output\label{cha:formats_inout}}
1147
1107
%==================================
1166
1126
do not necessarily support the whole format specification.
1167
1127
Especially, VTK does not support material types, and has only recently
1168
1128
added support for polyhedral elements in \ensightg files (interpreted
1169
 
as convex point sets, and not true polyhedra, but at least usable).
 
1129
as convex point sets in \paraview versions 2.4 to 2.8, and as true
 
1130
polyhedra starting with \paraview versions 2.10).
1170
1131
Also, both \ensightg (8.2 and above) and VTK allow for automatic distribution,
1171
1132
reducing the usefulness of pre-distributed meshes with per-processor files.
1172
1133
 
1176
1137
volume zones may only be considered to be part of the same mesh
1177
1138
if the file defines vertex IDs (which we consider to be
1178
1139
unique vertex labels). In this case, \emph{part} numbers
1179
 
are interpreted as colors. Without vertex IDs, only one part is read,
1180
 
and no colors are assigned.
 
1140
are interpreted as group names. Without vertex IDs, only one part is read,
 
1141
and no groups are assigned.
1181
1142
 
1182
1143
\smallskip \noindent
1183
1144
\begin{tabular}[top]{|p{4.5cm}%
1193
1154
Volume elements:   & tetrahedra, pyramids, prisms, hexahedra, convex polyhedra\\
1194
1155
\hline
1195
1156
Zone selection:    & possibility of defining element materials (not used), or
1196
 
                     interpret part number as color number if vertex IDs are
 
1157
                     interpret part number as group name if vertex IDs are
1197
1158
                     given\\
1198
1159
\hline
1199
1160
Compatibility:     & files readable by \ensight 7.4 to 9.0, as well as tools
1201
1162
                     especially \paraview\ (\url{http://www.paraview.org})\\
1202
1163
\hline
1203
1164
Documentation:     & online documentation, also available at:
1204
 
                     \url{http://www.ensight.com/Downloads/}\\
 
1165
                     \url{http://www.ensight.com/downloads/cat\_view-5.html}\\
1205
1166
\hline
1206
1167
\end{tabular}
1207
1168
 
1245
1206
\hline
1246
1207
Zone selection:    & element families ({\it i.e.} colors and groups)\\
1247
1208
\hline
1248
 
Compatibility:     & \med 2.3.5, \med 2.3.6, or \med 3.0.2 and above (only unstructured
1249
 
                     nodal connectivity is supported)\\
 
1209
Compatibility:     & \med 2.3.5, \med 2.3.6, or \med 3.0.2 and above
 
1210
                     (only unstructured nodal connectivity is supported)\\
1250
1211
\hline
1251
1212
Documentation:     & online documentation. Download link at \url{http://files.salome-platform.org/Salome/other/med-3.0.3.tar.gz}\\
1252
1213
\hline
1335
1296
                     selection, but the \pcs allows creation of groups associated to
1336
1297
                     zones or sections in the mesh using mesh selection sub-options\\
1337
1298
\hline
1338
 
Compatibility:     & CGNS 2.5 or 3.1 on output\\
 
1299
Compatibility:     & CGNS 2.5 or CGNS 3.1\\
1339
1300
\hline
1340
1301
Documentation:     & See CGNS site: \url{http://www.cgns.org}\\
1341
1302
\hline
1342
1303
\end{tabular}
1343
1304
 
1344
1305
%==================================
1345
 
\subsubsection{Mesh meta-files}
1346
 
%==================================
1347
 
 
1348
 
The \pcs allows use of text files (preferably with a {\tt .mesh} extension)
1349
 
describing a set of meshes and their transformations, in place of (or
1350
 
combined with) ``true'' mesh files. These meta-files are
1351
 
described here:
1352
 
 
1353
 
Empty lines are ignored, and the \# character may be used to define
1354
 
comments (the part of a line following this character is ignored).
1355
 
 
1356
 
One may request the reading of as many meshes as one needs, using
1357
 
for each mesh a section such as:
1358
 
 
1359
 
\noindent
1360
 
\verb+read_mesh:+ {\it filename}
1361
 
 
1362
 
or:
1363
 
 
1364
 
\noindent
1365
 
\verb+read_mesh:+ {\it filename} {\tt <sub-options>}
1366
 
 
1367
 
If this section type appears more than once, the corresponding meshes
1368
 
are automatically appended. If needed, a mesh meta-file may itself
1369
 
declare another meta-file as a mesh file.
1370
 
Possible sub-options associated with a file may be separated by commas,
1371
 
semicolumns, or spaces, and are of the following form:
1372
 
 
1373
 
\noindent
1374
 
\begin{tabular}[top]{ p{2.5cm}%
1375
 
                     >{\PreserveBackslash\raggedright\hspace{0pt}}p{12.5cm} }
1376
 
{\tt format=}   & {format name (identical to command-line options)}\\
1377
 
{\tt num=}      & {mesh number (useful when a file contains multiple meshes)}\\
1378
 
{\tt grp\_cel=} & {{\tt <section} or {\tt zone>}, useful only for files in
1379
 
                    CGNS format}\\
1380
 
{\tt grp\_fac=} & {{\tt <section} or {\tt zone>}, useful only for files in
1381
 
                    CGNS format}\\
1382
 
\end{tabular}
1383
 
 
1384
 
\smallskip
1385
 
It is also possible to define a geometric transformation to apply to a mesh,
1386
 
using a homogeneous coordinates transformation matrix (3 lines, 4 columns,
1387
 
with the 3 first columns describing a rotation/scaling factor,
1388
 
and the last column describing a translation. The corresponding section
1389
 
is as follows (values may be spread over several lines):
1390
 
 
1391
 
\noindent
1392
 
\verb+transformation_matrix:+ $t_{11}$ $t_{12}$ $t_{13}$ $t_{14}$
1393
 
$t_{21}$ $t_{22}$ $t_{23}$ $t_{24}$ $t_{31}$ $t_{32}$ $t_{33}$ $t_{34}$\\
1394
 
 
1395
 
Note that the order in which multiple meshes are declared defines the
1396
 
order in which they are read and appended, but the geometric transformation
1397
 
is only applied at the end (this is a description file, not a command file).
1398
 
If multiple transformations are needed, a hierarchy of mesh meta-files
1399
 
may be used.
1400
 
 
1401
 
%==================================
1402
1306
\subsubsection{Meshing tools and associated formats}
1403
1307
%==================================
1404
1308
 
1420
1324
 
1421
1325
The use of files of the ``Common Solver'' type\footnote{File type specifically
1422
1326
developed for the early prototype versions of \CS (\texttt{tlc}) extension}
1423
 
is still possible but is deprecated. Such files are read directly from the
1424
 
Kernel, without the \pcs.
1425
 
The variable SOLCOM must
1426
 
 be set to 1 in the launch scripts. Many potentialities of \CS are not
 
1327
is still in part possible but is deprecated. Such files are read directly
 
1328
from the Kernel, and this format is not handled by the launch
 
1329
scripts anymore. Many potentialities of \CS are not
1427
1330
usable with this file format (mesh joining with hanging nodes, periodicity,
1428
1331
parallel computing, ...).
1429
 
For all the other formats, the \pcs must be used (SOLCOM=0).
1430
1332
 
1431
1333
%==================================
1432
1334
\subsubsection{Meshing remarks}
1450
1352
\begin{list}{$\bullet$}{}
1451
1353
\item \texttt{--help}: gives a summary of the different command line options
1452
1354
 
1453
 
\item \texttt{-m mesh1 mesh2}: used to specify the names of the different meshes
1454
 
used. The launch script automatically calls the Preprocessor with the option
1455
 
\texttt{-m \$MESH}, where \texttt{MESH} is the variable where the user has
1456
 
specified the different meshes to be used.
1457
 
 
1458
 
\item \texttt{--join}: triggers the mesh joining functions. If nothing more is
1459
 
specified, every area of contact between two meshes will be joined together. The
1460
 
joining can be limited to certain selected faces. For instance, to join only
1461
 
the faces of colors 6 and 7, the full option will be \mbox{\texttt{--join --color
1462
 
6 7}}. These options are to be specified in the \texttt{COMMAND\_JOIN} variable in
1463
 
the launch script, to be automatically passed to the command line.
1464
 
 
1465
 
\item \texttt{--perio}: triggers periodic boundary conditions. Two types of
1466
 
periodic boundaries are possible: translation or rotation (see
1467
 
\S\ref{prg_paralperio} for additional details). For the translation, the basic
1468
 
option line is \texttt{--perio --trans tx ty tz}\\
1469
 
where \texttt{tx}, \texttt{ty} and \texttt{tz} are the coordinates of the
1470
 
translation vector. For the rotation, there are two possibilities. The
1471
 
transformation can be defined with a rotation angle (in degrees, between -180
1472
 
and 180), a direction  and an
1473
 
invariant point\\
1474
 
\texttt{--perio --rota --angle a --dir dx dy dz --invpt px py pz}\\
1475
 
(with obvious notations), or by giving the rotation matrix and an invariant point\\
1476
 
\texttt{--perio --rota --matrix m11 m12 m13 m21 m22 m23 m31 m32 m33 --invpt px py
1477
 
pz}\\
1478
 
A rotation and a translation can be combined, by giving both \texttt{--rota} and
1479
 
\texttt{--trans} specifications. The translation will always be applied first,
1480
 
whatever the order in which the rotation and the translation have been given.\\
1481
 
The orientation of the transformations is not important since both the
1482
 
transformation and its inverse will be used to connect faces. Yet, when
1483
 
combining a translation and a rotation, the orientations given for both have to
1484
 
be consistent.\\
1485
 
It is possible (and usually recommended) to restrict the  search for periodic
1486
 
connections between faces to a certain group of faces, by adding selection
1487
 
arguments like \texttt{--color}. It is also possible to specify up to 3
1488
 
independent periodicities, simply by repeating the \texttt{--perio} option. Below
1489
 
is given a example of the option line for a triple periodicity (the \verb+\+
1490
 
indicates the continuation of the command line):\\
1491
 
\texttt{--perio --trans -10.2 0 0 --color 2} \verb+\+\\
1492
 
\texttt{--perio --rota --angle 90 --dir 0 0 1 --invpt 0 0 0 --color 3 4} \verb+\+\\
1493
 
\texttt{--perio --trans 0 1 0 --rota --matrix 1 0  0 0 0 -1 0 1 0 --invpt 0 0 -0.2}\\
1494
 
This option is to be specified in the \texttt{COMMAND\_PERIO} variable in
1495
 
the launch script, to be automatically passed to the command line.
 
1355
\item \texttt{<mesh>}: the last argumen is used to specify the name of the mesh file.
 
1356
The launch script automatically calls the Preprocessor for every
 
1357
mesh in the \texttt{MESHES[]} list specified by th user.
1496
1358
 
1497
1359
\item \texttt{--reorient}: try to re-orient badly-oriented cells
1498
1360
if it is necessary to compensate for mesh-generation software
1508
1370
controlled by the launch script. The potential command line options are passed
1509
1371
through user modifiable variables at the beginning of the script. This way, the
1510
1372
user only has to fill these variables and doesn't need
1511
 
to search deep in the script for the Kernel command line. Yet, below is given
1512
 
the complete list of options, with the variables in which they should be
1513
 
specified in the script.
 
1373
to search deep in the script for the Kernel command line. For more advanced
 
1374
usage, the main options are described below:
1514
1375
 
1515
1376
\begin{list}{$\bullet$}{}
1516
1377
\item \texttt{--solcom}: this option indicates that the Kernel will read the
1517
1378
mesh directly, not using the Preprocessor output files. This is only possible
1518
1379
with ``Common Solver'' type of mesh files (see \S\ref{prg_maillages} for
1519
1380
restrictions).\\
1520
 
This option is triggered by the \texttt{SOLCOM} variable in the launch
1521
 
script. If \texttt{SOLCOM} is set to 1, the \texttt{-solcom} option is
1522
 
automatically added to the Kernel command line. The variable
1523
 
\texttt{ifoenv\index{ifoenv}} in the Fortran code will be set to 0 if the
1524
 
\texttt{--solcom} option has been used, otherwise it will be set to 1.
 
1381
This option is obsolete, and is not handled by the launch script anymore.
 
1382
 
 
1383
\item \texttt{--app-name}: specifies the application name. This is
 
1384
useful only in the case of code coupling, where the application name
 
1385
is used to distinguish between different code instances launched together.
1525
1386
 
1526
1387
\item \texttt{--mpi}: specifies that the calculation is running
1527
1388
with MPI communications. The number of processors used will be determined
1528
 
automatically by the Kernel. If necessary, the launch script automatically
1529
 
passes the \texttt{--mpi} option to the Kernel command line
1530
 
(see \ref{prg_runcase}).
 
1389
automatically by the Kernel. With most MPI implementations, the
 
1390
code will detect the presence of an MPI environment automatically, and
 
1391
this option is redundant. It is only kept for the rare case in which the
 
1392
MPI environment might not be detected.
 
1393
 
 
1394
\item \texttt{--mpi-io}: specifies that if MPI-IO should be used where
 
1395
available, and which mode should be used (\texttt{off} to disable,
 
1396
\texttt{eo} for explicit offsets, and \texttt{ip} for individual file
 
1397
pointers). MPI-IO is only available when running with MPI, and may improve
 
1398
performance only on parallel file systems. In other cases, it will incurr
 
1399
additional overhead.
 
1400
 
 
1401
\item \texttt{--preprocess}: triggers the preprocessing-only mode.
 
1402
The code may run without any Interface parameter file nor any user subroutine.
 
1403
Only the initial operations such as mesh joining and modification are
 
1404
executed.
1531
1405
 
1532
1406
\item \texttt{-q} or \texttt{--quality}: triggers the verification mode.
1533
 
The code runs without any Interface parameter file nor any user subroutine.
1534
 
The mesh is read and elementary tests are performed:\\
 
1407
The code may run without any Interface parameter file nor any user subroutine.
 
1408
This mode includes the preprocessing stages, and adds elementary tests:\\
1535
1409
\begin{list}{-}{}
1536
1410
\item the quality criteria of the mesh are calculated (non-orthogonality angles,
1537
1411
internal faces off-set, \ldots) and corresponding EnSight
1539
1413
\item test calculation of the gradient of $sin(x+2y+3z)$. The calculated
1540
1414
value is compared to the exact value, and an EnSight part for the
1541
1415
corresponding error is created. The gradient is calculated with each
1542
 
option IMRGRA from $0$ to $4$.\\
 
1416
option \texttt{imrgra} from $0$ to $4$.\\
1543
1417
\end{list}
1544
 
The command \texttt{-q} is to be placed in the \texttt{ARG\_CS\_VERIF}
1545
 
variable in the launch script to be added automatically to the Kernel
1546
 
command line.\\
1547
 
 
1548
 
\item \texttt{--cwf}: triggers the cutting of boundary and internal faces which
1549
 
have a warp angle larger than a certain limit\footnote{the warp angle is an
1550
 
indicator of the non-coplanarity of the different vertices of the face}. The
1551
 
concerned faces are divided into triangles. This option is to handle with care,
1552
 
since the division of the faces increases the non-orthogonalities of the mesh,
1553
 
but it is sometimes required (for the Lagrangian modeling, for instance, where
1554
 
non-plane faces lead to noticeable particle loss). By default, the faces are
1555
 
divided if their warp angle is larger than 0.01 degrees. This default value can
1556
 
be changed by adding an optional angle value to the command. For instance, to
1557
 
devide faces with a warp angle larger than 0.02 degrees, the full option will
1558
 
be \mbox{\texttt{-cwf 0.02}}.\\
1559
 
This option is to be specified in the \texttt{COMMAND\_CWF} variable in
1560
 
the launch script, to be automatically passed to the command line.
1561
1418
 
1562
1419
\item \texttt{--benchmark}: triggers the benchmark mode, for a timing
1563
1420
of elementary operations on the machine. A secondary option
1574
1431
\hspace*{0.5cm}\texttt{n=0}: output directed towards the standard output\\
1575
1432
\hspace*{0.5cm}\texttt{n=1}: output redirected towards a file \texttt{listing}
1576
1433
(default behaviour)\\
1577
 
This option can be specified in the \texttt{ARG\_CS\_OUTPUT} variable of the
1578
 
launch script.
 
1434
This option can be specified in the \texttt{domain.logging\_args} field
 
1435
of the user script.
1579
1436
 
1580
1437
\item \texttt{--logp n}: specifies the destination of the output for the
1581
1438
processors of rank 1 to $N-1$ in a calculation in parallel on $N$ processors
1588
1445
\hspace*{0.5cm}\texttt{n=1}: one file for the output of each processor. The
1589
1446
output of the processors of rank 1 to $N-1$ are directed to the files
1590
1447
\texttt{listing\_n0002} to \texttt{listing\_n$N$}.
1591
 
This option can be specified in the \texttt{ARG\_CS\_OUTPUT} variable of the
1592
 
launch script.
 
1448
This option can be specified in the \texttt{domain.logging\_args} field
 
1449
of the user script.
1593
1450
 
1594
1451
\item \texttt{-p xxx} or \texttt{--param xxx}: specifies the name of the GUI
1595
1452
parameter file to use for the calculation.\\
1596
 
The value of \texttt{xxx} is to be placed in the \texttt{PARAM} variable in the launch
1597
 
script (the file will be looked for in the directory \texttt{DATA}).
1598
 
The option \mbox{\texttt{-param \$PARAM}} is automatically added to the
1599
 
Kernel command line.
 
1453
The value of \texttt{xxx} is to be defined by the \texttt{--param} option
 
1454
of \texttt{code\_saturne run}, either directly or in the standard \texttt{runcase}
 
1455
script (the file will be searched for in the \texttt{data} directory, though
 
1456
an absolute path name may also be defined).
1600
1457
 
1601
1458
\item \texttt{-h} or \texttt{--help}: to display a summary of the different
1602
1459
command line options.
1603
1460
\end{list}
1604
1461
 
1605
1462
%==================================
1606
 
\subsection{Parameters in the launch script}
 
1463
\subsection{Launch scripts}
1607
1464
%==================================
1608
1465
\label{prg_runcase}%
1609
1466
 
1610
1467
The case preparer command \texttt{code\_saturne~create} places an example of launch script,
1611
 
\texttt{runcase}, in the \texttt{SCRIPTS} directory. This script is quite general
1612
 
and known to work on every architecture \CS has been tested on. The beginning
1613
 
if the script contains the definition of certain parameters (environment
1614
 
variables) necessary to set the calculation. The second part of the script
1615
 
contains the commands for the preparation and execution of the calculation. No
1616
 
user intervention should be necessary in this second part.\\
1617
 
The Graphical User Interface allows to fill in the major
1618
 
parameters of the script without having to edit the file.
1619
 
 
1620
 
Below is a list of the different variables and parameters that might be modified
1621
 
for a calculation, in their order of apparition in the script:
1622
 
\begin{list}{$\bullet$}{}
1623
 
\item LSF headers: definition of the headers for an LSF batch system, as can be
1624
 
found on the machines of the CCRT (Platine). The data expected are
1625
 
the number of processors reserved (\texttt{\#BSUB -n}), the CPU time limit
1626
 
(\texttt{\#BSUB -W}), the name of the standard output file (\texttt{\#BSUB -o}),
1627
 
the name of the standard error file (\texttt{\#BSUB -e}) and the name of
1628
 
the job (\texttt{\#BSUB -J}).
1629
 
 
1630
 
\item PBS headers: definition of the headers for a PBS batch system, as can be
1631
 
found on the machines of the Chatou cluster. The data expected are the number of
1632
 
nodes reserved (\texttt{nodes}), the number of processors per node
1633
 
(\texttt{ppn}), the total CPU time (\texttt{walltime}), the memory reserved
1634
 
(\texttt{mem}), and the name of the job (\texttt{\#PBS -N}).
1635
 
 
1636
 
\item Manchester headers: definition of the headers for the batch system
1637
 
specific to the cluster of the University of Manchester
1638
 
 
1639
 
\item \texttt{SOLCOM}: a value of 1 will pass the \texttt{-solcom} option to the
1640
 
Kernel (see \ref{prg_optappelnoy})
1641
 
\end{list}
1642
 
 
1643
 
\begin{list}{$\bullet$}{}
1644
 
\item \texttt{STUDY}: name of the study directory (automatically set by
1645
 
\texttt{code\_saturne~create}, see \S\ref{prg_architecture})
1646
 
 
1647
 
\item \texttt{CASE}: name of the case directory (automatically set by
1648
 
\texttt{code\_saturne~create}, see \S\ref{prg_architecture})
1649
 
 
1650
 
\item \texttt{PARAM}: name of the Interface parameter file, if necessary (see
1651
 
\ref{prg_optappelnoy})
1652
 
 
1653
 
\item \texttt{MESH}: name(s) of the mesh(es) used for the calculation (see
1654
 
\ref{prg_optappelecs} and \ref{prg_maillages}). The files will be looked for in
1655
 
the directory \texttt{MESHDIR} (see below).
1656
 
 
1657
 
\item \texttt{COMMAND\_JOIN}: Preprocessor command line option for mesh joining (see
1658
 
\ref{prg_optappelecs})
1659
 
 
1660
 
\item \texttt{COMMAND\_CWF}: Kernel command line option for the division of
1661
 
faces with too large a warp angle (see \ref{prg_optappelnoy})
1662
 
 
1663
 
\item \texttt{COMMAND\_PERIO}: Preprocessor command line option for the definition
1664
 
of periodic boundary conditions (see \ref{prg_optappelecs})
1665
 
 
1666
 
\item \texttt{THERMOCHEMISTRY\_DATA}: name of the thermochemical data file, if
1667
 
necessary (the file is looked for in the directory \texttt{DATA}, see
1668
 
\S\ref{prg_usppmo})
1669
 
 
1670
 
\item \texttt{NUMBER\_OF\_PROCESSORS}: number of processors (potentially virtual)
1671
 
to be used for the calculation.\\
1672
 
If the variable is left empty, the launch script
1673
 
will fill it automatically: on a batch system, \texttt{NUMBER\_OF\_PROCESSORS}
1674
 
will be equal to the number of processors reserved; in case of an
1675
 
interactive calculation, it will be set to 1.\\
1676
 
When using a batch system,
1677
 
\texttt{NUMBER\_OF\_PROCESSORS} should ideally be equal to the number of
1678
 
processors reserved, and can never be larger (one executable per
1679
 
processor). With an interactive calculation (like a Linux PC),
1680
 
\texttt{NUMBER\_OF\_PROCESSORS} can be larger than the total number of processors
1681
 
available, although it is not recommended (loss of efficiency because several
1682
 
executables share the same processor).\\
1683
 
In case of
1684
 
coupling with \syrthes, one processor is reserved for \syrthes, and the Kernel
1685
 
of \CS will therefore automatically be set to run on
1686
 
\texttt{NUMBER\_OF\_PROCESSORS-1} processors.
1687
 
 
1688
 
\item \texttt{PROCESSOR\_LIST}: list of nodes on which the calculation is to
1689
 
be run. On batch systems, this list is set automatically by the batch
1690
 
manager. For calculations on a stand-alone machine, the list is not used. Hence,
1691
 
except for very specific test (mainly for developing purposes), it is
1692
 
recommended to leave this variable empty.
1693
 
 
1694
 
\item \texttt{USER\_INPUT\_FILES}: list of the user data files to be
1695
 
copied in the temporary execution directory before the calculation (input
1696
 
profiles for instance). The files will
1697
 
be looked for in the directory \texttt{DATA}. The thermochemical data files,
1698
 
Interface parameter file and calculation restart files are specified in other
1699
 
variables and do not need to appear here. When using the vortex method for LES
1700
 
entry conditions, the corresponding data files have to be specified in
1701
 
\texttt{USER\_INPUT\_FILES} (see \S\ref{prg_usvort})
1702
 
 
1703
 
\item \texttt{USER\_OUTPUT\_FILES}: list of user result files to be
1704
 
copied in the directory \texttt{RESU} at the end of the calculation. A directory
1705
 
\texttt{RES\_USERS.mmddhhmm} will be created in the directory \texttt{RESU} and
1706
 
all the files will be stored in it. The files automatically created by the code
1707
 
(listings, post-processing, automatic chronological records\footnote{when using
1708
 
\texttt{ushist} for user-defined chronological records, the files created need
1709
 
to be specified in \texttt{USER\_OUTPUT\_FILES}},
1710
 
restart files) do not need to be specified in
1711
 
\texttt{USER\_OUTPUT\_FILES}.
1712
 
 
1713
 
\item \texttt{CS\_TMP\_PREFIX}: alternate temporary directory for the
1714
 
calculation (see \S\ref{prg_temporarydirectory})
1715
 
 
1716
 
\item \texttt{OPTIMIZATION}: optimisation level for compilation
1717
 
 (LO, DBG, EF or PROF; see \S\ref{prg_library}). This optimisation
1718
 
level will be applied to all the modules of \CS (BASE, CFBL, COGZ, CPLV, ELEC,
1719
 
FUEL, LAGR, MATI, RAYT).
1720
 
Leaving the variable empty stands for ``standard''
1721
 
optimisation.
1722
 
 
1723
 
\item \texttt{CS\_LIB\_ADD}: additional commands for the link stage of the
1724
 
compilation. This can be especially useful if the user subroutines call routines
1725
 
provided by external libraries. To link with an external library ``foo'', the
1726
 
variable would be for instance\\
1727
 
\texttt{CS\_LIB\_ADD=``-L/opt/foo/lib -lfoo''}
1728
 
 
1729
 
\item \texttt{VALGRIND}: command to be placed before the \CS executable name on
1730
 
the execution command line ({\em i.e.} the launch script will execute the
1731
 
command \texttt{\$VALGRIND cs\_solver ...}). It is especially designed to use the
1732
 
valgrind debugging and profiling tool. The usual value to use valgrind is
1733
 
\texttt{VALGRIND=``valgrind --tool=memcheck''}
1734
 
 
1735
 
\item \texttt{ARG\_CS\_VERIF}: verification mode to be used for \CS (see
1736
 
\ref{prg_optappelnoy}). An empty variable implies standard calculation mode
1737
 
(IVERIF=0).
1738
 
 
1739
 
\item \texttt{ARG\_CS\_OUTPUT}: options for the redirection of the standard
1740
 
output (see \ref{prg_optappelnoy})
1741
 
 
1742
 
\item \texttt{ECHOCOMM}: level for the \texttt{--echo-comm} option of the Kernel
1743
 
command line (see \ref{prg_optappelnoy})
1744
 
 
1745
 
\item \texttt{ADAPTATION}: commands to trigger the automatic mesh
1746
 
adaptation with the software Homard. This option is still under development and
1747
 
restricted to developpers use.
1748
 
 
1749
 
\item \texttt{CASEDIR}: root directory of the calculation. This variable is
1750
 
automatically set by \texttt{code\_saturne~create} and should not be changed.
1751
 
 
1752
 
\item \texttt{DATA}: DATA directory of the case (see \ref{prg_architecture}).
1753
 
This variable is automatically set by \texttt{code\_saturne~create} and should not be
1754
 
changed.
1755
 
 
1756
 
\item \texttt{RESU}: RESU directory of the case (see \ref{prg_architecture}).
1757
 
This variable is automatically set by \texttt{code\_saturne~create} and should not be
1758
 
changed.
1759
 
 
1760
 
\item \texttt{SRC}: SRC directory of the case (see \ref{prg_architecture}).
1761
 
This variable is automatically set by \texttt{code\_saturne~create} and should not be
1762
 
changed.
1763
 
 
1764
 
\item \texttt{SCRIPTS}: SCRIPTS directory of the case (see
1765
 
\ref{prg_architecture}). This variable is automatically set by
1766
 
\texttt{code\_saturne~create} and should not be changed.
1767
 
 
1768
 
\item \texttt{RESTART\_IN}: directory containing the files for calculation
1769
 
restart.
1770
 
 
1771
 
\item \texttt{PREPROCESSOR\_OUTPUT\_IN}: \texttt{preprocessor\_ouput} file for a calculation in ``calculation'' mode (see \ref{prg_executionmodes})
1772
 
 
1773
 
\item \texttt{MESHDIR}: directory containing the mesh files (see
1774
 
\ref{prg_architecture}). This variable is automatically set by
1775
 
\texttt{code\_saturne~create} and should generally not be changed.
1776
 
 
1777
 
\item \texttt{DATA\_SYR}: directory for the \syrthes data. This directory has
1778
 
to be created by the user. It is advised to keep the location proposed
1779
 
in the launch script, which complies with the standard architecture
1780
 
of \CS (see
1781
 
\ref{prg_architecture}).
1782
 
 
1783
 
\item \texttt{SYRTHES\_ENV}: name of the environment file for \syrthes (usually
1784
 
\texttt{syrthes.env}, as proposed in the launch script).
1785
 
 
1786
 
\item \texttt{SRC\_SYR}: directory for the \syrthes user subroutines.
1787
 
This directory has to be created by the user. It is advised to keep the location
1788
 
proposed in the launch script, which complies with the standard architecture
1789
 
of \CS (see \ref{prg_architecture}).
1790
 
 
1791
 
\item \texttt{COUPLING\_MODE}: coupling mode between \CS and \syrthes 3.4, when
1792
 
such coupling is activated (see \texttt{COMMAND\_SYRTHES}). Two options are
1793
 
available:\\
1794
 
\hspace*{0.5cm}\texttt{MPI}: for a coupling based on MPI messages (requires a
1795
 
MPI library)\\
1796
 
\hspace*{0.5cm}\texttt{sockets}: for a coupling based on sockets
1797
 
 
1798
 
\item \texttt{EXEC\_PREPROCESSOR}: execution mode for \CS preprocessor (see \ref{prg_executionmodes})
1799
 
 
1800
 
\item \texttt{EXEC\_PARTITION}: execution mode for \CS partitionner (see \ref{prg_executionmodes})
1801
 
 
1802
 
\item \texttt{EXEC\_KERNEL}: execution mode for \CS kernel (see \ref{prg_executionmodes})
1803
 
 
1804
 
\end{list}
1805
 
 
 
1468
\texttt{runcase}, in the \texttt{SCRIPTS} directory. This script is quite minimalist and is known to work on every architecture \CS has been tested on.
 
1469
If a batch system is available, this script will contain options
 
1470
for batch submission.
 
1471
The script will then contain a line setting the proper \texttt{PYTHONPATH}
 
1472
variable for \CS to run.
 
1473
Finally, it simply contains the \texttt{code\_saturne run}  command,
 
1474
possible with a \texttt{--param} option when a parameters file
 
1475
defined by the GUI is used. Other options recognized by
 
1476
\texttt{code\_saturne run} may be added.
 
1477
 
 
1478
In the case of a coupled calculation, this script also exists, and
 
1479
may be used for preprocessing stages, but an additional
 
1480
\texttt{runcase\_coupling} is added in the directory above the coupled case
 
1481
directories, and may be used to define the list of coupled cases,
 
1482
as well as global options, such as MPI options ot the temporary
 
1483
execution directory. An additional \texttt{runcase\_batch} file will
 
1484
contain batch submission options when a batch system is available
 
1485
(and is the file that should be submitted when using a batch system).
 
1486
 
 
1487
When not using the GUI, or if additional options need to be accessed,
 
1488
the \texttt{cs\_user\_scripts.py} file may be copied from
 
1489
the \texttt{DATA/REFERENCE} to the \texttt{DATA} and edited.
 
1490
This file contains several Python functions:
 
1491
 
 
1492
\begin{list}{$\bullet$}{}
 
1493
 
 
1494
\item \texttt{define\_domain\_parameter\_file} allows defining
 
1495
 the choice of a parameters file produced by the GUI. This is
 
1496
 generally not useful, as the parameters file may be directly
 
1497
 defined in \texttt{runcase} or \texttt{runcase\_coupling}, or passed
 
1498
 as an option to \texttt{code\_saturne run}, but could be useful
 
1499
 when running more complex parametric scripts, and is provided for
 
1500
 the sake of completeness.
 
1501
\item \texttt{define\_domain\_parameters} allows defining
 
1502
 most paramters relative to case execution for the current
 
1503
 domain, including advanced options not accessible
 
1504
 through the GUI. This function is the most important one in the user
 
1505
 scripts file, and contains descriptions of the various options.
 
1506
 Note that in most examples, setting of options is preceded by
 
1507
 a \texttt{if domain.param == None:} line, ensuring the settings
 
1508
 are only active if no GUI-defined parameters file is present.
 
1509
 This is used to prevent accidental override of parameters defined
 
1510
 by the GUI: parameters defined through the user script have priority
 
1511
 over the GUI parameters file, so if both are used, these tests
 
1512
 may be removed for parameters which should be defined through
 
1513
 user scripts.
 
1514
\item \texttt{define\_case\_parameters} allows defining
 
1515
 most paramters relative to the global calculation, such as
 
1516
 the number of processors or the execution directory.
 
1517
 To avoid potentially conflicting definitions, this function is ignored
 
1518
 for coupled calculations, where the corresponding parameters
 
1519
 may be defined in the \texttt{runcase\_coupling} script.
 
1520
\item \texttt{define\_mpi\_environment} allows defining
 
1521
 advanced MPI parameters or redefining MPI options if the automatic
 
1522
 settings are incorrect, and ts use should only rarely be necessary.
 
1523
 To avoid potentially conflicting definitions, this function is ignored
 
1524
 for coupled calculations, where the corresponding parameters
 
1525
 may be defined in the \texttt{runcase\_coupling} script.
 
1526
\end{list}
1806
1527
 
1807
1528
%==================================
1808
1529
\subsection{Graphical User Interface}
1809
1530
%==================================
1810
 
\label{prg_ihm}%
 
1531
\label{prg_gui}%
1811
1532
A Graphical User Interface is available with \CS.
1812
1533
This Interface creates or reads an XML file according to
1813
1534
a specific \CS syntax which is then interpreted by the code.
1856
1577
followings:
1857
1578
 
1858
1579
\begin{list}{-}{}
1859
 
\item Analysis environment: definition of the calculation directories
1860
 
      (STUDY, CASE), mesh file(s), periodicity, coupling with \syrthes,
1861
 
      stand-alone execution of the
1862
 
      Preprocessor module (used by the Interface to get the colors of the boundary
 
1580
\item Identity and paths: definition of the calculation directories
 
1581
      (STUDY, CASE, DATA, SRC, SCRIPTS, MESH).
 
1582
 
 
1583
\item Calculation environment: definition of the mesh file(s),
 
1584
      stand-alone execution of the Preprocessor module
 
1585
      (used by the Interface to get the groups of the boundary
1863
1586
      faces).
1864
1587
 
1865
1588
\item Thermophysical models: physical model, ALE mobile mesh features,
1866
 
      turbulence model, thermal model,
1867
 
      initialisation of the variables.
 
1589
      turbulence model, thermal model, coupling with \syrthes.
 
1590
 
 
1591
\item Additional scalars: definition, initialisation of the scalars,
 
1592
      and physical characteristics.
1868
1593
 
1869
1594
\item Physical properties: reference pressure, fluid characteristics, gravity.
 
1595
      It is also possible to write user laws for the density, the viscosity,
 
1596
      the specific heat and the thermal conductivity in the interface through
 
1597
      the use of a formulae interpreter.
1870
1598
 
1871
 
\item Additional scalars: definition, physical characteristics and
1872
 
      initialisation of the scalars (apart from the temperature, which
1873
 
      is treated separately in the Interface).
 
1599
\item Volume conditions: initialization of the variables, and definition of
 
1600
      the zones where to apply head loss.
1874
1601
 
1875
1602
\item Boundary conditions: definition of the boundary conditions for
1876
1603
      each variable. The colors of the boundary faces may be read
1877
 
      directly from a ``listing'' file created by the Preprocessor. This
1878
 
      file can be generated directly by the Interface under the heading\\
1879
 
      ``Analysis environment $\rightarrow$ Solution Domain $\rightarrow$
1880
 
        Stand-alone running''.
1881
 
 
1882
 
\item Analysis control: parameters concerning the time averages, time step,
 
1604
      directly from a ``listing'' file created by the Preprocessor.
 
1605
 
 
1606
\item Numerical parameters: number and type of time step, advanced parameters
 
1607
      for the numerical solution of the equations.
 
1608
 
 
1609
\item Calculation control: parameters concerning the time averages, time step,
1883
1610
      location of
1884
1611
      the probes where some variables will be monitored over time,
1885
1612
      definition of the frequency of the outputs in the calculation
1886
1613
      listing and in the chronological records and of the EnSight outputs.
1887
 
 
1888
 
\item Numerical parameters: advanced parameters for the numerical solution of
1889
 
      the equations
 
1614
      The item {\itshape Profiles} allows to save, with a  given frequency,
 
1615
      1D profiles on an axis defined from two points provided by the user.
1890
1616
 
1891
1617
\item Calculation management: management of the calculation restarts,
1892
1618
      updating of the launch script (temporary execution directory, parallel
1893
 
      computing, user data or result files, ...), interactive launch of the
1894
 
      calculation and user arrays definition.
 
1619
      computing, user data or result files, ...) and interactive launch of the
 
1620
      calculation.
1895
1621
 
1896
1622
\end{list}
1897
1623
 
1924
1650
out, thus saving the user the tedious task of uncommenting all the lines (and
1925
1651
the risk of skipping some of them).
1926
1652
 
1927
 
 
1928
 
%==================================
1929
 
\subsection{Face and cell mesh-defined properties and selection}
1930
 
%==================================
1931
 
\label{selection_criteria}
1932
 
 
1933
 
The mesh entities may be referenced by the user during the mesh
1934
 
creation. These references may then be used to mark out some mesh entities
1935
 
according to the need (specification of boundary conditions, pressure
1936
 
drop zones, ...). The references are generally of one of the two
1937
 
following types:
1938
 
\begin{list}{$\bullet$}{}
1939
 
\item color.
1940
 
A color is an integer possibly associated with boundary faces and
1941
 
volume elements by the mesh generator. Depending on the tool,
1942
 
this concept may have different names, which \CS interprets
1943
 
as colors. Most tools allow only one color per face or element.
1944
 
      \begin{list}{-}{}
1945
 
      \item I-deas uses a color number with a default of
1946
 
            7 (green) for elements, be they volume elements or boundary
1947
 
            ``surface coating'' elements. Color 11 (red) is used for
1948
 
            for vertices, but vertex properties are ignored by \CS.
1949
 
      \item SIMAIL uses the equivalent notions of ``reference''
1950
 
            for element faces, and ``subdomain'' for volume elements.
1951
 
            By default, element faces are assigned no reference (0),
1952
 
            and volume elements domain 1.
1953
 
      \item Gmsh uses ``physical property'' numbers.
1954
 
      \item EnSight has no similar notion, but if several parts
1955
 
            are present in an EnSight 6 file, or several parts
1956
 
            are present \emph{and} vertex ids are given in an
1957
 
            Ensight Gold file, the part number is interpreted as
1958
 
            a color number by the Preprocessor.
1959
 
      \item The Comet Design (pro-STAR/STAR4) and NUMECA Hex file
1960
 
            formats have a CAD section id that is interpreted
1961
 
            as a color number. In the latter case, this notion
1962
 
            only applies to faces, so volume elements are given
1963
 
            color.
1964
 
      \item The MED format allow integer ``attributes'', though
1965
 
            many tools working with this format ignore those
1966
 
            and only handle groups.
1967
 
      \end{list}
1968
 
\item groups.
1969
 
Named ``groups'' of mesh entities may also be used with many
1970
 
mesh generators or formats. In some cases, a given cell or face may belong
1971
 
to multiple groups (as some tools allow new groups to be defined
1972
 
by boolean operations on existing groups).
1973
 
In \CS, every group is assigned a group number (base on alphabetical
1974
 
ordering of groups).
1975
 
      \begin{list}{-}{}
1976
 
      \item I-deas assigns a group number with each
1977
 
            group, but by default, this number is just a counter.
1978
 
            Only the group name is considered by \CS (so that elements
1979
 
            belonging to two groups with identical names and different
1980
 
            numbers are considered as belonging to the same group).
1981
 
      \item CGNS allows both for named boundary conditions and mesh
1982
 
            sections. If present, boundary condition names are
1983
 
            interpreted as group names, and groups may also be defined
1984
 
            based on element section or zone names using additional
1985
 
            Preprocessor options (\texttt{-grp-cel} or
1986
 
            \texttt{-grp-fac} followed by \texttt{section} or
1987
 
            \texttt{zone}).
1988
 
      \item Using the MED format, it is preferable to use ``groups''
1989
 
            to colors, as many tools ignore the latter.
1990
 
      \end{list}
1991
 
\end{list}
1992
 
 
1993
 
Selection criteria may be defined in a similar fashion whether
1994
 
using the GUI or in user subroutines.
1995
 
Typically, a selection criteria is simply a string containing
1996
 
the required color numbers or group names, possibly combined
1997
 
using boolean expressions. Simple geometric criteria are also
1998
 
possible.
1999
 
 
2000
 
A few examples are given below:
2001
 
 
2002
 
\verb+ENTRY+\\
2003
 
\verb+1 or 7+\\
2004
 
\verb+all[]+\\
2005
 
\verb+3.1 >= z >= -2 or not (15 or entry)+\\
2006
 
\verb+range[04, 13, attribute]+\\
2007
 
\verb+sphere[0, 0, 0, 2] and (not no_group[])+
2008
 
 
2009
 
Strings such as group names containing whitespace
2010
 
or having names similar to reserved operators may be protected
2011
 
using ``escape characters''.\footnote{Note that for defining a
2012
 
string in Fortran, double quotes are easier to use, as they do not
2013
 
conflict with Fortran's single quotes delimiting a string.
2014
 
In C, the converse is true. Also, in C, to define a string
2015
 
such as \texttt{{$\backslash$}plane}, the string
2016
 
\texttt{{$\backslash$}{$\backslash$}plane} must be
2017
 
used, as the first $\backslash$ character is used by the
2018
 
compiler itself. Using the GUI, either notation is easy.}
2019
 
More complex examples of strings whith protected strings are given here:
2020
 
 
2021
 
\verb+"First entry" or Wall\ or\ sym+\\
2022
 
\verb+entry or \plane or "noone's output"+
2023
 
 
2024
 
The following operators and syntaxes are allowed (fully capitalized
2025
 
versions of keywords are also allowed, but mixed capitals/lowercase
2026
 
versions are not):
2027
 
 
2028
 
\begin{tabular}[top]{p{6cm} l}
2029
 
\multicolumn{2}{l}{\bf escape characters }\\
2030
 
protect next character only: & \texttt{$\backslash$} \\
2031
 
protect string:              & \texttt{{'}$string${'}} \quad \texttt{"$string$"}\\
2032
 
\end{tabular}
2033
 
 
2034
 
\begin{tabular}[top]{p{6cm} l}
2035
 
\multicolumn{2}{l}{\bf basic operators }\\
2036
 
priority: & \texttt{(} \quad \texttt{)} \\
2037
 
not:      &  \texttt{not} \quad \texttt{!} \quad \texttt{!=} \\
2038
 
and:      &  \texttt{and} \quad \texttt{\&} \quad \texttt{\&\&} \\
2039
 
or:       &  \texttt{or} \quad \texttt{|} \quad \texttt{||} \quad \texttt{,} \quad \texttt{;} \\
2040
 
xor:      &  \texttt{xor} \quad \texttt{\^} \\
2041
 
\end{tabular}
2042
 
 
2043
 
\begin{tabular}[top]{p{6cm} l}
2044
 
\multicolumn{2}{l}{\bf general functions }\\
2045
 
select all:                        &  \texttt{all[]}\\
2046
 
entities having no group or color: &  \texttt{no\_group[]} \\
2047
 
select a range of groups or colors: &  \texttt{range[$first$, $last$]} \\
2048
 
                                    &  \texttt{range[$first$, $last$, group]} \\
2049
 
                                    &  \texttt{range[$first$, $last$, attribute]} \\
2050
 
\end{tabular}
2051
 
 
2052
 
For the range operator, $first$ and $last$ values are inclusive.
2053
 
For attribute (color) numbers, natural integer value ordering is used,
2054
 
while for group names, alphabetical ordering is used. Note also that in
2055
 
the bizarre (not recommended) case in which a mesh would contain for
2056
 
example both a color number 15 and a group named ``15'', using
2057
 
\texttt{range[15, 15, group]} or \texttt{range[15, 15, attribute]}
2058
 
could be used to distinguish the two.
2059
 
 
2060
 
Geometric functions are also available. The coordinates considered are
2061
 
those of the cell or face centers. Normals are of course
2062
 
usable only for face selections, not cell selections.
2063
 
 
2064
 
\begin{tabular}[top]{p{6cm} l}
2065
 
\multicolumn{2}{l}{\bf geometric functions }\\
2066
 
face normals:   &  \texttt{normal[$x$, $y$, $z$, $epsilon$]} \\
2067
 
                &  \texttt{normal[$x$, $y$, $z$, epsilon = $epsilon$]} \\
2068
 
plane, $ax + by + cz + d = 0$ form: &  \texttt{plane[$a$, $b$, $c$, $d$, $epsilon$]} \\
2069
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
2070
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
2071
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
2072
 
plane, normal + point in plane form: &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, $epsilon$]} \\
2073
 
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, epsilon = $epsilon$]} \\
2074
 
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, inside]} \\
2075
 
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, outside]} \\
2076
 
box, extents form: &  \texttt{box[$x_{min}$, $y_{min}$, $z_{min}$,
2077
 
                                  $x_{max}$, $y_{max}$, $z_{max}$]} \\
2078
 
box, origin + axes form: &  \texttt{box[$x_0$, $y_0$, $z_0$,}\\
2079
 
                         &  \texttt{\qquad $dx_1$, $dy_1$, $dz_1$,
2080
 
                                        $dx_2$, $dy_2$, $dz_2$,
2081
 
                                        $dx_3$, $dy_3$, $dz_3$]} \\
2082
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
2083
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
2084
 
                &  \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
2085
 
cylinder:       &  \texttt{cylinder[$x_0$, $y_0$, $z_0$, $x_1$, $y_1$, $z_1$, $radius$]} \\
2086
 
sphere:         &  \texttt{sphere[$x_c$, $y_c$, $z_c$, $radius$]} \\
2087
 
inequalities:   &  \texttt{>}, \texttt{<}, \texttt{>=}, \texttt{<=} associated
2088
 
                   with \texttt{x}, \texttt{y}, \texttt{z}  or
2089
 
                   \texttt{X}, \texttt{Y}, \texttt{Z} keywords\\
2090
 
                &   and coordinate value; \\
2091
 
                &  \texttt{$x_{min}$ <= x < $x_{max}$} type syntax is allowed. \\
2092
 
\end{tabular}
2093
 
 
2094
 
In the current version of \CS, all selection criteria used
2095
 
are maintained in a list, so that re-interpreting a criterion already
2096
 
encountered (such as at the previous time step) is avoided.
2097
 
Lists of entities corresponding to a criteria containing no geometric
2098
 
functions are also saved in a compact manner, so re-using a previously
2099
 
used selection should be very fast. For criteria containing geometric
2100
 
functions, the full list of corresponding entities is not maintained,
2101
 
so each entity must be compared to the criterion at each time step.
2102
 
Heavy use of many selection criteria containing geometric functions
2103
 
may thus lead to reduced performance.
2104
 
 
2105
 
%==================================
2106
 
\section{Preprocessing}
2107
 
%==================================
2108
 
 
2109
 
The \pcs module of \CS reads the
2110
 
mesh file(s) (under any supported format) and translates the necessary
2111
 
information into a Kernel input file. Mesh joining and domain partitioning for parallel
2112
 
calculations are done at this stage. In case of periodic boundary
2113
 
conditions, the \pcs module also identifies the boundary faces that are
2114
 
related through periodicity and generates the corresponding connectivity.
2115
 
 
2116
 
The executable of the \pcs module is \texttt{cs\_preprocess},
2117
 
and the most useful options and sub-options are described briefly here.
2118
 
To obtain a complete and up-to-date list of options and environment
2119
 
variables, use the following command:
2120
 
\texttt{cs\_preprocess~-h} or \texttt{cs\_preprocess~--help}. Many options,
2121
 
such as this one, accept a short and a long version.
2122
 
 
2123
 
For the main options, the launch script \texttt{runcase} contains
2124
 
corresponding variables, that are used to define options for the
2125
 
\pcs. This way, the user only has to define these variables
2126
 
and does not detailed knowledge of the \pcs command line.
2127
 
 
2128
 
Nonetheless, it may be useful to call the \pcs manually
2129
 
in certain situations, especially for frequent verification when
2130
 
building a mesh, so its use is described here. Verification
2131
 
may also be done using the \texttt{code\_saturne~check\_mesh} command,
2132
 
which takes a subset of the same command-line arguments.
2133
 
 
2134
 
The \pcs is controlled using command-line arguments, some of these
2135
 
accepting sub-arguments. It is possible to complete the command-line
2136
 
with a file, using the same syntax as the command-line, but also
2137
 
allowing multiple lines and comments. A few environment variables
2138
 
allow an expert user to modify some behaviors or to obtain
2139
 
a trace of memory management.
2140
 
 
2141
 
%==================================
2142
 
\subsection{\pcs options and sub-options\label{sec:optpcs_ssopt}}
2143
 
%==================================
2144
 
 
2145
 
Main choices are done using command-line options. Sub-option arguments
2146
 
must directly follow the one activating the corresponding option, and
2147
 
the definition of sub-options ends with the first argument which does
2148
 
not match the same sub-option. Some options may be applied multiple
2149
 
times. For example, \texttt{-j} being the option which activates
2150
 
face joining, \texttt{--fraction} the sub-option modifying the
2151
 
default tolerance, and  \texttt{--color} a face selection sub-option:
2152
 
 
2153
 
\texttt{cs\_preprocess -m fluid.msh -j --fraction 0.2 --color 2 --color 3 -j}
2154
 
 
2155
 
\noindent means that we apply a joining to boundary faces of
2156
 
color $2$ or $3$ of mesh \texttt{fluid.msh} with a tolerance of $0.2$,
2157
 
then that we apply a second joining to all remaining boundary faces
2158
 
(with default parameters), while:
2159
 
 
2160
 
\texttt{cs\_preprocess -m fluid.msh -j --fraction 0.2 -color 2 -j --color 3}
2161
 
 
2162
 
\noindent means that we apply a joining to boundary faces of
2163
 
color $2$ of mesh \texttt{fluid.msh} with a tolerance of $0.2$,
2164
 
then that we apply a second joining to boundary faces of color $3$
2165
 
(with default values for other parameters).
2166
 
 
2167
 
\subsubsection{Option files\label{sec:optpcs:input}}
2168
 
 
2169
 
It is possible to complete the command-line with a file, using the same
2170
 
syntax as the command-line, but allowing the addition of arbitrary line
2171
 
jumps and comments. On a given line, anything that follows a\texttt{\#}
2172
 
character until the end of the line is ignored in such a file.
2173
 
The use of such a file is activated by the argument \texttt{-i}.
2174
 
If for example a file \texttt{pp\_cmd} contains the following
2175
 
lines:
2176
 
 
2177
 
\noindent
2178
 
\begin{tabular}{l l}
2179
 
\texttt{--ensight} & \texttt{\# activate EnSight output}\\
2180
 
\texttt{--med}     & \texttt{\# activate MED output}\\
2181
 
\end{tabular}
2182
 
 
2183
 
\noindent
2184
 
\begin{tabular}{l l}
2185
 
then command:     & \texttt{cs\_preprocess -i pp\_cmd -m mesh.unv}\\
2186
 
is equivalent to: & \texttt{cs\_preprocess -m mesh.unv --ensight --med}\\
2187
 
\end{tabular}
2188
 
 
2189
 
The use of option files may circumvent command-line length limits
2190
 
(now rarely an issue), and allows easier manipulation and better
2191
 
readability of complex option combinations.
2192
 
 
2193
 
\subsubsection{Mesh selection\label{sec:optpcs:mesh}}
2194
 
 
2195
 
Any use of the preprocessor requires one or several meshes (except for
2196
 
\texttt{cs\_preprocess} and \texttt{cs\_preprocess~-h} which respectively
2197
 
print the version number and list of options).
2198
 
They are selected using the \texttt{--mesh} or \texttt{-m} option, followed
2199
 
by th list of meshes to read. The file format is usually automatically
2200
 
determined based on its extension (c.f. \ref{sec:formats_in}
2201
 
page~\pageref{sec:formats_in}) but this option also allows a \texttt{--format}
2202
 
sub-option, to force the format choice of selected files.
2203
 
 
2204
 
For formats allowing multiple meshes in a single file, the
2205
 
\texttt{--num} sub-option followed by a strictly positive integer allows
2206
 
selection of a specific mesh; by default, the first mesh is selected.
2207
 
 
2208
 
For meshes in CGNS format, we may in addition use the \texttt{--grp-cel}
2209
 
or \texttt{--grp-fac} sub-options, followed by the \texttt{section}
2210
 
or \texttt{zone} keywords, to define additional groups of cell or faces
2211
 
based on the organization of the mesh in sections or zones. The sub-options
2212
 
have no effect on meshes of other formats.
2213
 
 
2214
 
We may define as many mesh selections as we wish. Meshes are read and
2215
 
automatically compounded (but not joined) in the order of their appearance.
2216
 
For example:
2217
 
 
2218
 
\noindent
2219
 
\texttt{cs\_preprocess -m file.1 file.2 --format ideas -m branch.cgns --grp-cel section}
2220
 
 
2221
 
\noindent
2222
 
reads mesh files \texttt{file.1} and \texttt{file.2} as \ideas files,
2223
 
and appends the first mesh from the \texttt{branch.cgns} file,
2224
 
on which additional groups of cells corresponding to the CGNS section
2225
 
names to which cells belong.
2226
 
 
2227
 
\subsubsection{Post-processing output\label{sec:optpcs:post}}
2228
 
 
2229
 
By default, the \pcs does not generate any post-processor output.
2230
 
By adding \texttt{--ensight}, \texttt{--med}, or \texttt{--cgns} to
2231
 
the command-line arguments, the output of the mesh to the indicated format
2232
 
is provoked. It is possible to generate output to different formats
2233
 
simultaneously. Note that we will obtain additional surface meshes
2234
 
corresponding to the calculation domain boundary, to faces joined
2235
 
or modified by joinings or periodicity, etc. Note also that
2236
 
periodic faces are not considered to be part of the domain boundary.
2237
 
\footnote{Periodicity is interpreted as a ``geometric'' condition
2238
 
rather than a classical boundary condition.}
2239
 
 
2240
 
We consider 4 types of output: the volume mesh (output before possible
2241
 
joinings), the boundary mesh, informational meshes (such as faces
2242
 
stemming from or modified by a joining of periodicity, or
2243
 
selected interior faces), and meshes outlining to zones with errors.
2244
 
By default, all types of meshes are output. If one or several of
2245
 
the three filtering sub-options is used , only the meshes of the
2246
 
requested types will be output, as well as meshes corresponding to
2247
 
zones with errors (non-filterable). The filtering sub-options
2248
 
are: \texttt{--volume}, \texttt{--boundary}, and \texttt{--info}.
2249
 
 
2250
 
One may also optionally avoid outputting polygons or polyhedra
2251
 
by adding the \texttt{--discard-poly} sub-option.
2252
 
This allow working around bugs or limited polyhedron support
2253
 
in visualization tools or limitations of the CGNS 2 format.
2254
 
In this case, the post-processing output will be incomplete,
2255
 
but at least readable.
2256
 
 
2257
 
In the case of \emph{EnSight Gold} output, we may use the
2258
 
\texttt{--simple} sub-option to avoid splitting the output in
2259
 
several \emph{parts} corresponding to different attributes
2260
 
(colors and groups) borne by this mesh.
2261
 
 
2262
 
Still in the case of the \emph{EnSight Gold} output, we may
2263
 
force the output in text mode using the \texttt{--text} sub-option,
2264
 
or force binary output to ``big-endian'' variant using the
2265
 
\texttt{--big-endian} sub-option. By default, the output is native
2266
 
binary.
2267
 
 
2268
 
Finally, in the case of output in the \emph{MED} format, we may
2269
 
force the conversion of attributes (colors) to groups using
2270
 
the \texttt{--color-to-group} sub-option.
2271
 
 
2272
 
\subsubsection{Faces selection\label{sec:optpcs:select}}
2273
 
 
2274
 
Selection of faces occurs at several levels, especially for conforming
2275
 
joining.
2276
 
 
2277
 
It is also possible to select a set of interior faces bearing attributes
2278
 
(colors or groups) for verification purposes using the option
2279
 
\texttt{--int-face}. The \pcs prints the number of interior faces
2280
 
matching a selection criterion, and if in addition post-processing
2281
 
output is activated, a surface mesh corresponding to the selected faces
2282
 
will be generated.
2283
 
 
2284
 
\pcs selection criteria are more limited than those
2285
 
used by th kernel, and are generated using the following sub-options:
2286
 
 
2287
 
\noindent
2288
 
\begin{tabular}{l l}
2289
 
\texttt{--color} $c_1$ $c_2$ ... $c_n$~ &
2290
 
to select faces of the indicated color numbers\\
2291
 
\texttt{--group} $g_1$ $g_2$ ... $g_n$~ &
2292
 
to select faces of the groups named\\
2293
 
\texttt{--invsel} &
2294
 
to use the complement of the indicated colors and groups\\
2295
 
\end{tabular}
2296
 
 
2297
 
The same selection sub-options are used for conforming joining, periodicity,
2298
 
and interior faces verification. In the case of joining and periodicity,
2299
 
the selection is automatically restricted to boundary faces, while
2300
 
in the case of interior face verification, it is restricted to
2301
 
interior faces bearing attributes.
2302
 
 
2303
 
For example, to select all interior faces of mesh \texttt{example.des}
2304
 
which bear an attribute (color or group), but are not of color 2 and do not
2305
 
belong to group ``inlet'', with output of an \emph{Ensight Gold} part
2306
 
and with no kernel output (using \texttt{-sc}), we use the following
2307
 
command line (the \verb=\= character marks line continuation):
2308
 
 
2309
 
\noindent
2310
 
\begin{tabular}{l l l}
2311
 
\texttt{cs\_preprocess} & \texttt{-m example.des -sc --ensight } \verb=\= \\
2312
 
         & \texttt{--int-face --group entree --color 2 --invsel}\\
2313
 
\end{tabular}
2314
 
 
2315
 
\subsubsection{Joining of non-conforming meshes\label{sec:optpcs:join}}
2316
 
 
2317
 
Conforming joining of possibly non-conforming meshes is one of the
2318
 
\pcs's main functions. To activate it, use the \texttt{--join} or
2319
 
\texttt{-j} command-line options, possibly followed by face selection
2320
 
criteria and sub-options controlling associated tolerance parameters.
2321
 
 
2322
 
For a simple mesh, it is rarely useful to specify face selection
2323
 
criteria, as joining is sufficiently automated to detect which faces
2324
 
may actually be joined. For a more complex mesh, or a mesh with thin
2325
 
walls which we want to avoid transforming into interior faces, it is
2326
 
recommended to filter boundary faces that may be joined by using
2327
 
face selection sub-arguments (see \S\ref{sec:formats_in}). This has the
2328
 
additional advantage of reducing the number of faces to test for
2329
 
in the intersection/overlap search, and thus reduced to time
2330
 
required by the joining algorithm.
2331
 
 
2332
 
One may also modify tolerance criteria using 2 sub-options:
2333
 
 
2334
 
\noindent
2335
 
\begin{tabular}[top]{p{3.0cm}%
2336
 
                     >{\PreserveBackslash\raggedright\hspace{0pt}}p{12.0cm}}
2337
 
\texttt{--fraction} $r$  &
2338
 
assigns value $r$ (where $0 < r < 0,49$) to the maximum
2339
 
intersection distance multiplier ($0,1$ by default). The maximum
2340
 
intersection distance for a given vertex is based on the length of
2341
 
the shortest incident edge, multiplied by $r$. The maximum intersection
2342
 
at a given point along an edge is interpolated from that at its
2343
 
vertices, as shown on the left of figure \ref{fig_join_tolerance}; \\
2344
 
\texttt{--plane} $c$ &
2345
 
assigns the minimum cosine between normals for two faces to be
2346
 
considered coplanar ($0,8$ by default, which corresponds to almost 37�);
2347
 
this parameter is used in the second stage of the algorithm, to
2348
 
reconstruct conforming faces, as shown on the right of figure
2349
 
\ref{fig_join_tolerance}.\\
2350
 
\end{tabular}
2351
 
 
2352
 
\begin{figure}[hp]
2353
 
\centerline{
2354
 
\includegraphics*[width=14cm]{join_tolerance}}
2355
 
\caption{Maximum intersection tolerance and faces normal angle
2356
 
\label{fig_join_tolerance}}
2357
 
\end{figure}
2358
 
 
2359
 
In practice, we are sometimes led to increase the maximum intersection
2360
 
distance multiplier to $0.2$ or even $0.3$ when joining curved surfaces,
2361
 
so that all intersection are detected. As this influences merging
2362
 
of vertices and thus simplification of reconstructed faces, but also
2363
 
deformation of ``lateral'' faces, it is recommended only to modify it
2364
 
if necessary. As for the \texttt{--plane} sub-option, its use has
2365
 
only been necessary on a few meshes up to now, and always in the
2366
 
sense of reducing the tolerance (i.e. bringing the minimum cosine closer
2367
 
to 1) so that face reconstruction does not try to generate faces
2368
 
from initial faces on different surfaces.
2369
 
 
2370
 
As an example, to join faces with color $2$ of the mesh \texttt{mesh.des}
2371
 
with an intersection distance multiplier of  $0.15$, then joining all
2372
 
remaining joinable boundary faces with a default parameter of $0.1$,
2373
 
we may use the following command:
2374
 
 
2375
 
\texttt{cs\_preprocess -m mesh.des -j --fraction 0.15 --color 2 -j}
2376
 
 
2377
 
In cases where any two faces to join always have at least one common vertex
2378
 
(which is the case with meshes containing hanging nodes generated by
2379
 
tools such as \harpoon), we may use the \texttt{--semi-conf}
2380
 
sub-option, for a much faster edge intersection search than with
2381
 
the usual algorithm.
2382
 
 
2383
 
\subsubsection{Periodicity\label{sec:optpcs:period}}
2384
 
 
2385
 
Handling of periodicity is based on an extension of conforming joining,
2386
 
as shown on figure \ref{fig_join_periodic}. It is thus not necessary
2387
 
that periodic faces be conforming (though it usually leads to better
2388
 
mesh quality). All sub-options relative to conforming joining of
2389
 
non-conforming faces also apply to periodicity. Note also that
2390
 
once pre-processed, 2 periodic faces have the same orientation
2391
 
(possibly adjusted by periodicity of rotation).
2392
 
 
2393
 
\begin{figure}[hp]
2394
 
\centerline{
2395
 
\includegraphics*[height=8cm]{join_periodic}}
2396
 
\caption{Matching of periodic faces
2397
 
\label{fig_join_periodic}}
2398
 
\end{figure}
2399
 
 
2400
 
The sub-option for a translation-type periodicity is \texttt{--trans} followed
2401
 
by the three translation vector components $(tx, ty, tz)$.
2402
 
The sub-option for a rotation-type periodicity is \texttt{--rota}, 
2403
 
which must be completed either by:
2404
 
 
2405
 
\noindent
2406
 
\texttt{--angle} $\alpha$ \texttt{--dir} $dx$ $dy$ $dz$
2407
 
 
2408
 
\noindent
2409
 
where $\alpha$ is the rotation angle in degrees and $(dx, dy, dz)$ defines
2410
 
the rotation axis (using the trigonometric orientation), or by:
2411
 
 
2412
 
\noindent
2413
 
\texttt{--matrix} $m11$ $m12$ $m13$ $m21$ $m22$ $m23$ $m31$ $m32$ $m33$
2414
 
 
2415
 
\noindent
2416
 
where 
2417
 
\begin{math}
2418
 
  \left( \begin{smallmatrix}
2419
 
     m_{11} & m_{12} & m_{13} \\ m_{21} & m_{22} & m_{23} \\ m_{31} & m_{32} & m_{33}
2420
 
  \end{smallmatrix} \right)
2421
 
\end{math}
2422
 
 defines the rotation matrix.
2423
 
 
2424
 
In either case, we may define an invariant point different from $(0, 0, 0)$
2425
 
by adding the rotation sub-option \texttt{--invpt} $px$ $py$ $pz$.
2426
 
A translation and a rotation may be combined: in this case, the composite
2427
 
transformation is always $R \circ T$, independently of the order in which
2428
 
the translation and rotation are defined.
2429
 
 
2430
 
The orientation of the transformations has no importance (but in the
2431
 
case of a composite transformation $R \circ T$, $R$ and $T$ must be
2432
 
consistent).
2433
 
As with joining, it is recommended to filter boundary faces to process
2434
 
using a selection criterion. As many periodicities may be built as desired,
2435
 
as long as boundary faces are present. One a periodicity is handled,
2436
 
faces having periodic matches do not appear as boundary faces, but as
2437
 
interior faces, and are thus not available anymore for other
2438
 
periodicities.
2439
 
 
2440
 
We finish with the example of a periodicity of rotation of $90$ degrees around
2441
 
an axis of direction $(0, 0, 1)$ passing through $(1, 0, 0)$,
2442
 
for faces of group ``perio\_1'' and with a joining tolerance of $20\%$ (the
2443
 
\verb=\= character marks line continuation):
2444
 
 
2445
 
\noindent
2446
 
\begin{tabular}{l l l}
2447
 
\texttt{--perio} & \texttt{--rota --angle 90 --dir 0 0 1 --invpt 1 0 0} \verb=\= \\
2448
 
 & \texttt{--fraction 0.2 --group perio\_1}\\
2449
 
\end{tabular}
2450
 
 
2451
 
\subsubsection{Element orientation correction\label{sec:optpcs:orient}}
2452
 
 
2453
 
We may active the possible element orientation correction using the
2454
 
\texttt{--reorient} option.
2455
 
 
2456
 
Note that we cannot guarantee correction (or even detection) of a bad
2457
 
orientation in all cases.
2458
 
Not all local numbering possibilities of elements are tested,
2459
 
as we focus on ``usual'' numbering permutations. Moreover,
2460
 
the algorithms used may produce false positives or fail to find
2461
 
a correct renumbering in the case of highly non convex elements.
2462
 
In this case, nothing may be done short of modifying the mesh, as
2463
 
without a convexity hypothesis, it is not always possible to choose
2464
 
between two possible definitions starting from a point set.
2465
 
 
2466
 
With a post-processing option such as \texttt{--ensight},
2467
 
visualizable meshes of corrected elements as well as remaining
2468
 
badly oriented elements are generated.
2469
 
 
2470
 
\subsection{Environment variables\label{sec:envvpcs}}
2471
 
 
2472
 
Setting a few environment variables specific to the \pcs allows modifying
2473
 
its default behavior. In general, if a given behavior is modifiable
2474
 
through an environment variable rather than by a command-line option,
2475
 
it has little interest for a non-developer, or its modification is
2476
 
potentially hazardous. The environment variables used by the \pcs
2477
 
are described here:
2478
 
 
2479
 
\envvar{CS\_PREPROCESS\_MEM\_LOG}
2480
 
 
2481
 
Allows defining a file name in which memory allocation, reallocation,
2482
 
and freeing is logged.
2483
 
 
2484
 
\envvar{CS\_PREPROCESS\_MIN\_EDGE\_LEN}
2485
 
 
2486
 
Under the indicated length ($10^{-15}$ by default), an edge is considered
2487
 
to be degenerate and its vertices will be merged after the transformation
2488
 
to descending connectivity. Degenerate edges and faces will thus be
2489
 
removed. Hence, the post-processed element does not change, but the
2490
 
Kernel may handle a prism where the preprocessor input contained a
2491
 
hexahedron with two identical vertex couples (and thus a face of zero
2492
 
surface). If the \pcs does not print any information relative to this
2493
 
type of correction, it means that it has not been necessary. To completely
2494
 
deactivate this automatic correction, a negative value may be assigned
2495
 
to this environment variable.
2496
 
 
2497
 
\envvar{CS\_PREPROCESS\_IGNORE\_IDEAS\_COO\_SYS}
2498
 
 
2499
 
If this variable is defined and is a strictly positive integer, coordinate
2500
 
systems in \ideas universal format files will be ignored. The behavior
2501
 
of the \pcs will thus be the same as that of versions 1.0 and 1.1.
2502
 
Note that in any case, non Cartesian coordinate systems are not handled yet.
2503
 
 
2504
 
\envvar{CS\_PREPROCESS\_JOIN\_MAX\_SUB\_FACES}
2505
 
 
2506
 
Defines the number of new faces originating from an initial face ($100$
2507
 
by default) above which we consider that the joining reconstruction has
2508
 
probably entered an infinite loop and has thus failed.
2509
 
This criterion is the last to intervene in the detection of errors and
2510
 
only comes into play in pathological cases probably related to excessive
2511
 
deformation of faces to join (and thus a too large tolerance factor).
2512
 
It should not be necessary to increase it for a mesh really intended for
2513
 
a calculation, as $100$ faces correspond to a refinement ratio of $10$
2514
 
in each direction for joined cells, which is excessive from a numerical
2515
 
standpoint.
2516
 
 
2517
 
\subsubsection{System environment variables\label{sec:envpcs:sys}}
2518
 
 
2519
 
Some system environment variables may also modify the behavior of
2520
 
the \pcs. For example, if the \pcs was compiled with \med support
2521
 
on an architecture allowing shared (dynamic) libraries, the
2522
 
\texttt {LD\_PRELOAD} environment variable may be used to define a
2523
 
``prioritary'' path to load \med or HDF5 libraries, and thus experiment
2524
 
with another version of these libraries without recompiling the \pcs.
2525
 
To determine which shared libraries are used by an executable file, use
2526
 
the following command: \texttt{ldd~\{executable\_path\}}.
2527
 
 
2528
 
\subsection{Optional functionality\label{sec:pcs:lib_opt}}
2529
 
 
2530
 
Some functions of the \pcs are based on external libraries,
2531
 
which may not always be available. It is thus possible to configure
2532
 
and compile the \pcs so as not to use these libraries.
2533
 
When running the \pcs, the supported options are printed.
2534
 
The following optional libraries may be used:
2535
 
 
2536
 
\begin{itemize}
2537
 
 
2538
 
\item CGNS library. In its absence, \hyperref[fmtdesc:cgns]{CGNS}
2539
 
      format support is deactivated.
2540
 
 
2541
 
\item \med-file library. In its absence, \hyperref[fmtdesc:med]{\med}
2542
 
      format is simply deactivated.
2543
 
 
2544
 
\item Read compressed files using Zlib. With this option, it is
2545
 
      possible to diretly read mesh files compressed with a
2546
 
      \emph{gzip} type algorithm and bearing a \emph{.gz} extension.
2547
 
      This is limited to formats not already based on an external
2548
 
      library (i.e. it is not usable with CGNS or \med files),
2549
 
      and has memory and CPU time overhead, but may be practical.
2550
 
      Without this library, files must be uncompressed before use.
2551
 
 
2552
 
\end{itemize}
2553
 
 
2554
 
\subsection{General remarks}
2555
 
 
2556
 
Note that the \pcs is in general capable of reading all ``classical''
2557
 
element types present in mesh files (triangles, quadrangles, tetrahedra,
2558
 
pyramids, prisms, and hexahedra).
2559
 
Quadratic or cubic elements are converted upon reading into their
2560
 
linear counterparts. Vertices referenced by no element (isolated vertices
2561
 
or centers of higher-degree elements) are discarded. Meshes are read
2562
 
in the order defined by the user and are appended, vertex and element
2563
 
indices being incremented appropriately.
2564
 
\footnote{Possible entity labels are not maintained, as they would
2565
 
probably not be unique when appending multiple meshes.}
2566
 
 
2567
 
At this stage, volume elements are sorted by type, and the fluid domain
2568
 
post-processing output is generated if required. Conforming joining,
2569
 
which may transform cells into general polyhedra only occurs
2570
 
after this. This allows bypassing a limitation of most post-processing
2571
 
tools, which do not handle polyhedral elements.
2572
 
\emph{It is possible to require the simultaneous output with
2573
 
multiple formats.}
2574
 
 
2575
 
In general, colors or groups assigned to vertices are ignored.
2576
 
selections are thus based on faces or cells. with tools such
2577
 
as \simail, faces of volume elements may be referenced directly, while
2578
 
with \ideas or SALOME, a layer of surface elements bearing the required
2579
 
colors and groups must be added. Internally, the \pcs always considers
2580
 
that a layer of surface elements is added (i.e. when reading a \simail
2581
 
mesh, additional faces are generated to bear cell face colors.
2582
 
When building the descending connectivity, all faces with the
2583
 
same topology are merged: the initial presence of two layers of identical
2584
 
surface elements bearing different colors would thus lead to
2585
 
a calculation mesh with faces bearing two colors.
2586
 
 
2587
 
\subsection{Files passed to the Kernel\label{sec:pcs:mode_comm}}
2588
 
 
2589
 
Data passed to the Kernel by the \pcs is transmitted using a
2590
 
binary file, using ``big endian'' data representation, named
2591
 
\texttt{preprocessor\_output}.
2592
 
 
2593
 
When using the \pcs for mesh verification, data for the Kernel
2594
 
is usually not needed. In this case, the \texttt{-sc} option may be
2595
 
used to simulate output, without creation of a {\tt preprocessor\_output}
2596
 
file.
2597
 
 
2598
 
%==================================
2599
 
\section{Partitioning for parallel runs\label{sec:parall}}
2600
 
%==================================
2601
 
 
2602
 
Graph partitioning (using one of the optional \metis or
2603
 
\scotch libraries) is done using a secondary executable,\\
2604
 
\texttt{cs\_partition},
2605
 
which reads the file produced by the \pcs and builds one or
2606
 
several ``cell $\rightarrow$ domain'' distribution files, named
2607
 
{\tt domain\_number\_\it{p}} for a partitioning on $p$ sub-domains.
2608
 
 
2609
 
This separation leads to extra work for the Kernel, which must
2610
 
redistribute data read in the  {\tt preprocessor\_output} file
2611
 
based on the associated partitioning, but avoids requiring
2612
 
re-running the \pcs whenever running on a different number of
2613
 
files. This useful mainly for large files (20 to 100 million
2614
 
cells, for which running the \pcs may require several hours and
2615
 
a machine with a very large memory capacity. Simple domain
2616
 
partitioning requires much less time, and in general slightly
2617
 
less memory than the \pcs.
2618
 
 
2619
 
Without partitioning (for example if neither \metis nor
2620
 
\scotch is available, or the partitioner has not been run
2621
 
for the required number of sub-domains), the Kernel will
2622
 
use a built-in partitioning using a space-filling curve
2623
 
(Z-curve) technique. This usually leads to partitionings
2624
 
of lower quality than with graph partitioning, but parallel
2625
 
performance remains reasonable.
2626
 
 
2627
 
\subsection{Options\label{sec:optcmd:parall}}
2628
 
 
2629
 
To list the partitioner's options, use the following command:
2630
 
{\tt cs\_partition~-h} 
2631
 
 
2632
 
We provide the list of required partitionings an optionally additional
2633
 
options. For example, to simulate a partitioning for calculations on
2634
 
64 and 128 processes with no output, we may use the following command:
2635
 
 
2636
 
\texttt{cs\_partition 64 128 --no-write}
2637
 
 
2638
 
\subsubsection{Ignore periodicity\label{sec:optcmdpart:noperiod}}
2639
 
 
2640
 
By default, face periodicity relations are taken into account when building
2641
 
the ``cell $\rightarrow$ cell'' connectivity graph used for partitioning.
2642
 
This allows better partitioning optimization, but increases the probability
2643
 
of having groups of cells at opposite sides of the domain in a same
2644
 
sub-domain. This is not an issue for standard calculations, but may
2645
 
degrade performance of search algorithms based on bounding boxes.
2646
 
It is thus possible to ignore periodicity when partitioning a mesh
2647
 
using the \texttt{--no-perio} option.
2648
 
 
2649
 
Note that nothing guarantees that a graph partitioner will not place
2650
 
disjoint cells in the same sub-domain independently of this option,
2651
 
but this behavior is rare.
2652
 
 
2653
 
\subsubsection{Partitioner choice\label{sec:optpart:partlib}}
2654
 
 
2655
 
If the Partitioner has been configured with both \metis and
2656
 
\scotch libaries, using the \texttt{--metis} or \texttt{--scotch}
2657
 
option allows choosing between either library. By default, \emph{metis} is
2658
 
used if both choices are available.
2659
 
 
2660
 
\subsubsection{Simulation mode\label{sec:optpart:nowrite}}
2661
 
 
2662
 
Using the \texttt{--no-write} option, we can tell the partitioner
2663
 
not to output a {\tt domain\_number\_\it{p}} file.
2664
 
Partitioning is thus computed, but not saved.
2665
 
 
2666
 
\subsubsection{Environment variables\label{sec:optpart:envvar}}
2667
 
 
2668
 
\envvar{CS\_PARTITION\_MEM\_LOG}
2669
 
 
2670
 
Allows defining a file name in which memory allocations, reallocations,
2671
 
and frees will be logged.
2672
 
 
2673
 
%==================================
2674
 
\section{Main variables}
 
1653
%==================================
 
1654
\subsection{User subroutines}
 
1655
%==================================
 
1656
%==================================
 
1657
\label{prg_ssprgutilis}
 
1658
%==================================
 
1659
\subsubsection{Preliminary comments}
 
1660
%==================================
 
1661
 
 
1662
The user can run the calculations with or without an interface, with or
 
1663
 without the user subroutines. Without interface, some user subroutines
 
1664
 are needed. With interface, all the user subroutines are optional.
 
1665
 
 
1666
The parameters can be read in the interface and then in the user
 
1667
subroutines. In the case that a parameter is specified in the interface
 
1668
 and in a user subroutine, it is the value in the user subroutine that
 
1669
 is taken into acount. For this reason, all the examples of
 
1670
 user subroutines are placed in the \texttt{REFERENCE} directory by the
 
1671
 case setup \texttt{code\_saturne~create}.
 
1672
 
 
1673
%==================================
 
1674
\subsubsection{Main variables}
2675
1675
%==================================
2676
1676
 
2677
1677
This section presents a non-exhaustive list of the main variables which
2687
1687
integer array [ia], real array [ra].
2688
1688
 
2689
1689
%==================================
2690
 
\subsection{Array sizes}
 
1690
\subsubsubsection{Array sizes}
2691
1691
%==================================
2692
1692
\label{prg_dimensions}
2693
1693
 
2726
1726
 
2727
1727
\bigskip
2728
1728
 
2729
 
\variabsize{nphas}{Effective number of phases. \texttt{nphas} must be
2730
 
inferior or equal to \texttt{nphsmx}. In the current version, \texttt{nphas}
2731
 
is forced to 1 and should not be changed.}
2732
 
 
2733
 
\variabsize{nphsmx}{Maximum number of phases (default value:
2734
 
1)\footnote{the data structure of \CS is ready for a multiphase description,
2735
 
however no multiphase model has been implemented. Moreover, some options of the
2736
 
code are not compatible with \texttt{nphas} different from 1.}}
2737
 
 
2738
1729
\variabsize{nvar}{Number of solved variables (must be lower than
2739
1730
\texttt{nvrmax})}
2740
1731
 
2772
1763
 
2773
1764
\bigskip
2774
1765
 
2775
 
\variabsize{longia}{Size of the macro array of integer \texttt{ia}}
2776
 
 
2777
 
\variabsize{longra}{Size of the macro array of real \texttt{ra}}
2778
 
 
2779
1766
\variabsize{npromx}{Maximum number of physical properties. They will
2780
1767
be stored in the arrays \texttt{propce}, \texttt{propfa} or \texttt{propfb}}
2781
1768
 
2872
1859
standard use.
2873
1860
 
2874
1861
%==================================
2875
 
\subsection{Geometric variables}
 
1862
\subsubsubsection{Geometric variables}
2876
1863
%==================================
2877
1864
 
2878
1865
The main geometric variables are available in most of the
2879
 
subroutines and directly accessible through the following arrays.
 
1866
subroutines and directly accessible through the following arrays,
 
1867
defined in the \texttt{mesh} module (i.e. \texttt{use mesh}).
2880
1868
 
2881
1869
\variab{cdgfac}{cdgfac(ndim,nfac)}{ra}{Coordinates of the
2882
1870
centers of the internal faces}
2884
1872
\variab{cdgfbo}{cdgfbo(ndim,nfabor)}{ra}{Coordinates of the centers of the
2885
1873
boundary face}
2886
1874
 
2887
 
 
2888
1875
\variab{ifacel}{ifacel(2,nfac)}{ia}{Index-numbers of the two (only) neighboring
2889
1876
cells for each internal face}
2890
1877
 
2898
1885
\variab{ipnfbr}{ipnfbr(nfabor+1)}{ia}{Position of the first node of the each boundary
2899
1886
face in the array \texttt{nodfbr} (see note 3 in paragraph \ref{prg_dimensions}).}
2900
1887
 
2901
 
 
2902
1888
\variab{nodfac}{nodfac(lndfac)}{ia} {Index-numbers of the nodes of each
2903
1889
internal face (see note 3 in paragraph \ref{prg_dimensions}).}
2904
1890
 
2918
1904
 
2919
1905
\variab{xyznod}{xyznod(ndim,nnod)}{ra}{Coordinates of the mesh vertices}
2920
1906
 
2921
 
In addition, other geometric variables are accessible in sections of
2922
 
the unidimensional macro-arrays IA (for integers) and RA (for real numbers)
2923
 
which are passed as arguments
2924
 
in every subroutine (apart from a few ones of very low level). The
2925
 
index-number of the first element of these sections is stored in a ``common''
2926
 
(in the file \texttt{pointe.h}), passed to most of the routines. Hence, the
2927
 
surface of an internal face \texttt{ifac} is stored in
2928
 
\texttt{ra(isrfan+ifac-1)}.
2929
 
Or, the coordinate of vector $\vect{OF}$ (see below for
2930
 
definition) in the II$^{th}$ direction for face \texttt{ifac} is stored in
2931
 
\texttt{ra(idofij+(ifac-1)*ndim+ii-1)}\footnote{in Fortran, a multidimensional
2932
 
array \texttt{a(3,2)} is in fact a unidimensional array containing the elements
2933
 
\texttt{a(1,1)}, \texttt{a(2,1)}, \texttt{a(3,1)}, \texttt{a(1,2)},
2934
 
\texttt{a(2,2)}
2935
 
and \texttt{a(3,2)} in this order.}.
2936
 
 
 
1907
In addition, other geometric variables are useful for gradients
 
1908
reconstruction.
2937
1909
The main variables of this type are the following:
2938
1910
 
2939
 
\variab{idijpf}{idijpf}{i}{In \texttt{ra}, pointer to
2940
 
\texttt{dijpf(ndim,nfac)}, real array giving, for every internal face,
 
1911
\variab{dijpf}{dijpf(ndim,nfac)}{ra}{For every internal face,
2941
1912
the three components of the vector  $\vect{I'J'}$, where I' and J' are
2942
1913
respectively the orthogonal projections of the neighboring cell centers I and J
2943
1914
on a straight line orthogonal to the face and passing through its center.}
2944
1915
 
2945
 
\variab{idiipb}{idiipb}{i}{In \texttt{ra}, pointer to
2946
 
\texttt{diipb(ndim,nfabor)}, real array giving, for every boundary
 
1916
\variab{diipb}{diipb(ndim,nfabor)}{ra}{For every boundary
2947
1917
face, the three components of the vector $\vect{II'}$. I' is the
2948
1918
orthogonal projection of I, center of the neighboring cell, on the
2949
1919
straight line perpendicular to the face and passign through its center}
2950
1920
 
2951
 
\variab{idist}{idist}{i}{In \texttt{ra}, pointer to \texttt{dist(nfac)}, real
2952
 
array giving, for every internal face, the scalar product between the
2953
 
vectors $\vect{IJ}$ and $\vect{n}$. I and J are respectively the centers
 
1921
\variab{idist}{dist(nfac)}{ra}{For every internal face,
 
1922
dot product of the vectors $\vect{IJ}$ and $\vect{n}$.
 
1923
I and J are respectively the centers
2954
1924
of the first and the second neighboring cell. The vector $\vect{n}$ is
2955
1925
the unit vector normal to the face and oriented from the first to the
2956
1926
second cell}
2957
1927
 
2958
 
\variab{idistb}{idistb}{i}{In \texttt{ra}, pointer to \texttt{distbr(nfabor)},
2959
 
real array giving, for every boundary face, the scalar product between
2960
 
the vectors $\vect{IF}$ and $\vect{n}$. I is the center of the
2961
 
neighboring cell. F is the face center. The vector $\vect{n}$ is the
2962
 
unit vector normal to the face and oriented to the exterior of the
2963
 
domain}
2964
 
 
2965
 
\variab{idofij}{idofij}{i}{In \texttt{ra}, pointer to \texttt{dofij(ndim,nfac)},
2966
 
real array giving, for every internal face, the components of the
2967
 
vector $\vect{OF}$. O is the intersection point between the face and
2968
 
the straight line joining the centers of the two neighboring cells. F
2969
 
is the face center}
2970
 
 
2971
 
\variab{iicelb}{iicelb}{i}{In \texttt{ia}, pointer to \texttt{icelbr(ncelbr)},
2972
 
integer array giving the list of cells having at least one boundary face}
2973
 
 
2974
 
\variab{ipond}{ipond}{i}{In \texttt{ra}, pointer to \texttt{pond(nfac)},
2975
 
real array giving
2976
 
$\displaystyle\frac{\vect{FJ}.\vect{n}}{\vect{IJ}.\vect{n}}$, for every
2977
 
internal face. With regard to the mesh quality, its ideal value is 0.5}
2978
 
 
2979
 
\variab{isrfan}{isrfan}{i}{In \texttt{ra}, pointer to \texttt{surfan(nfac)},
2980
 
real array giving the norm of the surface vector of the internal faces}
2981
 
 
2982
 
\variab{isrfbn}{isrfbn}{i}{In \texttt{ra}, pointer to \texttt{surfbn(nfabor)},
2983
 
real array giving the norm of the surface of the boundary faces}
 
1928
\variab{distbr}{distbr(nfabor)}{ra}{For every boundary face,
 
1929
dot product between the vectors $\vect{IF}$ and $\vect{n}$.
 
1930
I is the center of the neighboring cell. F is the face center.
 
1931
The vector $\vect{n}$ is the unit vector normal to the face and
 
1932
oriented to the exterior of the domain}
 
1933
 
 
1934
\variab{dofij}{dofij(ndim,nfac)}{ra}{For every internal
 
1935
face, the three components of the vector $\vect{OF}$. O is the intersection
 
1936
point between the face and the straight line joining the centers
 
1937
of the two neighboring cells. F is the face center}
 
1938
 
 
1939
\variab{icelbr}{icelbr(ncelbr)}{ia}{List of cells having at
 
1940
least one boundary face}
 
1941
 
 
1942
\variab{pond}{ipond(nfac)}{ra}{For every internal face,
 
1943
$\displaystyle\frac{\vect{FJ}.\vect{n}}{\vect{IJ}.\vect{n}}$.
 
1944
With regard to the mesh quality, its ideal value is 0.5}
 
1945
 
 
1946
\variab{surfan}{surfan(nfac)}{ra}{Norm of the surface vector of
 
1947
the internal faces}
 
1948
 
 
1949
\variab{surfbn}{surfbn(nfabor)}{ra}{Norm of the surface of the boundary faces}
2984
1950
 
2985
1951
%==================================
2986
 
\subsection{Physical variables}
 
1952
\subsubsubsection{Physical variables}
2987
1953
%==================================
2988
1954
 
2989
1955
The main physical variables are available in the majority of the
3014
1980
 
3015
1981
The indexes allowing to mark out the different variables (from 1 to
3016
1982
\texttt{nvar}) are integers available in a ``common'' file called
3017
 
\texttt{numvar.h}. Some solved variables (pressure, velocity, turbulence)
3018
 
depend on the considered phase, and the index which refers to it is then a
3019
 
array of size \texttt{nphsmx}, the maximum number of phases.
 
1983
\texttt{numvar.h}.
3020
1984
 
3021
 
For example, \texttt{ipr(iphas)} refers to the variable ``pressure'' of
3022
 
the phase \texttt{iphas} (with 1$\leqslant$iphas$\leqslant$nphas):
3023
 
the pressure of the phase \texttt{iphas} in the cell \texttt{iel}
3024
 
at the current time step is therefore \texttt{rtp(iel,ipr(iphas))}.
 
1985
For example, \texttt{ipr} refers to the variable ``pressure'':
 
1986
the pressure in the cell \texttt{iel} at the current time step is
 
1987
therefore \texttt{rtp(iel,ipr)}.
3025
1988
 
3026
1989
The list of integers referring to solved variables is given below. These
3027
1990
variable index-numbers are not only used for the \texttt{rtp} and
3028
1991
\texttt{rtpa} arrays, but also for some arrays of variable associated options
3029
 
(for instance, \texttt{blencv(ik(iphas))} is the percentage of second-order
3030
 
convective scheme for the turbulent energy of
3031
 
the phase \texttt{iphas} when a corresponding turbulent model is used).
 
1992
(for instance, \texttt{blencv(ik)} is the percentage of second-order
 
1993
convective scheme for the turbulent energy
 
1994
when a corresponding turbulent model is used).
3032
1995
 
3033
1996
\begin{list}{$\bullet$}{}
3034
 
\item \texttt{ipr(iphas)}\index{\texttt{ipr}}: pressure
3035
 
\footnote{\texttt{ipr(iphas)} corresponds to a
 
1997
\item \texttt{ipr}\index{\texttt{ipr}}: pressure
 
1998
\footnote{\texttt{ipr} corresponds to a
3036
1999
reduced pressure, from which the standard hydrostatic pressure has be
3037
2000
deduced. The total pressure is stored in the PROPCE array}.
3038
 
\item \texttt{iu(iphas)}\index{\texttt{iu}}: velocity along the X axis.
3039
 
\item \texttt{iv(iphas)}\index{\texttt{iv}}: velocity along the Y axis.
3040
 
\item \texttt{iw(iphas)}\index{\texttt{iw}}: velocity along the Z axis.
3041
 
\item \texttt{ik(iphas)}\index{\texttt{ik}}: turbulent energy, in $k-\varepsilon$,
 
2001
\item \texttt{iu}\index{\texttt{iu}}: velocity along the X axis.
 
2002
\item \texttt{iv}\index{\texttt{iv}}: velocity along the Y axis.
 
2003
\item \texttt{iw}\index{\texttt{iw}}: velocity along the Z axis.
 
2004
\item \texttt{ik}\index{\texttt{ik}}: turbulent energy, in $k-\varepsilon$,
3042
2005
$k-\omega$ modeling or v2f ($\varphi$-model) modeling.
3043
 
\item \texttt{ir11(iphas)}\index{\texttt{ir11}}: Reynolds stress R11, in
3044
 
      $R_{ij}-\varepsilon$ or SSG modeling.
3045
 
\item \texttt{ir22(iphas)}\index{\texttt{ir22}}: Reynolds stress R22, in
3046
 
      $R_{ij}-\varepsilon$ or SSG modeling.
3047
 
\item \texttt{ir33(iphas)}\index{\texttt{ir33}}: Reynolds stress R33, in
3048
 
      $R_{ij}-\varepsilon$ modeling.
3049
 
\item \texttt{ir12(iphas)}\index{\texttt{ir12}}: Reynolds stress R12, in
3050
 
      $R_{ij}-\varepsilon$ modeling.
3051
 
\item \texttt{ir13(iphas)}\index{\texttt{ir13}}: Reynolds stress R13, in
3052
 
      $R_{ij}-\varepsilon$ modeling.
3053
 
\item \texttt{ir23(iphas)}\index{\texttt{ir23}}: Reynolds stress R23, in
3054
 
      $R_{ij}-\varepsilon$ modeling.
3055
 
\item \texttt{iep(iphas)}\index{\texttt{iep}}: turbulent dissipation in $k-\varepsilon$,
 
2006
\item \texttt{ir11}\index{\texttt{ir11}}: Reynolds stress R11, in
 
2007
      $R_{ij}-\varepsilon$ or SSG modeling.
 
2008
\item \texttt{ir22}\index{\texttt{ir22}}: Reynolds stress R22, in
 
2009
      $R_{ij}-\varepsilon$ or SSG modeling.
 
2010
\item \texttt{ir33}\index{\texttt{ir33}}: Reynolds stress R33, in
 
2011
      $R_{ij}-\varepsilon$ modeling.
 
2012
\item \texttt{ir12}\index{\texttt{ir12}}: Reynolds stress R12, in
 
2013
      $R_{ij}-\varepsilon$ modeling.
 
2014
\item \texttt{ir13}\index{\texttt{ir13}}: Reynolds stress R13, in
 
2015
      $R_{ij}-\varepsilon$ modeling.
 
2016
\item \texttt{ir23}\index{\texttt{ir23}}: Reynolds stress R23, in
 
2017
      $R_{ij}-\varepsilon$ modeling.
 
2018
\item \texttt{iep}\index{\texttt{iep}}: turbulent dissipation in $k-\varepsilon$,
3056
2019
$R_{ij}-\varepsilon$ or v2f ($\varphi$-model) modeling.
3057
 
\item \texttt{iomg(iphas)}\index{\texttt{iomg}}: Specific dissipation rate $\omega$, in
 
2020
\item \texttt{iomg}\index{\texttt{iomg}}: Specific dissipation rate $\omega$, in
3058
2021
$k-\omega$ SST modeling.
3059
 
\item \texttt{iphi(iphas)}\index{\texttt{iphi}}: variable $\varphi=\overline{v^2}/k$ in v2f ($\varphi$-model).
3060
 
\item \texttt{ifb(iphas)}\index{\texttt{ifb}}: variable $\overline{f}$ in v2f ($\varphi$-model).
 
2022
\item \texttt{iphi}\index{\texttt{iphi}}: variable $\varphi=\overline{v^2}/k$ in v2f ($\varphi$-model).
 
2023
\item \texttt{ifb}\index{\texttt{ifb}}: variable $\overline{f}$ in v2f ($\varphi$-model).
3061
2024
\item \texttt{isca(j)}\index{\texttt{isca}}: scalar j(1$\leqslant$j$\leqslant$nscal).
3062
2025
\end{list}
3063
2026
 
3078
2041
      ``specific physics'' scalars, with
3079
2042
      \texttt{nscal=nscaus+nscapp}. \texttt{nscal} must be inferior or
3080
2043
       equal to \texttt{nscamx}.
3081
 
\item The phase related to the scalar \texttt{j} is
3082
 
      \texttt{iphsca(j)}\index{\texttt{iphsca}}.
3083
2044
\item The \texttt{j}$^{\text{th}}$ user scalar is, in
3084
2045
      the whole list of the \texttt{nscal} scalars, the scalar number
3085
2046
      \texttt{j}. In the list of the \texttt{nvar} solved variables, it
3095
2056
      \texttt{rtp(iel,isca(iscapp(j)))}.
3096
2057
 
3097
2058
\item The temperature (or the enthalpy) is the scalar number
3098
 
      \texttt{iscalt(iphas)}\index{iscalt} in the list of the \texttt{nscal}
3099
 
      scalars. It corresponds to the variable number \texttt{isca(iscalt(iphas))}
 
2059
      \texttt{iscalt}\index{iscalt} in the list of the \texttt{nscal}
 
2060
      scalars. It corresponds to the variable number \texttt{isca(iscalt)}
3100
2061
      and its value in the cell \texttt{iel} is
3101
 
      \texttt{rtp(iel,isca(iscalt(iphas)))}. if there is no thermal scalar,
3102
 
      \texttt{iscalt(iphas)} is equal to -1.
 
2062
      \texttt{rtp(iel,isca(iscalt))}. if there is no thermal scalar,
 
2063
      \texttt{iscalt} is equal to -1.
3103
2064
\item A ``user'' scalar number \texttt{j} may represent the average of the
3104
2065
      square of the fluctuations of a scalar \texttt{k} ({\em i.e.} the average
3105
2066
      $\overline{\varphi^\prime\varphi^\prime}$ for a fluctuating scalar
3136
2097
 
3137
2098
\item All the properties (used or not) have a unique and distinct index-number,
3138
2099
given automatically by the code and stored in an integer or an integer array
3139
 
(its size may be the maximum number of phases, the maximum
3140
 
number of scalars or the maximum number of variables).
 
2100
(its size may be the maximum number of scalars
 
2101
or the maximum number of variables).
3141
2102
 
3142
2103
\item The indexes referring  to the different properties stored in the
3143
2104
\texttt{prop{\bf xx}} arrays are given respectively by the following integer arrays:
3153
2114
 
3154
2115
\end{list}
3155
2116
 
3156
 
For instance, the index number corresponding to the density of the phase
3157
 
\texttt{iphas} is \texttt{irom(iphas)}.\\
3158
 
In the list of the properties defined at the cell center, the density of
3159
 
the phase \texttt{iphas} is therefore the \texttt{ipproc(irom(iphas))}$^{\text{th}}$
 
2117
For instance, the index number corresponding to the density is \texttt{irom}.\\
 
2118
In the list of the properties defined at the cell center, the density
 
2119
is therefore the \texttt{ipproc(irom)}$^{\text{th}}$
3160
2120
property: its value at the center of the cell \texttt{iel} is given by \\
3161
 
\texttt{prop{\bf ce}(iel,ippro{\bf c}(irom(iphas)))}.\\
 
2121
\texttt{prop{\bf ce}(iel,ippro{\bf c}(irom))}.\\
3162
2122
In the same way, in the list of the properties defined at the boundary
3163
 
faces, the density of the phase \texttt{iphas} is the
3164
 
\texttt{ipprob(irom(iphas)))}$^{\text{th}}$ property: its value at the boundary
 
2123
faces, the density is the
 
2124
\texttt{ipprob(irom))}$^{\text{th}}$ property: its value at the boundary
3165
2125
face is given by \\
3166
 
\texttt{prop{\bf fb}(iel,ippro{\bf b}(irom(iphas)))}
 
2126
\texttt{prop{\bf fb}(iel,ippro{\bf b}(irom))}
3167
2127
 
3168
2128
The list of properties accessible in the PROPxx arrays is given below (this does
3169
2129
not include the properties linked to the specific physics modules):
3170
2130
 
3171
 
\variab{irom}{irom(nphsmx)}{ia}{For each phase, property number
 
2131
\variab{irom}{irom}{ia}{Property number
3172
2132
corresponding to the density ({\em i.e.} $\rho$ in $kg.m^{-3}$)\\
3173
2133
stored at the cells and the boundary faces}
3174
2134
 
3175
 
\variab{iroma}{iroma(nphsmx)}{ia}{For each phase, property number
 
2135
\variab{iroma}{iroma}{ia}{Property number
3176
2136
corresponding to the density ({\em i.e.} $\rho$ in $kg.m^{-3}$) at the
3177
2137
previous time step, in the case of a second-order extrapolation in time\\
3178
2138
stored at the cells and the boundary faces}
3179
2139
 
3180
 
\variab{iviscl}{iviscl(nphsmx)}{ia}{For each phase, property number
 
2140
\variab{iviscl}{iviscl}{ia}{Property number
3181
2141
corresponding to the fluid molecular dynamic viscosity ({\em i.e.} $\mu$ in
3182
2142
$kg.m^{-1}.s^{-1}$)\\
3183
2143
stored at the cells}
3184
2144
 
3185
 
\variab{ivisla}{ivisla(nphsmx)}{ia}{For each phase, property number
 
2145
\variab{ivisla}{ivisla}{ia}{Property number
3186
2146
corresponding to the fluid molecular dynamic viscosity ({\em i.e.} $\mu$
3187
2147
in $kg.m^{-1}.s^{-1}$) at the previous time step, in the case of a
3188
2148
second-order extrapolation in time\\
3189
2149
stored at the cells}
3190
2150
 
3191
 
\variab{ivisct}{ivisct(nphsmx)}{ia}{For each phase, property number
 
2151
\variab{ivisct}{ivisct}{ia}{Property number
3192
2152
corresponding to the fluid turbulent dynamic viscosity ({\em i.e.}
3193
2153
$\mu_t$ in $kg.m^{-1}.s^{-1}$)\\
3194
2154
stored at the cells}
3195
2155
 
3196
 
\variab{ivista}{ivista(nphsmx)}{ia}{For each phase, property number
 
2156
\variab{ivista}{ivista}{ia}{Property number
3197
2157
corresponding to the fluid turbulent dynamic viscosity ({\em i.e.}
3198
2158
$\mu_t$ in $kg.m^{-1}.s^{-1}$) at the previous time step, in the case of a
3199
2159
second-order extrapolation in time\\
3200
2160
stored at the cells}
3201
2161
 
3202
 
\variab{icp}{icp(nphsmx)}{ia}{For each phase,  property number
 
2162
\variab{icp}{icp}{ia}{Property number
3203
2163
corresponding to the specific heat, in case where it is variable
3204
2164
({\em i.e.} $C_p$ in $m^2.s^{-2}.K^{-1}$). See note below\\
3205
2165
stored at the cells}
3206
2166
 
3207
 
\variab{icpa}{icpa(nphsmx)}{ia}{For each phase,  property number
 
2167
\variab{icpa}{icpa}{ia}{Property number
3208
2168
corresponding to the specific heat, in case where it is variable
3209
2169
({\em i.e.} $C_p$ in $m^2.s^{-2}.K^{-1}$), at the previous time step,
3210
2170
in the case of a second-order extrapolation in time. See note below\\
3211
2171
stored at the cells}
3212
2172
 
3213
 
\variab{itsnsa}{itsnsa(nphsmx)}{ia}{For each phase, in the case of a
 
2173
\variab{itsnsa}{itsnsa}{ia}{In the case of a
3214
2174
calculation run with a second-order discretisation in time with
3215
2175
extrapolation of the source terms, property number corresponding to the
3216
2176
source term of Navier-Stokes at the previous time step ($kg.m^{-1}.s^{-2}$)\\
3217
2177
stored at the cells}
3218
2178
 
3219
 
\variab{itstua}{itstua(nphsmx)}{ia}{For each phase, in the case of a
 
2179
\variab{itstua}{itstua}{ia}{In the case of a
3220
2180
calculation run with a second-order discretisation in time with
3221
2181
extrapolation of the source terms, property number corresponding to the
3222
2182
source terms of the turbulence at the previous time step\\
3223
2183
stored at the cells}
3224
2184
 
3225
 
\variab{itssca}{itssca(nphsmx)}{ia}{For each phase, in the case of a
 
2185
\variab{itssca}{itssca}{ia}{In the case of a
3226
2186
calculation run with a second-order discretisation in time with
3227
2187
extrapolation of the source terms, property number corresponding to the
3228
2188
source terms of the equations solved for the scalars at the previous
3229
2189
time step ($kg.m^{-1}.s^{-2}$)\\
3230
2190
stored at the cells}
3231
2191
 
3232
 
\variab{iestim}{iestim(nestmx,nphsmx)}{ia}{For each phase, property
 
2192
\variab{iestim}{iestim(nestmx)}{ia}{Property
3233
2193
number for the \texttt{nestmx} error estimators for Navier-Stokes. The estimators
3234
 
currently available are \texttt{iestim(iespre\index{iespre},iphas)},\\
3235
 
\texttt{iestim(iesder\index{iesder},iphas)},
3236
 
\texttt{iestim(iescor\index{iescor},iphas)},
3237
 
\texttt{iestim(iestot\index{iestot},iphas)}
 
2194
currently available are \texttt{iestim(iespre\index{iespre})},\\
 
2195
\texttt{iestim(iesder\index{iesder})},
 
2196
\texttt{iestim(iescor\index{iescor})},
 
2197
\texttt{iestim(iestot\index{iestot})}
3238
2198
stored at the cells}
3239
2199
 
3240
2200
\variab{ifluma}{ifluma(nvarmx)}{ia}{Property number corresponding to the
3241
2201
mass flow associated with each variable ({\em i.e.} for each face
3242
2202
of surface $S$, $\rho \vect{u} \,.\,\vect{S}$ in $kg.s^{-1}$). It
3243
2203
must be noticed that the mass flows are associated with the
3244
 
variables and not with the phases. This allows to have a distinct
3245
 
convective flow for each scalar.\\
 
2204
variables, which allows to have a distinct convective flow for each scalar.\\
3246
2205
stored at the internal faces and boundary faces}
3247
2206
 
3248
2207
\variab{ifluaa}{ifluaa(nvarmx)}{ia}{Property number corresponding to the
3263
2222
previous time step, in the case of a second-order extrapolation in time\\
3264
2223
stored at the cells}
3265
2224
 
3266
 
\variab{ismago}{ismago(nphsmx)}{ia}{For each phase, property number
 
2225
\variab{ismago}{ismago}{i}{Property number
3267
2226
corresponding to the variable $C$ of the dynamic model, {\em i.e}
3268
2227
so that $\mu_t=\rho C\overline{\Delta}^2\sqrt{2S_{ij}S_{ij}}$ (with the
3269
2228
notations of \cite{benhamadouche01}). $C$ corresponds to $C_s^2$ in the
3270
2229
classical model of Smagorinsky\\
3271
2230
stored at the cells}
3272
2231
 
3273
 
\variab{icour}{icour(nphsmx)}{ia}{For each phase, CFL number in each cell at the
 
2232
\variab{icour}{icour}{i}{CFL number in each cell at the
3274
2233
present time step\\
3275
2234
stored at the cells}
3276
2235
 
3277
 
\variab{ifour}{ifour(nphsmx)}{ia}{For each phase, Fourier number in each cell at
 
2236
\variab{ifour}{ifour}{i}{Fourier number in each cell at
3278
2237
the present time step\\
3279
2238
stored at the cells}
3280
2239
 
3281
 
\variab{iprtot}{iprtot(nphsmx)}{ia}{For each phase\footnote{Although the data
3282
 
structure of \CS allows multi-phase variables,  the algorithm does not allow
3283
 
more than one pressure}, total pressure in each cell\\
 
2240
\variab{iprtot}{iprtot}{i}{Total pressure in each cell\\
3284
2241
stored at the cells}
3285
2242
 
3286
2243
\variab{ivisma}{ivisma(1 or 3)}{ia}{When the ALE method for deformable meshes is
3311
2268
\begin{list}{$\bullet$}{}
3312
2269
\item It is the case for the specific heat $C_p$.
3313
2270
\begin{list}{-}{}
3314
 
\item If $C_p$ is constant for the phase \texttt{iphas}, it can be specified in
3315
 
      the interface or by indicating \texttt{icp(iphas)=0} in \texttt{usini1},
3316
 
      and the property will be stored in the real number \texttt{cp0(iphas)}.
 
2271
\item If $C_p$ is constant, it can be specified in
 
2272
      the interface or by indicating \texttt{icp=0} in \texttt{usini1},
 
2273
      and the property will be stored in the real number \texttt{cp0}.
3317
2274
\item If $C_p$ is variable, it can be specified in the interface or by
3318
 
      indicating \texttt{icp(iphas)=1} in \texttt{usini1}. The code will then
3319
 
      modify this value to make \texttt{icp(iphas)} refer to the effective
3320
 
      property number corresponding to the specific heat of the phase
3321
 
      \texttt{iphas}, in a way which is transparent for the user. For each cell
 
2275
      indicating \texttt{icp=1} in \texttt{usini1}. The code will then
 
2276
      modify this value to make \texttt{icp} refer to the effective
 
2277
      property number corresponding to the specific heat,
 
2278
      in a way which is transparent for the user. For each cell
3322
2279
      \texttt{iel}, the value of $C_p$ is then given in \texttt{usphyv} and
3323
 
      stored in the array \texttt{propce(iel,ipproc(icp(iphas)))}.
 
2280
      stored in the array \texttt{propce(iel,ipproc(icp))}.
3324
2281
\end{list}
3325
2282
\item It is the same for the diffusivity $K$ of each scalar \texttt{iscal}.
3326
2283
\begin{list}{-}{}
3337
2294
\end{list}
3338
2295
\end{list}
3339
2296
 
3340
 
 
3341
2297
\minititre{Note: cumulated duration associated with the averages
3342
2298
defined by the user}\label{prg_moyennes}
3343
2299
The cumulated duration associated with the calculation of a time averages
3381
2337
although they concern only the wall boundary faces.
3382
2338
 
3383
2339
 
3384
 
 
3385
 
%%%ICI%%%%%%%%%%%%%%%
3386
 
 
3387
2340
%==================================
3388
 
\subsection{Variables related to the numerical methods}
 
2341
\subsubsubsection{Variables related to the numerical methods}
3389
2342
%==================================
3390
2343
 
3391
2344
The main numerical variables and ``pointers''\footnote{As for the
3392
2345
geometrical variables, some variables may be accessed to directly in
3393
 
sections of the unidimensional macro-arrays IA (for the integers) and RA
3394
 
(for the real numbers) which are present as arguments in every
3395
 
subroutine (apart from a few ones of very low level). The number of the
3396
 
first position of these sections in IA and RA is indicated by an integer
3397
 
stored in a ``common''. These integers are called ``pointers''} are
 
2346
sections of the unidimensional macro-array \texttt{ra}
 
2347
(for the real numbers) which is present as an argument to many
 
2348
subroutines. The number of the first position of these sections in \texttt{ra}
 
2349
is indicated by an integer stored in a the \texttt{pointe} Fortran module.
 
2350
These integers are referred to as ``pointers''} are
3398
2351
displayed below.
3399
2352
 
3400
2353
\minititre{Boundary conditions}
3424
2377
element of the section allowing to mark out the ``wall'' (\texttt{itypfb=iparoi}
3425
2378
or \texttt{iparug})
3426
2379
or ``symmetry'' (\texttt{itypfb=isymet}) boundary faces in order to prevent the
3427
 
mass flow (these faces are impermeable). For instance, for the phase
3428
 
\texttt{iphas}, if the face \texttt{ifac} is a wall or symmetry face,
3429
 
\texttt{ia(iismph+ifac-1)=0} (with \texttt{iismph=iisymp+nfabor*(iphas-1))}.\\
 
2380
mass flow (these faces are impermeable). For instance,
 
2381
if the face \texttt{ifac} is a wall or symmetry face,
 
2382
\texttt{ia(iismph+ifac-1)=0} (with \texttt{iismph=iisymp+nfabor)}.\\
3430
2383
Otherwise \texttt{ia(iisymp+ifac-1)=1}. \\
3431
2384
In some subroutines, an array called \texttt{isympa(nfabor)}\index{\texttt{isympa}}
3432
2385
allows to simplify the coding with \texttt{isympa(ifac)=ia(iismph+ifac-1)}}
3433
2386
 
3434
 
\variab{iitrif}{iitrif}{i}{In \texttt{ia}, pointer to \texttt{itrifb}}
3435
 
 
3436
 
\variab{iitypf}{iitypf}{i}{In \texttt{ia}, pointer to \texttt{itypfb}}
3437
 
 
3438
 
\variab{itrifb}{itrifb(nfabor,nphas)}{ia}{Indirection array allowing to
 
2387
\variab{itrifb}{itrifb(nfabor)}{ia}{Indirection array allowing to
3439
2388
sort the boundary faces according to their boundary condition type \texttt{itypfb}}
3440
2389
 
3441
 
\variab{itypfb}{itypfb(nfabor,nphas)}{ia}{Boundary condition type at the
3442
 
boundary face \texttt{ifac} for the phase \texttt{iphas} (see user subroutine
3443
 
\texttt{usclim})}
 
2390
\variab{itypfb}{itypfb(nfabor)}{ia}{Boundary condition type at the
 
2391
boundary face \texttt{ifac} (see user subroutine \texttt{usclim})}
3444
2392
 
3445
 
\variab{iuetbo}{iuetbo}{i}{In \texttt{ra}, pointer to \texttt{uetbor}, used to
3446
 
store the friction velocity at the wall, in the case of a LES calculation with van
3447
 
Driest-wall damping}
 
2393
\variab{uetbor}{uetbor(nfabor)}{ra}{Friction velocity at the wall,
 
2394
in the case of a LES calculation with van Driest-wall damping}
3448
2395
 
3449
2396
\minititre{Distance to the wall}
3450
2397
 
3451
 
\variab{iifapa}{iifapa(nphsmx)}{ia}{For each phase, the pointer in \texttt{ia}
3452
 
which  marks out the number of the wall face(type \texttt{itypfb=iparoi} or
3453
 
\texttt{iparug}) which is closest  to the center of a given volume when necessary
 
2398
\variab{ifapat}{ifapat(ncelet)}{ra}{Number of the wall
 
2399
face(type \texttt{itypfb=iparoi} or \texttt{iparug}) which is closest
 
2400
to the center of a given volume when necessary
3454
2401
($R_{ij}-\varepsilon$ with wall echo, LES with van Driest-wall damping,
3455
2402
or SST $k-\omega$ turbulence model) and when \texttt{icdpar=2}.
3456
 
The number of the wall face (for the phase \texttt{iphas}) which is the closest to
3457
 
the center of the cell \texttt{iel} is therefore \texttt{ia(iifapa(iphas)+iel-1)}. This calculation method is not compatible with parallelism and periodicity}
 
2403
The number of the wall face which is the closest to
 
2404
the center of the cell \texttt{iel} is \texttt{ifapat(iel1)}.
 
2405
This calculation method is not compatible with parallelism and periodicity}
3458
2406
 
3459
 
\variab{idipar}{idipar}{i}{For each phase, pointer in \texttt{ra} to the section
3460
 
allowing to mark out the distance between the center of a given volume and the
3461
 
closest wall, when it is necessary ($R_{ij}-\varepsilon$ with wall echo,
 
2407
\variab{dispar}{dispar(ncelet)}{ra}{Distance between the center of
 
2408
a given volume and the closest wall, when it is necessary
 
2409
($R_{ij}-\varepsilon$ with wall echo,
3462
2410
LES with van Driest-wall damping, or SST $k-\omega$ turbulence model)
3463
2411
and when \texttt{icdpar=1}. The distance between the center of the cell
3464
 
\texttt{iel} and the closest wall is therefore \texttt{ra(idipar+iel-1)}}
 
2412
\texttt{iel} and the closest wall is \texttt{dispar(iel)}}
3465
2413
 
3466
 
\variab{iyppar}{iyppar}{i}{For each phase, pointer in \texttt{ra} to the section
3467
 
allowing to mark out the adimensional distance $y^+$ between a given
 
2414
\variab{yplpar}{yplpar}{ra}{Adimensional distance $y^+$ between a given
3468
2415
volume and the closest wall, when it is necessary (LES with van
3469
2416
Driest-wall damping) and when \texttt{icdpar=1}. The adimensional distance $y^+$
3470
2417
between the center of the cell \texttt{iel} and the closest wall is therefore
3471
 
\texttt{ra(iyppar+iel-1)}}
 
2418
\texttt{yplpar(iel1)}}
3472
2419
 
3473
2420
\minititre{Pressure drops}
3474
2421
 
3475
 
\variab{iicepd}{iicepd(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3476
 
\texttt{ia} to \\
3477
 
\texttt{icepdc(ncepdc(iphas))}, array allowing to mark out the index-numbers of
3478
 
the \\
3479
 
\texttt{ncepdc(iphas)} cells in which a pressure drop is imposed. \\
3480
 
The number of these cells is therefore given by
3481
 
\texttt{icepdc(ii)=ia(iicepd(iphas)+ii-1)}, with
3482
 
1$\leqslant$\texttt{ii}$\leqslant$\texttt{ncepdc(iphas)}. See the user subroutine
3483
 
\texttt{uskpdc}}
3484
 
 
3485
 
\variab{icepdc}{icepdc(ncepdc(iphas))}{ia}{Number of the \texttt{ncepdc(iphas)}
 
2422
\variab{icepdc}{icepdc(ncepdc)}{ia}{Number of the \texttt{ncepdc}
3486
2423
cells in which a pressure drop is imposed. See \texttt{iicepd} and the user
3487
2424
subroutine \texttt{uskpdc}}
3488
2425
 
3489
 
\variab{ickupd}{ickupd(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3490
 
\texttt{ra} to \\
3491
 
\texttt{ckupdc(ncepdc(iphas),6)}, array allowing to mark out the\\
3492
 
coefficients of the pressure drop tensor of the
3493
 
\texttt{ncepdc(iphas)} cells in which a pressure drop is imposed. See the user
3494
 
subroutine \texttt{uskpdc}}
3495
 
 
3496
 
\variab{ckupdc}{ckupdc(ncepdc(iphas),6)}{ra}{Value of the
3497
 
coefficients of the pressure drop tensor of the
3498
 
\texttt{ncepdc(iphas)} cells in which a pressure drop is imposed.
 
2426
\variab{ckupdc}{ckupdc(ncepdc,6)}{ra}{Value of the
 
2427
coefficients of the pressure drop tensor of the
 
2428
\texttt{ncepdc} cells in which a pressure drop is imposed.
3499
2429
See \texttt{ickpdc} and the user subroutine \texttt{uskpdc}}
3500
2430
 
3501
 
\variab{ncepdc}{ncepdc(nphsmx)}{ia}{For each phase, number of cells in
 
2431
\variab{ncepdc}{ncepdc}{ia}{Number of cells in
3502
2432
which a pressure drop is imposed. See the user subroutine \texttt{uskpdc}}
3503
2433
 
3504
2434
 
3505
2435
\minititre{Mass sources}
3506
2436
 
3507
 
\variab{iicesm}{iicesm(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3508
 
\texttt{ia} to \\
3509
 
\texttt{icetsm(ncetsm(iphas)}, array allowing to mark out the numbers of the \\
3510
 
\texttt{ncetsm(iphas)} cells in which a source of mass is imposed. The number of
3511
 
these cells is therefore given by \texttt{icetsm(ii)=ia(iicesm(iphas)+ii-1)}, with
3512
 
1$\leqslant$\texttt{ii}$\leqslant$\texttt{ncetsm(iphas)}. See the user subroutine
3513
 
\texttt{ustsma}}
3514
 
 
3515
 
\variab{iitpsm}{iitpsm(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3516
 
\texttt{ia} to \texttt{itypsm} (type of mass source for each variable).
3517
 
See \texttt{itypsm} and the user subroutine \texttt{ustsma}}
3518
 
 
3519
 
\variab{icetsm}{icetsm(ncetsm(iphas))}{ia}{Number of the \texttt{ncetsm(iphas)}
 
2437
\variab{icetsm}{icetsm(ncetsm)}{ia}{Number of the \texttt{ncetsm}
3520
2438
cells in which a mass source term is imposed. See \texttt{iicesm} and the user
3521
2439
subroutine \texttt{ustsma}}
3522
2440
 
3523
 
\variab{ismace}{ismace(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3524
 
\texttt{ra} to \texttt{smacel} (mass source term and if necessary injection value
3525
 
for every variable apart from pressure). See \texttt{smacel} and the user subroutine
3526
 
\texttt{ustsma}}
3527
 
 
3528
 
\variab{itypsm}{itypsm(ncetsm(iphas),nvar)}{ia}{Type of mass source term
 
2441
\variab{itypsm}{itypsm(ncetsm,nvar)}{ia}{Type of mass source term
3529
2442
for each variable (0 for an injection at ambient value, 1 for an
3530
2443
injection at imposed value). See the user subroutine \texttt{ustsma}}
3531
2444
 
3532
 
\variab{ncetsm}{ncetsm(nphsmx)}{ia}{For each phase, number of cells with
 
2445
\variab{ncetsm}{ncetsm}{i}{Number of cells with
3533
2446
mass sources. See the user subroutine \texttt{ustsma}}
3534
2447
 
3535
 
\variab{smacel}{smacel(ncetsm(iphas),nvar)}{ra}{Value of the mass source
 
2448
\variab{smacel}{smacel(ncetsm,nvar)}{ra}{Value of the mass source
3536
2449
term for pressure. For the other variables, eventual imposed injection
3537
2450
value. See the user subroutine \texttt{ustsma}}
3538
2451
 
3541
2454
\variab{nfpt1d}{nfpt1d}{i}{Number of boundary faces which are coupled
3542
2455
with a wall 1D thermal module. See the user subroutine \texttt{uspt1d}}
3543
2456
 
3544
 
\variab{iifpt1}{iifpt1}{i} {In \texttt{ia}, pointer to \texttt{ifpt1d(nfpt1d)},
3545
 
array allowing to mark out the numbers of the \texttt{nfpt1d} boundary faces
3546
 
which are coupled with a wall 1D thermal module. The number of these boundary
3547
 
faces is therefore given by \texttt{ifpt1d(ii)=ia(iifpt1+ii-1)}, with
 
2457
\variab{ifpt1d}{ifpt1d}{ia} {Array allowing to mark out the numbers of
 
2458
the \texttt{nfpt1d} boundary faces which are coupled with a wall 1D
 
2459
thermal module. The numbers of these boundary faces are
 
2460
given by \texttt{ifpt1d(ii)}, with
3548
2461
1$\leqslant$\texttt{ii}$\leqslant$\texttt{nfpt1d}.
3549
2462
See the user subroutine \texttt{uspt1d}}
3550
2463
 
3551
 
\variab{inppt1}{inppt1}{i}{In \texttt{ia}, pointer to \texttt{nppt1d(nfpt1d)},
3552
 
array giving the number of discretisation cells in the 1D wall for the
 
2464
\variab{nppt1d}{nppt1d}{ia}{Number of discretisation cells in the 1D wall for the
3553
2465
\texttt{nfpt1d} boundary faces which are coupled with a wall 1D thermal module. The
3554
 
number of cells for these boundary faces is therefore given by
3555
 
\texttt{nppt1d(ii)=ia(inppt1+ii-1)}, with
 
2466
number of cells for these boundary faces is given by
 
2467
\texttt{nppt1d(ii)}, with
3556
2468
1$\leqslant$\texttt{ii}$\leqslant$\texttt{nfpt1d}. See
3557
2469
the user subroutine \texttt{uspt1d}}
3558
2470
 
3559
 
\variab{ieppt1}{ieppt1}{i}{In \texttt{ia}, pointer to \texttt{eppt1d(nfpt1d)},
3560
 
array giving the thickness of the 1D wall for the \texttt{nfpt1d} boundary faces
3561
 
which are coupled with a wall 1D thermal module. The wall thickness for these
3562
 
boundary faces is therefore given by \texttt{eppt1d(ii)=ia(ieppt1+ii-1)}, with
 
2471
\variab{eppt1d}{eppt1d}{ia}{Thickness of the 1D wall for the
 
2472
\texttt{nfpt1d} boundary faces which are coupled with a wall 1D thermal
 
2473
module. The wall thickness for these boundary faces is therefore given
 
2474
by \texttt{eppt1d(ii)}, with
3563
2475
1$\leqslant$\texttt{ii}$\leqslant$\texttt{nfpt1d}. See the user subroutine
3564
2476
\texttt{uspt1d}}
3565
2477
 
3569
2481
 
3570
2482
\variab{ifmcel}{ifmcel(ncelet)}{ia}{Family number of the elements. See note 1}
3571
2483
 
3572
 
\variab{is2kw}{is2kw(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3573
 
\texttt{ra} to the section storing the square of the norm of the deformation
3574
 
rate tensor. In the cell \texttt{iel}, for the phase \texttt{iphas},
3575
 
$S^2=2S_{ij}S_{ij}$
3576
 
is therefore given by \texttt{ra(is2kw(iphas)+iel-1)}. This array is defined only
3577
 
when the phase \texttt{iphas} is treated with the SST $k-\omega$ turbulence model}
 
2484
\variab{s2kw}{s2kw(ncelet)}{ra}{Square of the norm of the deformation
 
2485
rate tensor. In the cell \texttt{iel}, $S^2=2S_{ij}S_{ij}$
 
2486
is given by \texttt{ra(is2kw+iel-1)}. This array is defined only
 
2487
with the SST $k-\omega$ turbulence model}
3578
2488
 
3579
 
\variab{idvukw}{idvukw(nphsmx)}{ia}{For each phase \texttt{iphas}, pointer in
3580
 
\texttt{ra} to the section storing the divergence of the velocity. In the
3581
 
cell \texttt{iel}, for the phase \texttt{iphas}, $div(\vect{u})$ is therefore
3582
 
given by \texttt{ra(idvukw(iphas)+iel-1)}. This array is defined only when the
3583
 
phase \texttt{iphas} is treated with the SST $k-\omega$ turbulence model
 
2489
\variab{divukw}{divukw}{ia}{Divergence of the velocity. In the
 
2490
cell \texttt{iel},  $div(\vect{u})$ is given by \texttt{divukw(iel1)}.
 
2491
This array is defined only with the SST $k-\omega$ turbulence model
3584
2492
(because in this case it may be calculated at the same time as $S^2$)}
3585
2493
 
3586
2494
\variab{ngrmmx}{ngrmmx}{i}{upper limit of the number of grid levels
3587
 
in the case of a multigrid solving (see \texttt{ngrmax})}
3588
 
 
3589
 
\variab{ia}{ia(longia)}{ia}{Integer work array}
3590
 
 
3591
 
\variab{ra}{ra(longra)}{ra}{Real work array}
3592
 
 
 
2495
when using the multigrid solver (see \texttt{ngrmax})}
 
2496
 
 
2497
\variab{ra}{ra(ifinra)}{ra}{Real work array}
3593
2498
 
3594
2499
\minititre{Note: boundary conditions}
3595
2500
The boundary conditions in \CS boil down to determine a value for the
3615
2520
\mbox{$\phi_f$=\texttt{coefa(ifac,iclvar)+coefb(ifac,iclvar)} $\phi_{I'}$}
3616
2521
with \texttt{iclvar=iclrtp(ivar,icoef)}
3617
2522
 
3618
 
 
3619
 
%==================================
3620
 
\subsection{User arrays}
3621
 
%==================================
3622
 
The code allows to define two user arrays, one integer array and one
3623
 
real array. The default size of these arrays is zero, and may be changed
3624
 
in \texttt{usini1}. The two arrays are then passed as arguments in every
3625
 
user subroutine of the code. For instance, a local variable calculated during
3626
 
the determination of the physical properties (user subroutine
3627
 
\texttt{usphyv}) may be stored in these arrays and sent to the
3628
 
post-processor at the end of the time step (user subroutine \texttt{usvpst}).
3629
 
 
3630
 
\variab{nituse}{nituse}{i}{Size of the user integer array}
3631
 
 
3632
 
\variab{nrtuse}{nrtuse}{i}{Size of the user real array}
3633
 
 
3634
 
\variab{ituser}{ituser(nituse)}{ia}{User integer array}
3635
 
 
3636
 
\variab{rtuser}{rtuser(nrtuse)}{ra}{User real array}
3637
 
 
3638
 
%==================================
3639
 
\subsection{Developer arrays}
3640
 
%==================================
3641
 
The code allows to define two developer arrays (similar to the user
3642
 
arrays \texttt{ituser} and \texttt{rtuser}), one integer array a one real array.
3643
 
The default size of these arrays is zero, and may be changed in
3644
 
\texttt{ustbus}. The two arrays are then passed as arguments in the rest
3645
 
of the code. They are designed to be used during the transitory
3646
 
development phases, in order to ease the tests (transfer of pieces of
3647
 
informations without consequence on the arguments of the subroutines).
3648
 
 
3649
 
\variab{nideve}{nideve}{i}{Size of the developer integer array}
3650
 
 
3651
 
\variab{nrdeve}{nrdeve}{i}{Size of the developer real array}
3652
 
 
3653
 
\variab{idevel}{idevel(nideve)}{ia}{Complementary integer array, used
3654
 
during development and test phases}
3655
 
 
3656
 
\variab{rdevel}{rdevel(nrdeve)}{ra}{Complementary real array, used
3657
 
during development and test phases}
3658
 
 
3659
 
%==================================
3660
 
\subsection{Parallelism and periodicity}
 
2523
%==================================
 
2524
\subsubsubsection{User arrays}
 
2525
%==================================
 
2526
Modules containing user arrays accessible from all user subroutines may
 
2527
be defined in the \texttt{user\_modules.f90} file. This file is
 
2528
compiled before any other Fortran user file, to ensure modules
 
2529
may be acessed in other user subroutines using the \texttt{use <module>}
 
2530
construct.
 
2531
 
 
2532
%==================================
 
2533
\subsubsubsection{Parallelism and periodicity}
3661
2534
%==================================
3662
2535
 
3663
2536
Parallelism is based on domain partitioning: each processor is assigned
3704
2577
\label{prg_paralperio}
3705
2578
{\bf Activation}
3706
2579
 
3707
 
Parallelism and periodicity are activated by means of the launch script
 
2580
Parallism is activated by means GUI or of the launch scripts
3708
2581
in the standard cases:
3709
2582
\begin{list}{$\bullet$}{}
3710
2583
 
3711
 
\item On clusters with PBS batch systems, the launching of a parallel run
3712
 
      requires to complete the \texttt{PBS} batch cards located in the
3713
 
      beginning of \texttt{runcase}, and particularly to set the number of
3714
 
      physical nodes (\texttt{nodes}) and the number of physical
3715
 
      processors per node (\texttt{ppn}) wanted. This can be done through
3716
 
      the Graphical Interface or by editing the \texttt{runcase} file directly.
3717
 
      The number of processors used for the calculation will then be set
3718
 
      automatically to the number of processors reserved and the 
3719
 
      variable \texttt{NUMBER\_OF\_PROCESSORS} can be left empty
3720
 
      (see also \S\ref{prg_runcase}).
3721
 
 
3722
 
\item On clusters with LSF batch systems (like the CCRT machines),
3723
 
      the launching of a parallel run
3724
 
      requires to complete the \texttt{LSF} batch cards located in the
3725
 
      beginning of \texttt{runcase}, and particularly to set the
3726
 
      number of processors (\texttt{\#BSUB -n}) wanted and the limit CPU
3727
 
      time (\texttt{\#BSUB -W}). As for now, this can only be done
3728
 
      by editing the \texttt{runcase} file directly.
3729
 
      The number of processors used for the calculation will then be set
3730
 
      automatically to the number of processors reserved and the 
3731
 
      variable \texttt{NUMBER\_OF\_PROCESSORS} can be left empty
3732
 
      (see also \S\ref{prg_runcase}).
3733
 
 
3734
 
\item On clusters with other batch systems, \texttt{runcase} file may have to
3735
 
      be modified manually. Please do not hesitate to contact the \CS support
 
2584
\item On clusters with batch systems, the launching of a parallel run
 
2585
      requires to complete the batch cards located in the
 
2586
      beginning of \texttt{runcase} or \texttt{runcase\_batch}
 
2587
      script, and set the number of MPI processes, or the numbers
 
2588
      of physical nodes and processors per node (\texttt{ppn}) wanted.
 
2589
      This can be done through the Graphical Interface or by editing
 
2590
      the \texttt{runcase}  or \texttt{runcase\_batch} file directly.
 
2591
      The number of processors defined here will override the number
 
2592
      defined through the GUI in a non-batch environment
 
2593
      (so that studies defined on one environment may be migrated
 
2594
      to larger compute resources easily), but it may be overriden
 
2595
      by the \item \texttt{define\_case\_parameters} function from
 
2596
      the \texttt{cs\_user\_scripts.py} file, or by setting the
 
2597
      \texttt{n\_procs\_weight}, \texttt{n\_procs\_min}, and
 
2598
      \texttt{n\_procs\_max} parameters for the different domains
 
2599
      defined in \texttt{runcase\_coupling}.
 
2600
 
 
2601
\item On clusters with unsupported batch systems,
 
2602
      \texttt{runcase} file may have to be modified manually.
 
2603
      Please do not hesitate to contact the \CS support
3736
2604
      (saturne-support@edf.fr) so that these modifications can be added to
3737
2605
      the standard launch script to make it more general.
3738
2606
 
3739
 
\item Although on batch systems the \texttt{NUMBER\_OF\_PROCESSORS} variable
3740
 
      in the script (indicating the number of processors used for the
3741
 
      calculation) is filled automatically to the number of processors
3742
 
      reserved, the user can still choose to specify another value for it.
3743
 
      This might only happen in very specific conditions and is not advised,
3744
 
      as it will probably not be compatible with the batch system. Indeed,
3745
 
      batch systems forbid to launch a calculation on more processors than the
3746
 
      number of processors reserved, and some batch systems also forbid to
3747
 
      launch a calculation on less processors than the number of processors
3748
 
      reserved (automatic timeout on the idle processors that will stop the
3749
 
      whole calculation).
3750
 
 
3751
 
 
3752
 
\item Periodicity is activated through the Graphical Interface or by completing
3753
 
      the \texttt{COMMAND\_PERIO} of the launch script \texttt{runcase}.
3754
 
      The transformation
3755
 
      allowing to pass from a boundary to the other one must be defined
3756
 
      (the direction does not matter) and the set of periodic faces
3757
 
      should be (optional but strongly advised) marked out (for instance
3758
 
      by means of a color).
3759
 
 
3760
 
\item Periodicity is compatible with parallelism.
3761
 
 
3762
 
\item Periodicity can also work when the periodic boundaries are meshed
3763
 
      differently (periodicity of non-conforming faces), {\it apart} from
3764
 
      the case of a 180 degree rotation periodicity with faces coupled
3765
 
      on the rotation axis.
3766
 
 
3767
2607
\item A parallel calculation may be stopped in the same manner as a
3768
2608
      sequential one using a \texttt{ficstp} file (see praragraph
3769
2609
      \ref{prg_ficstp}).
3779
2619
\vspace{0.5cm}
3780
2620
{\bf User subroutines}
3781
2621
 
3782
 
The user can notice in a subroutine
 
2622
The user can check in a subroutine
3783
2623
\begin{list}{-}{}
3784
2624
\item that the presence of periodicity is tested with the variable
3785
2625
      \texttt{iperio} (=1 if periodicity is activated);
3862
2702
      (irangp.le.0) then ...}).
3863
2703
\end{list}
3864
2704
 
3865
 
 
3866
2705
{\bf Some notes about periodicity}
3867
2706
 
 
2707
Note that periodic faces are not part of the domain boundary:
 
2708
periodicity is interpreted as a ``geometric'' condition
 
2709
rather than a classical boundary condition.
 
2710
 
3868
2711
Some particular points should be reminded:
3869
2712
\begin{list}{-}{}
 
2713
\item Periodicity can also work when the periodic boundaries are meshed
 
2714
      differently (periodicity of non-conforming faces), {\it apart} from
 
2715
      the case of a 180 degree rotation periodicity with faces coupled
 
2716
      on the rotation axis.
3870
2717
\item rotation periodicity is incompatible with
3871
2718
  \begin{list}{-}{}
3872
2719
  \item semi-transparent radiation,
3879
2726
\end{list}
3880
2727
 
3881
2728
%==================================
3882
 
\subsection{Geometry and particule  arrays
 
2729
\subsubsubsection{Geometry and particule  arrays
3883
2730
      related to Lagrangian modeling}
3884
2731
%==================================
3885
2732
 
3934
2781
\minititre{Note: continuous eulerian phase number}
3935
2782
The current version of Lagrangian module is planned to work with only one
3936
2783
eulerian phase. This phase carries inclusions, and source terms of
3937
 
backward coupling are applied to it, if necessary. The number of this
3938
 
phase is stored in the variable \texttt{ilphas}\index{\texttt{ilphas}}.
3939
 
The standard value is \texttt{ilphas = 1}.
 
2784
backward coupling are applied to it, if necessary.
3940
2785
 
3941
2786
\minititre{Lagrangian arrays}
3942
2787
 
4105
2950
 
4106
2951
 
4107
2952
%==================================
4108
 
\subsection{Variables saved to allow calculation restarts}
 
2953
\subsubsubsection{Variables saved to allow calculation restarts}
4109
2954
%==================================
4110
2955
 
4111
 
The directory \texttt{RESTART*} contains:
 
2956
The directory \texttt{checkpoint} contains:
4112
2957
\begin{list}{-}{}
4113
 
\item \texttt{suiava}: main restart file,
4114
 
\item \texttt{suiavx}: auxiliary restart file (see \texttt{ileaux\index{ileaux}},
 
2958
\item \texttt{main}: main restart file,
 
2959
\item \texttt{auxiliary}: auxiliary restart file (see \texttt{ileaux\index{ileaux}},
4115
2960
                       \texttt{iecaux\index{iecaux}}),
4116
 
\item \texttt{rayava}: restart file for the radiation module,
4117
 
\item \texttt{lagava}: main restart file for the Lagrangian module,
4118
 
\item \texttt{lasava}: auxiliary restart file for the Lagrangian module (mainly
4119
 
                       for the statistics),
4120
 
\item \texttt{t1dava}: restart file for the 1D wall thermal module,
4121
 
\item \texttt{vorava}: restart file for the vortex method (see
 
2961
\item \texttt{radiative\_transfer}: restart file for the radiation module,
 
2962
\item \texttt{lagrangian}: main restart file for the Lagrangian module,
 
2963
\item \texttt{lagrangian\_stats}: auxiliary restart file for the Lagrangian module (mainly for the statistics),
 
2964
\item \texttt{1dwall\_module}: restart file for the 1D wall thermal module,
 
2965
\item \texttt{vortex}: restart file for the vortex method (see
4122
2966
                       \texttt{ivrtex\index{ivrtex}}).
4123
2967
\end{list}
4124
2968
 
4192
3036
file only when they are extrapolated in time, or with the Joule effect for the
4193
3037
specific heat).
4194
3038
 
4195
 
Apart from \texttt{vorava} which has a different structure and is
 
3039
Apart from \texttt{vortex} which has a different structure and is
4196
3040
always in text format, all the restart files are binary
4197
 
files. Nonetheless, they may be dumped by the \texttt{cs\_io\_dump}
4198
 
tool provided with the Preprocessor.
 
3041
files. Nonetheless, they may be dumped or compared using
 
3042
the \texttt{cs\_io\_dump} tool.
4199
3043
 
4200
3044
In the case of parallel calculations, it should be noted that all the processors
4201
3045
will write their restart data in the same files. Hence, for instance, there will
4202
 
always be one and only one \texttt{suiava} file, whatever the number of
 
3046
always be one and only one \texttt{main} file, whatever the number of
4203
3047
processors used. The data in the file are written according to the initial full
4204
 
domain index-numbers for the cells, faces and nodes. This allows in particular
4205
 
to continue with {\it p} processors a calculation begun with {\it n} processors,
4206
 
or to make the restart files independent of any vectorial renumbering that may
 
3048
domain ids for the cells, faces and nodes. This allows in particular
 
3049
to restart using {\it p} processors a calculation begun with {\it n} processors,
 
3050
or to make the restart files independent of any mesh renumbering that may
4207
3051
be carried out in each domain.
4208
3052
 
4209
 
{\bf On the other hand}, if the numbering of the initial full domain mesh is
4210
 
modified, the restart files will not be compatible. This may be the case if the
4211
 
mesh is composed of different elements that are pasted by the Preprocessor module
4212
 
and the order of the different elements has been changed in the Preprocessor command
4213
 
line between two calculations.
4214
 
 
4215
3053
{\em WARNING: if the mesh is composed of several files, the order
4216
3054
in which they appear in the launch script or in the Graphical Interface must not
4217
3055
be modified in case of a calculation restart\footnote{when uncertain, the user
4218
3056
can check the saved copy of the launch script in the \texttt{RESU} directory, or
4219
 
the head of the \texttt{listpre} file, which repeats the command line passed to
4220
 
the Preprocessor module}.}
 
3057
the head of the \texttt{preprocessor*.log} files, which repeat the
 
3058
command lines passed to the Preprocessor module}.}
4221
3059
 
4222
 
{\em NOTE: when meshes are pasted by the Preprocessor module with potential hanging
4223
 
nodes, two nodes closer than a certain (small) tolerance will be
4224
 
merged. Hence, due to numerical round-up errors, two different machines may
4225
 
yield different results. This might change the number of faces in the global
 
3060
{\em NOTE: when joining of faces or periodicity is used, two nodes closer
 
3061
than a certain (small) tolerance will be merged. Hence, due to numerical
 
3062
round-up errors, two different machines may yield different results.
 
3063
This might change the number of faces in the global
4226
3064
domain\footnote{the number of cells will not be modified, it is always the sum of the
4227
3065
number of cells of the different meshes} and make restart files
4228
3066
incompatible. Should that problem arise when making a calculation restart on a
4229
 
different architecture, the solution is to discard the \texttt{suiavx} file and
4230
 
use only the \texttt{suiava} file.}
4231
 
 
4232
 
 
4233
 
 
4234
 
 
4235
 
%==================================
4236
 
%==================================
4237
 
\section{User subroutines}
4238
 
%==================================
4239
 
%==================================
4240
 
\label{prg_ssprgutilis}
4241
 
%==================================
4242
 
\subsection{Preliminary comments}
4243
 
%==================================
4244
 
The user can run the calculations with or without an interface, with or
4245
 
 without the user subroutine. Without interface, some user subroutines
4246
 
 are needed. With interface, all the user subroutines are optional.
4247
 
 
4248
 
The parameters can be read in the interface and then in the user
4249
 
subroutine. In the case that a parameter is specified in the interface
4250
 
 and in the user subroutine, it is the value in the user subroutine that
4251
 
 is taken into acount. It is for that reason that all the examples of
4252
 
 user subroutines are placed in the \texttt{REFERENCE} directory by the
4253
 
 case preparer \texttt{code\_saturne~create}.
4254
 
 
4255
 
 
4256
 
 
4257
 
%==================================
4258
 
\subsection{Using selection criteria in user subroutines}
 
3067
different architecture, the solution is to ignore the \texttt{auxiliary}
 
3068
file and use only the \texttt{main} file, by setting \texttt{ileaux = 0}
 
3069
in \texttt{usini1.f90}}
 
3070
 
 
3071
%==================================
 
3072
\subsubsection{Using selection criteria in user subroutines}
4259
3073
%==================================
4260
3074
\label{fvm_selector}
4261
3075
 
4343
3157
\texttt{nomgrp} of the type \texttt{character*} and its lenght
4344
3158
\texttt{lngnom} of the type \texttt{integer}) may be used.
4345
3159
 
4346
 
 
4347
 
 
4348
 
%==================================
4349
 
\subsection{Initialisation of the main key words: \textmd{\texttt{usini1}}}
4350
 
%==================================
4351
 
 
4352
 
\noindent
4353
 
\textit{Subroutine only called during calculation initialisation.}
4354
 
 
4355
 
This subroutine is used to indicate the value of different calculation
4356
 
basic parameters: constant and uniform physical values, parameters of
4357
 
numerical schemes, input-output management ...\\
4358
 
 
4359
 
In the case of a calculation launched using the interface, it is only
 
3160
%==================================
 
3161
\subsection{Face and cell mesh-defined properties and selection}
 
3162
%==================================
 
3163
\label{selection_criteria}
 
3164
 
 
3165
The mesh entities may be referenced by the user during the mesh
 
3166
creation. These references may then be used to mark out some mesh entities
 
3167
according to the need (specification of boundary conditions, pressure
 
3168
drop zones, ...). The references are generally of one of the two
 
3169
following types:
 
3170
\begin{list}{$\bullet$}{}
 
3171
\item color.
 
3172
A color is an integer possibly associated with boundary faces and
 
3173
volume elements by the mesh generator. Depending on the tool,
 
3174
this concept may have different names, which \CS interprets
 
3175
as colors. Most tools allow only one color per face or element.
 
3176
      \begin{list}{-}{}
 
3177
      \item I-deas uses a color number with a default of
 
3178
            7 (green) for elements, be they volume elements or boundary
 
3179
            ``surface coating'' elements. Color 11 (red) is used for
 
3180
            for vertices, but vertex properties are ignored by \CS.
 
3181
      \item SIMAIL uses the equivalent notions of ``reference''
 
3182
            for element faces, and ``subdomain'' for volume elements.
 
3183
            By default, element faces are assigned no reference (0),
 
3184
            and volume elements domain 1.
 
3185
      \item Gmsh uses ``physical property'' numbers.
 
3186
      \item EnSight has no similar notion, but if several parts
 
3187
            are present in an EnSight 6 file, or several parts
 
3188
            are present \emph{and} vertex ids are given in an
 
3189
            Ensight Gold file, the part number is interpreted as
 
3190
            a color number by the Preprocessor.
 
3191
      \item The Comet Design (pro-STAR/STAR4) and NUMECA Hex file
 
3192
            formats have a CAD section id that is interpreted
 
3193
            as a color number. In the latter case, this notion
 
3194
            only applies to faces, so volume elements are given
 
3195
            color.
 
3196
      \item The MED format allow integer ``attributes'', though
 
3197
            many tools working with this format ignore those
 
3198
            and only handle groups.
 
3199
      \end{list}
 
3200
\item groups.
 
3201
Named ``groups'' of mesh entities may also be used with many
 
3202
mesh generators or formats. In some cases, a given cell or face may belong
 
3203
to multiple groups (as some tools allow new groups to be defined
 
3204
by boolean operations on existing groups).
 
3205
In \CS, every group is assigned a group number (base on alphabetical
 
3206
ordering of groups).
 
3207
      \begin{list}{-}{}
 
3208
      \item I-deas assigns a group number with each
 
3209
            group, but by default, this number is just a counter.
 
3210
            Only the group name is considered by \CS (so that elements
 
3211
            belonging to two groups with identical names and different
 
3212
            numbers are considered as belonging to the same group).
 
3213
      \item CGNS allows both for named boundary conditions and mesh
 
3214
            sections. If present, boundary condition names are
 
3215
            interpreted as group names, and groups may also be defined
 
3216
            based on element section or zone names using additional
 
3217
            Preprocessor options (\texttt{-grp-cel} or
 
3218
            \texttt{-grp-fac} followed by \texttt{section} or
 
3219
            \texttt{zone}).
 
3220
      \item Using the MED format, it is preferable to use ``groups''
 
3221
            to colors, as many tools ignore the latter.
 
3222
      \end{list}
 
3223
\end{list}
 
3224
 
 
3225
Selection criteria may be defined in a similar fashion whether
 
3226
using the GUI or in user subroutines.
 
3227
Typically, a selection criteria is simply a string containing
 
3228
the required color numbers or group names, possibly combined
 
3229
using boolean expressions. Simple geometric criteria are also
 
3230
possible.
 
3231
 
 
3232
A few examples are given below:
 
3233
 
 
3234
\verb+ENTRY+\\
 
3235
\verb+1 or 7+\\
 
3236
\verb+all[]+\\
 
3237
\verb+3.1 >= z >= -2 or not (15 or entry)+\\
 
3238
\verb+range[04, 13, attribute]+\\
 
3239
\verb+sphere[0, 0, 0, 2] and (not no_group[])+
 
3240
 
 
3241
Strings such as group names containing whitespace
 
3242
or having names similar to reserved operators may be protected
 
3243
using ``escape characters''.\footnote{Note that for defining a
 
3244
string in Fortran, double quotes are easier to use, as they do not
 
3245
conflict with Fortran's single quotes delimiting a string.
 
3246
In C, the converse is true. Also, in C, to define a string
 
3247
such as \texttt{{$\backslash$}plane}, the string
 
3248
\texttt{{$\backslash$}{$\backslash$}plane} must be
 
3249
used, as the first $\backslash$ character is used by the
 
3250
compiler itself. Using the GUI, either notation is easy.}
 
3251
More complex examples of strings whith protected strings are given here:
 
3252
 
 
3253
\verb+"First entry" or Wall\ or\ sym+\\
 
3254
\verb+entry or \plane or "noone's output"+
 
3255
 
 
3256
The following operators and syntaxes are allowed (fully capitalized
 
3257
versions of keywords are also allowed, but mixed capitals/lowercase
 
3258
versions are not):
 
3259
 
 
3260
\begin{tabular}[top]{p{6cm} l}
 
3261
\multicolumn{2}{l}{\bf escape characters }\\
 
3262
protect next character only: & \texttt{$\backslash$} \\
 
3263
protect string:              & \texttt{{'}$string${'}} \quad \texttt{"$string$"}\\
 
3264
\end{tabular}
 
3265
 
 
3266
\begin{tabular}[top]{p{6cm} l}
 
3267
\multicolumn{2}{l}{\bf basic operators }\\
 
3268
priority: & \texttt{(} \quad \texttt{)} \\
 
3269
not:      &  \texttt{not} \quad \texttt{!} \quad \texttt{!=} \\
 
3270
and:      &  \texttt{and} \quad \texttt{\&} \quad \texttt{\&\&} \\
 
3271
or:       &  \texttt{or} \quad \texttt{|} \quad \texttt{||} \quad \texttt{,} \quad \texttt{;} \\
 
3272
xor:      &  \texttt{xor} \quad \texttt{\^} \\
 
3273
\end{tabular}
 
3274
 
 
3275
\begin{tabular}[top]{p{6cm} l}
 
3276
\multicolumn{2}{l}{\bf general functions }\\
 
3277
select all:                        &  \texttt{all[]}\\
 
3278
entities having no group or color: &  \texttt{no\_group[]} \\
 
3279
select a range of groups or colors: &  \texttt{range[$first$, $last$]} \\
 
3280
                                    &  \texttt{range[$first$, $last$, group]} \\
 
3281
                                    &  \texttt{range[$first$, $last$, attribute]} \\
 
3282
\end{tabular}
 
3283
 
 
3284
For the range operator, $first$ and $last$ values are inclusive.
 
3285
For attribute (color) numbers, natural integer value ordering is used,
 
3286
while for group names, alphabetical ordering is used. Note also that in
 
3287
the bizarre (not recommended) case in which a mesh would contain for
 
3288
example both a color number 15 and a group named ``15'', using
 
3289
\texttt{range[15, 15, group]} or \texttt{range[15, 15, attribute]}
 
3290
could be used to distinguish the two.
 
3291
 
 
3292
Geometric functions are also available. The coordinates considered are
 
3293
those of the cell or face centers. Normals are of course
 
3294
usable only for face selections, not cell selections.
 
3295
 
 
3296
\begin{tabular}[top]{p{6cm} l}
 
3297
\multicolumn{2}{l}{\bf geometric functions }\\
 
3298
face normals:   &  \texttt{normal[$x$, $y$, $z$, $epsilon$]} \\
 
3299
                &  \texttt{normal[$x$, $y$, $z$, epsilon = $epsilon$]} \\
 
3300
plane, $ax + by + cz + d = 0$ form: &  \texttt{plane[$a$, $b$, $c$, $d$, $epsilon$]} \\
 
3301
                &  \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
 
3302
                &  \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
 
3303
                &  \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
 
3304
plane, normal + point in plane form: &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, $epsilon$]} \\
 
3305
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, epsilon = $epsilon$]} \\
 
3306
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, inside]} \\
 
3307
                &  \texttt{plane[$n_x$, $n_y$, $n_z$, $x$, $y$, $z$, outside]} \\
 
3308
box, extents form: &  \texttt{box[$x_{min}$, $y_{min}$, $z_{min}$,
 
3309
                                  $x_{max}$, $y_{max}$, $z_{max}$]} \\
 
3310
box, origin + axes form: &  \texttt{box[$x_0$, $y_0$, $z_0$,}\\
 
3311
                         &  \texttt{\qquad $dx_1$, $dy_1$, $dz_1$,
 
3312
                                        $dx_2$, $dy_2$, $dz_2$,
 
3313
                                        $dx_3$, $dy_3$, $dz_3$]} \\
 
3314
                &  \texttt{plane[$a$, $b$, $c$, $d$, epsilon = $epsilon$]} \\
 
3315
                &  \texttt{plane[$a$, $b$, $c$, $d$, inside]} \\
 
3316
                &  \texttt{plane[$a$, $b$, $c$, $d$, outside]} \\
 
3317
cylinder:       &  \texttt{cylinder[$x_0$, $y_0$, $z_0$, $x_1$, $y_1$, $z_1$, $radius$]} \\
 
3318
sphere:         &  \texttt{sphere[$x_c$, $y_c$, $z_c$, $radius$]} \\
 
3319
inequalities:   &  \texttt{>}, \texttt{<}, \texttt{>=}, \texttt{<=} associated
 
3320
                   with \texttt{x}, \texttt{y}, \texttt{z}  or
 
3321
                   \texttt{X}, \texttt{Y}, \texttt{Z} keywords\\
 
3322
                &   and coordinate value; \\
 
3323
                &  \texttt{$x_{min}$ <= x < $x_{max}$} type syntax is allowed. \\
 
3324
\end{tabular}
 
3325
 
 
3326
In the current version of \CS, all selection criteria used
 
3327
are maintained in a list, so that re-interpreting a criterion already
 
3328
encountered (such as at the previous time step) is avoided.
 
3329
Lists of entities corresponding to a criteria containing no geometric
 
3330
functions are also saved in a compact manner, so re-using a previously
 
3331
used selection should be very fast. For criteria containing geometric
 
3332
functions, the full list of corresponding entities is not maintained,
 
3333
so each entity must be compared to the criterion at each time step.
 
3334
Heavy use of many selection criteria containing geometric functions
 
3335
may thus lead to reduced performance.
 
3336
 
 
3337
%==================================
 
3338
\section{Importing and Preprocessing Meshes}
 
3339
%==================================
 
3340
 
 
3341
Importing and preprocessing meshes is done both by the
 
3342
\pcs module, which is used to import meshes, and using
 
3343
preprocessing functions of the code Kernel.
 
3344
 
 
3345
The \pcs module of \CS reads the
 
3346
mesh file(s) (under any supported format) and translates the necessary
 
3347
information into a Kernel input file.
 
3348
 
 
3349
When multiple meshes are used, the \pcs is called once per mesh,
 
3350
and each resulting output is added in a \texttt{mesh\_input}
 
3351
directory (instead of a single \texttt{mesh\_input} file).
 
3352
 
 
3353
The executable of the \pcs module is \texttt{cs\_preprocess},
 
3354
and the most useful options and sub-options are described briefly here.
 
3355
To obtain a complete and up-to-date list of options and environment
 
3356
variables, use the following command:
 
3357
\texttt{cs\_preprocess~-h} or \texttt{cs\_preprocess~--help}. Many options,
 
3358
such as this one, accept a short and a long version.
 
3359
 
 
3360
For the main options, the launch script \texttt{runcase} contains
 
3361
corresponding variables, that are used to define options for the
 
3362
\pcs. This way, the user only has to define these variables
 
3363
and does not detailed knowledge of the \pcs command line.
 
3364
 
 
3365
Nonetheless, it may be useful to call the \pcs manually
 
3366
in certain situations, especially for frequent verification when
 
3367
building a mesh, so its use is described here. Verification
 
3368
may also be done using the GUI or the mesh quality check mode
 
3369
of the general run script.
 
3370
 
 
3371
The \pcs is controlled using command-line arguments.
 
3372
A few environment variables allow an expert user to modify
 
3373
some behaviors or to obtain a trace of memory management.
 
3374
 
 
3375
%==================================
 
3376
\subsection{\pcs options\label{sec:optpcs}}
 
3377
%==================================
 
3378
 
 
3379
Main choices are done using command-line options. For example:
 
3380
 
 
3381
\texttt{cs\_preprocess --num 2 fluid.med}
 
3382
 
 
3383
\noindent means that we read the second mesh defined in the
 
3384
\texttt{fluid.med} file, while:
 
3385
 
 
3386
\texttt{cs\_preprocess --no-write --post-volume fluid.med fluid.msh}
 
3387
 
 
3388
\noindent means that we read file \texttt{fluid.msh}, and
 
3389
do not produce a \texttt{mesh\_input}  file, but do output
 
3390
a \texttt{fluid.med} file (effectively converting a Gmsh file to
 
3391
a MED file).
 
3392
 
 
3393
\subsubsection{Mesh selection\label{sec:optpcs:mesh}}
 
3394
 
 
3395
Any use of the preprocessor requires one mesh file (except for
 
3396
\texttt{cs\_preprocess} and \texttt{cs\_preprocess~-h} which respectively
 
3397
print the version number and list of options).
 
3398
This file is selected as the last argument to \texttt{cs\_preprocess},
 
3399
and its format is usually automatically determined based on its
 
3400
extension (c.f. \ref{sec:formats_in} page~\pageref{sec:formats_in})
 
3401
but a \texttt{--format} option allows forcing the format choice of
 
3402
the selected file.
 
3403
 
 
3404
For formats allowing multiple meshes in a single file, the
 
3405
\texttt{--num} option followed by a strictly positive integer allows
 
3406
selection of a specific mesh; by default, the first mesh is selected.
 
3407
 
 
3408
For meshes in CGNS format, we may in addition use the \texttt{--grp-cel}
 
3409
or \texttt{--grp-fac} options, followed by the \texttt{section}
 
3410
or \texttt{zone} keywords, to define additional groups of cell or faces
 
3411
based on the organization of the mesh in sections or zones. The sub-options
 
3412
have no effect on meshes of other formats.
 
3413
 
 
3414
\subsubsection{Post-processing output\label{sec:optpcs:post}}
 
3415
 
 
3416
By default, the \pcs does not generate any post-processor output.
 
3417
By adding \texttt{--post-volume [format]},
 
3418
with the optional \texttt{format} argument being one of \texttt{ensight},
 
3419
\texttt{med}, or \texttt{cgns} to the command-line arguments,
 
3420
the output of the volume mesh to the default or indicated format
 
3421
is provoked.
 
3422
 
 
3423
In case of errors, output of error visualization output is always
 
3424
produced, and by adding \texttt{--post-error [format]},
 
3425
the format of that output may be selected (from one of \texttt{ensight},
 
3426
\texttt{med}, or \texttt{cgns}, assuming MED and CGNS are
 
3427
available),
 
3428
 
 
3429
\subsubsection{Element orientation correction\label{sec:optpcs:orient}}
 
3430
 
 
3431
We may activate the possible element orientation correction using the
 
3432
\texttt{--reorient} option.
 
3433
 
 
3434
Note that we cannot guarantee correction (or even detection) of a bad
 
3435
orientation in all cases.
 
3436
Not all local numbering possibilities of elements are tested,
 
3437
as we focus on ``usual'' numbering permutations. Moreover,
 
3438
the algorithms used may produce false positives or fail to find
 
3439
a correct renumbering in the case of highly non convex elements.
 
3440
In this case, nothing may be done short of modifying the mesh, as
 
3441
without a convexity hypothesis, it is not always possible to choose
 
3442
between two possible definitions starting from a point set.
 
3443
 
 
3444
With a post-processing option such as \texttt{--post-error}
 
3445
or, \texttt{--post-volume},
 
3446
visualizable meshes of corrected elements as well as remaining
 
3447
badly oriented elements are generated.
 
3448
 
 
3449
\subsection{Environment variables\label{sec:envvpcs}}
 
3450
 
 
3451
Setting a few environment variables specific to the \pcs allows modifying
 
3452
its default behavior. In general, if a given behavior is modifiable
 
3453
through an environment variable rather than by a command-line option,
 
3454
it has little interest for a non-developer, or its modification is
 
3455
potentially hazardous. The environment variables used by the \pcs
 
3456
are described here:
 
3457
 
 
3458
\envvar{CS\_PREPROCESS\_MEM\_LOG}
 
3459
 
 
3460
Allows defining a file name in which memory allocation, reallocation,
 
3461
and freeing is logged.
 
3462
 
 
3463
\envvar{CS\_PREPROCESS\_MIN\_EDGE\_LEN}
 
3464
 
 
3465
Under the indicated length ($10^{-15}$ by default), an edge is considered
 
3466
to be degenerate and its vertices will be merged after the transformation
 
3467
to descending connectivity. Degenerate edges and faces will thus be
 
3468
removed. Hence, the post-processed element does not change, but the
 
3469
Kernel may handle a prism where the preprocessor input contained a
 
3470
hexahedron with two identical vertex couples (and thus a face of zero
 
3471
surface). If the \pcs does not print any information relative to this
 
3472
type of correction, it means that it has not been necessary. To completely
 
3473
deactivate this automatic correction, a negative value may be assigned
 
3474
to this environment variable.
 
3475
 
 
3476
\envvar{CS\_PREPROCESS\_IGNORE\_IDEAS\_COO\_SYS}
 
3477
 
 
3478
If this variable is defined and is a strictly positive integer, coordinate
 
3479
systems in \ideas universal format files will be ignored. The behavior
 
3480
of the \pcs will thus be the same as that of versions 1.0 and 1.1.
 
3481
Note that in any case, non Cartesian coordinate systems are not handled yet.
 
3482
 
 
3483
\subsubsection{System environment variables\label{sec:envpcs:sys}}
 
3484
 
 
3485
Some system environment variables may also modify the behavior of
 
3486
the \pcs. For example, if the \pcs was compiled with \med support
 
3487
on an architecture allowing shared (dynamic) libraries, the
 
3488
\texttt {LD\_PRELOAD} environment variable may be used to define a
 
3489
``prioritary'' path to load \med or HDF5 libraries, and thus experiment
 
3490
with another version of these libraries without recompiling the \pcs.
 
3491
To determine which shared libraries are used by an executable file, use
 
3492
the following command: \texttt{ldd~\{executable\_path\}}.
 
3493
 
 
3494
\subsection{Optional functionality\label{sec:pcs:lib_opt}}
 
3495
 
 
3496
Some functions of the \pcs are based on external libraries,
 
3497
which may not always be available. It is thus possible to configure
 
3498
and compile the \pcs so as not to use these libraries.
 
3499
When running the \pcs, the supported options are printed.
 
3500
The following optional libraries may be used:
 
3501
 
 
3502
\begin{itemize}
 
3503
 
 
3504
\item CGNS library. In its absence, \hyperref[fmtdesc:cgns]{CGNS}
 
3505
      format support is deactivated.
 
3506
 
 
3507
\item \med-file library. In its absence, \hyperref[fmtdesc:med]{\med}
 
3508
      format is simply deactivated.
 
3509
 
 
3510
\item Read compressed files using Zlib. With this option, it is
 
3511
      possible to diretly read mesh files compressed with a
 
3512
      \emph{gzip} type algorithm and bearing a \emph{.gz} extension.
 
3513
      This is limited to formats not already based on an external
 
3514
      library (i.e. it is not usable with CGNS or \med files),
 
3515
      and has memory and CPU time overhead, but may be practical.
 
3516
      Without this library, files must be uncompressed before use.
 
3517
 
 
3518
\end{itemize}
 
3519
 
 
3520
\subsection{General remarks}
 
3521
 
 
3522
Note that the \pcs is in general capable of reading all ``classical''
 
3523
element types present in mesh files (triangles, quadrangles, tetrahedra,
 
3524
pyramids, prisms, and hexahedra).
 
3525
Quadratic or cubic elements are converted upon reading into their
 
3526
linear counterparts. Vertices referenced by no element (isolated vertices
 
3527
or centers of higher-degree elements) are discarded. Meshes are read
 
3528
in the order defined by the user and are appended, vertex and element
 
3529
indices being incremented appropriately.
 
3530
\footnote{Possible entity labels are not maintained, as they would
 
3531
probably not be unique when appending multiple meshes.}
 
3532
 
 
3533
At this stage, volume elements are sorted by type, and the fluid domain
 
3534
post-processing output is generated if required.
 
3535
 
 
3536
In general, groups assigned to vertices are ignored.
 
3537
selections are thus based on faces or cells. with tools such
 
3538
as \simail, faces of volume elements may be referenced directly, while
 
3539
with \ideas or SALOME, a layer of surface elements bearing the required
 
3540
colors and groups must be added. Internally, the \pcs always considers
 
3541
that a layer of surface elements is added (i.e. when reading a \simail
 
3542
mesh, additional faces are generated to bear cell face colors.
 
3543
When building the $faces \rightarrow cells$ connectivity, all faces with the
 
3544
same topology are merged: the initial presence of two layers of identical
 
3545
surface elements belonging to different groups would thus lead to
 
3546
a calculation mesh with faces belonging to two groups.
 
3547
 
 
3548
\subsection{Files passed to the Kernel\label{sec:pcs:mode_comm}}
 
3549
 
 
3550
Data passed to the Kernel by the \pcs is transmitted using a
 
3551
binary file, using ``big endian'' data representation, named
 
3552
\texttt{mesh\_input} (or contained in a directory of that name).
 
3553
 
 
3554
When using the \pcs for mesh verification, data for the Kernel
 
3555
is not always needed. In this case, the \texttt{--no-write} option may be
 
3556
avoid creating a \pcs output file.
 
3557
 
 
3558
%==================================
 
3559
\subsection{Mesh preprocessing%
 
3560
\label{sec:prepro}}
 
3561
%==================================
 
3562
 
 
3563
\subsubsection{Joining of non-conforming meshes}\label{sec:optpcs:join}
 
3564
 
 
3565
Conforming joining of possibly non-conforming meshes may be done by the
 
3566
solver, and defined either using the Graphical User Interface (GUI) or the
 
3567
\texttt{cs\_user\_join} user function. In the GUI, the user needs to
 
3568
add entries in the ``Face joining'' section of the ``Meshes'' tab in the item
 
3569
``Calculation environment $\rightarrow$ Meshes selection''.
 
3570
The user may specify faces to be joined, and can also modify basic joining
 
3571
parameters, see fig. \ref{fig:joining}.
 
3572
%
 
3573
\begin{figure}[!h]
 
3574
\begin{center}
 
3575
\includegraphics[width=15cm]{gui_mesh_join}
 
3576
\caption{Conformal or non-conformal joining}
 
3577
\label{fig:joining}
 
3578
\end{center}
 
3579
\end{figure}
 
3580
%
 
3581
For a simple mesh, it is rarely useful to specify strict face selection
 
3582
criteria, as joining is sufficiently automated to detect which faces
 
3583
may actually be joined. For a more complex mesh, or a mesh with thin
 
3584
walls which we want to avoid transforming into interior faces, it is
 
3585
recommended to filter boundary faces that may be joined by using
 
3586
face selection criteria. This has the
 
3587
additional advantage of reducing the number of faces to test for
 
3588
in the intersection/overlap search, and thus reduced to time
 
3589
required by the joining algorithm.
 
3590
 
 
3591
One may also modify tolerance criteria using 2 options:
 
3592
 
 
3593
\noindent
 
3594
\begin{tabular}[top]{p{3.0cm}%
 
3595
                     >{\PreserveBackslash\raggedright\hspace{0pt}}p{12.0cm}}
 
3596
\texttt{fraction} $r$  &
 
3597
assigns value $r$ (where $0 < r < 0,49$) to the maximum
 
3598
intersection distance multiplier ($0,1$ by default). The maximum
 
3599
intersection distance for a given vertex is based on the length of
 
3600
the shortest incident edge, multiplied by $r$. The maximum intersection
 
3601
at a given point along an edge is interpolated from that at its
 
3602
vertices, as shown on the left of figure \ref{fig_join_tolerance}; \\
 
3603
\texttt{lane} $c$ &
 
3604
assigns the maximum angle between normals for two faces to be
 
3605
considered coplanar ($25�$ by default);
 
3606
this parameter is used in the second stage of the algorithm, to
 
3607
reconstruct conforming faces, as shown on the right of figure
 
3608
\ref{fig_join_tolerance}.\\
 
3609
\end{tabular}
 
3610
 
 
3611
\begin{figure}[!hp]
 
3612
\centerline{
 
3613
\includegraphics*[width=14cm]{join_tolerance}}
 
3614
\caption{Maximum intersection tolerance and faces normal angle
 
3615
\label{fig_join_tolerance}}
 
3616
\end{figure}
 
3617
 
 
3618
In practice, we are sometimes led to increase the maximum intersection
 
3619
distance multiplier to $0.2$ or even $0.3$ when joining curved surfaces,
 
3620
so that all intersection are detected. As this influences merging
 
3621
of vertices and thus simplification of reconstructed faces, but also
 
3622
deformation of ``lateral'' faces, it is recommended only to modify it
 
3623
if necessary. As for the \texttt{plane} parameter, its use has
 
3624
only been necessary on a few meshes up to now, and always in the
 
3625
sense of reducing the tolerance so that face reconstruction does not
 
3626
try to generate faces from initial faces on different surfaces.
 
3627
 
 
3628
\subsubsection{Periodicity\label{sec:optpcs:period}}
 
3629
 
 
3630
Handling of periodicity is based on an extension of conforming joining,
 
3631
as shown on figure \ref{fig_join_periodic}. It is thus not necessary
 
3632
for the periodic faces to be conforming (though it usually leads to better
 
3633
mesh quality). All options relative to conforming joining of
 
3634
non-conforming faces also apply to periodicity. Note also that
 
3635
once pre-processed, 2 periodic faces have the same orientation
 
3636
(possibly adjusted by periodicity of rotation).
 
3637
 
 
3638
This operation can also be performed by the solver and specified
 
3639
either using the GUI or the \texttt{cs\_user\_periodicity} function.
 
3640
 
 
3641
\begin{figure}[!hp]
 
3642
\centerline{
 
3643
\includegraphics*[height=8cm]{join_periodic}}
 
3644
\caption{Matching of periodic faces
 
3645
\label{fig_join_periodic}}
 
3646
\end{figure}
 
3647
 
 
3648
As with joining, it is recommended to filter boundary faces to process
 
3649
using a selection criterion. As many periodicities may be built as desired,
 
3650
as long as boundary faces are present. One a periodicity is handled,
 
3651
faces having periodic matches do not appear as boundary faces, but as
 
3652
interior faces, and are thus not available anymore for other
 
3653
periodicities.
 
3654
 
 
3655
%==================================
 
3656
\subsubsection{Parameters for conforming or non-conforming mesh joinings}
 
3657
%==================================
 
3658
 
 
3659
The setting of these parameters is done in the user subroutine \texttt{cs\_user\_join} (called once). The user can specify the parameters used for the joining of different meshes. Below is given the list of the standard parameters which can me modified:
 
3660
\begin{list}{-}{}
 
3661
\item \texttt{fract}: the initial tolerance radius associated to each vertex is equal to the lenght of the shortest incident edge, multiplied by this fraction,
 
3662
\item \texttt{plane}: when subdividing faces, 2 faces are considered coplanar and may be joined if the angle between their unit normals (in degree) does not exceed this parameter,
 
3663
\item \texttt{iwarnj}: the associated verbosity level (debug level if over 3).
 
3664
\end{list}
 
3665
In the call of the function \texttt{cs\_join\_add}, a selection criteria for
 
3666
mesh faces to be joined is specified.
 
3667
The list of advanced modifiable parameters is given below:
 
3668
\begin{list}{-}{}
 
3669
\item \texttt{mtf}: a merge tolerance factor, used to locally modify the tolerance associated to each vertex before the merge step. Depending on its value four scenarii are possible:
 
3670
\begin{list}{$\rightarrow$}{}
 
3671
\item if $mtf=0$, no vertex merge
 
3672
\item if $mtf<1$, the vertex merge is more strict. It may increase the number of tolerance reduction and therfore define smaller subset of vertices to merge together but it can drive to loose intersections.
 
3673
\item if $mtf=1$, no change occurs
 
3674
\item if $mtf>1$, the vertex merge is less strict. The subset of vertices able to merge is greater.
 
3675
\end{list}
 
3676
\item \texttt{pmf}: a pre-merge factor. This parameter is used to define a limit under which two vertices are merged before the merge step,
 
3677
\item \texttt{tcm}: a tolerance computation mode. If its value is:
 
3678
\begin{list}{$\rightarrow$}{}
 
3679
\item 1 (default), the tolerance is the minimal edge length related to a vertex, multiplied by a fraction.
 
3680
\item 2, the tolerance is computed like for 1 with, in addition, the multiplication by a coefficient equal to the maximum between $sin(e1)$ and $sin(e2)$; where $e1$ and $e2$ are two edges sharing the same vertex V for which we want to compute the tolerance.
 
3681
\item 11, it is the same as 1 but taking into account only the selected faces.
 
3682
\item 12, it is the same as 2 but taking into account only the selected faces.
 
3683
\end{list}
 
3684
\item \texttt{icm}: the intersection computation mode. If its value is:
 
3685
\begin{list}{$\rightarrow$}{}
 
3686
\item 1 (default), the original algorithm is used. Care should taken to clip the intersection on an extremity.
 
3687
\item 2, a new intersection algorithm is used. Caution should be used to avoid to clip the intersection on an extremity.
 
3688
\end{list}
 
3689
\item \texttt{maxbrk}: defines the maximum number of equivalence breaks which is enabled during the merge step,
 
3690
\item \texttt{maxsf}: defines the maximum number of sub-faces used when splitting a selected face
 
3691
\end{list}
 
3692
%
 
3693
The followings are advanced parameters used in the search algorithm for face intersections between selected faces (octree structure). They are useful in case of memory limitation:
 
3694
\begin{list}{-}{}
 
3695
\item \texttt{tml}: the tree maximum level is the deepest level reachable during the tree building,
 
3696
\item \texttt{tmb}: the tree maximum boxes is the maximum number of bounding boxes (BB) which can be linked to a leaf of the tree (not necessary true for the deepest level),
 
3697
\item \texttt{tmr}: the tree maximum ratio. The building of the tree structure stops when the number of bounding boxes is superior to the product of \texttt{tmr} with the number of faces to locate. This is an efficient parameter to reduce memory consumption.
 
3698
\end{list}
 
3699
The call to the subroutine '\texttt{setajp}' returns the value of these parameters.
 
3700
 
 
3701
%==================================
 
3702
\subsubsection{Parameters for the periodicity}
 
3703
%==================================
 
3704
 
 
3705
Periodicities can be set directly in the Graphical User Interface (GUI) or using the user subroutine \texttt{cs\_user\_periodicity} (called when once during the calculation initialisation). In the GUI, the user can choose between 3 types of periodicities: translation, rotation, or mixed (see fig. \ref{fig:periodicities}).
 
3706
Then specific parameters must be set.
 
3707
 
 
3708
\begin{figure}[!h]
 
3709
\begin{center}
 
3710
\includegraphics[width=14cm]{gui_mesh_periodicity}
 
3711
\caption{Periodicity}
 
3712
\label{fig:periodicities}
 
3713
\end{center}
 
3714
\end{figure}
 
3715
 
 
3716
\texttt{cs\_user\_periodicity} can be used instead of the GUI, it allows also the user to specify the parameters used to set periodicities and gives access to more advanced parameters. Below is given the list of the main parameters which can me modified:
 
3717
\begin{list}{-}{}
 
3718
\item \texttt{fract}: the initial tolerance radius associated to each vertex is equal to the lenght of the shortest incident edge, multiplied by this fraction,
 
3719
\item \texttt{plane}. When subdividing faces, 2 faces are considered as coplanar and may be joined if the angle between their unit normals (in degree) does not exceed this parameter,
 
3720
\item \texttt{iwarnj}: the associated verbosity level (debug level if over 3).
 
3721
\end{list}
 
3722
The second part of the subroutine is used to define the periodic transformations. The user provides in the subroutine '\texttt{defpro}' the reference of the mesh the transformation applies to, as well as:
 
3723
\begin{list}{-}{}
 
3724
\item the translation vector, if a periodicity of translation is used,
 
3725
\item the axis, the angle of rotation, and an invariant point if a periodicity of rotation is used,
 
3726
\item an homogeneous matrix if a general transformation is used.
 
3727
\end{list}
 
3728
In addition, the user can modify advanced parameters in case problems occur during the joining step, or to get a better mesh quality:
 
3729
\begin{list}{-}{}
 
3730
\item \texttt{mtf}: a merge tolerance factor, used to locally modify the tolerance associated to each vertex before the merge step. Depending on its value four scenarii are possible:
 
3731
\begin{list}{$\rightarrow$}{}
 
3732
\item if $mtf=0$, there is no vertex merge.
 
3733
\item if $mtf<1$, the vertex merge is more strict. It may increase the number of tolerance reduction and therfore define smaller subset of vertices to merge together, but it can drive to loose intersections.
 
3734
\item if $mtf=1$, no changes occur.
 
3735
\item if $mtf>1$, the vertex merge is less strict. The subset of vertices able to merge is greater.
 
3736
\end{list}
 
3737
\item \texttt{pmf}: a pre-merge factor. This parameter is used to define a limit under which two vertices are merged before the merge step,
 
3738
\item \texttt{tcm}: a tolerance computation mode. If its value is:
 
3739
\begin{list}{$\rightarrow$}{}
 
3740
\item 1 (default), the tolerance is the minimal edge length related to a vertex, multiplied by a fraction.
 
3741
\item 2, the tolerance is computed like for 1 with, in addition, the multiplication by a coefficient equal to the maximum between $sin(e1)$ and $sin(e2)$, where $e1$ and $e2$ are two edges sharing the same vertex V for which we want to compute the tolerance.
 
3742
\item 11, it is the same as 1 but taking into account only the selected faces.
 
3743
\item 12, it is the same as 2 but taking into account only the selected faces.
 
3744
\end{list}
 
3745
\item \texttt{icm}: the intersection computation mode. If its value is:
 
3746
\begin{list}{$\rightarrow$}{}
 
3747
\item 1 (default), the original algorithm is used. Care should taken to clip the intersection on an extremity.
 
3748
\item 2, a new intersection algorithm is used. Caution should be used to avoid to clip the intersection on an extremity.
 
3749
\end{list}
 
3750
\item \texttt{maxbrk}: defines the maximum number of equivalence breaks which are enabled during the merge step,
 
3751
\item \texttt{maxsf}: defines the maximum number of sub-faces used when splitting a selected face
 
3752
\end{list}
 
3753
%
 
3754
The following are advanced parameters used in the search algorithm for face intersections between selected faces (octree structure). There are useful in case of memory limitation:
 
3755
\begin{list}{-}{}
 
3756
\item \texttt{tml}: the tree maximum level is the deepest level reachable during the tree building
 
3757
\item \texttt{tmb}: the tree maximum boxes is the maximum number of bounding boxes (BB) which can be linked to a leaf of the tree (not necessary true for the deepest level)
 
3758
\item \texttt{tmr}: the tree maximum ratio. The building of the tree structure stops when the number of bounding boxes is superior than the product of \texttt{tmr} with the number of faces to locate. This is an efficient parameter to reduce memory consumption.
 
3759
\end{list}
 
3760
The call to the routine '\texttt{setapp}' returns the value of these parameters.
 
3761
 
 
3762
%==================================
 
3763
\subsubsection{Modification of the mesh geometry}
 
3764
%==================================
 
3765
\noindent
 
3766
\textit{Subroutines called only during the calculation initialisation.}
 
3767
 
 
3768
The user subroutine \texttt{cs\_user\_mesh\_input} allows a detailed
 
3769
selection of imported meshes read, reading files multiple times,
 
3770
applying geometric transformations, and renaming groups.
 
3771
 
 
3772
The user subroutine \texttt{cs\_user\_mesh\_modify} may be used
 
3773
for advanced modification of the main \texttt{cs\_mesh\_t}} structure.
 
3774
 
 
3775
{\em WARNING: Caution must be exercised when using this subroutine
 
3776
along with periodicity. Indeed, the periodicity parameters are not
 
3777
updated accordingly, meaning that the periodicity may be unadapted
 
3778
after one changes the mesh vertex coordinates. It is particularly
 
3779
true when one rescales the mesh. Rescaling should thus be done
 
3780
in a separate run, before defining periodicity.}
 
3781
 
 
3782
The user subroutine \texttt{cs\_user\_mesh\_thinwall} allows
 
3783
insertion of thin walls in the calculation mesh.
 
3784
Faces on each side of a thin wall will share the same vertices,
 
3785
so postprocessing of the main volume mesh may not show the
 
3786
inserted walls, thouhg they will appear in the main boundary
 
3787
output meshmay be used to modify
 
3788
``manually'' the mesh vertices coordinates, \textit{i.e.}
 
3789
 the array \mbox{\texttt{mesh->vtx\_coord[]}}.
 
3790
 
 
3791
%==================================
 
3792
\section{Partitioning for parallel runs\label{sec:parall}}
 
3793
%==================================
 
3794
 
 
3795
Graph partitioning (using one of the optional \metis or
 
3796
\scotch libraries) is done using a secondary executable,\\
 
3797
\texttt{cs\_partition},
 
3798
which reads the file produced by the \pcs and builds one or
 
3799
several ``cell $\rightarrow$ domain'' distribution files, named
 
3800
{\tt domain\_number\_\it{p}} for a partitioning on $p$ sub-domains.
 
3801
 
 
3802
This separation leads to extra work for the Kernel, which must
 
3803
redistribute data read in {\tt mesh\_input}
 
3804
based on the associated partitioning, but avoids requiring
 
3805
re-running the \pcs whenever running on a different number of
 
3806
processors.
 
3807
 
 
3808
Without partitioning (for example if neither \metis nor
 
3809
\scotch is available, or the partitioner has not been run
 
3810
for the required number of sub-domains), the Kernel will
 
3811
use a built-in partitioning using a space-filling curve
 
3812
(Z-curve) technique. This usually leads to partitionings
 
3813
of lower quality than with graph partitioning, but parallel
 
3814
performance remains reasonable.
 
3815
 
 
3816
\subsection{Options\label{sec:optcmd:parall}}
 
3817
 
 
3818
To list the partitioner's options, use the following command:
 
3819
{\tt cs\_partition~-h} 
 
3820
 
 
3821
We provide the list of required partitionings an optionally additional
 
3822
options. For example, to simulate a partitioning for calculations on
 
3823
64 and 128 processes with no output, we may use the following command:
 
3824
 
 
3825
\texttt{cs\_partition 64 128 --no-write}
 
3826
 
 
3827
\subsubsection{Ignore periodicity\label{sec:optcmdpart:noperiod}}
 
3828
 
 
3829
By default, face periodicity relations are taken into account when building
 
3830
the ``cell $\rightarrow$ cell'' connectivity graph used for partitioning.
 
3831
This allows better partitioning optimization, but increases the probability
 
3832
of having groups of cells at opposite sides of the domain in a same
 
3833
sub-domain. This is not an issue for standard calculations, but may
 
3834
degrade performance of search algorithms based on bounding boxes.
 
3835
It is thus possible to ignore periodicity when partitioning a mesh
 
3836
using the \texttt{--no-perio} option.
 
3837
 
 
3838
Note that nothing guarantees that a graph partitioner will not place
 
3839
disjoint cells in the same sub-domain independently of this option,
 
3840
but this behavior is rare.
 
3841
 
 
3842
\subsubsection{Partitioner choice\label{sec:optpart:partlib}}
 
3843
 
 
3844
If the Partitioner has been configured with both \metis and
 
3845
\scotch libaries, using the \texttt{--metis} or \texttt{--scotch}
 
3846
option allows choosing between either library. By default, \emph{metis} is
 
3847
used if both choices are available.
 
3848
 
 
3849
\subsubsection{Simulation mode\label{sec:optpart:nowrite}}
 
3850
 
 
3851
Using the \texttt{--no-write} option, we can tell the partitioner
 
3852
not to output a {\tt domain\_number\_\it{p}} file.
 
3853
Partitioning is thus computed, but not saved.
 
3854
 
 
3855
\subsubsection{Environment variables\label{sec:optpart:envvar}}
 
3856
 
 
3857
\envvar{CS\_PARTITION\_MEM\_LOG}
 
3858
 
 
3859
Allows defining a file name in which memory allocations, reallocations,
 
3860
and frees will be logged.
 
3861
 
 
3862
 
 
3863
%==================================
 
3864
\section{Basic modelling setup}
 
3865
%==================================
 
3866
 
 
3867
%==================================
 
3868
\subsection{Initialisation of the main parameters}
 
3869
%==================================
 
3870
 
 
3871
This operation is done in the Graphical User Interface (GUI) or by using the user subroutine \texttt{usini1}.
 
3872
In the GUI, the initialisation is performed by filling the parameters displayed in Figs. \ref{fig:6_GUI} to \ref{fig:28_GUI}. If the option 'Mobile mesh' is activated in Fig. \ref{fig:6_GUI}, please see Section \ref{sec:ALE} for more details. In fig. \ref{fig:11_GUI}, the equivalent initialisations occur in the subroutine \texttt{usiniv} when the GUI is not used.
 
3873
The headings filled for the initialisation are the followings:
 
3874
\begin{list}{-}{}
 
3875
\item Thermophysical model options: ALE mobile mesh,
 
3876
      turbulence model, thermal model, see figs. \ref{fig:6_GUI} to \ref{fig:8_GUI}.
 
3877
\item Additional scalars: definition, initialisation of the scalars, and physical characteristics, see figs. \ref{fig:11_GUI} and \ref{fig:12_GUI}. In fig. \ref{fig:12_GUI}, the initial values are given in the subroutine \texttt{usiniv} if the GUI is not used, see Section \ref{sec:usiniv}.
 
3878
\item Physical properties: reference pressure, fluid characteristics, gravity, see figs. \ref{fig:13_GUI} to \ref{fig:15_GUI}. If non-constant values are used for the fluid properties, and if the GUI is not used, see Section \ref{sec:usphyv}.
 
3879
\item Numerical parameters: number and type of time steps, and advanced parameters for the numerical solution of the equations, see figs. \ref{fig:21_GUI} to \ref{fig:23_GUI}.
 
3880
\item Calculation control: parameters related to the time averages, the time step, the
 
3881
      locations of the probes where some variables will be monitored over time
 
3882
      (if the GUI is not used, this information is specified in Section
 
3883
      \ref{sec:usiniv}), the definition of the frequency of the outputs in the calculation
 
3884
      listing, the postprocessing output writer frequency and format options, and
 
3885
      the postprocessing output meshes and variables selection, see
 
3886
      figs. \ref{fig:24_GUI}, \ref{gui_output_log}, \ref{gui_output_writers},
 
3887
      and \ref{gui_output_meshes}. The item ``Profiles'' allows to save, with a
 
3888
      frequency defined by the user, 1D profiles on an axis defined by two
 
3889
      points, see fig. \ref{fig:26_GUI}.
 
3890
\end{list}
 
3891
 
 
3892
\begin{figure}[!ht]
 
3893
\begin{center}
 
3894
\includegraphics[width=13cm]{gui_mobile_mesh}
 
3895
\caption{Mobile mesh option}
 
3896
\label{fig:6_GUI}
 
3897
\end{center}
 
3898
\end{figure}
 
3899
 
 
3900
\begin{figure}[!ht]
 
3901
\begin{center}
 
3902
\includegraphics[width=13cm]{gui_turbulence_models}
 
3903
\caption{Turbulence model selection}
 
3904
\label{fig:7_GUI}
 
3905
\end{center}
 
3906
\end{figure}
 
3907
 
 
3908
\begin{figure}[!ht]
 
3909
\begin{center}
 
3910
\includegraphics[width=13cm]{gui_thermal_scalar}
 
3911
\caption{Thermal scalar selection}
 
3912
\label{fig:8_GUI}
 
3913
\end{center}
 
3914
\end{figure}
 
3915
 
 
3916
\begin{figure}[!ht]
 
3917
\begin{center}
 
3918
\includegraphics[width=13cm]{gui_user_scal_def_init}
 
3919
\caption{Definition and initialisation of the scalars}
 
3920
\label{fig:11_GUI}
 
3921
\end{center}
 
3922
\end{figure}
 
3923
 
 
3924
\begin{figure}[!ht]
 
3925
\begin{center}
 
3926
\includegraphics[width=13cm]{gui_user_scal_phys_props}
 
3927
\caption{Associated physical properties of the scalars}
 
3928
\label{fig:12_GUI}
 
3929
\end{center}
 
3930
\end{figure}
 
3931
 
 
3932
\begin{figure}[!ht]
 
3933
\begin{center}
 
3934
\includegraphics[width=13cm]{gui_phys_prop_ref_pressure}
 
3935
\caption{Setting of the reference pressure}
 
3936
\label{fig:13_GUI}
 
3937
\end{center}
 
3938
\end{figure}
 
3939
 
 
3940
\begin{figure}[!ht]
 
3941
\begin{center}
 
3942
\includegraphics[width=13cm]{gui_fluid_props}
 
3943
\caption{Fluid properties}
 
3944
\label{fig:14_GUI}
 
3945
\end{center}
 
3946
\end{figure}
 
3947
 
 
3948
\begin{figure}[!ht]
 
3949
\begin{center}
 
3950
\includegraphics[width=13cm]{gui_gravity_hyd_pressure}
 
3951
\caption{Settings of the gravity and of the hydrostatic pressure}
 
3952
\label{fig:15_GUI}
 
3953
\end{center}
 
3954
\end{figure}
 
3955
 
 
3956
\begin{figure}[!ht]
 
3957
\begin{center}
 
3958
\includegraphics[width=13cm]{gui_time_step}
 
3959
\caption{Time step settings}
 
3960
\label{fig:21_GUI}
 
3961
\end{center}
 
3962
\end{figure}
 
3963
 
 
3964
\begin{figure}[!ht]
 
3965
\begin{center}
 
3966
\includegraphics[width=13cm]{gui_numerical_parameters}
 
3967
\caption{Numerical parameters for the main variables resolution}
 
3968
\label{fig:22_GUI}
 
3969
\end{center}
 
3970
\end{figure}
 
3971
 
 
3972
\begin{figure}[!ht]
 
3973
\begin{center}
 
3974
\includegraphics[width=13cm]{gui_global_res_parameters}
 
3975
\caption{Global resolution parameters}
 
3976
\label{fig:23_GUI}
 
3977
\end{center}
 
3978
\end{figure}
 
3979
 
 
3980
\begin{figure}[!ht]
 
3981
\begin{center}
 
3982
\includegraphics[width=13cm]{gui_time_averages}
 
3983
\caption{Management of time averaged variables}
 
3984
\label{fig:24_GUI}
 
3985
\end{center}
 
3986
\end{figure}
 
3987
 
 
3988
\begin{figure}[!ht]
 
3989
\begin{center}
 
3990
\includegraphics[width=13cm]{gui_output_log}
 
3991
\caption{Parameters of chronological logging options}
 
3992
\label{gui_output_log}
 
3993
\end{center}
 
3994
\end{figure}
 
3995
 
 
3996
\begin{figure}[!ht]
 
3997
\begin{center}
 
3998
\includegraphics[width=13cm]{gui_output_writers}
 
3999
\caption{Management of postprocessing writers}
 
4000
\label{gui_output_writers}
 
4001
\end{center}
 
4002
\end{figure}
 
4003
 
 
4004
\begin{figure}[!ht]
 
4005
\begin{center}
 
4006
\includegraphics[width=13cm]{gui_output_meshes}
 
4007
\caption{Management of postprocessing meshes}
 
4008
\label{gui_output_meshes}
 
4009
\end{center}
 
4010
\end{figure}
 
4011
 
 
4012
\begin{figure}[!ht]
 
4013
\begin{center}
 
4014
\includegraphics[width=13cm]{gui_output_1d_profiles}
 
4015
\caption{Management of 1D profiles of the solution}
 
4016
\label{fig:26_GUI}
 
4017
\end{center}
 
4018
\end{figure}
 
4019
 
 
4020
In the case of a calculation launched using the interface, the subroutine \texttt{usini1} is only
4360
4021
used to modify high-level parameters which can not be managed by the
4361
4022
interface. In the case of a code utilisation without interface, this
4362
 
subroutine is compulsory and all the headings must be completed.
 
4023
subroutine is compulsory and all the headings must be completed. \texttt{usini1} is used to indicate the value of different calculation
 
4024
basic parameters: constant and uniform physical values, parameters of
 
4025
numerical schemes, input-output management...\\
 
4026
It is called only during the calculation initialisation.
4363
4027
 
4364
4028
For more details about the different parameters, please refer to the key
4365
4029
word list (\S\ref{prg_motscles}).
4366
4030
 
4367
 
\texttt{usini1.f90} is in fact a gouping of 6 sperate subroutines:  \texttt{usipph},
 
4031
\texttt{usini1} is in fact constituted of 6 seperate subroutines:  \texttt{usipph},
4368
4032
 \texttt{usinsc}, \texttt{usipsc}, \texttt{usipgl},
4369
 
\texttt{usipsu}and \texttt{usipes}. Each one controls the management of various
4370
 
 specific parameters. The key words that dont' feature in the supplied example
4371
 
can be provided by the user in  \texttt{SRC/REFERENCE/base}; in this case,
4372
 
understanding of the comments is needed to add the key words in the appropriate
4373
 
subroutine (the most widely used is \texttt{iphas}, it will assure that the value
 
4033
\texttt{usipsu} and \texttt{usipes}. Each one controls various
 
4034
 specific parameters. The key words which are not featured in the supplied example
 
4035
can be provided by the user in \texttt{SRC/REFERENCE/base}; in this case,
 
4036
understanding of the comments is required to add the key words in the appropriate
 
4037
subroutine, it will ensure that the value
4374
4038
has been well defined). The modifiable parameters in each of the subroutines of
4375
 
\texttt{usini1.f90} are:
 
4039
\texttt{usini1} are:
4376
4040
 
4377
4041
\begin{list}{$\bullet$}{}
4378
4042
\item \texttt{usipph}: \texttt{iturb} and \texttt{icp} (don't modify these
4382
4046
\item \texttt{usipsc}: \texttt{iscavr} and \texttt{ivisls} (don't modify these
4383
4047
      parameters anywhere else)
4384
4048
\item \texttt{usipgl}: \texttt{idtvar}, \texttt{ipucou}, \texttt{iphydr} and the
4385
 
      parameters related to the error estimators(don't modify these parameters
 
4049
      parameters related to the error estimators (don't modify these parameters
4386
4050
      anywhere else).
4387
4051
\item \texttt{usipsu}: physical parameters of the calculation (thermal scalar, physical
4388
 
      properties,...), numeric parameters (time steps, number of iterations, ...),
 
4052
      properties,...), numerical parameters (time steps, number of iterations, ...),
4389
4053
      definition of the time averages.
4390
 
\item \texttt{usipes}: post processing output parameters (periodicity, variable names,
 
4054
\item \texttt{usipes}: post-processing output parameters (periodicity, variable names,
4391
4055
      probe positions,...)
4392
4056
\end{list}
4393
4057
 
4394
 
For more details of the different parameters, see the list of key words  (\S\ref{prg_motscles}).
4395
 
 The names of the key words can also be seen in the helps sections of the interface.
 
4058
For more details on the different parameters, see the list of key words  (\S\ref{prg_motscles}).
 
4059
 The names of the key words can also be seen in the help sections of the interface.
4396
4060
 
4397
4061
\minititre{Notes}
4398
 
$\bullet\ $ Determined in the list of \texttt{nscaus} user scalars, representing
4399
 
 the mean square fluctuations of another whilst informing the \texttt{iscavr}
4400
 
array (warning, this was not the case in version 1.0). For
4401
 
the other scalars, \texttt{iscavr} does not need to be completed (by default,
 
4062
$\bullet\ $ The table \texttt{iscavr} is filled with the user scalars which represent the mean square fluctuations of another scalar amongst the list of the \texttt{nscaus} scalars (warning, this was not the case in version 1.0). For the other scalars, \texttt{iscavr} does not need to be completed (by default,
4402
4063
\texttt{iscavr(ii)}$\leqslant$0). For instance, if the scalar \texttt{jj}
4403
4064
represents the average of the square of the fluctuations of the scalar \texttt{kk},
4404
4065
the user must indicate \texttt{iscavr(jj)=kk}
4406
4067
 
4407
4068
\noindent
4408
4069
$\bullet\ $ When using the interface, only the
4409
 
supplementary parameters (which can not be defined in the interface)
 
4070
additional parameters (which can not be defined in the interface)
4410
4071
should appear in \texttt{usini1}. To spare the user the necessity to
4411
 
delete the other parameters appearing as examples in the subroutine, the
4412
 
utility program \texttt{code\_saturne~create} comments automatically all the
4413
 
example lines of \texttt{usini1} with a code \texttt{!ex}. The user
4414
 
needs then only to uncomment the lines which are useful in his
 
4072
delete the other parameters given as examples in the subroutine, the
 
4073
setup program \texttt{code\_saturne~create} comments automatically all the
 
4074
example lines of \texttt{usini1} with a code ``\texttt{!ex}''. The user
 
4075
needs then only to remove comments at the lines which are useful for his
4415
4076
case. This function of
4416
4077
\texttt{code\_saturne~create} can be deactivated with
4417
 
the option \texttt{--nogui} (useful if the user knows that he will not
 
4078
the option ``\texttt{--nogui}'' (useful if the user knows that he will not
4418
4079
use the interface).
4419
4080
 
4420
 
%==================================
4421
 
\subsection{Management of boundary conditions: \textmd{\texttt{usclim}}}
 
4081
\subsection{Selection of mesh inputs: \textmd{\texttt{cs\_user\_mesh\_input}}}
4422
4082
%==================================
4423
4083
 
4424
4084
\noindent
4425
 
\textit{Subroutine called every time step.}
4426
 
 
4427
 
It is the second compulsory subroutine for every calculation launched
4428
 
without interface(except in the specific physics case where the
 
4085
\textit{Subroutine called only during the calculation initialisation.}
 
4086
 
 
4087
This C function may be used to select which mesh input files
 
4088
are read, and apply optional coordinate transformations or group renumberings
 
4089
to them. By default, the input read is a file or directory named
 
4090
\texttt{mesh\_input}, but if this function is used, any file may be selected,
 
4091
and the same file may be read multiple times (applying a different
 
4092
coordinate transformation each time).
 
4093
All inputs read through this function are automatically concatenated, and
 
4094
may be later joined using the mesh joining options.
 
4095
 
 
4096
Geometric transformations are defined using a homogeneous coordinates
 
4097
transformation matrix. Such a matrix has 3 lines and 4 columns, with the
 
4098
3 first columns describing a rotation/scaling factor, and the last column
 
4099
describing a translation. A 4th line is implicit, containing zeroes
 
4100
off-diagonal, and 1 on the diagonal. The advantages of this representation
 
4101
is that any rotation/translation/scaling combination may be expressed
 
4102
by matrix multiplication, while simple rotations or translations
 
4103
may still be defined easily.
 
4104
 
 
4105
%==================================
 
4106
%==================================
 
4107
\subsection{Non-default variables initialisation} \label{sec:usiniv}
 
4108
%==================================
 
4109
 
 
4110
The non-default variables initialisation is performed in the subroutine \texttt{usiniv} (called only during the calculation initialisation).\\ At the calculation beginning, the variables are initialised
 
4111
automatically by the code. Velocities and scalars are set to 0 (or \texttt{scamax} or \texttt{scamin} if 0 is outside the acceptable
 
4112
scalar variation range), and the turbulent variables are estimated from
 
4113
\texttt{uref} and \texttt{almax}. \\
 
4114
For the $k$ in $k-\varepsilon$, $R_{ij}-\varepsilon$, v2f or $k-\omega$
 
4115
model:\\
 
4116
{\texttt{rtp(iel,ikiph) = 1.5*(0.02*uref)**2}
 
4117
(in $R_{ij}-\varepsilon$,  $R_{ij}=\frac{2}{3}k\delta_{ij}$)\\
 
4118
For the $\varepsilon$ in $k-\varepsilon$, $R_{ij}-\varepsilon$ or v2f model:\\
 
4119
\texttt{rtp(iel,ieiph) = rtp(iel,ikiph)**1.5*cmu/almax}\\
 
4120
For $\omega$ in the $k-\omega$ model:\\
 
4121
\texttt{rtp(iel,iomgip) = rtp(iel,ikiph)**0.5/almax}\\
 
4122
For $\varphi$ and $\overline{f}$ in the v2f model:\\
 
4123
\texttt{rtp(iel,iphiph) = 2/3}\\
 
4124
\texttt{rtp(iel,ifbiph) = 0}
 
4125
 
 
4126
The subroutine \texttt{usiniv} allows if necessary to initialise certain
 
4127
variables to values closer to their estimated final values, in order to
 
4128
obtain a faster convergence.
 
4129
 
 
4130
This subroutine allows also to make a non-standard initialisation of
 
4131
physical parameters (density, viscosity, ...), to impose a local
 
4132
value of the time step, or to modify some parameters (time step,
 
4133
variable specific heat, ...) in the case of a calculation restart.
 
4134
 
 
4135
\minititre{Note: value of the time step}
 
4136
\begin{list}{-}{}
 
4137
\item For calculations with constant and uniform time step
 
4138
      (\texttt{idtvar}=0), the value of the time step is \texttt{dtref},
 
4139
      given in the parametric file of the interface or \texttt{usini1}.
 
4140
\item For calculations with a non-constant time step
 
4141
      (\texttt{idtvar}=1 or 2) which is not a calculation restart,
 
4142
      the value of \texttt{dtref} given in the parametric file of the interface
 
4143
      or in \texttt{usini1} is used to initialise the time step.
 
4144
\item For calculations with a non-constant time step
 
4145
      (\texttt{idtvar}=1 or 2) which is a restart of a
 
4146
      calculation whose time step type was different (for instance, restart
 
4147
      using a variable time step of a calculation run using a constant time
 
4148
      step), the value of \texttt{dtref}, given in the parametric file of the
 
4149
      interface or in \texttt{usini1}, is used to initialise the time step.
 
4150
\item For calculations with non-constant time step
 
4151
      (\texttt{idtvar}=1 or 2) which is a restart of a
 
4152
      calculation whose time step type was the same (for instance, restart with
 
4153
      \texttt{idtvar}=1 of a calculation run with \texttt{idtvar}=1), the time
 
4154
      step is read from the restart file and the value of \texttt{dtref} given
 
4155
      in the parametric file of the interface, or in \texttt{usini1}, is not used.
 
4156
\end{list}
 
4157
It follows, that for a calculation with a non-constant time step (\texttt{idtvar}=1
 
4158
or 2) which is a restart of a calculation in which
 
4159
\texttt{idtvar} had the same value, \texttt{dtref} does not allow to modify the
 
4160
time step. The user subroutine \texttt{usiniv} allows to modify the array
 
4161
\texttt{dt} which contains the value of the time step read from the restart file
 
4162
(array whose size is \texttt{ncelet}, defined at the cell centers whatever the
 
4163
chosen time step type is).
 
4164
 
 
4165
{\em WARNING: to initialise the variables in the framework of a
 
4166
specific physics module} (\texttt{nscapp.gt.0}), 
 
4167
one of the subroutines
 
4168
\texttt{usebui}, \texttt{usd3pi}, \texttt{uslwci} or \texttt{uscpiv} 
 
4169
should be used (depending on the activated module) instead of \texttt{usiniv}.
 
4170
 
 
4171
%==================================
 
4172
\subsection{Manage boundary conditions}
 
4173
%==================================
 
4174
The boundary conditions can be specified in the Graphical User Interface (GUI) under the heading ``Boundary conditions'' or in the user subroutine \texttt{usclim} called every time step. With the GUI, each region and the type of boundary condition associated to it are defined in fig. \ref{fig:19_GUI}. Then, the parameters of the boundary condition are specified in fig. \ref{fig:20_GUI}. The colors of the boundary faces may be read directly from a ``listing'' file created by the Preprocessor. This file can be generated directly by the interface under the heading ``Definition of boundary regions $\rightarrow$ Add from Preprocessor listing $\rightarrow$ import groups and references from Preprocessor listing'', see fig. \ref{fig:19_GUI}.
 
4175
%
 
4176
\begin{figure}[!ht]
 
4177
\begin{center}
 
4178
\includegraphics[width=13cm]{gui_bc_regions}
 
4179
\caption{Definition of the boundary conditions}
 
4180
\label{fig:19_GUI}
 
4181
\end{center}
 
4182
\end{figure}
 
4183
%
 
4184
\begin{figure}[!ht]
 
4185
\begin{center}
 
4186
\includegraphics[width=13cm]{gui_bc_parameters}
 
4187
\caption{Parameters of the boundary conditions}
 
4188
\label{fig:20_GUI}
 
4189
\end{center}
 
4190
\end{figure}
 
4191
 
 
4192
\texttt{usclim} is the second compulsory subroutine for every calculation launched
 
4193
without interface (except in the case of specific physics where the
4429
4194
corresponding boundary condition user subroutine must be used)  \\
4430
 
When the interface is used, \texttt{usclim} is used to define complex
 
4195
When the subroutine is used, \texttt{usclim} is used to define complex
4431
4196
boundary conditions (input profiles, conditions varying in time, ...)
4432
 
which could not be specified by means of the interface, and only these
 
4197
which could not be specified by the means of the interface, and only these
4433
4198
need to be defined. In the case of a calculation launched without the
4434
4199
interface, all the boundary conditions must appear in \texttt{usclim}.\\
4435
4200
\texttt{usclim} is essentially constituted of loops on boundary
4436
4201
face subsets. Several sequences 
4437
4202
of \verb+call getfbr+ \verb+('criterion', nlelt, lstelt)+ (cf.
4438
 
\S\ref{fvm_selector}) allow to differentiate 
4439
 
the boundary faces according to their group(s), their
 
4203
\S\ref{fvm_selector}) allow to select 
 
4204
the boundary faces with respect to their group(s), their
4440
4205
color(s) or geometric criteria. If needed, geometric and
4441
 
physical variables are also available to the user, these allow him
4442
 
to differentiate the boundary faces using other criteria.
 
4206
physical variables are also available to the user. These allow him
 
4207
to select the boundary faces using other criteria.
4443
4208
 
4444
4209
For more details about the treatment of boundary conditions, the user
4445
4210
may refer to the theoretical and computer documentation \cite{theory} of
4446
 
the subroutine \texttt{condli} (for the wall conditions, see
4447
 
\texttt{clptur}) (to access to this document on a workstation, use
 
4211
the subroutine \texttt{condli} (for wall conditions, see
 
4212
\texttt{clptur}) (to access this document on a workstation, use
4448
4213
\mbox{\texttt{code\_saturne~info --guide theory}}).
4449
4214
 
4450
 
From the user point of view, the boundary conditions are totally
4451
 
determined by three arrays\footnote{except with Lagrangian}:
4452
 
\texttt{itypfb(nfabor,nphas)}\index{\texttt{itypfb}},
 
4215
From the user point of view, the boundary conditions are fully
 
4216
defined by three arrays\footnote{except with Lagrangian}:
 
4217
\texttt{itypfb(nfabor)}\index{\texttt{itypfb}},
4453
4218
\texttt{icodcl(nfabor,nvar)}\index{\texttt{icodcl}} and
4454
4219
\texttt{rcodcl(nfabor,nvar,3)}\index{\texttt{rcodcl}}.
4455
4220
\begin{list}{-}{}
4456
 
\item \texttt{itypfb(ifac,iphas)} defines the type of the face \texttt{ifac}
4457
 
      (input, wall, ...) for the phase \texttt{iphas}.
 
4221
\item \texttt{itypfb(ifac)} defines the type of the face \texttt{ifac}
 
4222
      (input, wall, ...).
4458
4223
\item \texttt{icodcl(ifac,ivar)} defines the type of boundary
4459
 
      condition for the variable \texttt{ivar} at the face \texttt{ifac}
 
4224
      condition for the variable \texttt{ivar} on the face \texttt{ifac}
4460
4225
      (Dirichlet, flux ...).
4461
4226
\item \texttt{rcodcl(ifac,ivar,.)} gives the numerical values associated with the
4462
4227
      type of boundary condition (value of the Dirichlet, of the flux ...).
4463
4228
\end{list}
4464
4229
 
4465
4230
In the case of standard boundary conditions (see
4466
 
\S\ref{prg_clstandard}), it is enough to complete \texttt{itypfb(ifac,iphas)} and
4467
 
some boxes of the array \texttt{rcodcl}, the array \texttt{icodcl} and most of the
4468
 
boxes of \texttt{rcodcl} are completed automatically. For non-standard boundary
 
4231
\S\ref{prg_clstandard}), it is sufficient to complete \texttt{itypfb(ifac)} and
 
4232
parts of the array \texttt{rcodcl}; the array \texttt{icodcl} and most of \texttt{rcodcl} are filled automatically. For non-standard boundary
4469
4233
conditions (see \S\ref{prg_clnonstandard}), the arrays \texttt{icodcl} and
4470
 
\texttt{rcodcl} must be totally completed.
 
4234
\texttt{rcodcl} must be fully completed.
4471
4235
 
4472
4236
%==================================
4473
4237
\subsubsection{Coding of standard boundary conditions}
4474
4238
%==================================
4475
4239
\label{prg_clstandard}%
4476
 
The standard values taken by the indicator \texttt{itypfb} are:
 
4240
The standard key words used by the indicator \texttt{itypfb} are:
4477
4241
\texttt{ientre\index{ientre}}, \texttt{iparoi\index{iparoi}},
4478
4242
\texttt{iparug\index{iparug}}, \texttt{isymet\index{isymet}},
4479
4243
\texttt{isolib\index{isolib}} and \texttt{iindef\index{iindef}}.
4484
4248
\begin{list}{$\rightarrow$}{}
4485
4249
\item Zero-flux condition for pressure and Dirichlet condition for all
4486
4250
      other variables. The value of the Dirichlet must be given in
4487
 
      \texttt{rcodcl(ifac,ivar,1)} for every value of \texttt{ivar}, apart from
4488
 
      \texttt{ivar=ipr(iphas)}. The other values of \texttt{rcodcl} and
4489
 
      \texttt{icodcl} are completed automatically.
 
4251
      \texttt{rcodcl(ifac,ivar,1)} for every value of \texttt{ivar}, except for
 
4252
      \texttt{ivar=ipr}. The other values of \texttt{rcodcl} and
 
4253
      \texttt{icodcl} are filled automatically.
4490
4254
\end{list}
4491
4255
 
4492
4256
\item If \texttt{itypfb=iparoi}: smooth solid wall face, impermeable and with friction.
4493
4257
 
4494
4258
\begin{list}{$\rightarrow$}{}
4495
 
\item the eventual moving velocity of the wall tangent to the face is
4496
 
      given by \texttt{rcodcl(ifac,ivar,1)} (\texttt{ivar} being
4497
 
      \texttt{iu(iphas)}, \texttt{iv(iphas)} or \texttt{iw(iphas))}. The initial
4498
 
      value of \texttt{rcodcl(ifac,ivar,1)} is zero for
4499
 
      the three velocity components (and therefore needs to be specified
4500
 
      only in the case of the existence of a slipping velocity). \\
4501
 
{\em WARNING: the wall moving velocity must be in the boundary face
4502
 
      plane. By security, the code uses only the projection of this
 
4259
\item the potential sliding wall velocity of the face is
 
4260
      found in \texttt{rcodcl(ifac,ivar,1)} (\texttt{ivar} being
 
4261
      \texttt{iu}, \texttt{iv} or \texttt{iw)}. The initial
 
4262
      values of \texttt{rcodcl(ifac,ivar,1)} are zero for
 
4263
      the three velocity components (and therefore are to be specified
 
4264
      only if the velocity is not equal to zero). \\
 
4265
{\em WARNING: the wall sliding velocity must belong to the boundary face
 
4266
      plane. For safety, the code only uses the projection of this
4503
4267
      velocity on the face. As a consequence, if the velocity specified
4504
 
      by the user is not in the face plane, the wall moving velocity really
 
4268
      by the user does not belong to the face plane, the wall sliding velocity really
4505
4269
      taken into account will be different.}
4506
4270
 
4507
 
\item Concerning the scalars, two kinds of boundary conditions can be
 
4271
\item For scalars, two kinds of boundary conditions can be
4508
4272
      defined:
4509
4273
\begin{list}{$\rightsquigarrow$}{}
4510
4274
\item Imposed value at the wall. The user must write\\
4512
4276
\hspace*{1cm}\texttt{rcodcl(ifac,ivar,1)}=imposed value\\
4513
4277
\item Imposed flux at the wall. The user must write\\
4514
4278
\hspace*{1cm}\texttt{icodcl(ifac,ivar)}=3\\
4515
 
\hspace*{1cm}\texttt{rcodcl(ifac,ivar,3)}=flux imposed value (for the flux
4516
 
      definition according to the variable, the user may refer to the
4517
 
      case \texttt{icodcl}=3 of the paragraph \ref{prg_clnonstandard}).
4518
 
\item If the user does not complete these arrays, the default condition
 
4279
\hspace*{1cm}\texttt{rcodcl(ifac,ivar,3)}=flux imposed value (depending on the variable, the user may refer to the case \texttt{icodcl}=3 of Section \ref{prg_clnonstandard} for the flux definition).
 
4280
\item If the user does not fill these arrays, the default condition
4519
4281
      is zero flux.
4520
4282
\end{list}
4521
4283
\end{list}
4525
4287
\begin{list}{$\rightarrow$}{}
4526
4288
\item the eventual moving velocity of the wall tangent to the face is
4527
4289
      given by \texttt{rcodcl(ifac,ivar,1)} (\texttt{ivar} being
4528
 
      \texttt{iu(iphas)}, \texttt{iv(iphas)} or \texttt{iw(iphas)}). The initial
 
4290
      \texttt{iu}, \texttt{iv} or \texttt{iw}). The initial
4529
4291
      value of \texttt{rcodcl(ifac,ivar,1)} is zero for
4530
4292
      the three velocity components (and therefore needs to be specified
4531
4293
      only in the case of the existence of a slipping velocity). \\
4534
4296
      velocity on the face. As a consequence, if the velocity specified
4535
4297
      by the user is not in the face plane, the wall moving velocity really
4536
4298
      taken into account will be different.}
4537
 
\item The dynamic roughness must be specified in \texttt{rcdocl(ifac,iu(iphas),3)}.
4538
 
      The values of \texttt{rcdocl(ifac,iv(iphas),3)} and
4539
 
      \texttt{rcdocl(ifac,iw(iphas),3)} are not used.
 
4299
\item The dynamic roughness must be specified in \texttt{rcdocl(ifac,iu,3)}.
 
4300
      The values of \texttt{rcdocl(ifac,iv,3)} and
 
4301
      \texttt{rcdocl(ifac,iw,3)} are not used.
4540
4302
\item For scalars, two kinds of boundary conditions can be defined:
4541
4303
\begin{list}{$\rightsquigarrow$}{}
4542
4304
\item Imposed value at the wall. The user must write\\
4552
4314
      is zero flux.
4553
4315
\end{list}
4554
4316
\end{list}
4555
 
 
4556
 
 
4557
 
 
4558
4317
\item If \texttt{itypfb=isymet}: symmetry face (or wall without friction)
4559
4318
\begin{list}{$\rightarrow$}{}
4560
 
\item Nothing to write in \texttt{icodcl} and  \texttt{rcodcl}.
 
4319
\item Nothing to be writen in \texttt{icodcl} and  \texttt{rcodcl}.
4561
4320
\end{list}
4562
4321
 
4563
4322
\item If \texttt{itypfb=isolib}: free outlet face (or more precisely free 
4564
4323
      inlet/outlet with forced pressure)
4565
4324
\begin{list}{$\rightarrow$}{}
4566
4325
\item The pressure is always treated with a Dirichlet condition, calculated
4567
 
      in order to have $\displaystyle \frac{d}{dn}\left(\frac{dP}{d\tau}\right)=0$.
4568
 
      The pressure is given the value $P_0$ at the first face \texttt{isolib} met.
4569
 
      The pressure drop is always linked to just one face, even if there are
 
4326
      with the constraint $\displaystyle \frac{d}{dn}\left(\frac{dP}{d\tau}\right)=0$.
 
4327
      The pressure is set to $P_0$ at the first \texttt{isolib} face met.
 
4328
      The pressure calibration is always done on a single face, even if there are
4570
4329
      several outlets.
4571
4330
\item If the mass flow is coming in, the ``infinite'' velocity is retained
4572
 
      and Dirichlet condition for the scalars and the turbulent quantities is used
 
4331
      and a Dirichlet condition for the scalars and the turbulent quantities is used
4573
4332
      (or zero-flux condition if no Dirichlet value has been specified).
4574
 
\item If the mass flow is going out, zero-flux condition for the velocity,
 
4333
\item If the mass flow is going out, zero-flux condition are set for the velocity,
4575
4334
      the scalars and the turbulent quantities.
4576
 
\item Nothing to write in \texttt{icodcl} or \texttt{rcodcl} for pressure or
4577
 
      velocity. An optional Dirichlet condition can be specified for the scalars
 
4335
\item Nothing is written in \texttt{icodcl} or \texttt{rcodcl} for the pressure or
 
4336
      the velocity. An optional Dirichlet condition can be specified for the scalars
4578
4337
      and turbulent quantities.
4579
4338
\end{list}
4580
4339
 
4581
 
\item If \texttt{itypfb=iindef}: non-defined type face (non-standard case)
 
4340
\item If \texttt{itypfb=iindef}: undefined type face (non-standard case)
4582
4341
\begin{list}{$\rightarrow$}{}
4583
 
\item The coding is done by completing every array \texttt{rcodcl} and
 
4342
\item Coding is done in a non-standard way by filling both arrays \texttt{rcodcl} and
4584
4343
      \texttt{icodcl} (see \S\ref{prg_clnonstandard}).
4585
4344
\end{list}
4586
4345
\end{list}
4587
4346
 
4588
4347
\minititre{Notes}
4589
 
$\bullet\ $ Whatever the value of the indicator \texttt{itypfb(ifac,iphas)}, if
 
4348
$\bullet\ $ Whatever is the value of the indicator \texttt{itypfb(ifac)}, if
4590
4349
the array \texttt{icodcl(ifac,ivar)} is modified by the user ({\em i.e.} filled
4591
 
in by a value different from zero), the code will not use the default
4592
 
conditions for the variable \texttt{ivar} at the face \texttt{ifac}, but will
4593
 
take into account the values of \texttt{icodcl} and \texttt{rcodcl} given by the
4594
 
user (these arrays must then be totally completed, like in the non-standard case). \\
4595
 
For instance, for a symmetry face at which the scalar 1 is given a
 
4350
with a non-zero value), the code will not use the default
 
4351
conditions for the variable \texttt{ivar} at the face \texttt{ifac}. It will
 
4352
take into account only the values of \texttt{icodcl} and \texttt{rcodcl} provided by the
 
4353
user (these arrays must then be fully completed, like in the non-standard case). \\
 
4354
For instance, for a normal symmetry face where scalar 1 is associated with a
4596
4355
Dirichlet condition equal to 23.8 (with an infinite exchange
4597
4356
coefficient):\\
4598
 
\hspace*{2cm}\texttt{itypfb(ifac,iphas)=isymet}\\
 
4357
\hspace*{2cm}\texttt{itypfb(ifac)=isymet}\\
4599
4358
\hspace*{2cm}\texttt{icodcl(ifac,isca(1))=1}\\
4600
4359
\hspace*{2cm}\texttt{rcodcl(ifac,isca(1),1)=23.8}\\
4601
 
(\texttt{rcodcl(ifac,isca(1),2)=rinfin} is the default value, so it is
4602
 
not necessary to specify it)\\
4603
 
The boundary conditions for the other variables are still automatically
 
4360
(\texttt{rcodcl(ifac,isca(1),2)=rinfin} is the default value, therfore it is
 
4361
not necessary to specify a value)\\
 
4362
The boundary conditions for the other variables are remain automatically
4604
4363
defined.
4605
4364
 
4606
4365
\noindent
4607
 
$\bullet\ $The user may define new types of wall faces. He only needs to
4608
 
choose a value $N$ and to specify completely the boundary conditions
4609
 
corresponding to this new wall face type (see
4610
 
\S\ref{prg_clnonstandard}). He must then specify
4611
 
\texttt{itypfb(ifac,iphas)}=$N$. The value of $N$ must be between 1 and
 
4366
$\bullet\ $The user can define new types of boundary faces. He only needs to
 
4367
choose a value $N$ and to fully specify the boundary conditions (see
 
4368
\S\ref{prg_clnonstandard}). He must specify
 
4369
\texttt{itypfb(ifac)}=$N$ where $N$ range is 1 to
4612
4370
\texttt{ntypmx\index{ntypmx}} (maximum number of boundary face types), and of
4613
4371
course different from the values \texttt{ientre}, \texttt{iparoi},
4614
 
\texttt{iparug}, \texttt{isymet}, \texttt{isolib} and \texttt{iindef} (the value
4615
 
of these variables is given in the file \texttt{paramx.h}). This allows to
4616
 
easily isolate some boundary faces, in order to calculate balances.
 
4372
\texttt{iparug}, \texttt{isymet}, \texttt{isolib} and \texttt{iindef} (the values
 
4373
of these variables are given in the file \texttt{paramx.h}). This allows to
 
4374
easily isolate some boundary faces, in order for instance to calculate balances.
4617
4375
 
4618
4376
%==================================
4619
4377
\subsubsection{Coding of non-standard boundary conditions}
4620
4378
%==================================
4621
4379
\label{prg_clnonstandard}%
4622
 
In the case of a face not corresponding to a standard type, the user
4623
 
must complete all of the arrays \texttt{itypfb}, \texttt{icodcl} and
4624
 
\texttt{rcodcl}. \texttt{itypfb(ifac,iphas)} is then worth \texttt{iindef}
4625
 
or another value defined by the user (see note in the end of paragraph
 
4380
In the case a face does not correspond to a standard type, the user
 
4381
must fill completely the arrays \texttt{itypfb}, \texttt{icodcl} and
 
4382
\texttt{rcodcl}. \texttt{itypfb(ifac)} is then equal to \texttt{iindef}
 
4383
or another value defined by the user (see note at the end of Section
4626
4384
\ref{prg_clstandard}). The arrays \texttt{icodcl} and \texttt{rcodcl}
4627
 
must be completed as follows:
 
4385
must be filled as follows:
4628
4386
 
4629
4387
\begin{list}{$\bullet$}{}
4630
4388
\item If \texttt{icodcl(ifac,ivar)}=1: Dirichlet condition at the face
4636
4394
 
4637
4395
\item \texttt{rcodcl(ifac,ivar,2)} is the value of the exchange coefficient
4638
4396
      between the outside and the fluid for the variable \texttt{ivar}. An
4639
 
      infinite value (\texttt{rcodcl(ifac,ivar,2)=rinfin}) indicates a
4640
 
      perfect transfer between the outside and the fluid (default case).
 
4397
      infinite value (\texttt{rcodcl(ifac,ivar,2)=rinfin}) indicates an
 
4398
      ideal transfer between the outside and the fluid (default case).
4641
4399
 
4642
4400
\item \texttt{rcodcl(ifac,ivar,3)} is not used.
4643
4401
 
4644
 
\item \texttt{rcodcl(ifac,ivar,1)} is expressed in the unit of the variable
 
4402
\item \texttt{rcodcl(ifac,ivar,1)} has the units of the variable
4645
4403
      \texttt{ivar}, {\em i.e.}:
4646
4404
\begin{list}{$\rightsquigarrow$}{}
4647
4405
\item $m/s$ for the velocity
4656
4414
 
4657
4415
\item $J.kg^{-1}$ for the enthalpy
4658
4416
 
4659
 
\item \degresC$^2$ for the temperature fluctuations
 
4417
\item \degresC$^2$ for temperature fluctuations
4660
4418
 
4661
 
\item $J^2.kg^{-2}$ for the enthalpy fluctuations
 
4419
\item $J^2.kg^{-2}$ for enthalpy fluctuations
4662
4420
\end{list}
4663
4421
 
4664
 
\item \texttt{rcodcl(ifac,ivar,2)} is expressed in the following unit (defined so
4665
 
      that by multiplying the exchange coefficient and the variable, the
4666
 
      obtained flux has the same unit as the flux defined below for
 
4422
\item \texttt{rcodcl(ifac,ivar,2)} has the following units (defined in such way that when multiplying the exchange coefficient by the variable, the
 
4423
      given flux has the same units as the flux defined below when
4667
4424
      \texttt{icodcl=3)}:
4668
4425
 
4669
4426
\begin{list}{$\rightsquigarrow$}{}
4690
4447
      wall. This flux is negative if it is a source for the fluid. It corresponds to:
4691
4448
\begin{list}{$\rightsquigarrow$}{}
4692
4449
\item
4693
 
$\displaystyle -C_p(\frac{\lambda_T}{C_p}+\frac{\mu_t}{\sigma_T})\grad T\cdot\vect{n}$ in the case of a temperature (in $W/m^2$).
 
4450
$\displaystyle -C_p(\frac{\lambda_T}{C_p}+\frac{\mu_t}{\sigma_T})\grad T\cdot\vect{n}$ for a temperature (in $W/m^2$).
4694
4451
 
4695
4452
$\displaystyle -(\lambda_h+\frac{\mu_t}{\sigma_h})\grad h\cdot\vect{n}$
4696
 
     in the case of an enthalpy (in $W/m^2$).
4697
 
 
4698
 
$\displaystyle -(\lambda_\varphi+\frac{\mu_t}{\sigma_\varphi})\grad\varphi\cdot\vect{n}$ in the case of another scalar $\varphi$ (in $kg.m^{-2}.s^{-1}.[\varphi]$, where $[\varphi]$ is the unit of $\varphi$).
4699
 
 
4700
 
\item $-\Delta t\ \grad P\cdot\vect{n}$ in the case of the pressure (in $kg.m^{-2}.s^{-1}$).
4701
 
 
4702
 
\item $-(\mu+\mu_t)\grad U_i\cdot\vect{n}$ in the case of a velocity component (in $kg.m^{-1}.s^{-2}$).
4703
 
 
4704
 
\item $-\mu\grad R_{ij}\cdot\vect{n}$ in the case of a $R_{ij}$ tensor component (in $W/m^2$).
 
4453
     for an enthalpy (in $W/m^2$).
 
4454
 
 
4455
$\displaystyle -(\lambda_\varphi+\frac{\mu_t}{\sigma_\varphi})\grad\varphi\cdot\vect{n}$ in the case of another scalar $\varphi$ (in $kg.m^{-2}.s^{-1}.[\varphi]$, where $[\varphi]$ are the units of $\varphi$).
 
4456
 
 
4457
\item $-\Delta t\ \grad P\cdot\vect{n}$ for the pressure (in $kg.m^{-2}.s^{-1}$).
 
4458
 
 
4459
\item $-(\mu+\mu_t)\grad U_i\cdot\vect{n}$ for a velocity component (in $kg.m^{-1}.s^{-2}$).
 
4460
 
 
4461
\item $-\mu\grad R_{ij}\cdot\vect{n}$ for a $R_{ij}$ tensor component (in $W/m^2$).
4705
4462
\end{list}
4706
4463
 
4707
4464
\end{list}
4708
4465
 
4709
4466
\item If \texttt{icodcl(ifac,ivar)}=4: symmetry condition, for the symmetry
4710
4467
      faces or wall faces without friction. This condition can only be
4711
 
      used for the velocity components ($\vect{U}\cdot\vect{n}=0$) and
4712
 
      the $R_{ij}$ tensor components (for the other variables, a zero-flux
4713
 
      condition type is generally used).\\
 
4468
      used for velocity components ($\vect{U}\cdot\vect{n}=0$) and
 
4469
      the $R_{ij}$ tensor components (for other variables, a zero-flux
 
4470
      condition type is usually used).\\
4714
4471
 
4715
 
\item If \texttt{icodcl(ifac,ivar)}=5: friction condition, for the smooth-wall faces
 
4472
\item If \texttt{icodcl(ifac,ivar)}=5: friction condition, for wall faces
4716
4473
      with friction. This condition can not be applied to the pressure.
4717
4474
\begin{list}{$\rightsquigarrow$}{}
4718
4475
\item For the velocity and (if necessary) the turbulent variables, the
4719
4476
      values at the wall are calculated from theoretical profiles. In
4720
 
      the case of a moving wall, the three components of the slipping
4721
 
      velocity are given by (\texttt{rcodcl(ifac,iu(iphas),1)},
4722
 
      \texttt{rcodcl(ifac,iv(iphas),1)}, and \texttt{rcodcl(ifac,iw(iphas),1)}).\\
4723
 
{\em WARNING: the wall moving velocity must be in the boundary face
4724
 
      plane. By security, the code uses only the projection of this
4725
 
      velocity on the face. As a consequence, if the velocity specified
4726
 
      by the user is not in the face plane, the wall moving velocity really
 
4477
      the case of a sliding wall, the three components of the sliding
 
4478
      velocity are given by (\texttt{rcodcl(ifac,iu,1)},
 
4479
      \texttt{rcodcl(ifac,iv,1)}, and \texttt{rcodcl(ifac,iw,1)}).\\
 
4480
{\em WARNING: the wall sliding velocity must belong to the boundary face
 
4481
      plane. For safety, the code uses only the projection of this
 
4482
      velocity on the face. Therefore, if the velocity vector specified
 
4483
      by the user does not belong to the face plane, the wall sliding velocity really
4727
4484
      taken into account will be different.}
4728
4485
 
4729
 
\item For the other scalars, the condition \texttt{icodcl}=5 is similar to
 
4486
\item For other scalars, the condition \texttt{icodcl}=5 is similar to
4730
4487
      \texttt{icodcl=1}, but with a wall exchange coefficient calculated from a
4731
 
      theoretical law. The values of \texttt{rcodcl(ifac,ivar,1)} and
4732
 
      \texttt{rcodcl(ifac,ivar,2)} must therefore be specified: see \cite{theory}.
 
4488
      theoretical law. Therefore, the values of \texttt{rcodcl(ifac,ivar,1)} and
 
4489
      \texttt{rcodcl(ifac,ivar,2)} must be specified: see \cite{theory}.
4733
4490
\end{list}
4734
4491
 
4735
4492
\item If \texttt{icodcl(ifac,ivar)}=6: friction condition, for the rough-wall faces
4736
 
      with friction. This condition can not be applied to the pressure.
 
4493
      with friction. This condition can not be used with the pressure.
4737
4494
\begin{list}{$\rightsquigarrow$}{}
4738
4495
\item For the velocity and (if necessary) the turbulent variables, the
4739
4496
      values at the wall are calculated from theoretical profiles. In
4740
 
      the case of a moving wall, the three components of the slipping
4741
 
      velocity are given by (\texttt{rcodcl(ifac,iu(iphas),1)},
4742
 
      \texttt{rcodcl(ifac,iv(iphas),1)}, and \texttt{rcodcl(ifac,iw(iphas),1)}).\\
4743
 
{\em WARNING: the wall moving velocity must be in the boundary face
4744
 
      plane. By security, the code uses only the projection of this
4745
 
      velocity on the face. As a consequence, if the velocity specified
4746
 
      by the user is not in the face plane, the wall moving velocity really
 
4497
      the case of a sliding wall, the three components of the sliding
 
4498
      velocity are given by (\texttt{rcodcl(ifac,iu,1)},
 
4499
      \texttt{rcodcl(ifac,iv,1)}, and \texttt{rcodcl(ifac,iw,1)}).\\
 
4500
{\em WARNING: the wall sliding velocity must belong to the boundary face
 
4501
      plane. For safety, the code uses only the projection of this
 
4502
      velocity on the face. Therefore, if the velocity vector specified
 
4503
      by the user does not belong to the face plane, the wall sliding velocity really
4747
4504
      taken into account will be different.}\\
4748
 
      The dynamic roughness height is given by \texttt{rcodcl(ifac,iu(iphas),3)} only.
 
4505
      The dynamic roughness height is given by \texttt{rcodcl(ifac,iu,3)} only.
4749
4506
 
4750
4507
\item For the other scalars, the condition \texttt{icodcl}=6 is similar to
4751
4508
      \texttt{icodcl}=1, but with a wall exchange coefficient calculated from a
4755
4512
\end{list}
4756
4513
 
4757
4514
\item If \texttt{icodcl(ifac,ivar)}=9: free outlet condition for the
4758
 
      velocity. This condition can only be applied to the velocity
 
4515
      velocity. This condition is only applicable to velocity
4759
4516
      components.\\
4760
 
If the mass flow at the face is going out, this condition is equivalent
 
4517
If the mass flow at the face negative, this condition is equivalent
4761
4518
      to a zero-flux condition.\\
4762
 
If the mass flow at the face is coming in, the value zero is imposed to
4763
 
      the velocity at the face (but not to the mass flow).\\
 
4519
If the mass flow at the face is positive, the velocity at the face is set to zero (but not to the mass flow).\\
4764
4520
\texttt{rcodcl} is not used.
4765
4521
 
4766
4522
\end{list}
4778
4534
 
4779
4535
The code checks the main compatibilities between the boundary
4780
4536
conditions. In particular, the following rules must be respected: \\
4781
 
$\bullet\ $On each face, the three components of the velocity
4782
 
must belong to the same type. The same must be true for the different
4783
 
components of the $R_{ij}$ tensor.\\
 
4537
$\bullet\ $On each face, the boundary conditions of the three velocity components must belong to the same type. The same is true for the components of the $R_{ij}$ tensor.\\
4784
4538
$\bullet\ $If the boundary conditions for the velocity belong to the
4785
 
``slipping'' type (\texttt{icodcl}=4), the conditions for $R_{ij}$ must belong to
 
4539
``sliding'' type (\texttt{icodcl}=4), the conditions for $R_{ij}$ must belong to
4786
4540
the ``symmetry'' type (\texttt{icodcl}=4), and vice versa.\\
4787
4541
$\bullet\ $If the boundary conditions for the velocity belong to the
4788
 
``friction'' type (\texttt{icodcl}=5 or 6), the conditions for the turbulent variables
 
4542
``friction'' type (\texttt{icodcl}=5 or 6), the boundary conditions for the turbulent variables
4789
4543
must belong to the ``friction'' type, too.\\
4790
 
$\bullet\ $If the boundary condition for a scalar belongs to the
4791
 
``friction'' type, the boundary condition for the velocity must belong to
 
4544
$\bullet\ $If the boundary condition of a scalar belongs to the
 
4545
``friction'' type, the boundary condition of the velocity must belong to
4792
4546
the ``friction'' type, too.
4793
4547
 
4794
 
In case of error, if post-processing output is activated (which is the default),
4795
 
a special error output to the same mesh format occurs, so as to help
 
4548
In case of mistakes, if the post-processing output is activated (which is the default setting),
 
4549
a special error output, similar to the mesh format, is produced in order to help
4796
4550
correcting boundary condition definitions.
4797
4551
 
4798
4552
%==================================
4800
4554
%==================================
4801
4555
 
4802
4556
In the code, it may be necessary to have access to all the boundary
4803
 
faces of a given type. In order to ease this kind of search, an array of
4804
 
sorted faces is automatically completed (and updated at every time step)
4805
 
for each phase \texttt{iphas}: \texttt{itrifb(nfabor,iphas)\index{itrifb}}.\\
4806
 
\texttt{ifac=itrifb(i,iphas)} is the number of the i$^{\text{th}}$  face of type
 
4557
faces of a given type. To ease this kind of search, an array made of
 
4558
sorted faces is automatically filled (and updated at each time step):
 
4559
\texttt{itrifb(nfabor)\index{itrifb}}.\\
 
4560
\texttt{ifac=itrifb(i)} is the number of the i$^{\text{th}}$  face of type
4807
4561
1.\\
4808
 
\texttt{ifac=itrifb(i+n,iphas)} is the number of the i$^{\text{th}}$ face de type
 
4562
\texttt{ifac=itrifb(i+n)} is the number of the i$^{\text{th}}$ face of type
4809
4563
2, if there are $n$ faces of type 1.\\
4810
4564
... etc.
4811
4565
 
4812
4566
Two auxiliary arrays of size \texttt{ntypmx} are also defined.\\
4813
 
\texttt{idebty(ityp,iphas)\index{idebty}} is the number of the first box
4814
 
corresponding to the
4815
 
faces of type \texttt{ityp} in the array \texttt{itrifb}.\\
4816
 
\texttt{ifinty(ityp,iphas)\index{ifinty}} is the number of the last box
4817
 
corresponding to the
4818
 
faces of type \texttt{ityp} in the array \texttt{itrifb}.
4819
 
 
4820
 
Therefore, a number \texttt{ifac0} between \texttt{idebty(ityp,iphas)} and
4821
 
\texttt{ifinty(ityp,iphas)} corresponds to each face of type
4822
 
\texttt{ityp=itypfb(ifac,iphas)}, so that \texttt{ifac=itrifb(ifac0,iphas)}.
4823
 
 
4824
 
If there is no face of type \texttt{ityp}, the code imposes \\
4825
 
\texttt{ifinty(ityp,iphas)=idebty(ityp,iphas)-1},\\
4826
 
which allows to bypass, for all the missing \texttt{ityp}, the loops like \\
4827
 
\texttt{do ii=idebty(ityp,iphas),ifinty(ityp,iphas)}.
4828
 
 
4829
 
The values of all these indicators are displayed in the beginning of the
 
4567
\texttt{idebty(ityp)\index{idebty}} is the index
 
4568
corresponding to the first
 
4569
face of type \texttt{ityp} in the array \texttt{itrifb}.\\
 
4570
\texttt{ifinty(ityp)\index{ifinty}} is the index
 
4571
corresponding to the last
 
4572
face of type \texttt{ityp} in the array \texttt{itrifb}.
 
4573
 
 
4574
Therefore, a value \texttt{ifac0} found between \texttt{idebty(ityp)} and
 
4575
\texttt{ifinty(ityp)} is associated to each face \texttt{ifac} of type
 
4576
\texttt{ityp=itypfb(ifac)}, so that \texttt{ifac=itrifb(ifac0)}.
 
4577
 
 
4578
If there is no face of type \texttt{ityp}, the code set \\
 
4579
\texttt{ifinty(ityp)=idebty(ityp)-1},\\
 
4580
which enables to bypass, for all the missing \texttt{ityp}, the loops such as \\
 
4581
\texttt{do ii=idebty(ityp),ifinty(ityp)}.
 
4582
 
 
4583
The values of all these indicators are displayed at the beginning of the
4830
4584
code execution listing.
4831
4585
 
4832
4586
%=============================================================
4833
 
\subsection[Management of the boundary conditions with LES: \texttt{usvort}]
4834
 
{Management of the boundary conditions with LES: \textmd{\texttt{usvort}}}
 
4587
\subsubsection[Boundary conditions with LES]
 
4588
{Boundary conditions with LES}
4835
4589
%===============================================================
4836
4590
\label{prg_usvort}%
4837
 
This subroutine allows to generate the non-stationary inlet boundary
 
4591
The subroutine \texttt{usvort} allows to generate the non-stationary inlet boundary
4838
4592
conditions for the LES by the vortex method. The method is based on
4839
4593
 the generation of vortices in the 2D inlet plane with help from
4840
4594
the pre-defined functions. The fluctuation normal to the inlet plane
4909
4663
The 4 edges are numbered relative to the directions \texttt{dir1} and
4910
4664
\texttt{dir2} as shown in figure \ref{Fig_vortex}:
4911
4665
 
4912
 
\begin{figure}[hp]
 
4666
\begin{figure}[!ht]
4913
4667
\centerline{
4914
4668
\includegraphics*[width=8cm]{vortex}}
4915
4669
\caption{Numbering of the edges of a rectangular inlet(\texttt{icas}=1)
5006
4760
 \texttt{phidat}.
5007
4761
\end{list}
5008
4762
 
5009
 
 
5010
 
%==================================
5011
 
\subsection{Management of the variable physical properties:
5012
 
  \textmd{\texttt{usphyv}}}
5013
 
%==================================
5014
 
 
5015
 
\noindent
5016
 
\textit{Subroutine called every time step.}
5017
 
 
5018
 
If necessary, all the variation laws related to the fluid physical
5019
 
parameters (density, viscosity, thermal diffusivity, ...) are written in this
5020
 
subroutine.
 
4763
%==================================
 
4764
\subsection{Manage the variable physical properties}
 
4765
%==================================
 
4766
%==================================
 
4767
\subsubsection{Basic variable physical properties}\label{sec:usphyv}
 
4768
%==================================
 
4769
When the fluid properties are not constant, the user is offered the choice to define the variation laws in the Graphical User Interface (GUI) or in the subroutine \texttt{usphyv} which is called at each time step. In the GUI, in the item ``Fluid properties'' under the heading ``Physical properties'', the variation laws are defined for the fluid density, viscosity, specific heat and thermal conductivity through the use of a formula editor, see figs. \ref{fig:V-60_GUI} and \ref{fig:UL1_GUI}.
 
4770
%
 
4771
\begin{figure}[!ht]
 
4772
\begin{center}
 
4773
\includegraphics[width=13cm]{gui_fluid_props}
 
4774
\caption{Physical properties - Fluid properties}
 
4775
\label{fig:V-60_GUI}
 
4776
\end{center}
 
4777
\end{figure}
 
4778
%
 
4779
\begin{figure}[!ht]
 
4780
\begin{center}
 
4781
\includegraphics[width=9cm]{gui_density_law}
 
4782
\caption{Definition of a user law for the density}
 
4783
\label{fig:UL1_GUI}
 
4784
\end{center}
 
4785
\end{figure}
 
4786
 
 
4787
If necessary, all the variation laws related to the fluid physical properties are written in the subroutine \texttt{usphyv}.
5021
4788
 
5022
4789
The validity of the variation laws must be checked, particularly when
5023
4790
non-linear laws are defined (for instance, a third-degree polynomial law
5024
4791
may produce negative density values).
5025
4792
 
5026
 
{\bf \underline{WARNING}}\label{prg_propvar}
 
4793
{\bf \underline{WARNING}}\label{prg_propvar}%
5027
4794
\begin{list}{$\bullet$}{}
5028
 
\item If one wishes to impose a density or viscosity variable in
5029
 
      \texttt{usphyv}, it can be done either in the interface or in
5030
 
      \texttt{usini1}(\texttt{irovar(iphas)}=1, \texttt{ivivar(iphas)}=1).
 
4795
\item If one wishes to impose a variable density or variable viscosity in
 
4796
      \texttt{usphyv}, it must be flagged either in the interface or in
 
4797
      \texttt{usini1}(\texttt{irovar}=1, \texttt{ivivar}=1).
5031
4798
\item In order to impose a physical property ($\rho$, $\mu$,
5032
4799
      $\lambda$, $C_p$)\footnote{except for some specific physics} a reference
5033
 
      value must be inputted to the interface or in \texttt{usini1}(in
5034
 
      particular for $\rho$, the pressure will contain 1 part as $\rho_0 gz$)
5035
 
\item By default, the $C_p$ coefficient of the phase \texttt{iphas} and the
5036
 
      diffusivity of the scalars \texttt{iscal} ($\lambda/C_p$ for the
 
4800
      value should be provided in the interface or in \texttt{usini1} (in
 
4801
      particular for $\rho$, the pressure will be function of $\rho_0 gz$)
 
4802
\item By default, the $C_p$ coefficient and the
 
4803
      diffusivity for the scalars \texttt{iscal} ($\lambda/C_p$ for the
5037
4804
      temperature) are considered as constant in time and uniform in
5038
 
      space, with the values \texttt{cp0(iphas)} and \texttt{visls0(iscal)}
 
4805
      space, with the values \texttt{cp0} and \texttt{visls0(iscal)}
5039
4806
      specified in the interface or in \texttt{usini1}.\\
5040
 
To give a variable value to $C_p$, the user must specify it in the
5041
 
      interface or give the value 1 to \texttt{icp(iphas)} in \texttt{usini1},
5042
 
      and complete for each cell \texttt{iel} the array
 
4807
To assign a variable value to $C_p$, the user \textbf{must}t specify it in the
 
4808
      interface or assign the value 1 to \texttt{icp} in \texttt{usini1},
 
4809
      and fill for each cell \texttt{iel} the array
5043
4810
      \texttt{propce(iel,ipccp)} in \texttt{usphyv}. Completing the array
5044
 
      \texttt{propce(iel,ipccp)} while \texttt{icp(iphas)=0} induces array
 
4811
      \texttt{propce(iel,ipccp)} while \texttt{icp=0} induces array
5045
4812
      overwriting problems and produces wrong results.
5046
4813
 
5047
4814
\item In the same way, to have variable diffusivities for the scalars
5048
 
      \texttt{iscal}, the user must specify it in the interface or give the value
 
4815
      \texttt{iscal}, the user \textbf{must} specify it in the interface or give the value
5049
4816
      1 to \texttt{ivisls(iscal)} in \texttt{usini1}, and complete for each cell
5050
4817
      \texttt{iel} the array \texttt{propce(iel,ipcvsl)} in \texttt{usphyv}.
5051
4818
      Completing \texttt{propce(iel,ipcvsl)} while \texttt{ivisls(iscal)}=0
5052
4819
      induces memory overwriting problems and produces wrong results.\\
5053
4820
 
5054
 
{\em Example}: If the scalars 1 and 3 have a constant and uniform
5055
 
      viscosity, and if the scalars 2 and 4 have a variable viscosity,
5056
 
      the following values must be imposed in \texttt{usini1}: \\
 
4821
{\em Example}: If scalars 1 and 3 have a constant and uniform
 
4822
      diffusivity, and if scalars 2 and 4 have a variable diffusivity,
 
4823
      the following values must be set in \texttt{usini1}: \\
5057
4824
      \texttt{ivisls(1)}=0, \texttt{ivisls(2)}=1, \texttt{ivisls(3)}=0
5058
4825
      and \texttt{ivisls(4)}=1. \\
5059
4826
      The indicators \texttt{ivisls(2)} and \texttt{ivisls(4)} are then
5060
 
      modified automatically by the code in order to reflect the rank
 
4827
      modified automatically by the code in order to return the rank
5061
4828
      corresponding to the diffusivity of each scalar in the list of physical
5062
 
      properties\footnote{they are no longer worth 1 but stay positive
5063
 
      so that \texttt{ivisls}$>$0 is synonymous with variable property}.
 
4829
      properties\footnote{they are no longer equal to 1 but stay positive
 
4830
      so that \texttt{ivisls}$>$0 is synonymous with variable diffusivity}.
5064
4831
      The arrays \mbox{\texttt{propce(iel,ipcvsl)}} in \texttt{usphyv} must
5065
4832
      then be completed with \texttt{ipcvsl=ipproc(ivisls(2))} and
5066
4833
      \texttt{ipcvsl=ipproc(ivisls(4))}. \\
5075
4842
      is variable.
5076
4843
\end{list}
5077
4844
 
5078
 
%==================================
5079
 
\subsection{Non-default variables initialisation:
5080
 
  \textmd{\texttt{usiniv}}}
5081
 
%==================================
5082
 
 
5083
 
\noindent
5084
 
\textit{Subroutine only called during calculation initialisation.}
5085
 
 
5086
 
At the calculation beginning, the variables are initialised
5087
 
automatically by the code. Velocities and scalars are set to the value
5088
 
0 (or \texttt{scamax} or \texttt{scamin} if 0 is outside the acceptable
5089
 
scalar variation range), and the turbulent variables are estimated from
5090
 
\texttt{uref} and \texttt{almax}. \\
5091
 
For $k$ in $k-\varepsilon$, $R_{ij}-\varepsilon$, v2f or $k-\omega$
5092
 
model:\\
5093
 
{\texttt{rtp(iel,ikiph) = 1.5*(0.02*uref(iphas))**2}
5094
 
(in $R_{ij}-\varepsilon$,  $R_{ij}=\frac{2}{3}k\delta_{ij}$)\\
5095
 
For $\varepsilon$ in $k-\varepsilon$, $R_{ij}-\varepsilon$ or v2f model:\\
5096
 
\texttt{rtp(iel,ieiph) = rtp(iel,ikiph)**1.5*cmu/almax(iphas)}\\
5097
 
For $\omega$ in $k-\omega$ model:\\
5098
 
\texttt{rtp(iel,iomgip) = rtp(iel,ikiph)**0.5/almax(iphas)}\\
5099
 
For $\varphi$ and $\overline{f}$ in v2f model:\\
5100
 
\texttt{rtp(iel,iphiph) = 2/3}\\
5101
 
\texttt{rtp(iel,ifbiph) = 0}
5102
 
 
5103
 
The subroutine \texttt{usiniv} allows if necessary to initialise some
5104
 
variables at values closer to their estimated final values, in order to
5105
 
obtain a faster convergence.
5106
 
 
5107
 
This subroutine allows also to make non-standard initialisation of
5108
 
physical parameters (density, viscosity, ...), to impose a local
5109
 
value of the time step, or to modify some parameters (time step,
5110
 
variable specific heat, ...) in the case of a calculation restart.
5111
 
 
5112
 
\minititre{Note: value of the time step}
5113
 
\begin{list}{-}{}
5114
 
\item In the case of a calculation with constant and uniform time step
5115
 
      (\texttt{idtvar}=0), the value of the time step is \texttt{dtref},
5116
 
      given in the parametric file of the interface or \texttt{usini1}, the
5117
 
      calculation being whether a restart (\texttt{isuite}=1) or not (
5118
 
      \texttt{isuite}=0).
5119
 
\item In the case of a calculation with non-constant time step
5120
 
      (\texttt{idtvar}=1 or 2) which is not a calculation restart
5121
 
      (\texttt{isuite}=0), the
5122
 
      value of \texttt{dtref} given in the parametric file of the interface or in
5123
 
      \texttt{usini1} is used to initialise the time step.
5124
 
\item In the case of a calculation with non-constant time step
5125
 
      (\texttt{idtvar}=1 or 2) which is a restart (\texttt{isuite}=1) of a
5126
 
      calculation whose time step type was different (for instance, restart
5127
 
      using a variable time step of a calculation run using a constant time
5128
 
      step), the value of \texttt{dtref} given in the parametric file of the
5129
 
      interface or in \texttt{usini1} is used to initialise the time step.
5130
 
\item In the case of a calculation with non-constant time step
5131
 
      (\texttt{idtvar}=1 or 2) which is a restart (\texttt{isuite}=1) of a
5132
 
      calculation whose time step type was the same (for instance, restart with
5133
 
      \texttt{idtvar}=1 of a calculation run with \texttt{idtvar}=1), the time
5134
 
      step is read from the restart file and the value of \texttt{dtref} given
5135
 
      in the parametric file of the interface or in \texttt{usini1} is not used.
5136
 
\end{list}
5137
 
It follows that for a calculation with non-constant time step (\texttt{idtvar}=1
5138
 
or 2) which is a restart (\texttt{isuite}=1) of a calculation in which
5139
 
\texttt{idtvar} had the same value, \texttt{dtref} does not allow to modify the
5140
 
time step. The user subroutine \texttt{usiniv} allows to modify the array
5141
 
\texttt{dt} which contains the value of the time step read from the restart file
5142
 
(array whose size is \texttt{ncelet}, defined at the cell centers whatever the
5143
 
chosen time step type).
5144
 
 
5145
 
{\em WARNING: to initialise the variables in the framework of a
5146
 
specific physics module} (\texttt{nscapp.gt.0}) {\em one of the subroutines
5147
 
\texttt{usebui}, \texttt{usd3pi}, \texttt{uslwci} or \texttt{uscpiv}
5148
 
should be used instead of \texttt{usiniv} (depending on the activated module).}
5149
 
 
5150
 
%==================================
5151
 
\subsection{Non-standard management of the chronological record files:
5152
 
  \textmd{\texttt{ushist}}}
5153
 
%==================================
5154
 
\label{prg_ushist}
5155
 
 
5156
 
\noindent
5157
 
\textit{Subroutine called every time step}
5158
 
 
5159
 
The interface and the subroutine \texttt{usini1} allow to manage the
5160
 
``automatic'' chronological record files in an autonomous way:
5161
 
position of the probes, printing frequency and concerned variables. The
5162
 
results are written in a different file for each variable. These files
5163
 
are written in {\em xmgrace or {\em gnuplot}} format and contain the profiles corresponding to
5164
 
every probe. This type of output format may not be well adapted if, for
5165
 
instance, the number of probes is too high. The subroutine
5166
 
\texttt{ushist} allows then to personalise the output format of the
5167
 
chronological record files. The version given as example in the
5168
 
directory works as follows:
5169
 
 
5170
 
\begin{list}{-}{}
5171
 
\item Positionning of the probes (only at the first passage): the index
5172
 
      \texttt{ii} varies between 1 and the number of probes. The coordinates
5173
 
      \texttt{xx}, \texttt{yy} and \texttt{zz} of each probe are given.
5174
 
      The subroutine \texttt{findpt}
5175
 
      gives then the number \texttt{icapt(ii)\index{icapt}} of the cell center
5176
 
      which is the closest to the defined probe.
5177
 
 
5178
 
\item Opening of the output files (only at the first pass): in the
5179
 
      version given as example, the program opens a different file for
5180
 
      all the \texttt{nvar} variables. \texttt{ficush(j)} contains the name of the
5181
 
      J\raisebox{1ex}{\small th} file and \texttt{impush(j)} its unit number
5182
 
      (\texttt{impush} is initialised by default so that the user has at his
5183
 
      disposal specific unit numbers and does not run the risk to overwrite an
5184
 
      already open file).
5185
 
 
5186
 
\item Writing to the files: in the version given as example, the program
5187
 
      writes the time step number, the physical time step (based on the
5188
 
      standard time step in the case of a variable time step) and the
5189
 
      value of the selected variable at the different probes.
5190
 
 
5191
 
\item Closing of the files (only at the last time step).
5192
 
 
5193
 
\end{list}
5194
 
 
5195
 
{\em WARNING: The use of {\em\texttt{ushist}} neither erases nor replaces the
5196
 
parameters given in the interface or in {\em\texttt{usini1}}. Therefore, in
5197
 
the case of the use of {\em\texttt{ushist}}, and to avoid the creation
5198
 
of useless files, the user should set {\em \texttt{ncapt}=0} in the interface or
5199
 
in {\em \texttt{usini1}} to deactivate the automatic production of
5200
 
chronological records}.\\
5201
 
In addition, {\em \texttt{ushist}} generates supplementary result
5202
 
files. The user shoud remember to add in the launch script the necessary
5203
 
command to copy them in the directory \texttt{RESU} at the end of the
5204
 
calculation. The interface allows the specification of the name of the copied
5205
 
 user results files. For the calculations without interface, the variable must
5206
 
 be inputted in USER\_OUTPUT\_FILES in the launch script.
5207
 
 
5208
 
%==================================
5209
 
\subsection{User source terms in Navier-Stokes: \textmd{\texttt{ustsns}}}
5210
 
%==================================
5211
 
 
5212
 
\noindent
5213
 
\textit{Subroutine called every time step}
5214
 
 
5215
 
This subroutine is used to add user source terms to the Navier-Stokes
5216
 
equations. For each phase \texttt{iphas}, it is called three times every time
5217
 
step, once for each velocity component (\texttt{ivar} is successively worth
5218
 
\texttt{iu(iphas)}, \texttt{iv(iphas)} and \texttt{iw(iphas)}).
5219
 
At each passage, the user must complete if necessary the arrays \texttt{crvimp}
5220
 
and \texttt{crvexp} expressing respectively the implicit and explicit part of
5221
 
the source term. If no other source terms apart from \texttt{ivar=iu(iphas)} for
5222
 
example, are required, \texttt{crvimp} and \texttt{crvexp} must be read over and
5223
 
their 2 other components, \texttt{ivar=iv(ihpas)} and \texttt{ivar=iw(iphas)}
5224
 
must be cancelled.
 
4845
 
 
4846
%==================================
 
4847
\subsubsection{Modification of the turbulent viscosity}
 
4848
%==================================
 
4849
 
 
4850
The subroutine \texttt{usvist} is used to modify the calculation of the turbulent
 
4851
viscosity, {\em i.e.} $\mu_t$ in $kg.m^{-1}.s^{-1}$
 
4852
(this piece of information, at the mesh cell centers, is conveyed by the
 
4853
variable \texttt{propce(iel,ipcvst)}, with
 
4854
\texttt{ipcvst =  ipproc(ivisct)}). The
 
4855
subroutine is called at the beginning of every time step, after the
 
4856
calculation of the physical parameters of the flow and of the
 
4857
``conventional'' value of $\mu_t$ corresponding to the chosen turbulence
 
4858
model (indicator \texttt{iturb}).\\
 
4859
{\em WARNING: The calculation of the turbulent viscosity being a
 
4860
particularly sensible stage, a wrong use of {\em\texttt{usvist}} may
 
4861
seriously distort the results.}
 
4862
 
 
4863
%==================================
 
4864
\subsubsection{Modification of the variable $C$ of the dynamic LES model}
 
4865
%==================================
 
4866
 
 
4867
\noindent
 
4868
\textit{Subroutine called every time step in the case of LES with the
 
4869
dynamic model.}
 
4870
 
 
4871
The subroutine \texttt{ussmag} is used to modify the calculation of the variable $C$ of
 
4872
the LES sub-grid scale dynamic model.
 
4873
 
 
4874
Let us first remind that the LES approach introduces the notion of
 
4875
filtering between large eddies and small motions. The solved variables
 
4876
are said to be filtered in an ``implicit'' way. Sub-grid scale models
 
4877
(``dynamic'' models) introduce in addition an explicit filtering.
 
4878
 
 
4879
The notations used for the definition of the variable $C$ used in the
 
4880
dynamic models of \CS are specified below. These notations are the ones
 
4881
assumed in the document \cite{benhamadouche01}, to which the user may
 
4882
refer for more details.
 
4883
 
 
4884
The value of $a$ filtered by the explicit filter (of width
 
4885
$\widetilde{\overline{\Delta}}$) is called $\widetilde{a}$ and the value
 
4886
of $a$ filtered by the implicit filter (of width $\overline{\Delta}$) is
 
4887
called $\overline{a}$.
 
4888
We define:
 
4889
\begin{equation}
 
4890
\begin{array}{ll}
 
4891
\overline{S}_{ij}=\frac{1}{2}(\frac{\partial \overline{u}_i}{\partial x_j}
 
4892
                  +\frac{\partial \overline{u}_j}{\partial x_i})  &
 
4893
||\overline{S}||=\sqrt{2 \overline{S}_{ij}\overline{S}_{ij}}\\
 
4894
\alpha_{ij}=-2\widetilde{\overline{\Delta}}^2
 
4895
             ||\widetilde{\overline{S}}||
 
4896
             \widetilde{\overline{S}}_{ij}&
 
4897
\beta_{ij}=-2\overline{\Delta}^2
 
4898
             ||\overline{S}||
 
4899
               \overline{S}_{ij}\\
 
4900
L_{ij}=\widetilde{\overline{u}_i\overline{u}_j}-
 
4901
 \widetilde{\overline{u}}_i\widetilde{\overline{u}}_j&
 
4902
M_{ij}=\alpha_{ij}-\widetilde{\beta}_{ij}\\
 
4903
\end{array}
 
4904
\end{equation}
 
4905
 
 
4906
 
 
4907
In the framework of LES, the total viscosity (molecular + sub-grid) in
 
4908
$kg.m^{-1}.s^{-1}$ may be written in \CS:
 
4909
\begin{equation}
 
4910
\begin{array}{llll}
 
4911
\mu_{\text{total}}&=&\mu+\mu_{\text{sub-grid}} &
 
4912
    \text{\ \ if\ \ }\mu_{\text{sub-grid}}>0\\
 
4913
                   &=&\mu                          &
 
4914
    \text{\ \ otherwise }\\
 
4915
\text{with\ }\mu_{\text{sub-grid}}&=&\rho C \overline{\Delta}^2 ||\overline{S}||
 
4916
\end{array}
 
4917
\end{equation}
 
4918
 
 
4919
$\overline{\Delta}$ is the width of the implicit filter, defined at the
 
4920
cell $\Omega_i$ by \\
 
4921
$\overline{\Delta}=XLESFL*(ALES*|\Omega_i|)^{BLES}$
 
4922
\index{xlesfl}\index{ales}\index{bles}.
 
4923
 
 
4924
In the case of the Smagorinsky model (\texttt{iturb=40}), $C$ is a
 
4925
constant which is worth $C_s^2$. $C_s^2$ is the so-called Smagorinsky
 
4926
constant and is stored the variable \texttt{$csmago$\index{csmago}}.
 
4927
 
 
4928
In the case of the dynamic model (\texttt{iturb=41}), $C$ is variable in
 
4929
time and in space. It is determined by
 
4930
$\displaystyle C=\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}$.
 
4931
 
 
4932
In practice, in order to increase the stability, the code does not use the
 
4933
value of $C$ obtained in each cell, but an average with the values
 
4934
obtained in the neighboring cells (this average uses the extended
 
4935
neighborhood and corresponds to the explicit filter). By default, the
 
4936
value calculated by the code is
 
4937
\begin{displaymath}
 
4938
C=\frac{\widetilde{M_{ij}L{ij}}}{\widetilde{M_{kl}M_{kl}}}
 
4939
\end{displaymath}
 
4940
 
 
4941
The subroutine \texttt{ussmag} allows to modify this value. It is for
 
4942
example possible to calculate the local average after having calculated the
 
4943
ratio
 
4944
\begin{displaymath}
 
4945
C=\widetilde{\left[\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}\right]}
 
4946
\end{displaymath}
 
4947
 
 
4948
{\em WARNING: The subroutine {\em\texttt{ussmag}} can be activated only when
 
4949
the dynamic model is used.}
 
4950
 
 
4951
%==================================
 
4952
\subsection{User source terms}
 
4953
%==================================
5225
4954
 
5226
4955
Let us assume that the user source terms modify the equation of a
5227
4956
variable $\varphi$ in the following way:
5228
4957
\begin{displaymath}
5229
4958
\rho\frac{\partial \varphi}{\partial t}+\ldots = \ldots + S_{impl}\times\varphi+S_{expl}
5230
4959
\end{displaymath}
5231
 
$\varphi$ is here a velocity component, but the examples are also valid
5232
 
for a turbulent variable ($k$, $\varepsilon$, $R_{ij}$, $\omega$,
 
4960
The example is valid a velocity component, for a turbulent variable ($k$, $\varepsilon$, $R_{ij}$, $\omega$,
5233
4961
$\varphi$ or $\overline{f}$) and for a scalar (or for the average of the
5234
4962
square of the fluctuations of a scalar), because the syntax of the
5235
4963
subroutines \texttt{ustske}, \texttt{ustsri}, \texttt{ustsv2},
5236
4964
\texttt{ustskw} and \texttt{ustssc} is similar.
5237
4965
 
5238
 
In finite volume formulation, the solved system is then modified as
 
4966
In the finite volume formulation, the solved system is then modified as
5239
4967
follows:
5240
4968
\begin{displaymath}
5241
4969
\left(\frac{\rho_i\Omega_i}{\Delta t_i}-\Omega_iS_{impl,i}\right)
5246
4974
$\text{\texttt{crvimp}}_i=\Omega_iS_{impl,i}$\\
5247
4975
$\text{\texttt{crvexp}}_i=\Omega_iS_{expl,i}$
5248
4976
 
5249
 
In practice, it is essential that the term
 
4977
In practice, it is essential for the term
5250
4978
$\displaystyle \left(\frac{\rho_i\Omega_i}{\Delta
5251
 
t_i}-\Omega_iS_{impl,i}\right)$ is positive. To ensure this property,
 
4979
t_i}-\Omega_iS_{impl,i}\right)$ to be positive. To ensure this property,
5252
4980
the equation really taken into account by the code is the following:
5253
4981
\begin{displaymath}
5254
4982
\left(\frac{\rho_i\Omega_i}{\Delta t_i}-
5257
4985
+\ldots = \ldots + \Omega_iS_{impl,i}\varphi_i^{(n)} + \Omega_iS_{expl,i}
5258
4986
\end{displaymath}
5259
4987
To make the ``implicitation'' effective, the source term decomposition
5260
 
between implicit and explicit parts will be done by the user who must
5261
 
make sure $\text{\texttt{crvimp}}_i=\Omega_iS_{impl,i}$ is always negative
5262
 
(otherwise the solved equation remains right, but there is no
 
4988
between the implicit and explicit parts will be done by the user who must
 
4989
ensure that $\text{\texttt{crvimp}}_i=\Omega_iS_{impl,i}$ is always negative
 
4990
(otherwise the solved equation remains right, but there will not be
5263
4991
``implicitation'').
5264
4992
 
5265
 
{\em WARNING: When the second-order in time with extrapolation of the
 
4993
{\em WARNING: When the second-order in time is used along with the extrapolation of the
5266
4994
source terms\footnote{indicator \texttt{isno2t} for the velocity,
5267
 
\texttt{ISTO2T} for the turbulence and \texttt{isso2t} for the scalars}
5268
 
is activated, it is no longer possible to test the sign of $S_{impl,i}$,
 
4995
\texttt{ISTO2T} for the turbulence and \texttt{isso2t} for the scalars}, it is no longer possible to test the sign of $S_{impl,i}$,
5269
4996
because of coherence reasons (for more details, the user may refer to
5270
4997
the theoretical and computer documentation \cite{theory} of the
5271
4998
subroutine \texttt{preduv}). The user must therefore make sure it is
5272
 
always positive.}
 
4999
always positive (or take the risk to affect the calculation stability).}
5273
5000
 
5274
5001
\minititre{Particular case of a linearised source term}
5275
5002
 
5280
5007
\begin{displaymath}
5281
5008
\rho\frac{\partial\varphi}{\partial t}=F(\varphi)
5282
5009
\end{displaymath}
5283
 
 
5284
5010
We want to make it implicit using the following method:
5285
5011
\begin{eqnarray*}
5286
5012
\frac{\rho_i\Omega_i}{\Delta t}\left(\varphi_i^{(n+1)}-\varphi_i^{(n)}\right) & = &
5303
5029
$\text{\texttt{crvimp}}_i=-2K\Omega_i\varphi_i^{(n)}$\\
5304
5030
$\text{\texttt{crvexp}}_i=K\Omega_i[\varphi_i^{(n)}]^2$
5305
5031
 
5306
 
 
5307
 
 
5308
 
%==================================
5309
 
\subsection{User source terms for $k$ and $\varepsilon$:
5310
 
  \textmd{\texttt{ustske}}}
 
5032
%==================================
 
5033
\subsubsection{In Navier-Stokes}
 
5034
%==================================
 
5035
 
 
5036
The subroutine \texttt{ustsns} is used to add user source terms to the Navier-Stokes
 
5037
equations (at each time step). It is called three times every time
 
5038
step, once for each velocity component (\texttt{ivar} is successively worth
 
5039
\texttt{iu}, \texttt{iv} and \texttt{iw}).
 
5040
At each passage, the user must complete if necessary the arrays \texttt{crvimp}
 
5041
and \texttt{crvexp} expressing respectively the implicit and explicit part of
 
5042
the source term. If no other source terms apart from \texttt{ivar=iu} for
 
5043
example, are required, \texttt{crvimp} and \texttt{crvexp} must be read over and
 
5044
their 2 other components, \texttt{ivar=iv(ihpas)} and \texttt{ivar=iw}
 
5045
must be cancelled.
 
5046
 
 
5047
%==================================
 
5048
\subsubsection{For $k$ and $\varepsilon$}
5311
5049
%==================================
5312
5050
 
5313
5051
\noindent
5314
5052
\textit{Subroutine called every time step, in $k-\varepsilon$ and
5315
5053
in v2f.}
5316
5054
 
5317
 
This subroutine is used to add source terms to the transport equations
 
5055
The subroutine \texttt{ustske} is used to add source terms to the transport equations
5318
5056
related to the turbulent kinetics energy $k$ and to the turbulent
5319
 
dissipation $\varepsilon$ (for each phase \texttt{iphas}).
5320
 
This subroutine is called every time step, once for each phase (the
 
5057
dissipation $\varepsilon$.
 
5058
This subroutine is called every time step (the
5321
5059
treatment of the two variables $k$ and $\varepsilon$ is made
5322
5060
simultaneously). The user is expected to provide the arrays \texttt{crkimp} and
5323
 
\texttt{crkexp} for $k$ and \texttt{creimp} and \texttt{creexp} for
 
5061
\texttt{crkexp} for $k$, and \texttt{creimp} and \texttt{creexp} for
5324
5062
$\varepsilon$. These arrays are similar to the arrays \texttt{crvimp} and
5325
5063
\texttt{crvexp} given for the velocity in the user subroutine \texttt{ustsns}.
5326
5064
The way of making implicit the resulting source terms is the same as the one
5327
5065
presented in \texttt{ustsns}. For $\varphi$ and $\bar{f}$
5328
 
in v2f, see \texttt{ustsv2}, \S\ref{prg_ustsv2}.
5329
 
 
5330
 
 
 
5066
in the v2f model, see \texttt{ustsv2}, \S\ref{prg_ustsv2}.
5331
5067
 
5332
5068
%==================================
5333
 
\subsection{User source terms for $R_{ij}$ and $\varepsilon$: \textmd{\texttt{ustsri}}}
 
5069
\subsubsection{For $R_{ij}$ and $\varepsilon$}
5334
5070
%==================================
5335
5071
 
5336
5072
\noindent
5337
5073
\textit{Subroutine called every time step, in $R_{ij}-\varepsilon$.}
5338
5074
 
5339
 
This subroutine is used to add source terms to the transport equations
 
5075
The subroutine \texttt{ustsri} is used to add source terms to the transport equations
5340
5076
related to the Reynolds stress variables $R_{ij}$ and to the turbulent
5341
 
dissipation $\varepsilon$ (for each phase \texttt{iphas}).
5342
 
This subroutine is called 7 times every time step and for each phase
 
5077
dissipation $\varepsilon$.
 
5078
This subroutine is called 7 times every time step
5343
5079
(once for each Reynolds stress component and once for the
5344
5080
dissipation). The user must provide the arrays \texttt{crvimp} and
5345
5081
\texttt{crvexp} for the variable \texttt{ivar} (referring successively to
5346
 
\texttt{ir11(iphas)}, \texttt{ir22(iphas)}, \texttt{ir33(iphas)},
5347
 
\texttt{ir12(iphas)}, \texttt{ir13(iphas)}, \texttt{ir23(iphas)} and
5348
 
\texttt{iep(iphas)}). These arrays are similar to the arrays \texttt{crvimp}
 
5082
\texttt{ir11}, \texttt{ir22}, \texttt{ir33},
 
5083
\texttt{ir12}, \texttt{ir13}, \texttt{ir23} and
 
5084
\texttt{iep}). These arrays are similar to the arrays \texttt{crvimp}
5349
5085
and \texttt{crvexp} given for the velocity in the user subroutine
5350
5086
\texttt{ustsns}. The method for impliciting the resulting source terms is the
5351
5087
same as that presented in \texttt{ustsns}.
5352
5088
 
5353
5089
%==================================
5354
 
\subsection{User source terms for $\varphi$ and $\overline{f}$:
5355
 
  \textmd{\texttt{ustsv2}}}
 
5090
\subsubsection{For $\varphi$ and $\overline{f}$}
5356
5091
%==================================
5357
5092
\label{prg_ustsv2}
 
5093
 
5358
5094
\noindent
5359
5095
\textit{Subroutine called every time step, in v2f.}
5360
5096
 
5361
 
This subroutine is used to add source terms to the transport equations
 
5097
The subroutine \texttt{ustsv2} is used to add source terms to the transport equations
5362
5098
related to the variables $\varphi$ and $\overline{f}$ of the v2f
5363
 
$\varphi$-model (for each phase \texttt{iphas}). This subroutine is called twice
5364
 
every time step and for each phase (once for $\varphi$ and once for
5365
 
$\overline{f}$). The user is expected to provide the arrays \texttt{crvimp} and
5366
 
\texttt{crvexp} for \texttt{ivar} referring successively to \texttt{iphi(iphas)}
5367
 
and \texttt{ifb(iphas)}. Concerning $\varphi$, these arrays are similar to the arrays
 
5099
$\varphi$-model. This subroutine is called twice
 
5100
every time step (once for $\varphi$ and once for $\overline{f}$).
 
5101
The user is expected to provide the arrays \texttt{crvimp} and
 
5102
\texttt{crvexp} for \texttt{ivar} referring successively to \texttt{iphi}
 
5103
and \texttt{ifb}. Concerning $\varphi$, these arrays are similar to the arrays
5368
5104
\texttt{crvimp} and \texttt{crvexp} given for the velocity in the user subroutine
5369
5105
\texttt{ustsns}. Concerning $\overline{f}$, the equation is slightly
5370
5106
different:
5371
5107
\begin{displaymath}
5372
5108
L^2 div(\grad(\overline{f})) = \overline{f} + \ldots + S_{impl}\times\overline{f}+S_{expl}
5373
5109
\end{displaymath}
5374
 
In finite volume formulation, the solved system is written:
 
5110
In the finite volume formulation, the solved system is written as:
5375
5111
\begin{displaymath}
5376
5112
\int_{\partial\Omega_i}\grad(\overline{f})^{(n+1)}dS=\frac{1}{L_i^2}\left(
5377
5113
\Omega_i\overline{f}^{(n+1)}_i + \ldots +  \Omega_iS_{impl,i}\overline{f}_i^{(n+1)} +
5385
5121
one presented in \texttt{ustsns}.
5386
5122
 
5387
5123
%==================================
5388
 
\subsection{User source terms for $k$ and $\omega$: \textmd{\texttt{ustskw}}}
 
5124
\subsubsection{For $k$ and $\omega$}
5389
5125
%==================================
5390
5126
 
5391
5127
\noindent
5392
5128
\textit{Subroutine called every time step, in $k-\omega$.}
5393
5129
 
5394
 
This subroutine is used to add source terms to the transport equations
 
5130
The subroutine \texttt{ustskw} is used to add source terms to the transport equations
5395
5131
related to the turbulent kinetics energy $k$ and to the specific
5396
 
dissipation rate $\omega$ (for each phase \texttt{iphas}). This subroutine is
5397
 
called every time step, once for each phase (the treatment of the two
5398
 
variables $k$ and $\omega$ is made simultaneously).The user is expected
 
5132
dissipation rate $\omega$. This subroutine is
 
5133
called every time step (the treatment of the two
 
5134
variables $k$ and $\omega$ is made simultaneously). The user is expected
5399
5135
to provide the arrays \texttt{crkimp} and \texttt{crkexp} for the variable
5400
 
$k$ the arrays \texttt{crwimp} and \texttt{crwexp} for the variable $\omega$.
 
5136
$k$, and the arrays \texttt{crwimp} and \texttt{crwexp} for the variable $\omega$.
5401
5137
These arrays are similar to the arrays \texttt{crvimp} and \texttt{crvexp}
5402
5138
given for the velocity in the user subroutine \texttt{ustsns}. The way of
5403
 
impliciting the resulting source terms is the same as the one presented in
 
5139
making implicit the resulting source terms is the same as the one presented in
5404
5140
\texttt{ustsns}.
5405
5141
 
5406
5142
%==================================
5407
 
\subsection{User source terms for the user scalars: \textmd{\texttt{ustssc}}}
 
5143
\subsubsection{For user scalars}
5408
5144
%==================================
5409
5145
 
5410
5146
\noindent
5411
5147
\textit{Subroutine called every time step.}
5412
5148
 
5413
 
This subroutine is used to add source terms to the transport equations
 
5149
The subroutine \texttt{ustssc} is used to add source terms to the transport equations
5414
5150
related to the user scalars (passive or not, average of the square of
5415
5151
the fluctuations of a scalar, ...). In the same way as
5416
5152
\texttt{ustsns}, this subroutine is called every time step, once for
5417
5153
each user scalar. The user needs to provide the arrays \texttt{crvimp}
5418
5154
and \texttt{crvexp} related to each scalar. \texttt{cvimp} and \texttt{crvexp}
5419
5155
must be set to 0 for the scalars on which it is not wished for the user source
5420
 
term term to be applied (the arrays are initially at 0 at each inlet in the subroutine.)
5421
 
 
5422
 
%==================================
5423
 
\subsection{Management of the pressure drops: \textmd{\texttt{uskpdc}}}
5424
 
%==================================
5425
 
 
5426
 
\noindent
5427
 
\textit{Subroutine called every time step.}
5428
 
 
5429
 
This subroutine is called three times every time step and for each phase
5430
 
\texttt{iphas}.
5431
 
 
5432
 
The tensor representing the pressure drops is supposed to be symmetric
 
5156
term to be applied (the arrays are initially set to 0 at each inlet in the subroutine.)
 
5157
 
 
5158
%==================================
 
5159
\subsection{Pressure drops (head losses)}
 
5160
%==================================
 
5161
 
 
5162
Pressure drops can be defined in the Gaphical User Interface (GUI) or in the subroutine \texttt{uskpdc} (called three times every time step). In the GUI, under the heading ``Volume conditions'', the item ``Volume regions definition'' allows to define areas where pressure drops occur, see an example in fig \ref{fig:hl1}. The item ``Head losses'' allows to specify the head loss coefficients, see fig \ref{fig:hl2}. The tensor representing the pressure drops is supposed to be symmetric
5433
5163
and positive.
5434
5164
 
 
5165
\begin{figure}[!ht]
 
5166
\begin{center}
 
5167
\begin{tabular}{c}
 
5168
\includegraphics[width=14cm]{gui_volume_regions} \\
 
5169
\\
 
5170
\includegraphics[width=9cm]{gui_head_loss_regions}
 
5171
\end{tabular}
 
5172
\caption{Creation of head losses region}
 
5173
\label{fig:hl1}
 
5174
\end{center}
 
5175
\end{figure}
 
5176
%
 
5177
\begin{figure}[!ht]
 
5178
\begin{center}
 
5179
\includegraphics[width=9cm]{gui_head_loss_coeffs}
 
5180
\caption{Head losses coefficients}
 
5181
\label{fig:hl2}
 
5182
\end{center}
 
5183
\end{figure}
 
5184
 
 
5185
If necessary, the pressure drops are written in the
 
5186
subroutine \texttt{uskpdc}.
 
5187
 
5435
5188
\begin{list}{$\bullet$}{}
5436
5189
\item During the first call, all the cells are checked to know the
5437
 
      number of cells in which a pressure drop is present for the phase
5438
 
      \texttt{iphas}. This number is called \texttt{ncepdp\index{ncepdp}} in
 
5190
      number of cells in which a pressure drop is present.
 
5191
      This number is called \texttt{ncepdp\index{ncepdp}} in
5439
5192
      \texttt{uskpdc} (and corresponds to
5440
 
      \texttt{ncepdc(iphas)\index{ncepdc}}). It is used to lay out the arrays
 
5193
      \texttt{ncepdc\index{ncepdc}}). It is used to lay out the arrays
5441
5194
      related to the pressure drops. If there is no pressure drop,
5442
5195
      \texttt{ncepdp} must be equal to zero (it is the default value, and the
5443
5196
      rest of the subroutine is then useless).
5445
5198
\item During the second call, all the cells are checked again to
5446
5199
      complete the array \texttt{icepdp\index{icepdp}} whose size is
5447
5200
      \texttt{ncepdp}. \mbox{\texttt{icepdc(ielpdc)}} is the number of the
5448
 
      \texttt{ielpdc}\raisebox{1ex}{\small th} cell containing pressure drops (for
5449
 
      the current phase).
 
5201
      \texttt{ielpdc}\raisebox{1ex}{\small th} cell containing pressure drops.
5450
5202
 
5451
5203
\item During the third call, all the cells containing pressure drops
5452
 
      (for the current phase) are checked in order to complete the array
 
5204
      are checked in order to complete the array
5453
5205
      containing the components of the tensor of pressure drops
5454
5206
      \mbox{\texttt{ckupdc(ncepdp,6)}\index{ckupdc}}. This array is so that
5455
5207
      the equation related to the velocity may be written:
5468
5220
zones or values may be treated.
5469
5221
 
5470
5222
%==================================
5471
 
\subsection{Management of the mass sources: \textmd{\texttt{ustsma}}}
 
5223
\subsection{Management of the mass sources}
5472
5224
%==================================
5473
5225
 
5474
 
\noindent
5475
 
\textit{Subroutine called every time step.}
5476
 
 
5477
 
This subroutine is used to add a density source term in some cells of
5478
 
the domain. The mass conservation equation is then modified as follows:
 
5226
The subroutine \texttt{ustsma} is used to add a density source term in some cells of
 
5227
the domain (called at each time step). The mass conservation equation is then modified as follows:
5479
5228
\begin{displaymath}
5480
5229
\frac{\partial \rho}{\partial t} + div(\rho\vect{u})=\Gamma
5481
5230
\end{displaymath}
5510
5259
 
5511
5260
\bigskip
5512
5261
 
5513
 
This subroutine is called three times every time step (for each phase).
 
5262
This subroutine is called three times every time step.
5514
5263
 
5515
5264
\begin{list}{$\bullet$}{}
5516
5265
\item During the first call, all the cells are checked to know the
5517
 
      number of cells containing a mass source term for the current
5518
 
      phase \texttt{iphas}. This number is called \texttt{ncesmp\index{ncesmp}} in
 
5266
      number of cells containing a mass source term.
 
5267
      This number is called \texttt{ncesmp\index{ncesmp}} in
5519
5268
      \texttt{ustsma} (and corresponds to
5520
 
      \texttt{ncetsm(iphas)\index{ncetsm}}). It is used to lay out the arrays
 
5269
      \texttt{ncetsm\index{ncetsm}}). It is used to lay out the arrays
5521
5270
      related to the mass sources. If there is no mass source,
5522
5271
      \texttt{ncesmp} must be equal to zero (it is the default value, and the
5523
5272
      rest of the subroutine is then useless).
5525
5274
\item During the second call, all the cells are checked again to
5526
5275
      complete the array \texttt{icetsm\index{icetsm}} whose dimension is
5527
5276
      \texttt{ncesmp}. \mbox{\texttt{icetsm(ieltsm)}} is the number of the
5528
 
      \texttt{ieltsm}\raisebox{1ex}{\small th} cell containing a mass source (for
5529
 
      the current phase).
 
5277
      \texttt{ieltsm}\raisebox{1ex}{\small th} cell containing a mass source.
5530
5278
 
5531
5279
\item During the third call, all the cells containing mass sources are
5532
5280
      checked in order to complete the arrays
5537
5285
      containing a mass source.\\
5538
5286
\hspace*{1cm}\texttt{itypsm}=0: $\varphi_i=\varphi^{(n+1)}$ condition\\
5539
5287
\hspace*{1cm}\texttt{itypsm}=1: imposed $\varphi_i$ condition\\
5540
 
\hspace*{1cm}\texttt{itypsm} is not used for \texttt{ivar=ipr(iphas)}\\
5541
 
- \texttt{(ieltsm,ipr(iphas))} is the value of the mass source term $\Gamma$, in
 
5288
\hspace*{1cm}\texttt{itypsm} is not used for \texttt{ivar=ipr}\\
 
5289
- \texttt{(ieltsm,ipr)} is the value of the mass source term $\Gamma$, in
5542
5290
$kg.m^{-3}.s^{-1}$.\\
5543
5291
- \texttt{smacel(ieltsm,ivar)}, for \texttt{ivar} different from
5544
 
\texttt{ipr(iphas)}, is the value
 
5292
\texttt{ipr}, is the value
5545
5293
of $\varphi_i$ for the variable \texttt{ivar} in the
5546
5294
\texttt{ielstm}\raisebox{1ex}{\small th} cell containing a mass source.\\
5547
5295
 
5548
5296
\minititre{Notes}
5549
5297
$\bullet$ If \texttt{itypsm(ieltsm,ivar)=0}, \texttt{smacel(ieltsm,ivar)}
5550
5298
      is not used.\\
5551
 
$\bullet$ If $\Gamma$=\texttt{smacel(ieltsm,ipr(iphas))}$<$0, mass is removed from
 
5299
$\bullet$ If $\Gamma$=\texttt{smacel(ieltsm,ipr)}$<$0, mass is removed from
5552
5300
      the system, and \CS considers automatically a
5553
5301
      $\varphi_i=\varphi^{(n+1)}$ condition, whatever the values given
5554
5302
      to \texttt{itypsm(ieltsm,ivar)} and \texttt{smacel(ieltsm,ivar)}
5563
5311
For the variance, do not take into account the scalar $\varphi_i$ in the environment
5564
5312
where $\varphi\ne\varphi_i$ generates a variance source.
5565
5313
 
5566
 
%========================================
5567
 
\subsection{Thermal module in a 1D wall}
5568
 
%========================================
5569
 
 
5570
 
\noindent
5571
 
\textit{subroutine called at every time step}
5572
 
 
5573
 
This subroutine takes into account the affected thermal inertia by a wall.
5574
 
 Some boundary faces are treated as a solid wall with a given thickness, on
5575
 
 which the code resolves an undimensional equation for the heat conduction.
5576
 
 The coupling between the 1D module and the fluid works in a similar way to
5577
 
 the coupling with the \syrthes. In construction, the user is not able to
5578
 
 account for the heat transfer between different parts of the wall. A physical
5579
 
 analysis of each problem, case by case is required to evaluate the relevance
5580
 
 of its usage by way of a report of the simple conditions (temperature, zero-flux
5581
 
 ) or a coupling with \syrthes.\\
5582
 
 
5583
 
The use of this code requires that theres is only 1 phase (\texttt{nphas=1})
5584
 
and that the thermal scalar is defined as (\texttt{iscalt}$>0$).
5585
 
 
5586
 
{\em WARNING: The 1D thermal module is developped assuming the thermal scalar
5587
 
 as a temperature. If the thermal scalar is an enthalpy, the code calls the
5588
 
 subroutine \texttt{usthht} for each transfer of information between the fluid
5589
 
 and the wall in order to convert the enthalpy to temperature and vice-versa.
5590
 
 This function has not been tested and is firmly discouraged. If the thermal
5591
 
 variable is the total (compressible) energy, the thermal module will not work.}
5592
 
 
5593
 
\bigskip
5594
 
 
5595
 
This procedure  is called twice,on initialisation and again at each time step.
5596
 
 
5597
 
\begin{list}{$\bullet$}{}
5598
 
\item The 1st call (initialisation) all the boundary faces that will be treated
5599
 
 as a coupled wall are marked out. This figure is written noted as
5600
 
 \texttt{nfkpt1d}. It applies dimension to the arrays in the thermal module.
5601
 
 \texttt{nfkpt1d} will be at 0 if there are no coupled faces (it is in fact the
5602
 
 default value, the remainer of the subroutine is not used in this case).
5603
 
 The parameter \texttt{isuit1} also need to be defined, this indicates if the
5604
 
 temperature of the wall must be initialised or written in the file (stored in
5605
 
 the variable \texttt{filmt1}).
5606
 
\item The 2nd call (initialisation) again concern the wall faces, it completes
5607
 
 the \texttt{ifpt1d} array of dimension \texttt{nfpt1d}.
5608
 
 \mbox{\texttt{ifpt1d(ifbt1d)}} is the number
5609
 
 \texttt{ifbt1d}\raisebox{1ex}{\small th} boundary faces coupled with the thermal module
5610
 
 of a 1D wall. The directional parameters are then completed for a pseudo
5611
 
 wall associated to each face
5612
 
\begin{list}{-}{}
5613
 
\item \texttt{nppt1d(nfpt1d)\index{nppt1d}}: number of cells in the 1D mesh associated
5614
 
 to the pseudo wall.
5615
 
\item \texttt{eppt1d(nfpt1d)\index{eppt1d}}: thickness of the pseudo wall.
5616
 
\item \texttt{rgpt1d(nfpt1d)\index{rgpt1d}}: geometery of the pseudo wall mesh (refined
5617
 
 as a fluid if \texttt{rgt1d} is smaller than 1)
5618
 
\item \texttt{tppt1d(nfpt1d)\index{tppt1d}}: initialisation temperature of the wall
5619
 
(uniform in thickness). In the course of the calculation, the array stores the
5620
 
 temperature of the solid at the fluid/solid interface.
5621
 
\end{list}
5622
 
 
5623
 
Other than for re-reading a file (\texttt{ficmt1}), \texttt{tppt1d} is not used.
5624
 
\texttt{nppt1d}, \texttt{ifpt1d}, \texttt{rgpt1d} and \texttt{eppt1d} are
5625
 
compared to data from the follow-up file and they must be identical.
5626
 
 
5627
 
{\em WARNING: The test in \texttt{ifpt1d} implicilty assumes that the array is completed
5628
 
 in ascending order (i.e \texttt{ifpt1d(ii)}$>$\texttt{ifpt1d(jj)} if ii$>$jj.
5629
 
 This will be the case if the coupled faces are defined starting from the unique loop on the
5630
 
boundary faces (as in the example). If this is not the case, contact the development
5631
 
 team to short circuit the test.}
5632
 
 
5633
 
\item The 3rd call (at each time step) is for the confirmation that all the arrays
5634
 
 involving physical parameter and external boundary conditions have been completed.
5635
 
\begin{list}{-}{}
5636
 
\item \texttt{iclt1d(nfpt1d)\index{iclt1d}}:Typical boundary condition at the external
5637
 
 (pseudo) wall: Dirichlet condition (\texttt{iclt1d}=1) or flux condition (\texttt{iclt1d}=3)
5638
 
\item \texttt{tept1d(nfpt1d)\index{tept1d}}: External temperature of the pseudo wall in the
5639
 
 Dirichlet case.
5640
 
\item \texttt{hept1d(nfpt1d)\index{hept1d}}: External coefficient of transfer in the pseudo
5641
 
 wall under Dirichlet conditions(en $W.m^{-2}.K^.$).
5642
 
\item \texttt{fept1d(nfpt1d)\index{nfpt1d}}: External heat flux in the pseudo wall  under
5643
 
 the flux conditions(en $W.m^{-2}$,negative value for energy entering the wall)
5644
 
\item \texttt{xlmt1d(nfpt1d)\index{xlmt1d}}: Conductivity$\lambda$ of the wall uniform
5645
 
in thickness, (in $W.m^{-1}.K^{-1}$).
5646
 
\item \texttt{rcpt1d(nfpt1d)\index{rcpt1d}}: Volumetric heat capacity $\rho C_p$ of the
5647
 
wall uniform in thickness in $J.m^{-3}.K^{-1}$)
5648
 
\item \texttt{dtpt1d(nfpt1d)\index{dtpt1d}}: Physical time step ascociated with the solved
5649
 
 1D equation of the pseudo wall(which can be different from the time step in the
5650
 
 calculation)
5651
 
\end{list}
5652
 
 
5653
 
\end{list}
5654
 
 
5655
 
The 3rd call, done at each time step, allows the imposition of boundary conditions
5656
 
 and physical values in time.
5657
 
 
5658
 
%==================================
5659
 
\subsection{ Initialization of the options of the variables related
5660
 
   to the ale module: \textmd{\texttt{usalin}} and \textmd{\texttt{usstr1}} }
5661
 
%==================================
5662
 
\label{prg_usalin}%
5663
 
\noindent
5664
 
\textit{Subroutine called at the start.}
5665
 
 
5666
 
 
5667
 
\minititre{Subroutine \texttt{usalin}}
5668
 
This subroutine completes \texttt{usini1}.
5669
 
 
5670
 
\texttt{usalin} allows to set option for the ale module, and in
5671
 
particular to active the ale module
5672
 
 
5673
 
\minititre{Subroutine \texttt{usstr1}}
5674
 
 
5675
 
\texttt{usstr1} allows to specify for the structure module the
5676
 
following pieces of information:
5677
 
\begin{list}{-}{}
5678
 
  \item number of structure (\texttt{nbstru}).
5679
 
  \item initial value of deplacement, velocity and acceleration
5680
 
    (\texttt{xstr0}, \texttt{xstreq} and \texttt{vstr0}).
5681
 
\end{list}
5682
 
 
5683
 
Below is a list of the different variables that might be modified:
5684
 
 
5685
 
\begin{list}{$\bullet$}{}
5686
 
 
5687
 
\item{\texttt{nbstru}} \\
5688
 
{the number of structures}
5689
 
 
5690
 
\item{\texttt{idfstr(i)}} \\
5691
 
{index of the structure, where I is the index of the face}
5692
 
 
5693
 
\item{\texttt{xstr0(i,k)}} \\
5694
 
{initial position of a structure, where \texttt{i} is the dimension of space
5695
 
and \texttt{k} the index of the structure}
5696
 
 
5697
 
\item{\texttt{xstreq(i,k)}} \\
5698
 
{position of balance of a structure, where \texttt{i} is the dimension of space
5699
 
and \texttt{k} the index of the structure}
5700
 
 
5701
 
\item{\texttt{vstr0(i,k)}} \\
5702
 
{initial velicity of a structure, where \texttt{i} is the dimension of space
5703
 
and \texttt{k} the index of the structure }
5704
 
\end{list}
5705
 
 
5706
 
%==================================
5707
 
\subsection{Management of the boundary conditions of velocity mesh related to the ale module: \textmd{\texttt{usalcl}}}
5708
 
%==================================
5709
 
 
5710
 
 
5711
 
\noindent
5712
 
\textit{Subroutine called every time step.}
5713
 
 
5714
 
\minititre{Subroutine \texttt{usalcl}}
5715
 
The use of \texttt{usalcl} is obligatory to run a calculation using
5716
 
the ale module just as it is in \texttt{usini1}. The way of using it
5717
 
is the same as the way of using \texttt{usclim} in the framework of
5718
 
standard calculations, that is to say a loop on the boundary faces
5719
 
marked out by their colour (or more generally by a property of their
5720
 
family), where the type of boundary condition of velocity mesh for
5721
 
each variable are defined.
5722
 
 
5723
 
The main numerical variables are described below.
5724
 
 
5725
 
\variab{ialtyb}{ialtyb(nfabor)}{ia}{In the ale module, the user
5726
 
defines the velocity mesh from the colour of the boundary faces, or
5727
 
more generally from their properties (colours, groups, ...), from the
5728
 
boundary conditions defined in \texttt{usclim}, or even from their
5729
 
coordinates. To do so, the array \texttt{ialtyb(nfabor)} gives for each face
5730
 
\texttt{ifac} the velocity mesh boundary condition types marked out by the key
5731
 
words \texttt{ivimpo\index{ivimpo}}, \texttt{igliss\index{igliss}},
5732
 
\texttt{ibfixe\index{ibfixe}}
5733
 
 
5734
 
\begin{list}{$\bullet$}{}
5735
 
 
5736
 
\item If \texttt{ialtyb=ivimpo}: imposed velocity.
5737
 
 
5738
 
\begin{list}{$\rightarrow$}{}
5739
 
\item In the case where all the nodes of a face have a imposed displacement,
5740
 
 it is not necessary to fill the tables with boundary conditions
5741
 
 velocity mesh for this face, they will be erased. In the other case,
5742
 
 the value of the Dirichlet must be given in \texttt{rcodcl(ifac,ivar,1)} for
5743
 
 every value of \texttt{ivar} (\texttt{iuma}, \texttt{ivma} and \texttt{iwma})
5744
 
 The other boxes of \texttt{rcodcl} and \texttt{icodcl} are completed automatically.
5745
 
 
5746
 
 The tangential velocity mesh is taken like a tape speed under the
5747
 
 boundary conditions of wall for the fluid, except if wall velocity
5748
 
 was specified by the user in the interface or usclim (in which case
5749
 
 it is this speed which is considered).
5750
 
\end{list}
5751
 
 
5752
 
 \item if \texttt{ialtyb(nfac) = ibfixe}: fixed wall
5753
 
\begin{list}{$\rightarrow$}{}
5754
 
 \item the velocity is null.
5755
 
\end{list}
5756
 
 
5757
 
 \item if \texttt{ialtyb(nfac) = igliss}:  sliding wall
5758
 
\begin{list}{$\rightarrow$}{}
5759
 
\item the tangential velocity is not used.
5760
 
\end{list}
5761
 
 
5762
 
\end{list}
5763
 
 
5764
 
}
5765
 
 
5766
 
 
5767
 
%==================================
5768
 
\subsection{Management of the structure property: \textmd{\texttt{usstr2}}}
5769
 
%==================================
5770
 
 
5771
 
\noindent
5772
 
\textit{Subroutine called every time step.}
5773
 
 
5774
 
The use of \texttt{usstr2}
5775
 
is obligatory to run a calculation using the ale module with a structure module.
5776
 
 
5777
 
For each structure, the system that will be solved is:
5778
 
 
5779
 
\begin{equation}
5780
 
M.x^{''}+C.x^{''}+K.(x-x_{0} = 0
5781
 
\end{equation}
5782
 
 
5783
 
where
5784
 
 
5785
 
\begin{list}{-}{}
5786
 
 \item $M$ is the mass stucture (\texttt{xmstru}).
5787
 
 \item $C$ is the dumping coefficient of the stucture (\texttt{xcstru}).
5788
 
 \item $K$ is the spring constant or force constant of the stucture (\texttt{xkstru}).
5789
 
 \item $x_{0}$ is the initial position
5790
 
\end{list}
5791
 
 
5792
 
Below is a list of the different variables that might be modified:
5793
 
 
5794
 
\begin{list}{$\bullet$}{}
5795
 
 
5796
 
\item{\texttt{xmstru(i,j,k})} \\
5797
 
{the mass stucture of the structure, where \texttt{i},\texttt{j} is
5798
 
the array of mass structure and \texttt{k} the index of the structure.}
5799
 
 
5800
 
\item{\texttt{xcstru(i,j,k})}\\
5801
 
{dumping coefficient of the stucture, where \texttt{i},\texttt{j} is the array of
5802
 
dumping coefficient and \texttt{k} the index of the structure.}
5803
 
 
5804
 
\item{\texttt{xkstru(i,j,k)}}\\
5805
 
{spring constant of the stucture, where \texttt{i},\texttt{j} is the array of spring
5806
 
constant and \texttt{k} the index of the structure.}
5807
 
 
5808
 
\item{\texttt{forstr(i,k)}}\\
5809
 
{force vector of the stucture, where \texttt{i} is the force vector and
5810
 
\texttt{k} the index of the structure.}
5811
 
\end{list}
5812
 
 
5813
 
 
5814
 
%==================================
5815
 
\subsection{Modification of the turbulent viscosity: \textmd{\texttt{usvist}}}
5816
 
%==================================
5817
 
\noindent
5818
 
\textit{Subroutine called every time step.}
5819
 
 
5820
 
This subroutine is used to modify the calculation of the turbulent
5821
 
viscosity of the phase \texttt{iphas}, {\em i.e.} $\mu_t$ in $kg.m^{-1}.s^{-1}$
5822
 
(this piece of information, at the mesh cell centers, is conveyed by the
5823
 
variable \texttt{propce(iel,ipcvst)}, with
5824
 
\texttt{ipcvst =  ipproc(ivisct(iphas))}). The
5825
 
subroutine is called at the beginning of every time step, after the
5826
 
calculation of the physical parameters of the flow and of the
5827
 
``conventional'' value of $\mu_t$ corresponding to the chosen turbulence
5828
 
model (indicator \texttt{iturb(iphas)}).\\
5829
 
{\em WARNING: The calculation of the turbulent viscosity being a
5830
 
particularly sensible stage, a wrong use of {\em\texttt{usvist}} may
5831
 
seriously distort the results.}
5832
 
 
5833
 
%==================================
5834
 
%==================================
5835
 
\subsection{Modification of the variable $C$ of the dynamic LES model:
5836
 
  \textmd{\texttt{ussmag}}}
5837
 
%==================================
5838
 
 
5839
 
\noindent
5840
 
\textit{Subroutine called every time step in the case of LES with the
5841
 
dynamic model.}
5842
 
 
5843
 
This subroutine is used to modify the calculation of the variable $C$ of
5844
 
the LES sub-grid scale dynamic model.
5845
 
 
5846
 
Let us first remind that the LES approach introduces the notion of
5847
 
filtering between large eddies and small motions. The solved variables
5848
 
are said to be filtered in an ``implicit'' way. Sub-grid scale models
5849
 
(``dynamic'' models) introduce in addition an explicit filtering.
5850
 
 
5851
 
The notations used for the definition of the variable $C$ used in the
5852
 
dynamic models of \CS are specified below. These notations are the ones
5853
 
assumed in the document \cite{benhamadouche01}, to which the user may
5854
 
refer for more details.
5855
 
 
5856
 
The value of $a$ filtered by the explicit filter (of width
5857
 
$\widetilde{\overline{\Delta}}$) is called $\widetilde{a}$ and the value
5858
 
of $a$ filtered by the implicit filter (of width $\overline{\Delta}$) is
5859
 
called $\overline{a}$.
5860
 
We define:
5861
 
\begin{equation}
5862
 
\begin{array}{ll}
5863
 
\overline{S}_{ij}=\frac{1}{2}(\frac{\partial \overline{u}_i}{\partial x_j}
5864
 
                  +\frac{\partial \overline{u}_j}{\partial x_i})  &
5865
 
||\overline{S}||=\sqrt{2 \overline{S}_{ij}\overline{S}_{ij}}\\
5866
 
\alpha_{ij}=-2\widetilde{\overline{\Delta}}^2
5867
 
             ||\widetilde{\overline{S}}||
5868
 
             \widetilde{\overline{S}}_{ij}&
5869
 
\beta_{ij}=-2\overline{\Delta}^2
5870
 
             ||\overline{S}||
5871
 
               \overline{S}_{ij}\\
5872
 
L_{ij}=\widetilde{\overline{u}_i\overline{u}_j}-
5873
 
 \widetilde{\overline{u}}_i\widetilde{\overline{u}}_j&
5874
 
M_{ij}=\alpha_{ij}-\widetilde{\beta}_{ij}\\
5875
 
\end{array}
5876
 
\end{equation}
5877
 
 
5878
 
 
5879
 
In the framework of LES, the total viscosity (molecular + sub-grid) in
5880
 
$kg.m^{-1}.s^{-1}$ may be written in \CS:
5881
 
\begin{equation}
5882
 
\begin{array}{llll}
5883
 
\mu_{\text{total}}&=&\mu+\mu_{\text{sub-grid}} &
5884
 
    \text{\ \ if\ \ }\mu_{\text{sub-grid}}>0\\
5885
 
                   &=&\mu                          &
5886
 
    \text{\ \ otherwise }\\
5887
 
\text{with\ }\mu_{\text{sub-grid}}&=&\rho C \overline{\Delta}^2 ||\overline{S}||
5888
 
\end{array}
5889
 
\end{equation}
5890
 
 
5891
 
$\overline{\Delta}$ is the width of the implicit filter, defined at the
5892
 
cell $\Omega_i$ by \\
5893
 
$\overline{\Delta}=XLESFL(IPHAS)*(ALES(IPHAS)*|\Omega_i|)^{BLES(IPHAS)}$
5894
 
\index{xlesfl}\index{ales}\index{bles}.
5895
 
 
5896
 
In the case of the Smagorinsky model (\texttt{iturb(iphas)=40}), $C$ is a
5897
 
constant which is worth $C_s^2$. $C_s^2$ is the so-called Smagorinsky
5898
 
constant and is stored the variable \texttt{$csmago$\index{csmago}}.
5899
 
 
5900
 
In the case of the dynamic model (\texttt{iturb(iphas)=41}), $C$ is variable in
5901
 
time and in space. It is determined by
5902
 
$\displaystyle C=\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}$.
5903
 
 
5904
 
In practice, in order to increase the stability, the code does not use the
5905
 
value of $C$ obtained in each cell, but an average with the values
5906
 
obtained in the neighboring cells (this average uses the extended
5907
 
neighborhood and corresponds to the explicit filter). By default, the
5908
 
value calculated by the code is
5909
 
\begin{displaymath}
5910
 
C=\frac{\widetilde{M_{ij}L{ij}}}{\widetilde{M_{kl}M_{kl}}}
5911
 
\end{displaymath}
5912
 
 
5913
 
The subroutine \texttt{ussmag} allows to modify this value. It is for
5914
 
example possible to calculate the local average after having calculated the
5915
 
ratio
5916
 
\begin{displaymath}
5917
 
C=\widetilde{\left[\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}\right]}
5918
 
\end{displaymath}
5919
 
 
5920
 
{\em WARNING: The subroutine {\em\texttt{ussmag}} can be activated only when
5921
 
the dynamic model is used.}
5922
 
 
5923
 
%==================================
5924
 
\subsection{Temperature-enthalpy and enthalpy-temperature conversions: \textmd{\texttt{usthht}}}
5925
 
%==================================
5926
 
 
5927
 
\noindent
5928
 
\textit{Subroutine optionally called.}
5929
 
 
5930
 
This subroutine is used to encapsulate a simple enthalpy-temperature
5931
 
conversion law and its inverse.
5932
 
This subroutine is called in \texttt{usray4}, user subroutine from the
5933
 
radiation module.
5934
 
 
5935
 
%==================================
5936
 
\subsection{Modification of the mesh geometry: \textmd{\texttt{usmodg}}}
5937
 
%==================================
5938
 
 
5939
 
\noindent
5940
 
\textit{Subroutine called only during the calculation initialisation.}
5941
 
 
5942
 
This subroutine may be used to modify ``manually'' the mesh vertices
5943
 
coordinates, \textit{i.e.} the array:
5944
 
\begin{list}{$\bullet$}{}
5945
 
\item \mbox{\texttt{xyznod(3,nnod)}} (vertex coordinates)
5946
 
\end{list}
5947
 
 
5948
 
{\em WARNING: Caution must be exercised when using this subroutine
5949
 
along with periodicity. Indeed, the periodicity parameters are not
5950
 
updated accordingly, meaning that the periodicity may be unadapted
5951
 
after one changes the mesh vertex coordinates. It is particularly
5952
 
true when one rescales the mesh.}\\
5953
 
 
5954
 
%==================================
5955
 
\subsection{Management of the post-processing intermediate outputs: \textmd{\texttt{usnpst}}}
5956
 
%==================================
5957
 
 
5958
 
\noindent
5959
 
\textit{Subroutine called every time step(even if the user hasn't moved it to the SRC directroy).}
5960
 
 
5961
 
This subroutine is used to determine when post-processing outputs will be
5962
 
generated. By default, it tests if the current time step number (\texttt{ntcabs}) is a
 
5314
%==================================
 
5315
\section{Results analysis}
 
5316
%==================================
 
5317
 
 
5318
%==================================
 
5319
\subsection{Management of the post-processing intermediate outputs}
 
5320
%==================================
 
5321
 
 
5322
The subroutine \texttt{usnpst} is used to specify when post-processing outputs will be
 
5323
generated (it is called at each time step even if the user hasn't moved it to the directory SRC). By default, it tests if the current time step number (\texttt{ntcabs}) is a
5963
5324
multiple of the chosen output frequency (\texttt{ntchr}). If it is the case, the
5964
5325
indicator \texttt{iipost} turns to 1, which triggers the writing of an
5965
5326
intermediate output. If the frequency is given a negative value, the
5966
 
test is not done.
 
5327
test is not performed.
5967
5328
 
5968
5329
For instance, a user who wants to generate post-processing outputs (also
5969
5330
called ``chronological outputs'') at
5992
5353
 
5993
5354
\newpage
5994
5355
%==================================
5995
 
\subsection{Definition of post-processing and mesh zones:
5996
 
  \textmd{\texttt{usdpst}}}
 
5356
\subsection{Definition of post-processing and mesh zones}
5997
5357
%==================================
5998
5358
 
5999
 
\noindent
6000
 
\textit{Subroutine called at the calculation beginning..}
6001
 
 
6002
 
This subroutine allows for the definition of  surface or volume
6003
 
sections, in the form of lists of \texttt{nlfac} internal faces
6004
 
(\texttt{lstfac}) and \texttt{nlfab} boundary faces (\texttt{lstfab}),
 
5359
The functions defined in \texttt{cs\_user\_postprocess.c}, namely
 
5360
\texttt{cs\_user\_postprocess\_writers}, \texttt{cs\_user\_postprocess\_meshes},
 
5361
and \texttt{cs\_user\_postprocess\_activate} allow for
 
5362
the definition of postprocessing output formats and frequency, and
 
5363
for the definition of  surface or volume sections, in the form
 
5364
of lists of \texttt{nlfac} internal faces (\texttt{lstfac}) and
 
5365
\texttt{nlfab} boundary faces (\texttt{lstfab}),
6005
5366
or of \texttt{nlcel} cells (\texttt{lstcel}), in order to generate
6006
5367
chronological outputs in {\em EnSight}, {\em MED} or {\em CGNS} format.
6007
5368
 
6008
 
One or several ``writers'' can be associated with each visualization
6009
 
mesh, or ``part'' created. The arguments of the function \texttt{pstcwr}
6010
 
defining a ``writer'' are as follows:
 
5369
One or several writers can be associated with each post-processing
 
5370
mesh, or ``part'' created. The arguments of the function
 
5371
\texttt{cs\_post\_define\_writer} are as follows:
6011
5372
 
6012
5373
\begin{list}{$\bullet$}{}
6013
 
       \item \texttt{nomcas}: basic name of the associated case.\\ {\em
 
5374
       \item \texttt{writer\_id}: id the the associated writer.\\
 
5375
             negative ids are reserved (-1 for the main output),
 
5376
             but the matching writer's options may be redifined by
 
5377
             calls to this function.
 
5378
       \item \texttt{case\_name}: basic name of the associated case.\\ {\em
6014
5379
             WARNING}: depending on the chosen format, this name may
6015
5380
             be shortened (maximum number of characters: 32 for {\em MED},
6016
5381
             19 for {\em EnSight}) or modified automatically (whitespaces or
6017
5382
             forbidden characters will be replaced by '\_')
6018
 
       \item \texttt{nomrep}: name of the output directory
6019
 
       \item \texttt{nomfmt}: choice of the output format:
 
5383
       \item \texttt{dir\_name}: name of the output directory
 
5384
       \item \texttt{fmt\_name}: choice of the output format:
6020
5385
        \begin{list}{$\rightarrow$}{}
6021
5386
               \item {\em EnSight Gold} ({\em EnSight} also accepted)
6022
5387
               \item {\em MED\_fichier} ({\em MED} also accepted)
6023
5388
               \item {\em CGNS}
6024
 
               \item {\em text} (mesh output, no variables output, for debug only).
6025
5389
         \end{list}
6026
5390
The options are not case-sensitive, so {\em ensight} or {\em cgns} are valid, too.
6027
 
       \item \texttt{optfmt}: character string containing a list of
 
5391
       \item \texttt{fmt\_opts}: character string containing a list of
6028
5392
             options related to the format, separated by commas; for the
6029
5393
             {\em EnSight Gold} format, these options are:
6030
5394
        \begin{list}{$\rightarrow$}{}
6046
5410
 variable as a series of independent variables (a variable is recognised as a
6047
5411
 tensor if its dimension is 6 or 9); not implemented yet.
6048
5412
         \end{list}
6049
 
       \item \texttt{indmod}: indicates if the post-processing (i.e. visualization) meshes
6050
 
             (or ``parts'') are:
 
5413
       \item \texttt{time\_dep}: indicates if the post-processing
 
5414
             (i.e. visualization) meshes (or ``parts'') are:
6051
5415
        \begin{list}{$\rightarrow$}{}
6052
 
               \item 0 fixed (usual case)
6053
 
               \item 1 deformable (the vertex positions may vary over time)
6054
 
               \item 2 modifiable:  (the lists of cells or faces
6055
 
                     defining these ``parts'' can be changed over time)
 
5416
               \item \texttt{FVM\_WRITER\_FIXED\_MESH} fixed (usual case)
 
5417
               \item \texttt{FVM\_WRITER\_TRANSIENT\_COORDS} deformable
 
5418
                     (the vertex positions may vary over time)
 
5419
               \item \texttt{FVM\_WRITER\_TRANSIENT\_CONNECT} modifiable:
 
5420
                     (the lists of cells or faces
 
5421
                     defining these meshes can be changed over time)
6056
5422
         \end{list}
6057
 
       \item \texttt{ntchrl}: default output frequency associated with
6058
 
             this ``writer'' (the output may be forced or prevented at
6059
 
             every time step using the subroutine \texttt{usnpst})
 
5423
       \item \texttt{output\_at\_end}: force output at calculation end
 
5424
             if not 0
 
5425
       \item \texttt{frequency\_n}: default output frequency in time steps
 
5426
             associated with this writer, or $< 0$ (the output may be forced
 
5427
             or prevented at any time step using the function
 
5428
             \texttt{cs\_user\_postprocess\_activate})
 
5429
       \item \texttt{frequency\_t}: default output frequency in seconds
 
5430
             associated with this writer, or $< 0$ (has priority over
 
5431
             \texttt{frequency\_n}, and the output may be forced or prevented
 
5432
             at any time step using the function
 
5433
             \texttt{cs\_user\_postprocess\_activate})
6060
5434
\end{list}
6061
5435
 
6062
5436
In order to allow the user to add an output format to
6063
5437
the main output format, or to add a mesh to the default
6064
 
output, the lists of standard and user meshes and ``writers'' are not
 
5438
output, the lists of standard and user meshes and writers are not
6065
5439
separated. Negative numbers are reserved for the non-user items. For
6066
5440
instance,the mesh numbers -1 and -2 correspond respectively to the global
6067
 
mesh and to boundary faces, generated by default, and the ``writer'' -1
 
5441
mesh and to boundary faces, generated by default, and the writer -1
6068
5442
corresponds to the usual post-processing case defined {\em via}
6069
5443
\texttt{usini1} or {\em via} the interface.
6070
5444
 
6071
5445
The user chooses the numbers corresponding to the post-processing
6072
 
meshes and ``writers'' he wants to create. These numbers must be positive
 
5446
meshes and writers he wants to create. These numbers must be positive
6073
5447
integers. It is possible to assocate a user mesh with the standard
6074
5448
post-processing case (-1), or to ask for outputs regarding the boundary
6075
 
faces (-2) associated with a user ``writer''.
 
5449
faces (-2) associated with a user writer.
6076
5450
 
6077
5451
For safety, the output frequency and the possibility to modify the
6078
 
post-processing meshes are associated with the ``writers'' rather than
6079
 
with with the ``parts''. This logic avoids unwanted generation of
 
5452
post-processing meshes are associated with the writers rather than
 
5453
with the meshes. This logic avoids unwanted generation of
6080
5454
inconstitent post-processing outputs. For instance EnSight would not
6081
5455
be able to read a case in which one field is output to a given part
6082
5456
every 10 time steps while another field is output to the same part
6083
5457
every 200 time steps.
6084
5458
 
6085
 
The possibility to modify a mesh over time is limited by the more restrictive
6086
 
``writer'' which is associated with it. For instance, if the ``writer''
6087
 
1 allows the modification of the mesh topology (argument \texttt{indmod
6088
 
= 2} in the call to \texttt{pstcwr}) and the ``writer'' 2 allows no
6089
 
modification (\texttt{indmod = 0}), a user post-processing mesh
6090
 
associated with the ``writers'' 1 and 2 will not be modifiable, but a
6091
 
mesh associated only with the ``writer'' 1 will be modifiable. The
 
5459
The possibility to modify a mesh over time is limited by the most restrictive
 
5460
writer which is associated with. For instance, if writer
 
5461
1 allows the modification of the mesh topology (argument \texttt{time\_dep
 
5462
= FVM\_WRITER\_TRANSIENT\_CONNECT} in the call to \texttt{cs\_post\_define\_writer}) and writer 2 allows no
 
5463
modification (\texttt{time\_dep = FVM\_WRITER\_FIXED\_MESH}),
 
5464
a user post-processing mesh
 
5465
associated with the writers 1 and 2 will not be modifiable, but a
 
5466
mesh associated only with the writer 1 will be modifiable. The
6092
5467
modification is done by means of the user subroutine \texttt{usmpst},
6093
 
which is called only for the currently modifiable meshes.
 
5468
which is called once per time step and per modifiable mesh.
6094
5469
 
6095
5470
It is possible to output variables which are normally automatically
6096
5471
output on the main volume or boundary meshes to a user mesh which is a subset
6097
 
of one of these by assigning the corresponding category to the user
6098
 
mesh. By default, a meshe's category is identical to its number, so
6099
 
the category associated with the main volume output is -1, and that
6100
 
associated with the main boundary output is -2. A category may be assigned
6101
 
using the \texttt{pstcat} subroutine.
 
5472
of one of these by setting the \texttt{auto\_variables} argument of
 
5473
one of the \texttt{cs\_post\_define\_...\_mesh} to \texttt{true}.
6102
5474
 
6103
5475
It is also possible to define an alias of a post-processing mesh. An
6104
 
alias shares all the attributes of a ``part'' (without duplication),
 
5476
alias shares all the attributes of its parent mesh (without duplication),
6105
5477
except its number. This may be used to output different variables on a
6106
 
same ``part'' with 2 different writers: the choice of output variables
6107
 
is based on the ``part'', so if $P_a$ is associated with writer $W_a$,
 
5478
same mesh with 2 different writers: the choice of output variables
 
5479
is based on the mesh, so if $P_a$ is associated with writer $W_a$,
6108
5480
all that is needed is to define an alias $P_b$ to $P_a$ and associate
6109
5481
it with writer $W_b$ to allow a different output variable selection with
6110
5482
each writer. An alias may be created using the \texttt{pstalm} subroutine.
6111
5483
 
6112
 
Modification of a part or it's alias over time is always limited by the
6113
 
most restrictive "writer" to which it's meshes have been asscoiated (parts of
6114
 
the structures being shared in memory). It is possible to define as many
6115
 
alias' as are required for a "part", but an alias cannot be defined for another alias.
6116
 
 
6117
 
It is not possible to mix cells and faces in the same ``part'' (most of
6118
 
the post-processing tools being perturbed by such a case)\footnote{in thr
6119
 
future, it will probably be possible to automatically add faces bearing
6120
 
group or attribute characteristics to a cell mesh, but those faces will
6121
 
only be written for formats supporting this (such as MED 2.3),
6122
 
and will only bear attributes, not variable fields}. If the user
6123
 
defines lists of faces and cells simultaneously, only the higher dimension
6124
 
entities (the cells) will be taken into account.
6125
 
 
6126
 
For a better understanding, the user may refer to the example given in
6127
 
{\texttt{usdpst}}. We can note that the whitespaces in the beginning or in
6128
 
the end of the character strings given as arguments of the functions
6129
 
called are suppressed automatically.
6130
 
 
6131
 
The variables to post-process on the defined ``parts'' will be specified
6132
 
in the subroutine \texttt{usvpst}.  ``
6133
 
 
6134
 
{\em WARNING In the parallel case, some ``parts'' may not contain any
 
5484
Modification of a postprocessing mesh or it's alias over time is always
 
5485
limited by the most restrictive "writer" to which it's meshes have been
 
5486
asscoiated (parts of the structures being shared in memory). It is
 
5487
possible to define as many aliases as are required for a true mesh,
 
5488
but an alias cannot be defined for another alias.
 
5489
 
 
5490
It is not possible to mix cells and faces in the same mesh (most of
 
5491
the post-processing tools being perturbed by such a case)\footnote{actually,
 
5492
faces adjacent to selected cells and belonging to face or cell groups
 
5493
may be selected when the \texttt{add\_groups} of
 
5494
\texttt{cs\_post\_define\_...\_mesh} is set to \texttt{true},
 
5495
so as to maintain group information, but those faces will
 
5496
only be written for formats supporting this (such as MED),
 
5497
and will only bear groups, not variable fields}.
 
5498
 
 
5499
For a better understanding, the user may refer to the examples given in
 
5500
\texttt{cs\_user\_postprocess\_meshes}. We can note that the whitespaces
 
5501
in the beginning or in the end of the character strings given as arguments
 
5502
of the functions called are suppressed automatically.
 
5503
 
 
5504
The additional variables to post-process on the defined meshes
 
5505
will be specified in the subroutine \texttt{usvpst}.  ``
 
5506
 
 
5507
{\em WARNING In the parallel case, some meshes may not contain any
6135
5508
local elements on a given processor. This is not a problem at all, as
6136
 
long as the ``part'' is defined for all processors (empty or not).
6137
 
It would in fact not be a good idea at all to define a ``part'' only
6138
 
if it contains local elements, global operations on the ``part'' would
6139
 
become impossible, leading to probable deadlocks or crashes.}
 
5509
long as the mesh is defined for all processors (empty or not).
 
5510
It would in fact not be a good idea at all to define a postprocessing
 
5511
mesh only if it contains local elements, global operations on that
 
5512
mesh would become impossible, leading to probable deadlocks or crashes.}
6140
5513
 
6141
5514
%==================================
6142
 
\subsection{Modification of the mesh zones to post-process:
6143
 
  \textmd{\texttt{usmpst}}}
 
5515
\subsection{Modification of the mesh zones to post-process}
6144
5516
%==================================
6145
5517
 
6146
5518
\noindent
6147
5519
\textit{Subroutine called only for each modifiable ``part'', at every
6148
5520
active time step of an associated ``writer''.}
6149
5521
 
6150
 
For the user ``parts'' defined {\em via} the user subroutine
6151
 
\texttt{usdpst} and associated only with ``writers'' allowing the ``part''
6152
 
modification over time ({\em i.e.} created with the
6153
 
parameter \texttt{indmod} = 2), this subroutine is used to modify the
6154
 
lists of cells, internal and boundary faces defining this ``part'' (or
6155
 
post-processing mesh).
 
5522
The subroutine \texttt{usmpst} is used to modify the
 
5523
lists of cells, internal and boundary faces which define a ``user part'' (or
 
5524
post-processing mesh) defined through the user subroutine
 
5525
\texttt{usdpst} and associated only with ``writers''; allowing ``part''
 
5526
modifications over time ({\em i.e.} created with the
 
5527
parameter \texttt{indmod} = 2).
6156
5528
 
6157
5529
At first, the corresponding lists contain the previously defined
6158
5530
values. If these lists are modified for a given post-processing mesh, the
6187
5559
velocity isosurface.
6188
5560
 
6189
5561
%==================================
6190
 
\subsection{Definition of the variables to post-process:
6191
 
  \textmd{\texttt{usvpst}}}
 
5562
\subsection{Definition of the variables to post-process}
6192
5563
%==================================
6193
5564
 
6194
 
\noindent
6195
 
\textit{Subroutine called for each ``part'', at every active time step of an
6196
 
associated ``writer'' (see \texttt{usdpst}).}
6197
 
 
6198
5565
For the parts defined in \texttt{usdpst}, the subroutine \texttt{usvpst}
6199
 
is used to specify the variables to post-process.
 
5566
is used to specify the variables to post-process (called for each ``part'', at every active time step of an
 
5567
associated ``writer'', see \texttt{usdpst}).
6200
5568
 
6201
5569
The output of a given variable is generated by means of a call to
6202
5570
\texttt{psteva}, whose arguments are:
6247
5615
             variable at the cells. If \texttt{ivarpr} $= 1$, this
6248
5616
             argument will be replaced by the position of the beginning
6249
5617
             of the array on which the variable in defined, for instance
6250
 
             \texttt{rtp(1, iu(1))} for the velocity of the phase 1.
 
5618
             \texttt{rtp(1, iu(1))} for the velocity.
6251
5619
       \item \texttt{trafac}: equivalent of \texttt{tracel} for the
6252
5620
             internal faces.
6253
5621
       \item \texttt{trafbr}: equivalent of \texttt{tracel} for the
6266
5634
associate it with a different ``writer'' in the subroutine \texttt{usdpst}.}
6267
5635
 
6268
5636
%==================================
6269
 
\subsection{Modification of the variables at the end of a time step: \textmd{\texttt{usproj}}}
 
5637
\subsection{Modification of the variables at the end of a time step}
6270
5638
%==================================
6271
5639
 
6272
 
\noindent
6273
 
\textit{Subroutine called every time step.}
6274
 
 
6275
 
This subroutine is called at the end of every time step. It is used to
 
5640
The subroutine \texttt{usproj} is called at the end of every time step. It is used to
6276
5641
print of modify any variable at the end of every time step.
6277
5642
 
6278
5643
Several examples are given:
6283
5648
\item Modification of the temperature in a given area starting from a
6284
5649
      given time
6285
5650
 
6286
 
\item Extraction of a 1D profile
 
5651
\item Extraction of a 1D profile, see fig. \ref{fig:26_GUI}
6287
5652
 
6288
5653
\item Printing of a moment
6289
5654
 
6307
5672
      the framework of periodic or parallel calculations (in particular
6308
5673
      when we want to calculate the gradient of a variable or to have
6309
5674
      access to values at the cells neighboring a face).
6310
 
\item Finally it must not be forgotten that the solving with
 
5675
\item Finally it must not be forgotten that the resolution with
6311
5676
      temperature as a solved variable is questionable when the specific
6312
5677
      heat is not constant.
6313
5678
\end{list}
6314
5679
 
6315
5680
%==================================
6316
 
\subsection{Radiative thermal transfers in semi-transparent gray media}
6317
 
%==================================
6318
 
 
6319
 
%==================================
6320
 
\subsubsection{Initialisation of the radiation main key words: \textmd{\texttt{usray1}}}
6321
 
%==================================
6322
 
 
6323
 
\noindent
6324
 
\textit{Subroutine called only during calculation initialisation.}
6325
 
 
6326
 
This subroutine is one of the two which must be completed by the user for all
6327
 
calculations including radiative thermal transfers. This subroutine is
6328
 
composed of three headings. The first one is dedicated to the activation
6329
 
of the radiation module, only in the case of classic physics. \\
6330
 
{\em WARNING: when a calculation is run using a specific physics module,
6331
 
this first heading must not be completed. The radiation module is then
6332
 
activated or not according to the parameter file related to the considered
6333
 
specific physics.} \\
6334
 
 
6335
 
\noindent
6336
 
In the second heading the basic parameters of the radiation module are indicated.\\
6337
 
Finally, the third heading deals with the selection of the
6338
 
post-processing graphic outputs. The variables to treat are splitted
6339
 
into two categories: the volumetric variables and those related to the
6340
 
boundary faces.\\
6341
 
 
6342
 
\noindent
6343
 
For more details about the different parameters, the user may refer to the
6344
 
key word list (\S\ref{prg_motscles}).
6345
 
 
6346
 
 
6347
 
%==================================
6348
 
\subsubsection{Management of the radiation boundary conditions:
6349
 
   \textmd{\texttt{usray2}}}
6350
 
%==================================
6351
 
 
6352
 
\noindent
6353
 
\textit{Subroutine called every time step.}
6354
 
 
6355
 
This is the second subroutine is necessary for every calculation
6356
 
including radiative thermal transfers. It is used to give all the
6357
 
necessary parameters concerning, in the one case, the wall temperature
6358
 
calculation, and in the other, the coupling between the termal
6359
 
scalar (temperature or enthalpy) and the radiation module at the
6360
 
calculation domain boundaries. It must be noted that the boundary conditions
6361
 
concerning the thermal scalar which may have been defined in the
6362
 
subroutine \texttt{usclim} will be modified by the radiation module
6363
 
according to the data given in \texttt{usray2} (cf. \S\ref{fvm_selector}).\\
6364
 
A zone number must be given to each boundary face \footnote{this must be less
6365
 
 than the maximum allowable by the code, \texttt{nozrdm}. This is fixed at 2000
6366
 
 in \texttt{radiat.h} and cannot be modified.}and, specifically for
6367
 
the walls, a boundary condition type and an initialisation temperature
6368
 
(in Kelvin). The initialisation temperature is only used to make the
6369
 
solving implicit at the first time step. The zone number allows to assign
6370
 
an arbitrary integer to a set of boundary faces having the same
6371
 
radiation boundary condition type. This gathering is used by the
6372
 
calculation, and in the listing to print some physical values (mean
6373
 
temperature, net radiative flux ...). An independent graphic output in
6374
 
{\em EnSight} format is associated with each zone and allows the display on
6375
 
the boundary faces of the variables selected in the third heading of the
6376
 
subroutine \texttt{usray1}.\\
6377
 
A boundary condition type stored in the array ISOTHP is associated with
6378
 
each boundary face. There are five different types:
6379
 
 
6380
 
\begin{list}{$\bullet$}{}
6381
 
 
6382
 
\item \texttt{\textbf{itpimp}}: wall face with imposed temperature,
6383
 
 
6384
 
\item \texttt{\textbf{ipgrno}}: for a gray or black wall face, calculation of the
6385
 
      temperature by means of a flux balance,
6386
 
 
6387
 
\item \texttt{\textbf{iprefl}}: for a reflecting wall face, calculation of the
6388
 
      temperature by means of a flux balance.
6389
 
 This is fixed at 2000 in \texttt{radiat.h} and cannot be modified.
6390
 
 
6391
 
\item \texttt{\textbf{ifgrno}}: gray or black wall face to which a conduction
6392
 
      flux is imposed,
6393
 
 
6394
 
\item \texttt{\textbf{ifrefl}}: reflecting wall face to which a conduction
6395
 
      flux is imposed, which is equivalent to impose this flux directly
6396
 
      to the fluid.
6397
 
 
6398
 
\end{list}
6399
 
 
6400
 
\noindent
6401
 
Depending on the selected boundary condition type at every wall face,
6402
 
the code needs to be given some supplementary pieces of information:
6403
 
 
6404
 
\begin{list}{$\bullet$}{}
6405
 
 
6406
 
\item \texttt{\textbf{itpimp}}: the array \texttt{tintp} must be completed
6407
 
      with the imposed temperature value and the array \texttt{epsp} must
6408
 
      be completed with the emissivity value (strictly positive).
6409
 
 
6410
 
\item \texttt{\textbf{ipgrno}}: must be given: an initialisation temperature in
6411
 
      the array \texttt{tintp}, the wall emissivity (strictly positive, in
6412
 
      \texttt{epsp}), thickness (in \texttt{epap}), thermal conductivity
6413
 
      (in \texttt{xlamp}) and an external temperature (in \texttt{textp})
6414
 
      in order to calculate a conduction flux across the wall.
6415
 
 
6416
 
\item \texttt{\textbf{iprefl}}: must be given: an initialisation temperature (in
6417
 
      \texttt{tintp}), the wall thickness (in \texttt{epap}) and thermal conductivity (in
6418
 
      \texttt{xlamp}) and an external temperature (in \texttt{textp}).
6419
 
 
6420
 
\item \texttt{\textbf{ifgrno}}: must be given: an initialisation temperature (in
6421
 
      \texttt{tintp}), the wall emissivity (in \texttt{epsp}) and the conduction
6422
 
      flux (in $W/m^2$ whatever the thermal scalar, enthalpy or temperature) in
6423
 
      the array \texttt{rcodcl}. The value of \texttt{rcodcl} is positive when the
6424
 
      conduction flux is directed from the inside of the fluid domain to the
6425
 
      outside (for instance, when the fluid heats the walls). If the
6426
 
      conduction flux is null, the wall is adiabatic.
6427
 
 
6428
 
\item \texttt{\textbf{ifrefl}}: must be given: an initialisation temperature (in
6429
 
      \texttt{tintp}) and the conduction flux (in $W/m^2$ whatever the thermal
6430
 
      scalar) in the array \texttt{rcodcl}. The value of \texttt{rcodcl} is
6431
 
      positive when the conduction flux is directed from the inside of the
6432
 
      fluid domain to the outside (for instance, when the fluid heats the
6433
 
      walls). If the conduction flux is null, the wall is adiabatic. The flux
6434
 
      received by \texttt{rcodcl} is directly imposed as boundary condition for
6435
 
      the fluid.
6436
 
 
6437
 
\end{list}
6438
 
 
6439
 
\noindent
6440
 
{\em WARNING: it is obligatory to set a zone number to every boundary
6441
 
face, even those which are not wall faces. These zones will be used during the
6442
 
printing in the listing. It is recommended to gather together the
6443
 
boundary faces of the same type, in order to ease the reading of the
6444
 
listing.}\\
6445
 
 
6446
 
%==================================
6447
 
\subsubsection{Absorption coefficient of the medium, boundary conditions
6448
 
   for the luminance and calcualtion of the net radiative flux:
6449
 
   \textmd{\texttt{usray3}}}
6450
 
%==================================
6451
 
 
6452
 
\noindent
6453
 
\textit{Subroutine called every time step.}
6454
 
 
6455
 
This subroutine is composed of three parts. In the first one, the user
6456
 
must provide the absorption coefficient of the medium in the array CK,
6457
 
for each cell of the fluid mesh. By default, the absorption coefficient
6458
 
of the medium is 0, which corresponds to a transparent medium.\\
6459
 
 
6460
 
{\em WARNING: when a specific physics is activated, it is forbidden to
6461
 
give a value to the absorption coefficient in this subroutine. In this
6462
 
case, it is calculated automatically, or given by the user {\em via} a
6463
 
thermo-chemical parameter file (dp\_C3P or dp\_C3PSJ for gas combustion,
6464
 
and dp\_FCP for pulverised coal combustion).}\\
6465
 
 
6466
 
\noindent
6467
 
The two following parts of this subroutine concern a more advanced use
6468
 
of the radiation module. It is about imposing boundary conditions to the
6469
 
equation of radiative transfer and net radiative flux calculation, in
6470
 
coherence with the luminance at the boundary faces, when the user wants
6471
 
to give it a particular value. In most cases, the given examples do not
6472
 
need to be modified.
6473
 
 
6474
 
%==================================
6475
 
\subsubsection{Encapsulation of the temperature-enthalpy conversion:
6476
 
  \textmd{\texttt{usray4}}}
6477
 
%==================================
6478
 
 
6479
 
\noindent
6480
 
\textit{Subroutine called every time step.}
6481
 
 
6482
 
This subroutine is used to call the subroutine \texttt{usthht}. The user
6483
 
can implement his own conversion formulas into it. \\
6484
 
This subroutine is useless when the thermal scalar is the temperature.\\
6485
 
\noindent
6486
 
 
6487
 
{\em WARNING: when a specific physics is activated, it is forbidden to use this
6488
 
subroutine. In this case, {\em \texttt{usray4}} is replaced by {\em
6489
 
\texttt{ppray4}}, which is not a user subroutine.}\\
6490
 
 
6491
 
 
6492
 
\noindent
6493
 
The value of the argument \texttt{mode} allows to know in which direction the
6494
 
conversion will be made:
6495
 
\begin{list}{$\bullet$}{}
6496
 
 
6497
 
\item \texttt{\textbf{mode = 1}}: the fluid enthalpy in the cell must be
6498
 
      converted into temperature (in Kelvin),
6499
 
 
6500
 
\item \texttt{\textbf{mode = -1}}: the wall temperature (\texttt{text}
6501
 
      or \texttt{tparoi}, in Kelvin) must be converted into enthalpy.
6502
 
 
6503
 
\end{list}
6504
 
%
6505
 
{\em WARNING: the value of \texttt{mode} is passed as argument and must not be
6506
 
modified by the user.}\\
6507
 
 
6508
 
 
6509
 
 
6510
 
%==================================
6511
 
\subsection{Utilisation of a specific physics: \textmd{\texttt{usppmo}}}
 
5681
\subsection{Non-standard management of the chronological record files}
 
5682
%==================================
 
5683
\label{prg_ushist}
 
5684
 
 
5685
The interface and the subroutine \texttt{usini1} allow to manage the
 
5686
``automatic'' chronological record files in an autonomous way:
 
5687
position of the probes, printing frequency and related variables. The
 
5688
results are written in a different file for each variable. These files
 
5689
are written in {\em xmgrace or {\em gnuplot}} format and contain the profiles corresponding to
 
5690
every probe. This type of output format may not be well adapted if, for
 
5691
instance, the number of probes is too high. The subroutine
 
5692
\texttt{ushist}, called at each time step, allows then to personalise the output format of the
 
5693
chronological record files. The version given as example in the
 
5694
directory works as follows:
 
5695
 
 
5696
\begin{list}{-}{}
 
5697
\item Positionning of the probes (only at the first passage): the index
 
5698
      \texttt{ii} varies between 1 and the number of probes. The coordinates
 
5699
      \texttt{xx}, \texttt{yy} and \texttt{zz} of each probe are given.
 
5700
      The subroutine \texttt{findpt}
 
5701
      gives then the number \texttt{icapt(ii)\index{icapt}} of the cell center
 
5702
      which is the closest to the defined probe.
 
5703
 
 
5704
\item Opening of the output files (only at the first pass): in the
 
5705
      version given as example, the program opens a different file for
 
5706
      all the \texttt{nvar} variables. \texttt{ficush(j)} contains the name of the
 
5707
      J\raisebox{1ex}{\small th} file and \texttt{impush(j)} its unit number
 
5708
      (\texttt{impush} is initialised by default so that the user has at his
 
5709
      disposal specific unit numbers and does not run the risk to overwrite an
 
5710
      already open file).
 
5711
 
 
5712
\item Writing to the files: in the version given as example, the program
 
5713
      writes the time step number, the physical time step (based on the
 
5714
      standard time step in the case of a variable time step) and the
 
5715
      value of the selected variable at the different probes.
 
5716
 
 
5717
\item Closing of the files (only at the last time step).
 
5718
 
 
5719
\end{list}
 
5720
 
 
5721
{\em WARNING: The use of {\em\texttt{ushist}} neither erases nor replaces the
 
5722
parameters given in the interface or in {\em\texttt{usini1}}. Therefore, in
 
5723
the case of the use of {\em\texttt{ushist}}, and to avoid the creation
 
5724
of useless files, the user should set {\em \texttt{ncapt}=0} in the interface or
 
5725
in {\em \texttt{usini1}} to deactivate the automatic production of
 
5726
chronological records}.\\
 
5727
In addition, {\em \texttt{ushist}} generates supplementary result
 
5728
files.
 
5729
 
 
5730
 
 
5731
%==================================
 
5732
\section{Advanced modelling setup}
 
5733
%==================================
 
5734
 
 
5735
%==================================
 
5736
\subsection{Use of a specific physics}
6512
5737
%==================================
6513
5738
\label{prg_usppmo}%
6514
 
\noindent
6515
 
\textit{Subroutine called only during calculation initialisation.}
6516
 
 
6517
 
This is one of the three subroutines which must be obligatory completed
6518
 
by the user in order to use a specific physics module.
 
5739
Specific physics such as dispersed phase, atmospheric flows and coal combustion models can be added by the user from the interface, or by using the subroutine \texttt{usppmo} (called only during the calculation initialisation). With the interface, when a specific physics is activated in fig. \ref{fig:5_GUI}, additional items or headings may appear (see for instance Sections \ref{sec:Ini-lag} and \ref{sec:Ini-coal}).
 
5740
 
 
5741
\begin{figure}[!ht]
 
5742
\begin{center}
 
5743
\includegraphics[width=14cm]{gui_thermo_phys_models}
 
5744
\caption{Thermophysical models selection}
 
5745
\label{fig:5_GUI}
 
5746
\end{center}
 
5747
\end{figure}
 
5748
 
 
5749
When the interface is not used, \texttt{usppmo} is one of the three subroutines which must be obligatory completed by the user in order to use a specific physics module. Also, some specific physics modules can not yet be activated through the interface such as the modules listed below which were not quoted at the beginning of this section.
6519
5750
At the moment, \CS allows to use two ``pulverised coal'' modules
6520
 
(Lagrangian coupling or not), two ``gas combustion'' modules, two
6521
 
``electric'' modules and one ``compressible'' module. To activate one of
 
5751
(with Lagrangian coupling or not), two ``gas combustion'' modules, two
 
5752
``electrical'' modules, a ``compressible'' module, an ``cooling towers'' module and an ``atmospheric'' module. To activate one of
6522
5753
these modules, the user needs to complete one (and only one) of the
6523
5754
indicators \texttt{ippmod(i.....)\index{ippmod}} in the subroutine
6524
5755
\texttt{usppmo}. By default, all the indicators \texttt{ippmod(i.....)} are
6553
5784
               \item \texttt{ippmod(icolwc)}=2 three peak model with adiabiatic conditions.
6554
5785
               \item \texttt{ippmod(icolwc)}=3 three peak model with permeatic conditions.
6555
5786
               \item \texttt{ippmod(icolwc)}=4 four peak model with adiabiatic conditions.
6556
 
               \item \texttt{ippmod(icolwc)}=5 four peak model with permeatic condintions.
 
5787
               \item \texttt{ippmod(icolwc)}=5 four peak model with permeatic conditions.
6557
5788
               \item \texttt{ippmod(icolwc)}=-1 module not activated.
6558
5789
          \end{list}
6559
5790
        \item Multi-coals and multi-classes pulverised coal combustion:
6606
5837
               \item \texttt{ippmod(icompf)} = 0 module activated
6607
5838
               \item \texttt{ippmod(icompf)} =-1 module not activated
6608
5839
         \end{list}
6609
 
 
 
5840
       \item atmospheric flow module: indicator {\bf \tt
 
5841
             ippmod(iatmos\index{icompf})}
 
5842
        \begin{list}{$\rightarrow$}{}
 
5843
               \item \texttt{ippmod(iatmos)} =-1 module not activated
 
5844
               \item \texttt{ippmod(iatmos)} = 0 standard modelling
 
5845
               \item \texttt{ippmod(iatmos)} = 1 dry atmosphere
 
5846
               \item \texttt{ippmod(iatmos)} = 2 humid atmosphere (NOT functional)
 
5847
         \end{list}
 
5848
       \item cooling towers module: indicator {\bf \tt
 
5849
             ippmod(iaeros\index{icompf})}
 
5850
        \begin{list}{$\rightarrow$}{}
 
5851
               \item \texttt{ippmod(iaeros\index)} =-1 module not activated
 
5852
               \item \texttt{ippmod(iaeros\index)} = 0 no model (NOT functional)
 
5853
               \item \texttt{ippmod(iaeros\index)} = 1 Poppe's model
 
5854
               \item \texttt{ippmod(iaeros\index)} = 2 Merkel's model
 
5855
         \end{list}
6610
5856
\end{list}
6611
5857
 
6612
5858
{\em WARNING: Only one specific physics module can be activated at the
6727
5973
\tiny{
6728
5974
\begin{tabular}{|c|c|c|c|} \hline
6729
5975
 Lines  &      Examples of values        &        Variables              & Observations                                         \\ \hline
6730
 
   1    &          THERMOCHIMIE          &                               & Comment line                                         \\ \hline
 
5976
   1    &          THERMOCHEMISTRY       &                               & Comment line                                         \\ \hline
6731
5977
   2    &               8                & \texttt{ncoel\index{ncoel}}   & Number of current species                            \\ \hline
6732
5978
   3    &               8                &  \texttt{npo\index{npo}}      & Number of points for the                             \\
6733
5979
        &                                &                               & enthalpy-temperature tabulation                      \\ \hline
6734
 
   4    &      ESPECES COURANTES         &                               & Comment line                                         \\ \hline
 
5980
   4    &        CURRENT SPECIES         &                               & Comment line                                         \\ \hline
6735
5981
   5    & CH4 C2H4 CO O2 CO2 H2O N2 C(S) & \texttt{nomcoel\index{nomcoel}}(\texttt{ncoel}) & List of the                                          \\
6736
5982
        &                                &                               & current species                                      \\ \hline
6737
5983
   6    &               300.             &  \texttt{tmin\index{tmin}}    & Temperature inferior limit (Kelvin)                  \\
6738
5984
        &                                &                               & for the enthalpy-temperature tabulation              \\ \hline
6739
5985
   7    &              2400.             &  \texttt{tmax\index{tmax}}    & Temperature superior limit (Kelvin)                  \\
6740
5986
        &                                &                               & for the enthalpy-temperature tabulation              \\ \hline
6741
 
   8    &               4                &  \texttt{nato\index{nato}}    & Number of elemental species                          \\ \hline
 
5987
   8    &               4                &  \texttt{nato\index{nato}}    & Number of elementary species                          \\ \hline
6742
5988
   9    &  .012  1  2  1  0  1  0  0  1  &                               & Molar mass of the elemental species                  \\
6743
5989
  10    &  .001  4  4  0  0  0  2  0  0  &\texttt{wmolat\index{wmolat}}(\texttt{nato}),    & (first column)                                       \\
6744
5990
  11    &  .016  0  0  1  2  2  1  0  0  &\texttt{atcoel\index{atcoel}}(\texttt{ncoel,nato})& and composition of the current species              \\
6745
5991
  12    &  .014  0  0  0  0  0  0  2  0  &                               & as a function of the elemental species               \\ \hline
6746
 
  13    &          RAYONNEMENT           &                               & Comment line                                         \\ \hline
 
5992
  13    &          RADIATION             &                               & Comment line                                         \\ \hline
6747
5993
  14    &               0.1              & \texttt{ckabs1\index{ckabs1}}  & Constant absorption coefficient                      \\
6748
5994
        &                                &                               & for the gas mixture                                  \\ \hline
6749
 
  15    &   CARACTERISTIQUES CHARBONS    &                               & Comment line                                         \\ \hline
 
5995
  15    &   COAL CHARACTERISTICS         &                               & Comment line                                         \\ \hline
6750
5996
  16    &               2                & \texttt{ncharb\index{ncharb}} & Number of coal types                                 \\ \hline
6751
5997
  17    &         1            1         & \texttt{nclpch\index{nclpch}}(\texttt{ncharb}) & Number of classes for each coal                      \\
6752
5998
        &                                &                               & (each column corresponding to                        \\
6773
6019
  28    &      0.         0.             & \texttt{ock\index{ock}}(\texttt{ncharb}) & Composition in O (mass.\%, dry) of the coke          \\
6774
6020
        &                                &                               & for each coal                                        \\ \hline
6775
6021
  29    &      0.         0.             & \texttt{pcick\index{pcick}}(\texttt{ncharb})& PCI of the dry coke ($Jkg^{-1}$) for each coal       \\ \hline
6776
 
  30    &          Cendres               &                               & Comment line                                         \\ \hline
 
6022
  30    &          Ashes               &                               & Comment line                                         \\ \hline
6777
6023
  31    &      6.3        6.3            & \texttt{xashch\index{xashch}}(\texttt{ncharb})& Ash mass fraction (mass.-\%, dry) in each coal       \\ \hline
6778
6024
  32    &      0.         0.             & \texttt{h0ashc\index{h0ashc}}(\texttt{ncharb})  & Ash formation enthalpy ($Jkg^{-1}$)                  \\
6779
6025
        &                                &                               & for each coal                                        \\ \hline
6780
6026
  33    &      0.         0.             & \texttt{cpashc\index{cpashc}}(\texttt{ncharb})   & CP of the ashes ($Jkg^{-1}K^{-1}$) for each coal     \\ \hline
6781
 
  34    &  D\'evolatilisation (Kobayashi)  &                             & Comment line                                         \\ \hline
6782
 
  35    &  1  0.37      0  0.37          & \texttt{iy1ch\index{iy1ch}}(\texttt{ncharb}),   & For each coal, pairs (\texttt{iy1ch}, \texttt{y1ch}).                  \\
 
6027
  34    &      0.         0.             & \texttt{xwatch\index{cpashc}}(\texttt{ncharb})   & humidity rate of the ashes (mass.-\%) for each coal     \\ \hline
 
6028
  35    &  Devolatilisation (Kobayashi)  &                             & Comment line                                         \\ \hline
 
6029
  36    &  1  0.37      0  0.37          & \texttt{iy1ch\index{iy1ch}}(\texttt{ncharb}),   & For each coal, pairs (\texttt{iy1ch}, \texttt{y1ch}).                  \\
6783
6030
        &                                & \texttt{y1ch\index{y1ch}}(\texttt{ncharb})     & The real \texttt{y1ch} is the adimensional stoich. coefficient\\
6784
6031
        &                                &                               & If the integer \texttt{iy1ch} is worth 1,                     \\
6785
6032
        &                                &                               & the provided value of \texttt{y1ch} is adopted and            \\
6789
6036
        &                                &                               & the provided value of \texttt{y1ch} is ignored:               \\
6790
6037
        &                                &                               & \texttt{y1ch} is calculated automatically (the light          \\
6791
6038
        &                                &                               & volatiles are then composed of {$CH_{4}$}, {$CO$}).  \\ \hline
6792
 
  36    &  1  0.74      1  0.74          & \texttt{iy2ch\index{iy2ch}}(\texttt{ncharb}),   & For each coal, pairs (\texttt{iy2ch}, \texttt{y2ch}).                  \\
 
6039
  37    &  1  0.74      1  0.74          & \texttt{iy2ch\index{iy2ch}}(\texttt{ncharb}),   & For each coal, pairs (\texttt{iy2ch}, \texttt{y2ch}).                  \\
6793
6040
        &                                & \texttt{y2ch\index{y2ch}}(\texttt{ncharb})     & The real \texttt{y2ch} is the adimensional stoich. coefficient\\
6794
6041
        &                                &                               & If the integer \texttt{iy2ch} is worth 1,                     \\
6795
6042
        &                                &                               & the provided value of \texttt{y2ch} is adopted and            \\
6799
6046
        &                                &                               & the provided value of \texttt{y2ch} is ignored:               \\
6800
6047
        &                                &                               & \texttt{y2ch} is calculated automatically (the heavy          \\
6801
6048
        &                                &                               & volatiles are then composed of {$C_{2}H_{4}$}, {$CO$}).\\ \hline
6802
 
  37    &  370000.      410000.          & \texttt{a1ch\index{a1ch}}(\texttt{ncharb})& Devolatilisation pre-exponential factor A1 ($s^{-1}$)\\
6803
 
        &                                &                               & for each coal (light volatile matters)               \\ \hline
6804
 
  38    &  1.3E13       1.52E13          & \texttt{a2ch\index{a2ch}}(\texttt{ncharb})& Devolatilisation pre-exponential factor A2 ($s^{-1}$)\\
6805
 
        &                                &                               & for each coal (heavy volatile matters)               \\ \hline
6806
 
  39    &   74000.       80000.          & \texttt{e1ch\index{e1ch}}(\texttt{ncharb})& Devolatilisation activation energy E1 ($Jmol^{-1}$)  \\
6807
 
        &                                &                               & for each coal (light volatile matters)               \\ \hline
6808
 
  40    &  250000.      310000.          & \texttt{e2ch\index{e2ch}}(\texttt{ncharb})& Energie d'activation E2 ($Jmol^{-1}$) de d\'evolatilisation\\
6809
 
        &                                &                               & for each coal (heavy volatile matters)               \\ \hline
6810
 
  41    &  Combustion h\'et\'erog\`ene   &                               & Ligne de commentaire                                 \\ \hline
6811
 
  42    &      17.88        17.88        & \texttt{ahetch\index{ahetch}}(\texttt{ncharb})   & Char burnout pre-exponential constant                \\
6812
 
        &                                &                               & ($kgm^{-2}s^{-1}atm^{-1}$) for each coal             \\ \hline
6813
 
  43    &      16.55        16.55        & \texttt{ehetch\index{ehetch}}(\texttt{ncharb})   & Char burnout activation energy ($kcalmol{-1}$)       \\
6814
 
        &                                &                               & for each coal                                        \\ \hline
6815
 
  44    &       1            1           & \texttt{iochet\index{iochet}}(\texttt{ncharb})   & Char burnout reaction order for each coal            \\
6816
 
        &                                &                               & 0.5 if \texttt{iochet} = 0 and 1 if \texttt{iochet} = 1                \\ \hline
 
6049
  38    &  370000.      410000.          & \texttt{a1ch\index{a1ch}}(\texttt{ncharb})& Devolatilisation pre-exponential factor A1 ($s^{-1}$)\\
 
6050
        &                                &                               & for each coal (light volatile matters)               \\ \hline
 
6051
  39    &  1.3E13       1.52E13          & \texttt{a2ch\index{a2ch}}(\texttt{ncharb})& Devolatilisation pre-exponential factor A2 ($s^{-1}$)\\
 
6052
        &                                &                               & for each coal (heavy volatile matters)               \\ \hline
 
6053
  40    &   74000.       80000.          & \texttt{e1ch\index{e1ch}}(\texttt{ncharb})& Devolatilisation activation energy E1 ($Jmol^{-1}$)  \\
 
6054
        &                                &                               & for each coal (light volatile matters)               \\ \hline
 
6055
  41    &  250000.      310000.          & \texttt{e2ch\index{e2ch}}(\texttt{ncharb})& Activation energy E2 ($Jmol^{-1}$) of devolatilisation\\
 
6056
        &                                &                               & for each coal (heavy volatile matters)               \\ \hline
 
6057
  42    &  heterogeneous combustion $O_2$   &                               & Comment lign                                 \\ \hline
 
6058
  43    &      17.88        17.88        & \texttt{ahetch\index{ahetch}}(\texttt{ncharb})   & Char burnout pre-exponential constant                \\
 
6059
        &                                &                               & ($kgm^{-2}s^{-1}atm^{-1}$) for each coal             \\ \hline
 
6060
  44    &      16.55        16.55        & \texttt{ehetch\index{ehetch}}(\texttt{ncharb})   & Char burnout activation energy ($kcalmol^{-1}$)       \\
 
6061
        &                                &                               & for each coal                                        \\ \hline
 
6062
  45    &       1            1           & \texttt{iochet\index{iochet}}(\texttt{ncharb})   & Char burnout reaction order for each coal            \\
 
6063
        &                                &                               & 0.5 if \texttt{iochet} = 0 and 1 if \texttt{iochet} = 1                \\ \hline
 
6064
  46    &  heterogeneous combustion $CO_2$  &                               & Comment lign                               \\ \hline
 
6065
  47    &      1.788        1.788        & \texttt{ahetch\index{ahetch}}(\texttt{ncharb})   & Char burnout pre-exponential constant                \\
 
6066
        &                                &                               & ($kgm^{-2}s^{-1}atm^{-1}$) for each coal             \\ \hline
 
6067
  48    &      1.655        1.655        & \texttt{ehetch\index{ehetch}}(\texttt{ncharb})   & Char burnout activation energy ($kcalmol^{-1}$)       \\
 
6068
        &                                &                               & for each coal                                        \\ \hline
 
6069
  49    &       1            1           & \texttt{iochet\index{iochet}}(\texttt{ncharb})   & Char burnout reaction order for each coal            \\
 
6070
        &                                &                               & 0.5 if \texttt{iochet} = 0 and 1 if \texttt{iochet} = 1                \\ \hline
 
6071
  50    &    OXYDIZERS CHARACTERISTICS   &                               & Comment lign                               \\ \hline
 
6072
  51    &              3                 & \texttt{noxyd\index{noxyd}}    & Number of oxydizers  \\
 
6073
        &                                &                               & (mixtures of $O_2,N_2,H_2O,CO_2$) \\ \hline
 
6074
  52    &    1.        0.        1.      & \texttt{oxyo2\index{oxyo2}}(\texttt{noxyd})   & Composition in $O_2$ of each oxydizer ($moles$) \\
 
6075
  53    &    0.        0.        1.      & \texttt{oxyn2\index{oxyn2}}(\texttt{noxyd})   & Composition in $N_2$ of each oxydizer ($moles$) \\
 
6076
  54    &    0.        0.        1.      & \texttt{oxyh2o\index{oxyh2o}}(\texttt{noxyd}) & Composition in $H_2O$ of each oxydizer ($moles$) \\
 
6077
  55    &  2.39        1.        1.      & \texttt{oxyco2\index{oxyco2}}(\texttt{noxyd}) & Composition in $CO_2$ of each oxydizer ($moles$) \\ \hline
6817
6078
\end{tabular}
6818
6079
}
6819
6080
\caption{Example of file for the pulverised coal combustion:
6821
6082
\end{center}
6822
6083
\end{table}
6823
6084
 
6824
 
 
6825
6085
       \item Example of file for the electric arc: \texttt{dp\_ELE} (see
6826
6086
             array \ref{tab_dpELE}).
6827
6087
 
6829
6089
\begin{center}
6830
6090
\small{
6831
6091
\begin{tabular}{|c|l|c|c|} \hline
6832
 
 Li nes & Examples of values               & Variables & Observations                                       \\ \hline
 
6092
 Lines  &        Examples of values        & Variables & Observations                                       \\ \hline
6833
6093
  1     &\# Fichier ASCII format libre ... &           & Free comment                                       \\ \hline
6834
6094
  2     &\# Les lignes de commentaires ... &           & Free comment                                       \\ \hline
6835
6095
  3     &\#                            ... &           & Free comment                                       \\ \hline
6843
6103
        &                    &                         & (\texttt{npo} $\leqslant$ \texttt{npot} set in \texttt{ppthch.h})             \\
6844
6104
        &                    &                         & So there will be \texttt{ngazg} blocks of \texttt{npo} lines each    \\ \hline
6845
6105
  9     &\#                            ... &           & Free comment                                       \\ \hline
6846
 
 10     &\#  Proprietes                ... &           & Free comment                                       \\ \hline
6847
 
 11     &\#  ~~~~T~~~~~~~~~~~H         ... &           & Free comment                                       \\ \hline
6848
 
 12     &\#  Temperature  Enthalpie    ... &           & Free comment                                       \\ \hline
6849
 
 13     &\#                            ... &           & Free comment                                       \\ \hline
6850
 
 14     &\#  ~~~~~K~~~~~~~~~J/kg       ... &           & Free comment                                       \\ \hline
 
6106
 14     &        0           & \texttt{ixkabe\index{ixkabe}} & Radiation options for \texttt{xkabe\index{xkabe}}   \\ \hline
6851
6107
 15     &\#                            ... &           & Free comment                                       \\ \hline
6852
 
 16     &    ~~~300.~~~~~~14000.       ... &           & Tabulation in line of the physical properties      \\
 
6108
 16     &\#  Proprietes                ... &           & Free comment                                       \\ \hline
 
6109
 17     &\#  ~~~~T~~~~~~~~~~~H         ... &           & Free comment                                       \\ \hline
 
6110
 18     &\#  Temperature  Enthalpie    ... &           & Free comment                                       \\ \hline
 
6111
 19     &\#                            ... &           & Free comment                                       \\ \hline
 
6112
 20     &\#  ~~~~~K~~~~~~~~~J/kg       ... &           & Free comment                                       \\ \hline
 
6113
 21     &\#                            ... &           & Free comment                                       \\ \hline
 
6114
 22     &    ~~~300.~~~~~~14000.       ... &           & Tabulation in line of the physical properties      \\
6853
6115
        &                                  &           & as a function of the temperature in Kelvin         \\
6854
6116
        &                                  &           & for each of the \texttt{ngazg} species             \\
6855
6117
        &                    &    \texttt{h}                    & Enthalpy in J/kg                                   \\
6869
6131
\end{list}
6870
6132
 
6871
6133
\clearpage
6872
 
%==================================
6873
 
\subsection{Management of the boundary conditions related to pulverised
6874
 
  coal and gas combustion: \textmd{\texttt{usebuc, usd3pc, uslwcc,
6875
 
  uscpcl and uscplc}} }
6876
 
%==================================
6877
 
 
6878
 
\noindent
6879
 
\textit{Subroutines called every time step.}
6880
 
 
6881
 
In this paragraph, ``specific physics'' refers to gas combustion or
 
6134
 
 
6135
 
 
6136
%==================================
 
6137
\subsection{Pulverised
 
6138
  coal and gas combustion module}
 
6139
%==================================
 
6140
%==================================
 
6141
\subsubsubsection{Initialisation of the variables}\label{sec:Ini-coal}
 
6142
%==================================
 
6143
For coal combustion, it is possible to initialise the specific variables in the Graphical User Interface (GUI) or in the subroutines \texttt{usebui, usd3pi, uslwci} and \texttt{uscpiv}. In the GUI, when a coal combustion physics is selected in the item ``Calculation features'' under the heading ``Thermophysical models'', an additional item appears:``Pulverized coal combustion''. In this item the user can define coal types, its composition, the oxydant and reactions parameters, see figs. \ref{fig:Ini-coal1} to \ref{fig:Ini-coal5}.
 
6144
 
 
6145
\begin{figure}[!ht]
 
6146
\begin{center}
 
6147
\includegraphics[width=12cm]{gui_coal_classes}
 
6148
\caption{Thermophysical models - Pulverized coal combustion, coal classes}
 
6149
\label{fig:Ini-coal1}
 
6150
\end{center}
 
6151
\end{figure}
 
6152
 
 
6153
\begin{figure}[!ht]
 
6154
\begin{center}
 
6155
\includegraphics[width=11cm]{gui_coal_coke}
 
6156
\caption{Pulverized coal combustion, coke}
 
6157
\label{fig:Ini-coal2}
 
6158
\end{center}
 
6159
\end{figure}
 
6160
 
 
6161
\begin{figure}[!ht]
 
6162
\begin{center}
 
6163
\includegraphics[width=11cm]{gui_coal_composition}
 
6164
\caption{Pulverized coal combustion, coal composition}
 
6165
\label{fig:Ini-coal3}
 
6166
\end{center}
 
6167
\end{figure}
 
6168
 
 
6169
\begin{figure}[!ht]
 
6170
\begin{center}
 
6171
\includegraphics[width=11cm]{gui_coal_reaction}
 
6172
\caption{Pulverized coal combustion, reaction parameters}
 
6173
\label{fig:Ini-coal4}
 
6174
\end{center}
 
6175
\end{figure}
 
6176
 
 
6177
\begin{figure}[!ht]
 
6178
\begin{center}
 
6179
\includegraphics[width=11cm]{gui_coal_oxydant}
 
6180
\caption{Pulverized coal combustion, oxydant}
 
6181
\label{fig:Ini-coal5}
 
6182
\end{center}
 
6183
\end{figure}
 
6184
 
 
6185
If the user deals with gas combustion or if he (or she) does not want to use the GUI for coal combustion, the subroutines \texttt{usebui, usd3pi, uslwci} and \texttt{uscpiv} are used (only during the calculation initialisation).\\
 
6186
In this section, ``specific physics'' will refer to gas combustion or
6882
6187
to pulverised coal combustion.
6883
6188
 
6884
 
As are \texttt{usini1} and \texttt{usppmo}, the use of \texttt{usebuc},
6885
 
\texttt {usd3pc}, \texttt{uslwcc}, \texttt{uscpcl} or \texttt{uscplc} is
6886
 
obligatory to run a calculation concerning a specific physics
6887
 
modeling. The way of using them is the same as the way of using
6888
 
\texttt{usclim} in the framework of standard calculations, that is to
6889
 
say several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
 
6189
These subroutines allow the user to initialise some variables specific
 
6190
to the specific physics activated {\em via} \texttt{usppmo}. As usual,
 
6191
the user may have access to several geometric variables to discriminate
 
6192
between different initialisation zones if needed.
 
6193
 
 
6194
{\em WARNING: in the case of a specific physics modeling, all the
 
6195
variables will be initialised here, even the potential user scalars: {\em
 
6196
\texttt{usiniv}} is no longer used.}
 
6197
 
 
6198
 
 
6199
\begin{list}{$\bullet$}{}
 
6200
       \item in the case of the EBU pre-mixed flame module, the user can
 
6201
             initialise in every cell \texttt{iel}: the mixing rate
 
6202
             \texttt{rtp\index{rtp}(iel,isca(ifm))} in variable richness, the
 
6203
             fresh gas mass fraction \\
 
6204
             \texttt{rtp(iel,isca(iygfm\index{iygfm}))}
 
6205
             and the mixture enthalpy \texttt{rtp(iel,isca(ihm\index{ihm}))} in
 
6206
             permeatic conditions
 
6207
 
 
6208
        \item in the case of the rapid complete chemistry diffusion flame
 
6209
             module, the user can initialise in every cell \texttt{iel}: the
 
6210
             mixing rate \texttt{rtp(iel,isca(ifm\index{ifm}))}, its variance
 
6211
             \texttt{rtp(iel,isca(ifp2m\index{ifp2m}))} and the mixture mass
 
6212
             enthalpy \texttt{rtp(iel,isca(ihm))} in permeatic conditions
 
6213
 
 
6214
        \item in the case of the pulverised coal combustion module, the
 
6215
             user can initialise in every cell \texttt{iel}:
 
6216
              \begin{list}{$\rightarrow$}{}
 
6217
                     \item the transport variables related to the solid phase
 
6218
                           \begin{list}{}{}
 
6219
                                  \item \texttt{rtp(iel,isca(ixch\index{ixch}(icla)))} the reactive coal mass fraction related to the class \texttt{icla} (\texttt{icla} from 1 to \texttt{nclacp} which is the total number of classes, {\em i.e.} for all the coal type)
 
6220
                                  \item \texttt{rtp(iel,isca(ixck(\index{ixck}icla)))} the coke mass fraction related to the class \texttt{icla}
 
6221
                                  \item        \texttt{rtp(iel,isca(inp\index{inp}(icla)))} the number of particles related to class \texttt{icla} per kg of air-coal mixture
 
6222
                                  \item \texttt{rtp(iel,isca(ih2\index{ih2}(icla)))} the mass enthalpy related to the class \texttt{icla} in permeatic conditions
 
6223
                           \end{list}
 
6224
                     \item \texttt{rtp(iel,isca(ihm))} the mixture enthalpy
 
6225
                     \item the transport variables related to the gas phase
 
6226
                           \begin{list}{}{}
 
6227
                                  \item
 
6228
                                       \texttt{rtp(iel,isca(if1m\index{if1m}(icha)))} the mean value of the tracer 1 representing the light volatile matters released by the coal \texttt{icha}
 
6229
                                  \item
 
6230
                                       \texttt{rtp(iel,isca(if2m\index{if2m}(icha)))} the mean value of the tracer 2 representing the heavy volatile matters released by the coal \texttt{icha}
 
6231
                                  \item \texttt{rtp(iel,isca(if3m\index{if3m}))}
 
6232
                                        the mean value of the tracer 3
 
6233
                                        representing the carbon released
 
6234
                                        as CO during coke burnout
 
6235
                                  \item \texttt{rtp(iel,isca(if4p2m\index{if4p2m}))} the variance associated with the tracer 4 representing the air (the mean value of this tracer is not transported, it can be deduced directly from the three others)
 
6236
                                  \item \texttt{rtp(iel,isca(ifp3m\index{ifp3m}))} the variance associated with the tracer 3
 
6237
                           \end{list}
 
6238
              \end{list}
 
6239
\end{list}
 
6240
 
 
6241
%==================================
 
6242
\subsubsection{Boundary conditions}\label{sec:coal-cl}
 
6243
%==================================
 
6244
In this section, ``specific physics'' refers to gas combustion or
 
6245
to pulverised coal combustion.\\
 
6246
For coal combustion, it is possible to manage the boundary conditions in the Graphical User Interface (GUI). When the coal combustion physics is selected in the heading ``Thermophysical models'', specific boundary conditions are activated for inlets, see fig. \ref{fig:cond_lim-coal}. The user fills for each type of coal previously defined (see Section \ref{sec:Ini-coal}) the initial temperature and initial composition of the inlet flow, as well as the mass flow rate.
 
6247
 
 
6248
\begin{figure}[!ht]
 
6249
\begin{center}
 
6250
\includegraphics[width=13cm]{gui_coal_bc}
 
6251
\caption{Boundary conditions for the combustion of coal}
 
6252
\label{fig:cond_lim-coal}
 
6253
\end{center}
 
6254
\end{figure}
 
6255
 
 
6256
For gas combustion or if the GUI is not used for coal combustion, the use of \texttt{usebuc} (called at every time step),
 
6257
\texttt {usd3pc}, \texttt{uslwcc}, \texttt{uscpcl} or \texttt{uscplc} is as
 
6258
mandatory as \texttt{usini1} and \texttt{usppmo} to run a calculation involving specific physics. The way of using them is the same as using
 
6259
\texttt{usclim} in the framework of standard calculations, that is, run several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
6890
6260
marked out by their colors, groups, or  geometrical criterion, where
6891
6261
the type of face, the type of boundary condition for each variable and
6892
6262
eventually the value of each variable are defined.
6932
6302
                                             velocity vector direction
6933
6303
                                             by giving the components of
6934
6304
                                             a direction vector in
6935
 
                                             \texttt{rcodcl\index{rcodcl}(ifac,iu\index{iu}(iphas))}, \texttt{rcodcl(ifac,iv\index{iv}(iphas))} and \texttt{rcodcl(ifac,iw\index{iw}(iphas))}
 
6305
                                             \texttt{rcodcl\index{rcodcl}(ifac,iu\index{iu})}, \texttt{rcodcl(ifac,iv\index{iv})} and \texttt{rcodcl(ifac,iw\index{iw})}
6936
6306
                                     \end{list}
6937
6307
 
6938
6308
{\em WARNING:
6949
6319
                                       \texttt{iqimp(izone)} the value 0 and set
6950
6320
                                       the three velocity components (in
6951
6321
                                       $m.s^{-1}$) in
6952
 
                                       \texttt{rcodcl(ifac,iu(iphas))},
6953
 
                                       \texttt{rcodcl(ifac,iv(iphas))} and
6954
 
                                       \texttt{rcodcl(ifac,iw(iphas))}
 
6322
                                       \texttt{rcodcl(ifac,iu)},
 
6323
                                       \texttt{rcodcl(ifac,iv)} and
 
6324
                                       \texttt{rcodcl(ifac,iw)}
6955
6325
                          \end{list}
6956
6326
                    \item finally he specifies for each gas inlet type
6957
6327
                          the mixing rate \texttt{fment\index{fment}(izone)} and
6994
6364
                          0). If the mass flow is imposed, the user
6995
6365
                          must set the air mass flow value
6996
6366
                          \texttt{qimpat\index{qimpat}(izone)}, its direction in
6997
 
                          \texttt{rcodcl(ifac,iu(iphas))}, \texttt{rcodcl(ifac,iv(iphas))}
6998
 
                          and \\ \texttt{rcodcl(ifac,iw(iphas))} and the incoming
 
6367
                          \texttt{rcodcl(ifac,iu)}, \texttt{rcodcl(ifac,iv)}
 
6368
                          and \\ \texttt{rcodcl(ifac,iw)} and the incoming
6999
6369
                          air temperature \texttt{timpat\index{timpat}(izone)} in
7000
6370
                          Kelvin. If the velocity is imposed, he has to
7001
 
                          set  \texttt{rcodcl(ifac,iu(iphas))}, \\
7002
 
                          \texttt{rcodcl(ifac,iv(iphas))} and \texttt{rcodcl(ifac,iw(iphas))}.
 
6371
                          set  \texttt{rcodcl(ifac,iu)}, \\
 
6372
                          \texttt{rcodcl(ifac,iv)} and \texttt{rcodcl(ifac,iw)}.
7003
6373
 
7004
6374
                    \item if the inlet belongs to the ``primary air and
7005
6375
                          pluverised coal'' \texttt{type (ientcp(izone) = 1)} the
7016
6386
\end{list}
7017
6387
 
7018
6388
%==================================
7019
 
\subsection{Initialisation of the variables related to pulverised
7020
 
  coal and gas combustion: \textmd{\texttt{usebui, usd3pi, uslwci and uscpiv}}}
7021
 
%==================================
7022
 
 
7023
 
\noindent
7024
 
\textit{Subroutines called only during the calculation initialisation.}
7025
 
 
7026
 
In this paragraph, ``specific physics'' refers to gas combustion or
7027
 
to pulverised coal combustion.
7028
 
 
7029
 
These subroutines allow the user to initialise some variables specific
7030
 
to the specific physics activated {\em via} \texttt{usppmo}. As usual,
7031
 
the user may have access to several geometric variables to discriminate
7032
 
between different initialisation zones if needed.
7033
 
 
7034
 
{\em WARNING: in the case of a specific physics modeling, all the
7035
 
variables will be initialised here, even the eventual user scalars: {\em
7036
 
\texttt{usiniv}} is no longer used.}
7037
 
 
7038
 
 
7039
 
\begin{list}{$\bullet$}{}
7040
 
       \item in the case of the EBU pre-mixed flame module, the user can
7041
 
             initialise in every cell \texttt{iel}: the mixing rate
7042
 
             \texttt{rtp\index{rtp}(iel,isca(ifm))} in variable richness, the
7043
 
             fresh gas mass fraction \\
7044
 
             \texttt{rtp(iel,isca(iygfm\index{iygfm}))}
7045
 
             and the mixture enthalpy \texttt{rtp(iel,isca(ihm\index{ihm}))} in
7046
 
             permeatic conditions
7047
 
 
7048
 
        \item in the case of the rapid complete chemistry diffusion flame
7049
 
             module, the user can initialise in every cell \texttt{iel}: the
7050
 
             mixing rate \texttt{rtp(iel,isca(ifm\index{ifm}))}, its variance
7051
 
             \texttt{rtp(iel,isca(ifp2m\index{ifp2m}))} and the mixture mass
7052
 
             enthalpy \texttt{rtp(iel,isca(ihm))} in permeatic conditions
7053
 
 
7054
 
        \item in the case of the pulverised coal combustion module, the
7055
 
             user can initialise in every cell \texttt{iel}:
7056
 
              \begin{list}{$\rightarrow$}{}
7057
 
                     \item the transport variables related to the solid phase
7058
 
                           \begin{list}{}{}
7059
 
                                  \item \texttt{rtp(iel,isca(ixch\index{ixch}(icla)))} the reactive coal mass fraction related to the class \texttt{icla} (\texttt{icla} from 1 to \texttt{nclacp} which is the total number of classes, {\em i.e.} for all the coal type)
7060
 
                                  \item \texttt{rtp(iel,isca(ixck(\index{ixck}icla)))} the coke mass fraction related to the class \texttt{icla}
7061
 
                                  \item        \texttt{rtp(iel,isca(inp\index{inp}(icla)))} the number of particles related to class \texttt{icla} per kg of air-coal mixture
7062
 
                                  \item \texttt{rtp(iel,isca(ih2\index{ih2}(icla)))} the mass enthalpy related to the class \texttt{icla} in permeatic conditions
7063
 
                           \end{list}
7064
 
                     \item \texttt{rtp(iel,isca(ihm))} the mixture enthalpy
7065
 
                     \item the transport variables related to the gas phase
7066
 
                           \begin{list}{}{}
7067
 
                                  \item
7068
 
                                       \texttt{rtp(iel,isca(if1m\index{if1m}(icha)))} the mean value of the tracer 1 representing the light volatile matters released by the coal \texttt{icha}
7069
 
                                  \item
7070
 
                                       \texttt{rtp(iel,isca(if2m\index{if2m}(icha)))} the mean value of the tracer 2 representing the heavy volatile matters released by the coal \texttt{icha}
7071
 
                                  \item \texttt{rtp(iel,isca(if3m\index{if3m}))}
7072
 
                                        the mean value of the tracer 3
7073
 
                                        representing the carbon released
7074
 
                                        as CO during coke burnout
7075
 
                                  \item \texttt{rtp(iel,isca(if4p2m\index{if4p2m}))} the variance associated with the tracer 4 representing the air (the mean value of this tracer is not transported, it can be deduced directly from the three others)
7076
 
                                  \item \texttt{rtp(iel,isca(ifp3m\index{ifp3m}))} the variance associated with the tracer 3
7077
 
                           \end{list}
7078
 
              \end{list}
7079
 
\end{list}
7080
 
 
7081
 
 
7082
 
%==================================
7083
 
\subsection{Initialisation of the options of the variables related to
7084
 
  pulverised coal and gas combustion: \textmd{\texttt{usebu1, usd3p1,
7085
 
  uslwc1, uscpi1 and uscpl1}}}
7086
 
%==================================
7087
 
 
7088
 
\noindent
7089
 
\textit{Subroutines called at calculation beginning.}
7090
 
 
7091
 
In this paragraph, ``specific physics'' refers to gas combustion or
 
6389
\subsubsection{Initialisation of the options of the variables}
 
6390
%==================================
 
6391
In the case of coal combustion, time averages, chronological records and listings follow-ups can be set in the Graphical User Interface (GUI) or in the subroutines \texttt{usebu1, usd3p1, uslwc1, uscpi1} and \texttt{uscpl1}. In the GUI, under the heading ``Calculation control'', additional variables appear in the list in the items ``Time averages'' and ``Profiles'', as well as in the item Volume solution control'', see figs. \ref{fig:t_average-coal} and \ref{fig:V_control-coal}.
 
6392
 
 
6393
\begin{figure}[!ht]
 
6394
\begin{center}
 
6395
\includegraphics[width=12cm]{gui_coal_time_average}
 
6396
\caption{Calculation control - Time averages}
 
6397
\label{fig:t_average-coal}
 
6398
\end{center}
 
6399
\end{figure}
 
6400
 
 
6401
\begin{figure}[!ht]
 
6402
\begin{center}
 
6403
\includegraphics[width=13cm]{gui_coal_solution_control}
 
6404
\caption{Calculation control - Volume solution control}
 
6405
\label{fig:V_control-coal}
 
6406
\end{center}
 
6407
\end{figure}
 
6408
 
 
6409
In this section, ``specific physics'' refers to gas combustion or
7092
6410
pulverised coal combustion.
7093
6411
 
7094
 
These 3 subroutines are used to complete \texttt{usini1} for the
7095
 
considered specific physics.
 
6412
For gas combustion or if the GUI is not used for coal combustion, the 3 subroutines \texttt{usebu1, usd3p1, uslwc1, uscpi1} and \texttt{uscpl1} can be used to complete \texttt{usini1} for the
 
6413
considered specific physics. These subroutines are called at the calculation start.
7096
6414
They allow to:
7097
6415
\begin{list}{$\bullet$}{}
7098
6416
\item generate, for the variables which are specific to the activated
7140
6458
       \end{list}
7141
6459
       \item rapid complete chemistry diffusion flame modeling:
7142
6460
             \begin{list}{}{}
7143
 
              \item  everything is identical to the ``EBU'' case, except from
 
6461
              \item  everything is identical to the ``EBU'' case, except
7144
6462
                     the fresh gas mass fraction which is replaced by the
7145
6463
                     variance of the mixing rate \texttt{ivar=isca(ifp2m\index{ifp2m})}
7146
6464
             \end{list}
7147
 
       \item pulverised coal modeling with 3 comustables:
 
6465
       \item pulverised coal modeling with 3 combustibles:
7148
6466
             \begin{list}{}{}
7149
6467
              \item {\em variables shared by the two phases}:
7150
6468
                    \begin{list}{-}{}
7251
6569
 
7252
6570
 \item set the value of the constant \texttt{cebu\index{cebu}} of the Eddy Break
7253
6571
      Up model (only in \texttt{usebu1}. By default \texttt{cebu}=2.5)
7254
 
 
7255
 
\end{list}
7256
 
 
7257
 
 
7258
 
 
7259
 
%==================================
7260
 
\subsection{Management of Boundary Conditions of the electric arc: \texttt{uselcl}}
7261
 
%==================================
7262
 
 
7263
 
 
7264
 
\noindent
7265
 
\textit {sub routine called at each time step.}
7266
 
 
7267
 
As in the \texttt{usini1} and \texttt{usppmo}, the use of \texttt{usecl}
7268
 
is required to run an electric calculation. The main use is the same as
7269
 
occurs in \texttt{usclim} for the standard \CS calculations, for which 
7270
 
different loops on the boundary faces is defined. Each faces list is
7271
 
built with the use of selection criteria (cf. \S\ref{fvm_selector}),
7272
 
and is referenced by their group(s), their color(s) or geometrical
7273
 
criterions. The face type, the boundary conditions for each variable,
7274
 
and finally the value of each variable or imposed flow are fixed.
7275
 
 
7276
 
{\em WARNING:for the electric module,  , the boundary conditions of all
7277
 
 the variables are defined here,
7278
 
even those of the eventual user scalars: {\em \texttt{usclim}} is not
7279
 
used at all.}
7280
 
 
7281
 
For the electric module, each boundary face is associated with a number
7282
 
 \texttt{izone} \footnote{\texttt{izone} must be less than the maximum
7283
 
 value allowed by the code, \texttt{nozzppm}. This is fixed at 2000 in \texttt
7284
 
{ppvar.h} and cannot be modified.}(the color \texttt{icoul} for example) in
7285
 
 order to group together all the boundary faces of the same type. In the report
7286
 
 \texttt{usclim}, the main change from the users point of view concerns the
7287
 
 specification of the boundary conditions of the potential, which isn't
7288
 
 implied by default. The Dirichlet and Neumann conditions must be imposed
7289
 
 explicitly using \texttt{icodcl} and \texttt{rcodcl} (as would be done for
7290
 
 the classical scalar).
7291
 
 
7292
 
Whats more, if one wishes to slow down the power dissipation(Joule module
7293
 
effect) or the current (electric arc module) from the imposed values
7294
 
\texttt{(puismp\index{puismp}} and \texttt{couimp\index{couimp}} respectively),
7295
 
 they can be changed by the potential scalar as shown below:
7296
 
 
7297
 
\begin{list}{-}{}
7298
 
\item For the electric arc, the imposed potential difference can be a fixed variable:
7299
 
 for example, the cathode can be fixed at 0 and the potential at the anode
7300
 
 contains the variable \texttt{dpot}. This variable is initialised in \texttt{useli1}
7301
 
 by an estimated potential difference. If \texttt{ielcor}=1 (see
7302
 
 \texttt{useli1}), \texttt{dpot} is updated automatically during the
7303
 
 calculation to obtain the required current.
7304
 
\item For the Joule module effect, \texttt{dpot} is again used with the same
7305
 
 signification as in the electric arc module. If \texttt{dpot} is not wanted
7306
 
 in the setting of the boundary condtions, the variable \texttt{coejou} can be
7307
 
 used. \texttt{coejou} is the coefficient by which the potential difference is
7308
 
 multiplied to obtain the desired power dissipation. By default this begins at
7309
 
 1 and is updated automatically. If \texttt{ielcor}=1 (see \texttt
7310
 
{useli1}), multiply the imposed potentials in \texttt{uselcl} by \texttt{coejou}
7311
 
 at each time step to achieive the desired power dissipation.
7312
 
 \end{list}
7313
 
 
7314
 
 {\em WARNING: In alternative current, attention should be paid to the values of potential
7315
 
 imposed at the limits: the variable named "real potential" represents an affective
7316
 
 value if the current is in single phase, and a "real part" if not.}
7317
 
\begin{list}{-}{}
7318
 
\item For the Joule studies, a complex potential is someitmes needed
7319
 
 (\texttt{ippmod(ieljou)}=2): this is the  case in particular where the current
7320
 
 has 3 phases. To have access to the phase of the potential, and not just its
7321
 
 amplitude, the 2 variables must be deleted: in \CS, there are 2 arrays
7322
 
 specified for this role, the real part and the imaginary
7323
 
 part of the potential. For use in the code, these variables are named
7324
 
 ``real potential'' and ``imaginary potential''. For an alternative
7325
 
 sinusoidal potential $Pp$, the maximum value is noted as $Pp_\text{max}$,
7326
 
 the phase is noted as $\phi$, the real potential
7327
 
 and the imaginary potential are respecively $Pp_\text{max}\,cos\phi$ and
7328
 
$Pp_\text{max}\,sin\phi$.
7329
 
\item For the Joule studies in which one does not have access to the phases, the real
7330
 
 potential (imaginary part =0) will suffice (\texttt{ippmod(ieljou)=1}): this is obviously the case with
7331
 
 continous current, but also with single phase alternative current. In \CS
7332
 
there is only 1 varialbe for the potential,  called "real potential". Pay attention to
7333
 
 the fact that in alternate current, the "real potential" represents a effective value
7334
 
 of potential , $\frac{1}{\sqrt{2}}\,Pp_\text{max}$ (in continous current there is no
7335
 
 such ambiguity).
7336
 
\end{list}
7337
 
 
7338
 
 
7339
 
%==================================
7340
 
\subsection{Initialisation of the variables in the electric module}
7341
 
%==================================
7342
 
 
7343
 
\noindent
7344
 
\textit{subroutine called only at the initialisation of the calculation}
7345
 
 
7346
 
This subroutine allows the user to initialise some of the specific physics variables
7347
 
 prompted via \texttt{usppmo}
7348
 
. The user has access, as usual, to many geometric variables so that the zones can
7349
 
 be differentiated if needed.
7350
 
 
7351
 
{\em WARNING: For the specific physics, it is here that all varialbes are initialsed:
7352
 
 \texttt{usiniv} is not used}
7353
 
 
7354
 
This subroutine works like \texttt{usiniv}. The values of potential and its
7355
 
constiuents are initialised if required.
7356
 
 
7357
 
It should be noted that the enthalpy is important.
7358
 
 
7359
 
\begin{list}{-}{}
7360
 
\item For the electric arc module, the enthalpy value is taken from the temperature
7361
 
 of reference \texttt{t0(iphas)} (given is \texttt{usini1}) from the temperature-enthalpy tables
7362
 
 supplied in the data file \texttt{dp\_ELE.} The user must not intervene here.
7363
 
\item For the Joule effect module, the value of enthalpy must be specified by the user
7364
 
. An example is given of how to obtain the enthalpy from the temperature of reference
7365
 
 T0 (IPHAS)(given in \texttt{usini1}), the the temperature-enthalpy low must be
7366
 
supplied. A code is suggested in the sub routine \texttt{usthht}(which is there for
7367
 
 the determination of physical properties).
7368
 
\end{list}
7369
 
%====================================
7370
 
\subsection { Initialisation of the variable options in the electric module}
7371
 
%==================================
7372
 
\label{prg_useli1}%
7373
 
\noindent
7374
 
\textit{subroutine called at each time step}
7375
 
 
7376
 
This subroutine is completed in \texttt{usini1} for the specific physics. It allows:
7377
 
\begin{list}{$\bullet$}{}
7378
 
\item Activates the variables in the specific physics module, the chronolgical
7379
 
outputs (\texttt{ichrvr(ipp)} indicators), the listings (\texttt{ilisvr(ipp)}
7380
 
indicators) and the
7381
 
historical exits at the probes defined in \texttt{usini1} (\texttt{ihisvr(ipp)}
7382
 
indicators).
7383
 
The functions are the same as in \texttt{usini1} and the script frequency of the
7384
 
exits are fixed using \texttt{usini1.} The indicators \texttt{ipp} are for the value \texttt{ipp=ipppro} (\texttt{ipproc(ivar)}, with \texttt{ivar}, the number of specific physics varibles. With the main variables
7385
 
 which concern the user (velocity, pressure, etc), the user must always use \texttt{usini1} if the history,the listings or the chronological files are required.
7386
 
 The variables which the user can activate are marked out. The number of variables in
7387
 
the calculation is given in \texttt{ivar} (defined by
7388
 
\texttt{propce(iel,ipproc(iprop)} for cell \texttt{iel}):
7389
 
 
7390
 
\begin{list}{$\rightarrow$}{}
7391
 
  \item Electric Arc Module:
7392
 
  \begin{list}{-}{}
7393
 
     \item Calculation variables \texttt{rtp(iel,ivar)}
7394
 
     \begin{list}{\texttt{ivar} = }{}
7395
 
       \item \texttt{isca(ihm\index{ihm})} enthalpy
7396
 
       \item \texttt{isca(ipotr\index{ipotr})} real potentiel
7397
 
       \item \texttt{isca(ipotva(i)\index{ipotva})} solved components of the potential vector.
7398
 
       \item \texttt{isca(iycoel(iesp)\index{iycoel})} the mass fraction of \texttt{ngazg} composites if there are more than 1
7399
 
     \end{list}
7400
 
     \item Properties \texttt{propce(iel,ipproc(iprop))}
7401
 
     \begin{list}{\texttt{iprop} = }{}
7402
 
       \item \texttt{itemp\index{itemp}}  temperature
7403
 
       \item \texttt{iefjou\index{iefjou}} power dissipation by the Joule effect.
7404
 
       \item \texttt{ilapla(i)\index{ilapla(i)}} components of the laplace forces.
7405
 
     \end{list}
7406
 
   \end{list}
7407
 
   \item Joule Module effect~:
7408
 
   \begin{list}{-}{}
7409
 
     \item Calculation variables \texttt{rtp(iel,ivar)}
7410
 
     \begin{list}{\texttt{ivar} = }{}
7411
 
       \item \texttt{isca(ihm\index{ihm})} enthalpy
7412
 
       \item \texttt{isca(ipotr\index{ipotr})} real potential
7413
 
       \item \texttt{isca(ipoti\index{ipoti})} imaginary potential if its to be taken into account
7414
 
       \item \texttt{isca(iycoel(iesp)\index{iycoel}}) the mass fraction of \texttt{ngazg} composites if there are more than 1
7415
 
     \end{list}
7416
 
     \item Properties \texttt{propce(iel,ipproc(iprop))}
7417
 
     \begin{list}{\texttt{iprop} = }{}
7418
 
       \item \texttt{itemp\index{itemp}} temperature
7419
 
       \item \texttt{iefjou\index{iefjou}} volumic power dissipation by Joule effect.
7420
 
     \end{list}
7421
 
   \end{list}
7422
 
\end{list}
7423
 
 
7424
 
       \item to give the coefficient of relaxation of the density \texttt{srrom}:\\
7425
 
$\rho^{n+1}=\texttt{srrom}*\rho^{n}+(1-\texttt{srrom})\rho^{n}$\\
7426
 
(for the electric arc, the sub-relaxation is taken into account during the 2nd time step; for the Joule effect the sub relaxation is not accounted for unless the user specifies in \texttt{uselph}
7427
 
 
7428
 
       \item indicates if the data will be fixed in the power dissipation or in the current, done in \texttt{ielcor}.
7429
 
       \item target current fixed as \texttt{couimp} (electric arc module) or the power dissipation \texttt{puism} (Joule module effect).
7430
 
       \item Fix the initial value of potential difference \texttt{dpot},
7431
 
 the for the calculations with a single fixed parameter as \texttt{couimp} or \texttt{puism}.
7432
 
 
7433
 
\end{list}
7434
 
 
7435
 
%==================================
7436
 
\subsection{Management of variable physical properties in the electric module}
7437
 
%==================================
7438
 
 
7439
 
\noindent
7440
 
\textit{Subroutine called at each time step}
7441
 
 
7442
 
All the laws of the variation of physical data of the fluid are written (where neccessary)
7443
 
in this subroutine... The subroutine replaces \texttt{usphyyv} and a similar component.
7444
 
 
7445
 
{\em WARNING: For the electric module, it is here that all the physical variables are defined
7446
 
 (including the relative cells and the eventuel user scalars):\texttt{usepelph} is not used.}
7447
 
 
7448
 
The user should ensure that the defined variation laws are valid for the whole range of
7449
 
variables. Particular attention should be taken with the non-linear laws (for example, a
7450
 
 3rd degree polynomial law giving negative values of density)
7451
 
 
7452
 
{\em WARNING: with the electric module, all the physical propertie are assumed as variables
7453
 
 and so are stored in the \texttt{propce} array. \texttt{cp0}, \texttt{viscls0}, \texttt{viscl0} are not used}
7454
 
 
7455
 
For the Joule effect, the user is required to supply the physical properties in the sub-
7456
 
routine. Examples are given which are to be adapted by the user. If the temperature is
7457
 
to be determined to calculate the physical properties, the solved variable, enthalpy must
7458
 
 be deduced. The preffered temperature-enthalpy law can be selected in the subruotine
7459
 
 \texttt{usthht} (an example of the interpolation is given from the law table. This
7460
 
subroutine can be re-used for the initialisation of the variables(\texttt{useliv}))
7461
 
 For the elecrtic arc module, the physical properties are intepolated from the data file
7462
 
 \texttt{dp\_ELE} supplied by the user. Modification is not generally necessary.
7463
 
 
7464
 
 
7465
 
 
7466
 
%==================================
7467
 
\subsection[Management of the {\em EnSight} output in the electric module: \texttt{uselen}]
7468
 
{Management of the post-processing output in the electric module: \textmd{\texttt{uselen}}}
7469
 
%==================================
7470
 
 
7471
 
\noindent
7472
 
\textit{Subroutine called at each chronological output}
7473
 
 
7474
 
This subroutine allows the addition on $n$ variables in the preprocessing output and
7475
 
 works like the subroutine \texttt{usvpst} (with the electric module, it is however also
7476
 
 possible to use \texttt{usvpst}.
7477
 
 
7478
 
The algebraic variables related to the electric module are provided by default provided
7479
 
 that they are not explicitely contained in the \texttt{propce} array:
7480
 
\begin{list}{-}{}
7481
 
\item gradient of real potential in $V m^{-1}$ ($\grad Pot_R = -\vect{E}$)
7482
 
\item density of real current in $A m^{-2}$  ($\vect{j}=\sigma \vect{E}$)
7483
 
\end{list}
7484
 
specifically for the Joule module effect with \texttt{ippmod(ieljou)}=2~:
7485
 
\begin{list}{-}{}
7486
 
\item gradient of imaginary potential in $V m^{-1}$
7487
 
\item density of real current in $A m^{-2}$
7488
 
\end{list}
7489
 
specifically for the electric arc module with \texttt{ippmod(ielarc)}=2~:
7490
 
\begin{list}{-}{}
7491
 
\item magnetic field in $T$ (\vect{B} = \vect{rot}\,\vect{A})
7492
 
\end{list}
7493
 
 
7494
 
If it is convenient for the user, there is no need to add this subroutine into the
7495
 
 SRC directory: the post-processing will be done automatically (at the same frequency
7496
 
 (\texttt{NTCHR}) as the other calculation variables)
7497
 
 
7498
 
 
7499
 
%==================================
7500
 
\subsection{Compressible module}
7501
 
%==================================
7502
 
 
7503
 
When the compressible module\footnote{For more details concerning the
7504
 
compressible version, the user may refer to the document ``Implantation
7505
 
d'un algorithme compressible dans \CS'', Rapport EDF 2003,
7506
 
HI-83/03/016/A, P. Mathon, F. Archambeau et J.-M. H\'erard.} is
7507
 
activated, it is recommended to:
7508
 
\begin{list}{-}{}
7509
 
 \item use the option ``time step variable in time and uniform in
7510
 
       space'' (\texttt{idtvar}=1) with a maximum Courant number of 0.4
7511
 
       (\texttt{coumax}=0.4): these choices must be written in \texttt{usini1}
7512
 
 \item keep the convective numerical schemes proposed by default.
7513
 
\end{list}
7514
 
 
7515
 
%==================================
7516
 
\subsubsection{ Initialisation of the options of the variables related
7517
 
   to the compressible module: \textmd{\texttt{uscfx1}} and \textmd{\texttt{uscfx2}}}
7518
 
%==================================
7519
 
\label{prg_uscfx12}%
7520
 
\noindent
7521
 
\textit{Subroutine called every time step.}
7522
 
 
7523
 
These subroutines complete \texttt{usini1}.
7524
 
 
7525
 
\texttt{uscfx1} allows to set non standard calculation options related to the
7526
 
compressible module, and in particular to fill in the key word \texttt{icfgrp}
7527
 
allowing to take into account the hydrostatic equilibrium in the
7528
 
boundary conditions.
7529
 
 
7530
 
\texttt{uscfx2} allows to specify for the molecular thermal conductivity and
7531
 
the volumetric viscosity the following pieces of information:
7532
 
\begin{list}{-}{}
7533
 
  \item variable or not (\texttt{iviscv})
7534
 
  \item reference value (\texttt{viscv0})
7535
 
\end{list}
7536
 
 
7537
 
%==================================
7538
 
\subsubsection{Management of the boundary conditions related to the
7539
 
   compressible module: \textmd{\texttt{uscfcl}}}
7540
 
%==================================
7541
 
 
7542
 
 
7543
 
\noindent
7544
 
\textit{Subroutine called every time step.}
7545
 
 
7546
 
The use of \texttt{uscfcl}
7547
 
is obligatory to run a calculation using the compressible module just
7548
 
as it is in both \texttt{usini1} and \texttt{usppmo} . The
7549
 
way of using it is the same as the way of using
7550
 
\texttt{usclim} in the framework of standard calculations, that is to
7551
 
say several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
7552
 
marked out by their colors, groups, or  geometrical criterion, where
7553
 
the type of face, the type of boundary condition for each variable and
7554
 
eventually the value of each variable are defined.
7555
 
 
7556
 
{\em WARNING: in the case of a calculation using the compressible
7557
 
module, the boundary conditions of all the variables are defined here,
7558
 
even those of the eventual user scalars: {\em \texttt{usclim}} is not
7559
 
used at all.}
7560
 
 
7561
 
In the compressible module, the different available boundary conditions
7562
 
are the followings:
7563
 
 
7564
 
\begin{list}{-}{}
7565
 
  \item inlet/outlet for which everything is known
7566
 
  \item supersonic outlet
7567
 
  \item subsonic inlet
7568
 
  \item subsonic wall
7569
 
  \item wall
7570
 
  \item symmetry
7571
 
\end{list}
7572
 
 
7573
 
 
7574
 
%==================================
7575
 
\subsubsection{Ininitialisation of the variables related to the
7576
 
  compressible module: \textmd{\texttt{uscfxi}}}
7577
 
%==================================
7578
 
 
7579
 
\noindent
7580
 
\textit{Subroutine called only during calculation initialisation.}
7581
 
 
7582
 
This subroutine is used to initialise some variables specific to the
7583
 
specific physics activated {\em via} \texttt{usppmo}.  As usual,
7584
 
the user may have access to several geometric variables to discriminate
7585
 
between different initialisation zones if needed.
7586
 
 
7587
 
{\em WARNING: in the case of a specific physics modeling, all the
7588
 
variables are initialised here: {\em \texttt{usiniv}} is not used at
7589
 
all.}
7590
 
 
7591
 
This subroutine works like \texttt{usiniv} for velocity,
7592
 
turbulence and passive scalars. Concerning pressure, density,
7593
 
temperature and specific total energy, only 2 variables out of the 4 are
7594
 
independant. The user may also initialise the variable pair he wants
7595
 
(apart from temperature-energy) and the two other variables will be
7596
 
calculated automatically by giving the right value to the variable
7597
 
\texttt{iccfth} used for the call to \texttt{uscfth}.
7598
 
 
7599
 
%==================================
7600
 
\subsubsection{Compressible module thermodynamics: \textmd{\texttt{uscfth}}}
7601
 
%==================================
7602
 
 
7603
 
\noindent
7604
 
\textit{This subroutine is called several times every time step (boundary conditions, physical properties, solving of the energy equation, ...).}
7605
 
 
7606
 
This subroutine is used to set the thermodynamics parameters. By
7607
 
default, the perfect gas laws are implemented. If the user needs to use
7608
 
other laws (perfect gas with variable Gamma, Van der Waals), he must
7609
 
modify this subroutine.
7610
 
 
7611
 
%==================================
7612
 
\subsubsection{Management of the variable physical properties in the
7613
 
   compressible module: \textmd{\texttt{uscfpv}}}
7614
 
%==================================
7615
 
 
7616
 
\noindent
7617
 
\textit{Subroutine called every time step.}
7618
 
 
7619
 
If necessary, all the variation laws of the fluid physical properties
7620
 
(viscosity, specific heat, ...) are described here. This subroutine
7621
 
replaces and is similar to \texttt{usphyv}.
7622
 
 
7623
 
The user should make sure that the defined variation laws are valid for
7624
 
the whole variation range of the variables.
7625
 
 
7626
 
%==================================
7627
 
\subsection{Lagrangian modeling of multiphasic flows with dipersed inclusions}
7628
 
%==================================
7629
 
 
7630
 
 
7631
 
%==================================
7632
 
\subsubsection{Initialisation of the main key words in the Lagrangian
7633
 
   modeling: \textmd{\texttt{uslag1}}}
7634
 
%==================================
7635
 
 
7636
 
\noindent
7637
 
\textit{Subroutine called only during calculation initialisation.}
7638
 
 
7639
 
\noindent
7640
 
This is one of the two subroutines which must be completed in
7641
 
the case of a calculation modeling a Lagrangian multiphasic flow. This
 
6572
\end{list}
 
6573
 
 
6574
%==================================
 
6575
\subsection{Heavy fuel oil combustion module}
 
6576
%==================================
 
6577
%==================================
 
6578
\subsubsection{Initialisation of transported variables}
 
6579
%==================================
 
6580
To initialise or modify (in case of a continuation) values of transported variables and of the time step, the subroutine \texttt{usfuiv} is used. It is similar to \texttt{usiniv}. It is called at the beginning of every computation (new or continuation) before the time loop.
 
6581
 
 
6582
Physical properties are stored in \texttt{propce} (cell center), \texttt{propfa} (inner face) and \texttt{propfb}. For instance, \texttt{propce(iel, ipproc(irom  ))} is \texttt{rom(iel)}, the mean density (in $kg.m^{-3}$), and \texttt{propfa(ifac,ipprof(ifluma(ivar)))} is \texttt{flumas(IFAC,IVAR)}, the convective flux of the variable \texttt{ivar}.\\
 
6583
Physical properties (\texttt{rom, viscl, cp, ...}) are computed in \texttt{ppphyv} and are not to be modified here.
 
6584
 
 
6585
All cells can be identified by using the subroutine '\texttt{getcel}'. All boundary faces may be identified using the '\texttt{getfbr}' subroutine. All internal faces may be identified using the '\texttt{getfac}' subroutine. Details of the syntax of these three subroutines are given in \texttt{usfuiv}.
 
6586
 
 
6587
In \texttt{usfuiv} the user initialise quantities related to the turbulent model chosen, and to gaseous species and droplets compositions. Exemples are provided in the subroutine.
 
6588
 
 
6589
%==================================
 
6590
\subsubsection{Boundary conditions}
 
6591
%==================================
 
6592
Boundary conditions are defined on a per-face basis in \texttt{usfucl}. Boundary faces may be identified using the '\texttt{getfbr}' subroutine. \texttt{usfucl} is very similar to \texttt{uscpcl}, see Section \ref{sec:coal-cl}. Boundary conditions may be assigned in two ways:
 
6593
\begin{list}{.}{}
 
6594
\item for ``standard'' boundary conditions (inlet, free outlet, wall, symmetry): a code is defined in the array \texttt{itypfb} (of dimensions equal to the number of boundary faces). This code will then be used by a non-user subroutine to assign the conditions.
 
6595
\item for ``non-standard'' conditions: see details given in \texttt{usfucl}.
 
6596
\end{list}
 
6597
 
 
6598
%==================================
 
6599
\subsubsection{Initialisation of the options of the variables}
 
6600
%==================================
 
6601
 
 
6602
The presence of a fuel combustion module variable in the listing, {\itshape histo} files, and the output frequency are set in the subroutine \texttt{usfui1}. If the vectors below are not allocated, default values will be used:
 
6603
\begin{list}{-}{}
 
6604
\item \texttt{ichrvr}: chronological output (1:yes / 0:no)
 
6605
\item \texttt{ilisvr}: listing output (1:yes / 0:no)
 
6606
\item \texttt{ihisvr}: {\itshape histo} output (number of probes and probe numbers), if $= -1$, every probes defined in \texttt{usini1} will be found in the {\itshape histo} files
 
6607
\end{list}
 
6608
 
 
6609
Calculation options such as a the relaxation parameter the for density (recommended when starting a combustion computation but forbidden for unstationnary computations) can also be set, as well as physical constants like the the laminar viscosity for the enthalpy.
 
6610
 
 
6611
%==================================
 
6612
\subsection{Radiative thermal transfers in semi-transparent gray media}
 
6613
%==================================
 
6614
%==================================
 
6615
\subsubsection{Initialisation of the radiation main parameters}
 
6616
%==================================
 
6617
 
 
6618
The main radiation parameters can be initialise in the Graphical User Interface (GUI) or in the user subroutine \texttt{usray1}. In the GUI, under the heading ``Thermophysical models'', when one of the two thermal radiative transfers models is selected, see fig. \ref{fig:0_ray}, additional items appear. The user is asked to choose the number of directions for angular discretisation, to define the absorption coefficient and select if the radiative calculation are restarted or not, see figs. \ref{fig:1_ray} and \ref{fig:3_ray}. When ``Advanced options'' is selected for both models figs. \ref{fig:2_ray} or \ref{fig:4_ray} appear, the user must fill the resolution frequency and verbosity levels. In addition, the activation of the radiative transfer leads to the creation of an item ``Surface solution control'' under the heading ``Calculation control'', see fig. \ref{fig:5_ray}, where radiative transfer variables can be selected to appear in the output listing.
 
6619
 
 
6620
\begin{figure}[ht]
 
6621
\begin{center}
 
6622
\includegraphics[width=13cm]{gui_rad_transf_models}
 
6623
\caption{Radiative transfers models}
 
6624
\label{fig:0_ray}
 
6625
\end{center}
 
6626
\end{figure}
 
6627
 
 
6628
\begin{figure}[ht]
 
6629
\begin{center}
 
6630
\includegraphics[width=10cm]{gui_rad_transf_do_params}
 
6631
\caption{Radiative transfers - parameters of the DO method}
 
6632
\label{fig:1_ray}
 
6633
\end{center}
 
6634
\end{figure}
 
6635
 
 
6636
\begin{figure}[ht]
 
6637
\begin{center}
 
6638
\includegraphics[width=7cm]{gui_rad_transf_do_advanced}
 
6639
\caption{Radiative transfers - advanced parameters of the DO method}
 
6640
\label{fig:2_ray}
 
6641
\end{center}
 
6642
\end{figure}
 
6643
 
 
6644
\begin{figure}[ht]
 
6645
\begin{center}
 
6646
\includegraphics[width=10cm]{gui_rad_transf_p1_params}
 
6647
\caption{Radiative transfers - parameters of the P-1 model}
 
6648
\label{fig:3_ray}
 
6649
\end{center}
 
6650
\end{figure}
 
6651
 
 
6652
\begin{figure}[ht]
 
6653
\begin{center}
 
6654
\includegraphics[width=7cm]{gui_rad_transf_p1_advanced}
 
6655
\caption{Radiative transfers - advanced parameters of th P-1 model}
 
6656
\label{fig:4_ray}
 
6657
\end{center}
 
6658
\end{figure}
 
6659
 
 
6660
\begin{figure}[ht]
 
6661
\begin{center}
 
6662
\includegraphics[width=6cm]{gui_rad_transf_post_output}
 
6663
\caption{Calculation control - Radiative transfers postprocessign output}
 
6664
\label{fig:5_ray}
 
6665
\end{center}
 
6666
\end{figure}
 
6667
 
 
6668
If the GUI is not used, \texttt{usray1} is one of the two subroutine which must be completed by the user for all
 
6669
calculations including radiative thermal transfers. It is called only during the calculation initialisation. It is composed of three headings. The first one is dedicated to the activation
 
6670
of the radiation module, only in the case of classic physics. \\
 
6671
{\em WARNING: when a calculation is ran using a specific physics module,
 
6672
this first heading must not be completed. The radiation module is then
 
6673
activated or not, according to the parameter file related to the considered
 
6674
specific physics.} \\
 
6675
 
 
6676
\noindent
 
6677
In the second heading the basic parameters of the radiation module are indicated.\\
 
6678
Finally, the third heading deals with the selection of the
 
6679
post-processing graphic outputs. The variables to treat are splitted
 
6680
into two categories: the volumetric variables and those related to the
 
6681
boundary faces.\\
 
6682
 
 
6683
\noindent
 
6684
For more details about the different parameters, the user may refer to the
 
6685
key word list (\S\ref{prg_motscles}).
 
6686
 
 
6687
 
 
6688
%==================================
 
6689
\subsubsection{Radiative transfers boundary conditions}
 
6690
%==================================
 
6691
These informations can be filled by the user through the Graphical User Interface (GUI) or by using the subroutine \texttt{usray2} (called every time step). If the interface is used, when one of the ``Radiative transfers'' options is selected in fig. \ref{fig:0_ray}, it activates specific boundary conditions each time a ``Wall'' is defined, see fig. \ref{fig:6_ray}. The user can then choose between 3 cases. The parameters the user must specify are displayed for one of them in fig. \ref{fig:7_ray}.
 
6692
 
 
6693
\begin{figure}[ht]
 
6694
\begin{center}
 
6695
\includegraphics[width=11cm]{gui_rad_transf_wall_model}
 
6696
\caption{Boundary conditions - choice of wall thermal radiative transfers}
 
6697
\label{fig:6_ray}
 
6698
\end{center}
 
6699
\end{figure}
 
6700
 
 
6701
\begin{figure}[ht]
 
6702
\begin{center}
 
6703
\includegraphics[width=11cm]{gui_rad_transf_wall_params}
 
6704
\caption{Boundary conditions - example of wall thermal radiative transfer}
 
6705
\label{fig:7_ray}
 
6706
\end{center}
 
6707
\end{figure}
 
6708
 
 
6709
When the GUI is not used, \texttt{usray2} is the second subroutine necessary for every calculation which includes radiative thermal transfers. It is used to give all the
 
6710
necessary parameters concerning, in the one case, the wall temperature
 
6711
calculation, and in the other, the coupling between the thermal
 
6712
scalar (temperature or enthalpy), and the radiation module at the
 
6713
calculation domain boundaries. It must be noted that the boundary conditions
 
6714
concerning the thermal scalar which may have been defined in the
 
6715
subroutine \texttt{usclim} will be modified by the radiation module
 
6716
according to the data given in \texttt{usray2} (cf. \S\ref{fvm_selector}).\\
 
6717
A zone number must be given to each boundary face \footnote{this must be less
 
6718
 than the maximum allowable by the code, \texttt{nozrdm}. This is fixed at 2000
 
6719
 in \texttt{radiat.h} and cannot be modified.}and, specifically for
 
6720
the walls, a boundary condition type and an initialisation temperature
 
6721
(in Kelvin). The initialisation temperature is only used to make the
 
6722
solving implicit at the first time step. The zone number allows to assign
 
6723
an arbitrary integer to a set of boundary faces having the same
 
6724
radiation boundary condition type. This gathering is used by the
 
6725
calculation, and in the listing to print some physical values (mean
 
6726
temperature, net radiative flux ...). An independent graphic output in
 
6727
{\em EnSight} format is associated with each zone and allows the display on
 
6728
the boundary faces of the variables selected in the third heading of the
 
6729
subroutine \texttt{usray1}.\\
 
6730
A boundary condition type stored in the array ISOTHP is associated with
 
6731
each boundary face. There are five different types:
 
6732
 
 
6733
\begin{list}{$\bullet$}{}
 
6734
 
 
6735
\item \texttt{\textbf{itpimp}}: wall face with imposed temperature,
 
6736
 
 
6737
\item \texttt{\textbf{ipgrno}}: for a gray or black wall face, calculation of the
 
6738
      temperature by means of a flux balance,
 
6739
 
 
6740
\item \texttt{\textbf{iprefl}}: for a reflecting wall face, calculation of the
 
6741
      temperature by means of a flux balance.
 
6742
 This is fixed at 2000 in \texttt{radiat.h} and cannot be modified.
 
6743
 
 
6744
\item \texttt{\textbf{ifgrno}}: gray or black wall face to which a conduction
 
6745
      flux is imposed,
 
6746
 
 
6747
\item \texttt{\textbf{ifrefl}}: reflecting wall face to which a conduction
 
6748
      flux is imposed, which is equivalent to impose this flux directly
 
6749
      to the fluid.
 
6750
 
 
6751
\end{list}
 
6752
 
 
6753
\noindent
 
6754
Depending on the selected boundary condition type at every wall face,
 
6755
the code needs to be given some supplementary pieces of information:
 
6756
 
 
6757
\begin{list}{$\bullet$}{}
 
6758
 
 
6759
\item \texttt{\textbf{itpimp}}: the array \texttt{tintp} must be completed
 
6760
      with the imposed temperature value and the array \texttt{epsp} must
 
6761
      be completed with the emissivity value (strictly positive).
 
6762
 
 
6763
\item \texttt{\textbf{ipgrno}}: must be given: an initialisation temperature in
 
6764
      the array \texttt{tintp}, the wall emissivity (strictly positive, in
 
6765
      \texttt{epsp}), thickness (in \texttt{epap}), thermal conductivity
 
6766
      (in \texttt{xlamp}) and an external temperature (in \texttt{textp})
 
6767
      in order to calculate a conduction flux across the wall.
 
6768
 
 
6769
\item \texttt{\textbf{iprefl}}: must be given: an initialisation temperature (in
 
6770
      \texttt{tintp}), the wall thickness (in \texttt{epap}) and thermal conductivity (in
 
6771
      \texttt{xlamp}) and an external temperature (in \texttt{textp}).
 
6772
 
 
6773
\item \texttt{\textbf{ifgrno}}: must be given: an initialisation temperature (in
 
6774
      \texttt{tintp}), the wall emissivity (in \texttt{epsp}) and the conduction
 
6775
      flux (in $W/m^2$ whatever the thermal scalar, enthalpy or temperature) in
 
6776
      the array \texttt{rcodcl}. The value of \texttt{rcodcl} is positive when the
 
6777
      conduction flux is directed from the inside of the fluid domain to the
 
6778
      outside (for instance, when the fluid heats the walls). If the
 
6779
      conduction flux is null, the wall is adiabatic.
 
6780
 
 
6781
\item \texttt{\textbf{ifrefl}}: must be given: an initialisation temperature (in
 
6782
      \texttt{tintp}) and the conduction flux (in $W/m^2$ whatever the thermal
 
6783
      scalar) in the array \texttt{rcodcl}. The value of \texttt{rcodcl} is
 
6784
      positive when the conduction flux is directed from the inside of the
 
6785
      fluid domain to the outside (for instance, when the fluid heats the
 
6786
      walls). If the conduction flux is null, the wall is adiabatic. The flux
 
6787
      received by \texttt{rcodcl} is directly imposed as boundary condition for
 
6788
      the fluid.
 
6789
 
 
6790
\end{list}
 
6791
 
 
6792
\noindent
 
6793
{\em WARNING: it is mandatory to set a zone number to every boundary
 
6794
face, even those which are not wall faces. These zones will be used during the
 
6795
printing in the listing. It is recommended to gather together the
 
6796
boundary faces of the same type, in order to ease the reading of the
 
6797
listing.}\\
 
6798
 
 
6799
%==================================
 
6800
\subsubsection{Absorption coefficient of the medium, boundary conditions
 
6801
   for the luminance and calculation of the net radiative flux}
 
6802
%==================================
 
6803
When the absorption coefficient is not constant, the subroutine \texttt{usray3} is called instead at each time step. It is composed of three parts. In the first one, the user
 
6804
must provide the absorption coefficient of the medium in the array CK,
 
6805
for each cell of the fluid mesh. By default, the absorption coefficient
 
6806
of the medium is 0, which corresponds to a transparent medium.\\
 
6807
 
 
6808
{\em WARNING: when a specific physics is activated, it is forbidden to
 
6809
give a value to the absorption coefficient in this subroutine. In this
 
6810
case, it is calculated automatically, or given by the user {\em via} a
 
6811
thermo-chemical parameter file (dp\_C3P or dp\_C3PSJ for gas combustion,
 
6812
and dp\_FCP for pulverised coal combustion).}\\
 
6813
 
 
6814
\noindent
 
6815
The two following parts of this subroutine concern a more advanced use
 
6816
of the radiation module. It is about imposing boundary conditions to the
 
6817
equation of radiative transfer and net radiative flux calculation, in
 
6818
coherence with the luminance at the boundary faces, when the user wants
 
6819
to give it a particular value. In most cases, the given examples do not
 
6820
need to be modified.
 
6821
 
 
6822
%==================================
 
6823
\subsubsection{Encapsulation of the temperature-enthalpy conversion}
 
6824
%==================================
 
6825
 
 
6826
\noindent
 
6827
\textit{Subroutine called every time step.}
 
6828
 
 
6829
The user subroutine \texttt{usray4} is used to call the user subroutine \texttt{usthht}. \texttt{usthht} is used to encapsulate a simple enthalpy-temperature
 
6830
conversion law and its inverse. The user
 
6831
can implement his own conversion formulas into it. \\
 
6832
This subroutine is useless when the thermal scalar is the temperature.\\
 
6833
\noindent
 
6834
 
 
6835
{\em WARNING: when a specific physics is activated, it is forbidden to use this
 
6836
subroutine. In this case, {\em \texttt{usray4}} is replaced by {\em
 
6837
\texttt{ppray4}}, which is not a user subroutine.}\\
 
6838
 
 
6839
\noindent
 
6840
The value of the argument \texttt{mode} allows to know in which direction the
 
6841
conversion will be made:
 
6842
\begin{list}{$\bullet$}{}
 
6843
 
 
6844
\item \texttt{\textbf{mode = 1}}: the fluid enthalpy in the cell must be
 
6845
      converted into temperature (in Kelvin),
 
6846
 
 
6847
\item \texttt{\textbf{mode = -1}}: the wall temperature (\texttt{text}
 
6848
      or \texttt{tparoi}, in Kelvin) must be converted into enthalpy.
 
6849
 
 
6850
\end{list}
 
6851
%
 
6852
{\em WARNING: the value of \texttt{mode} is passed as argument and must not be
 
6853
modified by the user.}\\
 
6854
 
 
6855
%==================================
 
6856
\subsubsection{Input of radiative transfer parameters}
 
6857
%==================================
 
6858
 
 
6859
\noindent
 
6860
\textit{The routine \texttt{usray5} is called twice. The first time is for boundary 
 
6861
conditions. The second time is for the net radiation flux computation}
 
6862
 
 
6863
In this subroutine, during the first call (\texttt{iappel=1}), the boundary conditions
 
6864
 are filled:
 
6865
\begin{list}{-}{}
 
6866
\item the radiative intensity must be set in the array \texttt{cofrua} when the discrete
 
6867
 ordinates model is used; an example is given in \texttt{usray5} for an isotropic radiation
 
6868
 field on a gray wall. Proposed boundary conditions for the intensity in \texttt{usray5} are: 
 
6869
symmetry, inlet/oulet, and wall boundary,
 
6870
\item the entering intensity for free boundaries is set to zero in \texttt{cofrua} (if the 
 
6871
user has more information, he can improve it),
 
6872
\item arrays \texttt{cofrua} and \texttt{cofrub} must be filled when the P-1 model is
 
6873
 used. The boundary conditions proposed are the same as with the discret ordinates model.
 
6874
\end{list}
 
6875
During the second call (\texttt{iappel=2}), the density of the net radiation flux must be
 
6876
 calculated consistently with the boundary conditions of the intensity considering that the 
 
6877
density of net flux is the balance between the radiative emiting part of a boundary face 
 
6878
(and not the reflecting one) and the radiative absorbing part. The provided example is 
 
6879
consistent with the example of the intensity boundary conditions given when the discret
 
6880
 ordinates model is used.
 
6881
 
 
6882
 
 
6883
%==================================
 
6884
\subsection{Conjugate heat transfers}
 
6885
%==================================
 
6886
%========================================
 
6887
\subsubsection{Thermal module in a 1D wall}
 
6888
%========================================
 
6889
 
 
6890
\noindent
 
6891
\textit{subroutine called at every time step}
 
6892
 
 
6893
This subroutine takes into account the affected thermal inertia by a wall.
 
6894
 Some boundary faces are treated as a solid wall with a given thickness, on
 
6895
 which the code resolves an undimensional equation for the heat conduction.
 
6896
 The coupling between the 1D module and the fluid works in a similar way to
 
6897
 the coupling with the \syrthes. In construction, the user is not able to
 
6898
 account for the heat transfer between different parts of the wall. A physical
 
6899
 analysis of each problem, case by case is required to evaluate the relevance
 
6900
 of its usage by way of a report of the simple conditions (temperature, zero-flux
 
6901
 ) or a coupling with \syrthes.\\
 
6902
 
 
6903
The use of this code requires that the thermal scalar is
 
6904
defined as (\texttt{iscalt}$>0$).
 
6905
 
 
6906
{\em WARNING: The 1D thermal module is developped assuming the thermal scalar
 
6907
 as a temperature. If the thermal scalar is an enthalpy, the code calls the
 
6908
 subroutine \texttt{usthht} for each transfer of information between the fluid
 
6909
 and the wall in order to convert the enthalpy to temperature and vice-versa.
 
6910
 This function has not been tested and is firmly discouraged. If the thermal
 
6911
 variable is the total (compressible) energy, the thermal module will not work.}
 
6912
 
 
6913
\bigskip
 
6914
 
 
6915
This procedure  is called twice,on initialisation and again at each time step.
 
6916
 
 
6917
\begin{list}{$\bullet$}{}
 
6918
\item The 1st call (initialisation) all the boundary faces that will be treated
 
6919
 as a coupled wall are marked out. This figure is written noted as
 
6920
 \texttt{nfkpt1d}. It applies dimension to the arrays in the thermal module.
 
6921
 \texttt{nfkpt1d} will be at 0 if there are no coupled faces (it is in fact the
 
6922
 default value, the remainer of the subroutine is not used in this case).
 
6923
 The parameter \texttt{isuit1} also need to be defined, this indicates if the
 
6924
 temperature of the wall must be initialised or written in the file (stored in
 
6925
 the variable \texttt{filmt1}).
 
6926
\item The 2nd call (initialisation) again concern the wall faces, it completes
 
6927
 the \texttt{ifpt1d} array of dimension \texttt{nfpt1d}.
 
6928
 \mbox{\texttt{ifpt1d(ifbt1d)}} is the number
 
6929
 \texttt{ifbt1d}\raisebox{1ex}{\small th} boundary faces coupled with the thermal module
 
6930
 of a 1D wall. The directional parameters are then completed for a pseudo
 
6931
 wall associated to each face
 
6932
\begin{list}{-}{}
 
6933
\item \texttt{nppt1d(nfpt1d)\index{nppt1d}}: number of cells in the 1D mesh associated
 
6934
 to the pseudo wall.
 
6935
\item \texttt{eppt1d(nfpt1d)\index{eppt1d}}: thickness of the pseudo wall.
 
6936
\item \texttt{rgpt1d(nfpt1d)\index{rgpt1d}}: geometery of the pseudo wall mesh (refined
 
6937
 as a fluid if \texttt{rgt1d} is smaller than 1)
 
6938
\item \texttt{tppt1d(nfpt1d)\index{tppt1d}}: initialisation temperature of the wall
 
6939
(uniform in thickness). In the course of the calculation, the array stores the
 
6940
 temperature of the solid at the fluid/solid interface.
 
6941
\end{list}
 
6942
 
 
6943
Other than for re-reading a file (\texttt{ficmt1}), \texttt{tppt1d} is not used.
 
6944
\texttt{nppt1d}, \texttt{ifpt1d}, \texttt{rgpt1d} and \texttt{eppt1d} are
 
6945
compared to data from the follow-up file and they must be identical.
 
6946
 
 
6947
{\em WARNING: The test in \texttt{ifpt1d} implicilty assumes that the array is completed
 
6948
 in ascending order (i.e \texttt{ifpt1d(ii)}$>$\texttt{ifpt1d(jj)} if ii$>$jj.
 
6949
 This will be the case if the coupled faces are defined starting from the unique loop on the
 
6950
boundary faces (as in the example). If this is not the case, contact the development
 
6951
 team to short circuit the test.}
 
6952
 
 
6953
\item The 3rd call (at each time step) is for the confirmation that all the arrays
 
6954
 involving physical parameter and external boundary conditions have been completed.
 
6955
\begin{list}{-}{}
 
6956
\item \texttt{iclt1d(nfpt1d)\index{iclt1d}}:Typical boundary condition at the external
 
6957
 (pseudo) wall: Dirichlet condition (\texttt{iclt1d}=1) or flux condition (\texttt{iclt1d}=3)
 
6958
\item \texttt{tept1d(nfpt1d)\index{tept1d}}: External temperature of the pseudo wall in the
 
6959
 Dirichlet case.
 
6960
\item \texttt{hept1d(nfpt1d)\index{hept1d}}: External coefficient of transfer in the pseudo
 
6961
 wall under Dirichlet conditions (in $W.m^{-2}.K^.$).
 
6962
\item \texttt{fept1d(nfpt1d)\index{nfpt1d}}: External heat flux in the pseudo wall under
 
6963
 the flux conditions(in $W.m^{-2}$, negative value for energy entering the wall).
 
6964
\item \texttt{xlmt1d(nfpt1d)\index{xlmt1d}}: Conductivity$\lambda$ of the wall uniform
 
6965
in thickness (in $W.m^{-1}.K^{-1}$).
 
6966
\item \texttt{rcpt1d(nfpt1d)\index{rcpt1d}}: Volumetric heat capacity $\rho C_p$ of the
 
6967
wall uniform in thickness (in $J.m^{-3}.K^{-1}$).
 
6968
\item \texttt{dtpt1d(nfpt1d)\index{dtpt1d}}: Physical time step ascociated with the solved
 
6969
 1D equation of the pseudo wall(which can be different from the time step in the
 
6970
 calculation).
 
6971
\end{list}
 
6972
 
 
6973
\end{list}
 
6974
 
 
6975
The $3^{rd}$ call, done at each time step, allows to impose boundary conditions
 
6976
 and physical values in time.
 
6977
 
 
6978
%==================================
 
6979
\subsubsection{Fluid-Thermal coupling with \syrthes}
 
6980
%==================================
 
6981
When the user wishes to couple \CS with \syrthes to include heat transfers, it can be 
 
6982
done in the Graphical User Interface (GUI) or in the user subroutine
 
6983
\texttt{cs\_syrthes\_coupling}.
 
6984
In the GUI, to set such a coupling, a thermal scalar must be 
 
6985
selected first in the item ``Thermal scalar'' under the heading ``Thermophysical models''.
 
6986
 Then the item ``Conjugate heat transfer'' will appear, see fig. \ref{fig:syrthes}.
 
6987
 The zones where the coupling occurs must be defined and a projection axis can be 
 
6988
specified in case of 2D coupling.
 
6989
 
 
6990
\begin{figure}[ht]
 
6991
\begin{center}
 
6992
\includegraphics[width=8cm]{gui_syrthes_coupling}
 
6993
\caption{Thermophysical models - coupling with \syrthes}
 
6994
\label{fig:syrthes}
 
6995
\end{center}
 
6996
\end{figure}
 
6997
 
 
6998
If the subroutine \texttt{ussyrc} is used, the user must specify the arguments 
 
6999
passed to the subroutine '\texttt{defsyr}'. These arguments are:
 
7000
\begin{list}{-}{}
 
7001
 \item \texttt{numsyr} is the matching \syrthes application \texttt{id} number, or $-1$,
 
7002
 \item \texttt{namsyr} is the matching \syrthes application name,
 
7003
 \item \texttt{cprjsy}: ' ' if the user wishes to use a 3D standard coupling,
 
7004
 or specify '$x$', '$y$', or '$z$' as the projection axis if a 2D coupling with \syrthes is used,
 
7005
 \item \texttt{critsu} is the surface selection criteria,
 
7006
 \item \texttt{critvl} is the volume selection criteria (only with \syrthes 4),
 
7007
 \item \texttt{iwarns} is the verbosity level.
 
7008
\end{list}
 
7009
Examples are provided in '\texttt{ussyrc}'.
 
7010
 
 
7011
 
 
7012
%==================================
 
7013
\subsection{Lagrangian modeling of multiphase flows with dipersed inclusions}
 
7014
%==================================
 
7015
 
 
7016
%==================================
 
7017
\subsubsection{Initialisation  of the Lagrangian
 
7018
   modeling parameters}\label{sec:Ini-lag}
 
7019
%==================================
 
7020
 
 
7021
The initialisation of the Lagrangian module parameters can be performed in
 
7022
 the Graphical User Interface (GUI) or in the user subroutine \texttt{uslag1} 
 
7023
(called only during the calculation initialisation). In the GUI, the selection
 
7024
 of the Lagrangian module in the item ``Calculation features'' under the heading
 
7025
 ``Thermophysical models'' activates the heading ``Particle and droplets 
 
7026
tracking''. The initialisation is performed in the three items included in 
 
7027
this heading. In ``Global settings'', the user defines the Eulerian/Lagrangian 
 
7028
multi-phase treatment, the main parameters, the specific physics associated with
 
7029
 the particles and numerical adavanced options, see figs. \ref {fig:Ini-Lag1}
 
7030
 to \ref {fig:Ini-Lag3}. In the item ``Statistics'', names are associated to 
 
7031
volume and boundary statistical variables for listing and post-processing, 
 
7032
see fig. \ref {fig:Ini-Lag4}. In the item ``Output'', the user defines the
 
7033
 output frequency, post-precessing options for particles and selects the variables
 
7034
 that will appear in the listing, see.fig. \ref {fig:Ini-Lag5}.
 
7035
 
 
7036
\begin{figure}[ht]
 
7037
\begin{center}
 
7038
\includegraphics[width=12cm]{gui_lagr_global_settings}
 
7039
\caption{Lagrangian module - global settings}
 
7040
\label{fig:Ini-Lag1}
 
7041
\end{center}
 
7042
\end{figure}
 
7043
 
 
7044
\begin{figure}[ht]
 
7045
\begin{center}
 
7046
\includegraphics[width=10cm]{gui_lagr_global_settings_coal}
 
7047
\caption{Lagrangian module - global settings, specific physics}
 
7048
\label{fig:Ini-Lag2}
 
7049
\end{center}
 
7050
\end{figure}
 
7051
 
 
7052
\begin{figure}[ht]
 
7053
\begin{center}
 
7054
\includegraphics[width=8cm]{gui_lagr_global_advanced}
 
7055
\caption{Lagrangian module - global settings, advanced numerical options}
 
7056
\label{fig:Ini-Lag3}
 
7057
\end{center}
 
7058
\end{figure}
 
7059
 
 
7060
\begin{figure}[ht]
 
7061
\begin{center}
 
7062
\includegraphics[width=11cm]{gui_lagr_statistics}
 
7063
\caption{Lagrangian module - statistics}
 
7064
\label{fig:Ini-Lag4}
 
7065
\end{center}
 
7066
\end{figure}
 
7067
 
 
7068
\begin{figure}[ht]
 
7069
\begin{center}
 
7070
\includegraphics[width=11cm]{gui_lagr_output}
 
7071
\caption{Lagrangian module - output}
 
7072
\label{fig:Ini-Lag5}
 
7073
\end{center}
 
7074
\end{figure}
 
7075
 
 
7076
\noindent
 
7077
When the GUI is not used, \texttt{uslag1} is one of the two subroutines which must be completed in
 
7078
the case of a calculation using a Lagrangian multiphase flow model. This
7642
7079
subroutine gathers in different headings all the key word which are
7643
7080
necessary to configure the Lagrangian module. The different headings
7644
7081
refer to:
7687
7124
modeling, the user must make sure that the volumetric statistics are
7688
7125
directly used for the calculation of the locally undisturbed fluid flow
7689
7126
field. \\
7690
 
 
7691
7127
\noindent
7692
7128
When the thermal evolution of the particles is activated, the associated
7693
7129
particulate scalars are always the inclusion temperature and the locally
7714
7150
 
7715
7151
%==================================
7716
7152
\subsubsection{Management of the boundary conditions related to the
7717
 
  particles: \textmd{\texttt{uslag2}} and \textmd{\texttt{uslain}}}
 
7153
  particles}
7718
7154
%==================================
 
7155
The boundary conditions related to particles can be defined in the 
 
7156
Graphical User Interface (GUI) or in the subroutines \texttt{uslag2} and 
 
7157
\texttt{uslain}. In the GUI, the selection of the Lagrangian module in the 
 
7158
item ``Calculation features'' under the heading ``Thermophysical models''
 
7159
 activates the item ``Particle boundary conditions'' under the heading 
 
7160
``Boundary conditions''. Different options are available depending on the
 
7161
 type of standard boundary conditions selected (wall, inlet/outlet, etc...),
 
7162
 see fig. \ref{fig:CL-Lag}.
 
7163
 
 
7164
\begin{figure}[ht]
 
7165
\begin{center}
 
7166
\includegraphics[width=16cm]{gui_lagr_bc}
 
7167
\caption{Lagrangian module - boundary conditions}
 
7168
\label{fig:CL-Lag}
 
7169
\end{center}
 
7170
\end{figure}
7719
7171
 
7720
7172
\noindent
7721
 
In the framework of the multiphasic lagrangrian modeling, the management
 
7173
In the framework of the multiphase lagrangrian modeling, the management
7722
7174
of the boundary conditions concerns the particle behaviour when there
7723
7175
is an interaction between its trajectory and a boundary face. These
7724
7176
boundary conditions may be imposed independently of those concerning the
7739
7191
 
7740
7192
\noindent
7741
7193
It is the second indispensable subroutine for every calculation using the
7742
 
Lagrangian module. The main numerical variables and ``pointers'' are
7743
 
described below.
 
7194
Lagrangian module. The main numerical variables are described below.
7744
7195
 
7745
7196
\variab{ifrlag}{ifrlag(nfabor)}{ia}{In the Lagrangian module, the user
7746
7197
defines \texttt{nfrlag\index{nfrlag}} boundary zones from the color of the
7824
7275
 
7825
7276
\end{list}
7826
7277
}
7827
 
 
7828
 
 
7829
7278
\variablist{iuslag}{iuslag(nclagm, nflagm, ndlaim)}{ia}{Some pieces of
7830
7279
information must be given for each particle class associated with an
7831
7280
injection zone. The first part consists in integers contained in the
7868
7317
 
7869
7318
\end{list}
7870
7319
}
7871
 
 
7872
7320
\variablist{ruslag}{ruslag(nclagm, nflagm, ndlagm)}{ra}{Some pieces of
7873
7321
information must be given for each particle class associated with an
7874
7322
injection zone. The second and last part consists in real numbers
7944
7392
 
7945
7393
\end{list}
7946
7394
}
7947
 
 
7948
7395
\variab{iusvis}{iusvis(nflagm)}{ia}{In order to display the variables at
7949
7396
the boundaries defined in the subroutine \texttt{uslag1}, this array
7950
7397
allows to select the boundary zones on which a display is wanted. To do
7962
7409
\textit{Subroutine called every time step.}
7963
7410
 
7964
7411
\noindent
7965
 
It is not obligatory to intervene in this subroutine.
 
7412
It is not mandatory to intervene in this subroutine.
7966
7413
 
7967
7414
\noindent
7968
7415
\texttt{uslain} is used to complete \texttt{uslag2} when the particles
7980
7427
the calculation domain at the current iteration are marked out by an index
7981
7428
varying between \texttt{nbpart}+1 and \texttt{nbpnew}.
7982
7429
 
7983
 
 
7984
 
%==================================
7985
 
\subsubsection{Treatment of the particle/boundary interaction:
7986
 
\textmd{\texttt{uslabo}}}
7987
 
%==================================
7988
 
 
7989
 
\noindent
7990
 
\textit{Subroutine called at every particle/boundary interaction.}
7991
 
 
7992
 
\noindent
7993
 
It is not obligatory to intervene in this subroutine, but it is required
7994
 
in four different cases.
 
7430
\clearpage
 
7431
 
 
7432
%==================================
 
7433
\subsubsection{Treatment of the particle/boundary interaction}
 
7434
%==================================
 
7435
 
 
7436
\noindent
 
7437
The subroutine \texttt{uslabo} is not mandatory but is required in four different
 
7438
 cases. It is called for each particle/boundary interaction.
7995
7439
 
7996
7440
\noindent
7997
7441
Firstly, an intervention is required when \texttt{jbord}* type boundary
8077
7521
second-order scheme is used elsewhere.
8078
7522
 
8079
7523
%==================================
8080
 
\subsubsection{Option for particle cloning/merging: \textmd{\texttt{uslaru}}}
 
7524
\subsubsection{Option for particle cloning/merging}
8081
7525
%==================================
8082
7526
 
8083
7527
\noindent
8084
7528
\textit{Subroutine called every Lagrangian iteration.}
8085
7529
 
8086
7530
\noindent
8087
 
An intervention in this subroutine is required if the particle
 
7531
An intervention in the subroutine \texttt{uslaru} is required when the particle
8088
7532
cloning/merging option is activated {\em via} the key word \texttt{iroule}. The
8089
 
importance function \texttt{croule} must then be completed. \\
 
7533
important function '\texttt{croule}' must then be completed. \\
8090
7534
The aim of this technique is to reduce the number of particles to treat in
8091
7535
the whole flow and to refine the description of the particle cloud only
8092
 
where the user wants to get volumetric statistics more accurate than in the
 
7536
where the user wants to get more accurate volumetric statistics than in the
8093
7537
rest of the calculation domain. \\
8094
7538
The values given to the importance function are strictly positive real
8095
7539
numbers allowing to classify the zones according to their
8117
7561
 
8118
7562
%==================================
8119
7563
\subsubsection{Manipulation of particulate variables at the end of an
8120
 
   iteration and user volumetric statistics: \textmd{\texttt{uslast}} and
8121
 
   \textmd{\texttt{uslaen}}}
 
7564
   iteration and user volumetric statistics}
8122
7565
%==================================
8123
7566
 
8124
7567
\noindent
8181
7624
\end{list}
8182
7625
 
8183
7626
%==================================
8184
 
\subsubsection{User stochastic differential equations:
8185
 
   \textmd{\texttt{uslaed}}}
 
7627
\subsubsection{User stochastic differential equations}
8186
7628
%==================================
8187
7629
 
8188
7630
\noindent
8189
 
\textit{Subroutine called every Lagrangian sub-step.}
8190
 
 
8191
 
\noindent
8192
 
An intervention in this subroutine is required if supplementary user
 
7631
An intervention in the subroutine \texttt{uslaed} is required if supplementary user
8193
7632
variables are added to the particle state vector (arrays \texttt{ettp}
8194
 
and \texttt{ettpa}).
 
7633
and \texttt{ettpa}). This subroutine is called at each Lagrangian sub-step.
8195
7634
 
8196
7635
\noindent
8197
7636
The integration of the stochastic differential equations associated with
8237
7676
 
8238
7677
 
8239
7678
%==================================
8240
 
\subsubsection{Particle relaxation time: \textmd{\texttt{uslatp}}}
 
7679
\subsubsection{Particle relaxation time}
8241
7680
%==================================
8242
7681
 
8243
7682
\noindent
8244
 
\textit{Subroutine called every Lagrangian sub-step.}
8245
 
 
8246
 
\noindent
8247
 
An intervention in this subroutine is not obligatory.
8248
 
 
8249
 
\noindent
8250
 
In this subroutine, the particle relaxation time may be modified
 
7683
An intervention in this subroutine is not mandatory.
 
7684
 
 
7685
\noindent
 
7686
The particle relaxation time may be modified in the subroutine \texttt{uslatp} 
8251
7687
according to the chosen formulation of the drag coefficient. \\
8252
7688
The particle relaxation time, modified or not by the user, is available
8253
7689
in the array \texttt{taup}.
8254
7690
 
8255
7691
%==================================
8256
 
\subsubsection{Particle thermal characteristic time: \textmd{\texttt{uslatc}}}
 
7692
\subsubsection{Particle thermal characteristic time}
8257
7693
%==================================
8258
7694
 
8259
7695
\noindent
8260
 
\textit{Subroutine called every Lagrangian sub-step.}
8261
 
 
8262
 
\noindent
8263
 
An intervention in this subroutine is not obligatory.
8264
 
 
8265
 
\noindent
8266
 
In this subroutine, the particle thermal characteristic time may be
8267
 
modified according to the chosen correlation for the calculation of the
8268
 
Nusselt number. \\
 
7696
An intervention in this subroutine is not mandatory.
 
7697
 
 
7698
\noindent
 
7699
The particle thermal characteristic time may be
 
7700
modified in the subroutine \texttt{uslatc} according to the chosen correlation 
 
7701
for the calculation of the
 
7702
Nusselt number. This subroutine is called ar each Lagrangian sub-step. \\
8269
7703
The thermal characteristic time, modified or not by the user, is
8270
7704
available in the zone \texttt{tempct(nbpmax,1)} of the array \texttt{tempct}.
 
7705
 
 
7706
%==================================
 
7707
\subsection{Compressible module}
 
7708
%==================================
 
7709
 
 
7710
When the compressible module\footnote{For more details concerning the
 
7711
compressible version, the user may refer to the document ``Implantation
 
7712
d'un algorithme compressible dans \CS'', Rapport EDF 2003,
 
7713
HI-83/03/016/A, P. Mathon, F. Archambeau et J.-M. H\'erard.} is
 
7714
activated, it is recommended to:
 
7715
\begin{list}{-}{}
 
7716
 \item use the option ``time step variable in time and uniform in
 
7717
       space'' (\texttt{idtvar}=1) with a maximum Courant number of 0.4
 
7718
       (\texttt{coumax}=0.4): these choices must be written in \texttt{usini1}
 
7719
 \item keep the convective numerical schemes proposed by default.
 
7720
\end{list}
 
7721
 
 
7722
%==================================
 
7723
\subsubsection{ Initialisation of the options of the variables}
 
7724
%==================================
 
7725
\label{prg_uscfx12}%
 
7726
\noindent
 
7727
\textit{Subroutines called at each time step.}
 
7728
 
 
7729
The subroutines \texttt{uscfx1} and \texttt{uscfx2} complete \texttt{usini1}.
 
7730
 
 
7731
\texttt{uscfx1} allows to set non standard calculation options related to the
 
7732
compressible module, and in particular to fill in the key word \texttt{icfgrp}
 
7733
allowing to take into account the hydrostatic equilibrium in the
 
7734
boundary conditions.
 
7735
 
 
7736
\texttt{uscfx2} allows to specify for the molecular thermal conductivity and
 
7737
the volumetric viscosity the following pieces of information:
 
7738
\begin{list}{-}{}
 
7739
  \item variable or not (\texttt{iviscv})
 
7740
  \item reference value (\texttt{viscv0})
 
7741
\end{list}
 
7742
 
 
7743
%==================================
 
7744
\subsubsection{Management of the boundary conditions}
 
7745
%==================================
 
7746
 
 
7747
\noindent
 
7748
\textit{Subroutine called every time step.}
 
7749
 
 
7750
The use of \texttt{uscfcl}
 
7751
is compulsory when running a calculation that uses the compressible module, just
 
7752
as it is in both \texttt{usini1} and \texttt{usppmo}. The
 
7753
way of using it is the same as the way of using
 
7754
\texttt{usclim} in the framework of standard calculations, that is to
 
7755
say several loops on the boundary faces lists (cf. \S\ref{fvm_selector})
 
7756
marked out by their colors, groups, or  geometrical criterion, where
 
7757
the type of face, the type of boundary condition for each variable and
 
7758
eventually the value of each variable are defined.
 
7759
 
 
7760
{\em WARNING: in the case of a calculation using the compressible
 
7761
module, the boundary conditions of all the variables are defined here,
 
7762
even those of the eventual user scalars: {\em \texttt{usclim}} is not
 
7763
used at all.}
 
7764
 
 
7765
In the compressible module, the different available boundary conditions
 
7766
are the followings:
 
7767
 
 
7768
\begin{list}{-}{}
 
7769
  \item inlet/outlet for which everything is known
 
7770
  \item supersonic outlet
 
7771
  \item subsonic inlet
 
7772
  \item subsonic wall
 
7773
  \item wall
 
7774
  \item symmetry
 
7775
\end{list}
 
7776
 
 
7777
%==================================
 
7778
\subsubsection{Initialisation of the variables}
 
7779
%==================================
 
7780
 
 
7781
The subroutine \texttt{uscfxi}, called during the calculation initialisation,
 
7782
 is used to initialise some variables specific to the
 
7783
specific physics activated {\em via} \texttt{usppmo}.  As usual,
 
7784
the user may have access to several geometric variables to discriminate
 
7785
between different initialisation zones if needed.
 
7786
 
 
7787
{\em WARNING: in the case of a specific physics modeling, all the
 
7788
variables are initialised here: {\em \texttt{usiniv}} is not used at
 
7789
all.}
 
7790
 
 
7791
This subroutine works like \texttt{usiniv} for velocity,
 
7792
turbulence and passive scalars. Concerning pressure, density,
 
7793
temperature and specific total energy, only 2 variables out of the 4 are
 
7794
independant. The user may also initialise the variable pair he wants
 
7795
(apart from temperature-energy) and the two other variables will be
 
7796
calculated automatically by giving the right value to the variable
 
7797
\texttt{iccfth} used for the call to \texttt{uscfth}.
 
7798
 
 
7799
%==================================
 
7800
\subsubsection{Thermodynamics}
 
7801
%==================================
 
7802
 
 
7803
\noindent
 
7804
\textit{The subroutine \texttt{uscfth} is called several times at each time step
 
7805
 (boundary conditions, physical properties, solving of the energy equation, ...).}
 
7806
 
 
7807
This subroutine is used to set the thermodynamics parameters. By
 
7808
default, the perfect gas laws are implemented. If the user needs to use
 
7809
other laws (perfect gas with variable Gamma, Van der Waals), he (or she) must
 
7810
modify this subroutine.
 
7811
 
 
7812
%==================================
 
7813
\subsubsection{Management of variable physical properties}
 
7814
%==================================
 
7815
 
 
7816
If necessary, all the variation laws of the fluid physical properties
 
7817
(viscosity, specific heat, ...) can be described in the subroutine \texttt{uscfpv}
 
7818
 which is then called at each time step. This subroutine replaces and is similar to \texttt{usphyv}.
 
7819
 
 
7820
The user should make sure that the defined variation laws are valid for
 
7821
the whole variation range of the variables.
 
7822
 
 
7823
%==================================
 
7824
\subsection{Management of the electric arc module}
 
7825
%==================================
 
7826
%==================================
 
7827
\subsubsection{Initialisation of the variables}
 
7828
%==================================
 
7829
 
 
7830
\noindent
 
7831
\textit{subroutine called only at the initialisation of the calculation}
 
7832
 
 
7833
The subroutine \texttt{useliv} allows the user to initialise some of the specific
 
7834
 physics variables
 
7835
 prompted via \texttt{usppmo}. It is called only during the initialisation of
 
7836
 the calculation. The user has access, as usual, to many geometric variables so
 
7837
 that the zones can be treated separately if needed.
 
7838
 
 
7839
{\em WARNING: For the specific physics, it is here that all variables are initialised:
 
7840
 \texttt{usiniv} is not used}
 
7841
 
 
7842
This subroutine works like \texttt{usiniv}. The values of potential and its
 
7843
constituents are initialised if required.
 
7844
 
 
7845
It should be noted that the enthalpy is relevant.
 
7846
 
 
7847
\begin{list}{-}{}
 
7848
\item For the electric arc module, the enthalpy value is taken from the temperature
 
7849
 of reference \texttt{t0} (given in \texttt{usini1}) from the temperature-enthalpy
 
7850
 tables
 
7851
 supplied in the data file \texttt{dp\_ELE.} The user must not intervene here.
 
7852
\item For the Joule effect module, the value of enthalpy must be specified by the user
 
7853
. An example is given of how to obtain the enthalpy from the temperature of reference
 
7854
 \texttt{t0}(given in \texttt{usini1}), the temperature-enthalpy law must be
 
7855
supplied. A code is suggested in the sub routine \texttt{usthht}(which is there for
 
7856
 the determination of physical properties).
 
7857
\end{list}
 
7858
 
 
7859
%==================================
 
7860
\subsubsection{Variable physical properties}
 
7861
%==================================
 
7862
 
 
7863
All the laws of the variation of physical data of the fluid are written (when neccessary)
 
7864
in the subroutine \texttt{uselph}... The subroutine replaces \texttt{usphyyv} and works
 
7865
 in a similar manner. It is called at each time step.
 
7866
 
 
7867
{\em WARNING: For the electric module, it is here that all the physical variables are defined
 
7868
 (including the relative cells and the eventuel user scalars):}\texttt{usepelph} {\em {is not used.}}
 
7869
 
 
7870
The user should ensure that the defined variation laws are valid for the whole range of
 
7871
variables. Particular care should be taken with non-linear laws (for example, a
 
7872
 $3^{rd}$ degree polynomial law giving negative values of density)
 
7873
 
 
7874
{\em WARNING: in the electric module, all the physical propertie are considered as variables
 
7875
 and are therefore stored in the \texttt{propce} array. \texttt{cp0}, \texttt{viscls0}, \texttt{viscl0}
 
7876
 are not used}
 
7877
 
 
7878
For the Joule effect, the user is required to supply the physical properties in the sub-
 
7879
routine. Examples are given which are to be adapted by the user. If the temperature is
 
7880
to be determined to calculate the physical properties, the solved variable, enthalpy must
 
7881
 be deduced. The prefered temperature-enthalpy law can be selected in the subruotine
 
7882
 \texttt{usthht} (an example of the interpolation is given from the law table. This
 
7883
subroutine can be re-used for the initialisation of the variables(\texttt{useliv}))
 
7884
 For the electric arc module, the physical properties are interpolated from the data file
 
7885
 \texttt{dp\_ELE} supplied by the user. Modifications are generally not necessary.
 
7886
 
 
7887
%==================================
 
7888
\subsubsection{Boundary Conditions}
 
7889
%==================================
 
7890
 
 
7891
\minititre{Subroutine \texttt{uselcl}}
 
7892
\noindent
 
7893
\textit {subroutine called at each time step.}
 
7894
 
 
7895
As much as \texttt{usini1} and \texttt{usppmo}, the use of \texttt{usecl}
 
7896
is required to run an electric calculation. The main use is the same as
 
7897
occurs in \texttt{usclim} for the standard \CS calculations, for which 
 
7898
different loops on the boundary faces is defined. Each faces list is
 
7899
built with the use of selection criteria (cf. \S\ref{fvm_selector}),
 
7900
and is referenced by their group(s), their color(s) or geometrical
 
7901
criterions. The face type, the boundary conditions for each variable,
 
7902
and finally the value of each variable or imposed flow are fixed.
 
7903
 
 
7904
{\em WARNING:for the electric module, the boundary conditions of all
 
7905
 the variables are defined here,
 
7906
even for those of the eventual user scalars: {\em \texttt{usclim}} is not
 
7907
used at all.}
 
7908
 
 
7909
For the electric module, each boundary face is associated with a number
 
7910
 \texttt{izone} \footnote{\texttt{izone} must be less than the maximum
 
7911
 value allowed by the code, \texttt{nozzppm}. This is fixed at 2000 in \texttt
 
7912
{ppvar.h} and cannot be modified.}(the color \texttt{icoul} for example) in
 
7913
 order to group together all the boundary faces of the same type. In the report
 
7914
 \texttt{usclim}, the main change from the users point of view concerns the
 
7915
 specification of the boundary conditions of the potential, which isn't
 
7916
 implied by default. The Dirichlet and Neumann conditions must be imposed
 
7917
 explicitly using \texttt{icodcl} and \texttt{rcodcl} (as would be done for
 
7918
 the classical scalar).
 
7919
 
 
7920
Whats more, if one wishes to slow down the power dissipation(Joule
 
7921
effect module) or the current (electric arc module) from the imposed values
 
7922
\texttt{(puismp\index{puismp}} and \texttt{couimp\index{couimp}} respectively),
 
7923
 they can be changed by the potential scalar as shown below:
 
7924
 
 
7925
\begin{list}{-}{}
 
7926
\item For the electric arc, the imposed potential difference can be a fixed variable:
 
7927
 for example, the cathode can be fixed at 0 and the potential at the anode
 
7928
 contains the variable \texttt{dpot}. This variable is initialised in \texttt{useli1}
 
7929
 by an estimated potential difference. If \texttt{ielcor}=1 (see
 
7930
 \texttt{useli1}), \texttt{dpot} is updated automatically during the
 
7931
 calculation to obtain the required current.
 
7932
\item For the Joule module effect, \texttt{dpot} is again used with the same
 
7933
 signification as in the electric arc module. If \texttt{dpot} is not wanted
 
7934
 in the setting of the boundary conditions, the variable \texttt{coejou} can be
 
7935
 used. \texttt{coejou} is the coefficient by which the potential difference is
 
7936
 multiplied to obtain the desired power dissipation. By default this begins at
 
7937
 1 and is updated automatically. If \texttt{ielcor}=1 (see \texttt
 
7938
{useli1}), multiply the imposed potentials in \texttt{uselcl} by \texttt{coejou}
 
7939
 at each time step to achieve the desired power dissipation.
 
7940
 \end{list}
 
7941
 
 
7942
 {\em WARNING: In alternative current, attention should be paid to the values of potential
 
7943
 imposed at the limits: the variable named "real potential" represents an affective
 
7944
 value if the current is in single phase, and a "real part" if not.}
 
7945
\begin{list}{-}{}
 
7946
\item For the Joule studies, a complex potential is sometimes needed
 
7947
 (\texttt{ippmod(ieljou)}=2): this is the  case in particular where the current
 
7948
 has 3 phases. To have access to the phase of the potential, and not just to its
 
7949
 amplitude, the 2 variables must be deleted: in \CS, there are 2 arrays
 
7950
 specified for this role, the real part and the imaginary
 
7951
 part of the potential. For use in the code, these variables are named
 
7952
 ``real potential'' and ``imaginary potential''. For an alternative
 
7953
 sinusoidal potential $Pp$, the maximum value is noted as $Pp_\text{max}$,
 
7954
 the phase is noted as $\phi$, the real potential
 
7955
 and the imaginary potential are respecively $Pp_\text{max}\,cos\phi$ and
 
7956
$Pp_\text{max}\,sin\phi$.
 
7957
\item For the Joule studies in which one does not have access to the phases, the real
 
7958
 potential (imaginary part =0) will suffice (\texttt{ippmod(ieljou)=1}): this is
 
7959
 obviously the case with
 
7960
 continous current, but also with single phase alternative current. In \CS
 
7961
there is only 1 varialbe for the potential,  called "real potential". Pay attention to
 
7962
 the fact that in alternate current, the "real potential" represents a effective value
 
7963
 of potential , $\frac{1}{\sqrt{2}}\,Pp_\text{max}$ (in continous current there is no
 
7964
 such ambiguity).
 
7965
\end{list}
 
7966
 
 
7967
\minititre{Subroutine \texttt{usetcl}}
 
7968
\noindent
 
7969
\textit{Subroutine called every time step.}
 
7970
 
 
7971
This subroutine is compulsory when the electrical module is used. It
 
7972
 manages the boundary conditions for variables unknown by \texttt{usclim}.
 
7973
 It calculates:
 
7974
\begin{list}{$\bullet$}{}
 
7975
\item  the intensity at each electrode
 
7976
\item  the voltage on each termin of transformers. To achieve it, the intensity,
 
7977
 the rvoltage at each termin, the Rvoltage, and the total intensity of the 
 
7978
transformer are calculated. 
 
7979
\end{list}
 
7980
 
 
7981
Finally, a test is performed to check if the offset is zero or if a boundary
 
7982
 face is in contact with the ground.
 
7983
 
 
7984
%====================================
 
7985
\subsubsection {Initialisation of the variable options}
 
7986
%==================================
 
7987
\label{prg_useli1}%
 
7988
 
 
7989
The subroutine \texttt{useli1} is completed in \texttt{usini1} for the specific
 
7990
 physics. It is called at each time step. It allows:
 
7991
\begin{list}{$\bullet$}{}
 
7992
\item to activate the variables in the specific physics module, the chronological
 
7993
outputs (\texttt{ichrvr(ipp)} indicators), the listings (\texttt{ilisvr(ipp)}
 
7994
indicators) and the
 
7995
historical exits at the probes defined in \texttt{usini1} (\texttt{ihisvr(ipp)}
 
7996
indicators).
 
7997
The functions are the same as in \texttt{usini1} and the script frequency of the
 
7998
exits are fixed using \texttt{usini1.} The indicators \texttt{ipp} are for the
 
7999
 value \texttt{ipp=ipppro} (\texttt{ipproc(ivar)}, with \texttt{ivar}, the number
 
8000
 of specific physics variables. With the main variables
 
8001
 which concern the user (velocity, pressure, etc), the user must always use
 
8002
 \texttt{usini1} if the history, the listings, or the chronological files are required.
 
8003
 The variables which the user can activate are marked out. The number of variables in
 
8004
the calculation is given in \texttt{ivar} (defined by
 
8005
\texttt{propce(iel,ipproc(iprop)} for cell \texttt{iel}):
 
8006
 
 
8007
\begin{list}{$\rightarrow$}{}
 
8008
  \item Electric Arc Module:
 
8009
  \begin{list}{-}{}
 
8010
     \item Calculation variables \texttt{rtp(iel,ivar)}
 
8011
     \begin{list}{\texttt{ivar} = }{}
 
8012
       \item \texttt{isca(ihm\index{ihm})} enthalpy
 
8013
       \item \texttt{isca(ipotr\index{ipotr})} real potentiel
 
8014
       \item \texttt{isca(ipotva(i)\index{ipotva})} solved components of the potential vector.
 
8015
       \item \texttt{isca(iycoel(iesp)\index{iycoel})} the mass fraction of \texttt{ngazg}
 
8016
 composites if there are more than 1
 
8017
     \end{list}
 
8018
     \item Properties \texttt{propce(iel,ipproc(iprop))}
 
8019
     \begin{list}{\texttt{iprop} = }{}
 
8020
       \item \texttt{itemp\index{itemp}}  temperature
 
8021
       \item \texttt{iefjou\index{iefjou}} power dissipation by the Joule effect.
 
8022
       \item \texttt{ilapla(i)\index{ilapla(i)}} components of the laplace forces.
 
8023
     \end{list}
 
8024
   \end{list}
 
8025
   \item Joule Module effect~:
 
8026
   \begin{list}{-}{}
 
8027
     \item Calculation variables \texttt{rtp(iel,ivar)}
 
8028
     \begin{list}{\texttt{ivar} = }{}
 
8029
       \item \texttt{isca(ihm\index{ihm})} enthalpy
 
8030
       \item \texttt{isca(ipotr\index{ipotr})} real potential
 
8031
       \item \texttt{isca(ipoti\index{ipoti})} imaginary potential if its to be taken into account
 
8032
       \item \texttt{isca(iycoel(iesp)\index{iycoel}}) the mass fraction of \texttt{ngazg}
 
8033
 composites if there are more than 1
 
8034
     \end{list}
 
8035
     \item Properties \texttt{propce(iel,ipproc(iprop))}
 
8036
     \begin{list}{\texttt{iprop} = }{}
 
8037
       \item \texttt{itemp\index{itemp}} temperature
 
8038
       \item \texttt{iefjou\index{iefjou}} volumic power dissipation by Joule effect.
 
8039
     \end{list}
 
8040
   \end{list}
 
8041
\end{list}
 
8042
 
 
8043
       \item to give the coefficient of relaxation of the density \texttt{srrom}:\\
 
8044
$\rho^{n+1}=\texttt{srrom}*\rho^{n}+(1-\texttt{srrom})\rho^{n}$\\
 
8045
(for the electric arc, the sub-relaxation is taken into account during the 2nd time
 
8046
 step; for the Joule effect the sub relaxation is not accounted for unless the user
 
8047
 specifies in \texttt{uselph}
 
8048
 
 
8049
       \item indicates if the data will be fixed in the power dissipation or
 
8050
 in the current, done in \texttt{ielcor}.
 
8051
       \item target current fixed as \texttt{couimp} (electric arc module)
 
8052
 or the power dissipation \texttt{puism} (Joule module effect).
 
8053
       \item Fix the initial value of potential difference \texttt{dpot},
 
8054
 the for the calculations with a single fixed parameter as \texttt{couimp}
 
8055
 or \texttt{puism}.
 
8056
 
 
8057
\end{list}
 
8058
 
 
8059
%==================================
 
8060
\subsubsection[{\em EnSight} output]
 
8061
{Post-processing output}
 
8062
%==================================
 
8063
 
 
8064
The subroutine \texttt{uselen} allows the addition on $n$ variables in the
 
8065
 preprocessing output and
 
8066
 works like the subroutine \texttt{usvpst} (with the electric module, it is however also
 
8067
 possible to use \texttt{usvpst}. It is called at each chronological output
 
8068
 
 
8069
The algebraic variables related to the electric module are provided by default provided
 
8070
 that they are not explicitely contained in the \texttt{propce} array:
 
8071
\begin{list}{-}{}
 
8072
\item gradient of real potential in $V m^{-1}$ ($\grad Pot_R = -\vect{E}$)
 
8073
\item density of real current in $A m^{-2}$  ($\vect{j}=\sigma \vect{E}$)
 
8074
\end{list}
 
8075
specifically for the Joule module effect with \texttt{ippmod(ieljou)}=2~:
 
8076
\begin{list}{-}{}
 
8077
\item gradient of imaginary potential in $V m^{-1}$
 
8078
\item density of real current in $A m^{-2}$
 
8079
\end{list}
 
8080
specifically for the electric arc module with \texttt{ippmod(ielarc)}=2~:
 
8081
\begin{list}{-}{}
 
8082
\item magnetic field in $T$ (\vect{B} = \vect{rot}\,\vect{A})
 
8083
\end{list}
 
8084
 
 
8085
If it is convenient for the user, there is no need to add this subroutine into the
 
8086
 SRC directory: the post-processing will be done automatically (at the same frequency
 
8087
 (\texttt{NTCHR}) as the other calculation variables)
 
8088
 
 
8089
 
 
8090
%==================================
 
8091
\subsection{\CS-\CS coupling}
 
8092
%==================================
 
8093
 
 
8094
\noindent
 
8095
\textit{Subroutine called once during the calculation initialisation.}
 
8096
 
 
8097
This user subroutine \texttt{ussatc} is used to couple \CS with itself.
 
8098
 It is used for turbomachine applications for instance, the first \CS managing
 
8099
 the fluid around the rotor and the other the fluid around the stator.
 
8100
In the case of a coupling between two \CS instances, the \texttt{numsat}
 
8101
 and \texttt{namsat} arguments of the subroutine '\texttt{defsat}' are ignored.
 
8102
 In case of multiple couplings, a coupling will be matched with available \CS
 
8103
 instances prioritarily based on the \texttt{namsat} (\CS instance name) argument,
 
8104
 then on the \texttt{numsat} (\CS instance application number) argument.\\
 
8105
If \texttt{namsat} is empty, matching will be based on \texttt{numsat} only.\\
 
8106
The arguments of '\texttt{defsat}' are:
 
8107
\begin{list}{-}{}
 
8108
\item \texttt{numsat}: the matching \CS application \texttt{id}, or $-1$,
 
8109
\item \texttt{namsat}: the matching \CS application name,
 
8110
\item \texttt{crtcsu}: the cell selection criteria for support,
 
8111
\item \texttt{crtfsu}: the boundary face selection criteria for support (not functional),
 
8112
\item \texttt{crtccp}: the cell selection criteria for coupled cells,
 
8113
\item \texttt{crtfcp}: the boundary face selection criteria for coupled faces,
 
8114
\item \texttt{iwarns}: the verbosity level.
 
8115
\end{list}
 
8116
 
 
8117
 
 
8118
%==================================
 
8119
\subsection{Fluid-Structure external coupling}
 
8120
%==================================
 
8121
 
 
8122
\noindent
 
8123
\textit{???Subroutine called only once or at each iteration???.}
 
8124
 
 
8125
The subroutine \texttt{usaste} belongs to the module dedicated to external
 
8126
 Fluid-Structure coupling with \textit{Code\_Aster}. Here one defines the boundary
 
8127
 faces coupled with \textit{Code\_Aster} and the fluid forces components which are
 
8128
 given to structural calculation. When using external coupling with \textit{Code\_Aster},
 
8129
 structure number necessarily needs to be negative; the references of coupled faces being
 
8130
 i.e. -1, -2, etc...
 
8131
The subroutine performs the following operations:
 
8132
\begin{list}{-}{}
 
8133
 \item '\texttt{getfbr}' is called to get a list of elements matching a 
 
8134
geometrical criterion or reference number then a colour (negative value) is associated
 
8135
 to these elements.
 
8136
 \item the value passed to \texttt{asddlf}, for user-chosen component, for every negative
 
8137
 colour, defines the movement imposed to the external structure.
 
8138
 \item the user specify with the value of \texttt{isyncp} if \CS and \textit{Code\_Aster}
 
8139
 use synchronised chronological output or not.
 
8140
\end{list}
 
8141
 
 
8142
%==================================
 
8143
\subsection{ALE module}
 
8144
%==================================
 
8145
%==================================
 
8146
\subsubsection{Initialisation of the options}
 
8147
%==================================
 
8148
\label{prg_usalin}%
 
8149
This initialisation can be performed in the Graphical User Interface (GUI)
 
8150
 or in the subroutines \texttt{usalin} and \texttt{usstr1}. First of all,
 
8151
 in the GUI when the ``Mobile mesh'' is selected in the ``Thermophysical models''
 
8152
 heading, additional options are displayed. The user must choose a type of mesh
 
8153
 viscosity and how to describe its spatial distribution, see fig. \ref{fig:Ini-ale}.
 
8154
 
 
8155
\begin{figure}[ht]
 
8156
\begin{center}
 
8157
\includegraphics[width=12cm]{gui_ale_mei}
 
8158
\caption{Thermophysical models - mobile mesh (ALE method)}
 
8159
\label{fig:Ini-ale}
 
8160
\end{center}
 
8161
\end{figure}
 
8162
 
 
8163
The following paragraphs are relevant if the GUI is not used.
 
8164
 
 
8165
\minititre{Subroutine \texttt{usalin}}
 
8166
\noindent
 
8167
\textit{Subroutine called at the start.}
 
8168
This subroutine completes \texttt{usini1}.
 
8169
 
 
8170
\texttt{usalin} allows to set option for the ale module, and in
 
8171
particular to active the ale module
 
8172
 
 
8173
\minititre{Subroutine \texttt{usstr1}}
 
8174
 
 
8175
\texttt{usstr1} allows to specify for the structure module the
 
8176
following pieces of information:
 
8177
\begin{list}{-}{}
 
8178
  \item number of structure (\texttt{nbstru}).
 
8179
  \item initial value of deplacement, velocity and acceleration
 
8180
    (\texttt{xstr0}, \texttt{xstreq} and \texttt{vstr0}).
 
8181
\end{list}
 
8182
 
 
8183
Below is a list of the different variables that might be modified:
 
8184
 
 
8185
\begin{list}{$\bullet$}{}
 
8186
 
 
8187
\item{\texttt{nbstru}} \\
 
8188
{the number of structures}
 
8189
 
 
8190
\item{\texttt{idfstr(i)}} \\
 
8191
{index of the structure, where I is the index of the face}
 
8192
 
 
8193
\item{\texttt{xstr0(i,k)}} \\
 
8194
{initial position of a structure, where \texttt{i} is the dimension of space
 
8195
and \texttt{k} the index of the structure}
 
8196
 
 
8197
\item{\texttt{xstreq(i,k)}} \\
 
8198
{position of balance of a structure, where \texttt{i} is the dimension of space
 
8199
and \texttt{k} the index of the structure}
 
8200
 
 
8201
\item{\texttt{vstr0(i,k)}} \\
 
8202
{initial velicity of a structure, where \texttt{i} is the dimension of space
 
8203
and \texttt{k} the index of the structure }
 
8204
\end{list}
 
8205
 
 
8206
%==================================
 
8207
\subsubsection{Boundary conditions of velocity mesh}
 
8208
%==================================
 
8209
The boundary conditions can be managed with the Graphical User Interface (GUI)
 
8210
 or with the subroutine \texttt{usalcl} (called at each time step). In the GUI,
 
8211
 when the item ``Mobile mesh'' is activated  the item ``Fluid structure interaction''
 
8212
 appears under the heading ``Boundary conditions''. Two types of Fluid-structure
 
8213
 coupling are offered. The first one is internal, using a simplified structure
 
8214
 model and the second is external with \textit{Code\_Aster}, see figs.
 
8215
 \ref{fig:CL-ale1} and  \ref{fig:CL-ale2}.
 
8216
%
 
8217
\begin{figure}[ht]
 
8218
\begin{center}
 
8219
\includegraphics[width=12cm]{gui_ale_internal}
 
8220
\caption{Boundary conditions - internal coupling}
 
8221
\label{fig:CL-ale1}
 
8222
\end{center}
 
8223
\end{figure}
 
8224
%
 
8225
\begin{figure}[ht]
 
8226
\begin{center}
 
8227
\includegraphics[width=12cm]{gui_ale_external}
 
8228
\caption{Boundary conditions - external coupling}
 
8229
\label{fig:CL-ale2}
 
8230
\end{center}
 
8231
\end{figure}
 
8232
 
 
8233
\minititre{Subroutine \texttt{usalcl}}
 
8234
When the GUI is not used, the use of \texttt{usalcl} is mandatory to run
 
8235
 a calculation using
 
8236
the ale module just as it is in \texttt{usini1}. The way of using it
 
8237
is the same as the way of using \texttt{usclim} in the framework of
 
8238
standard calculations, that is to say a loop on the boundary faces
 
8239
marked out by their colour (or more generally by a property of their
 
8240
family), where the type of boundary condition of velocity mesh for
 
8241
each variable are defined.
 
8242
 
 
8243
The main numerical variables are described below.
 
8244
 
 
8245
\variab{ialtyb}{ialtyb(nfabor)}{ia}{In the ale module, the user
 
8246
defines the velocity mesh from the colour of the boundary faces, or
 
8247
more generally from their properties (colours, groups, ...), from the
 
8248
boundary conditions defined in \texttt{usclim}, or even from their
 
8249
coordinates. To do so, the array \texttt{ialtyb(nfabor)} gives for each face
 
8250
\texttt{ifac} the velocity mesh boundary condition types marked out by the key
 
8251
words \texttt{ivimpo\index{ivimpo}}, \texttt{igliss\index{igliss}},
 
8252
\texttt{ibfixe\index{ibfixe}}
 
8253
 
 
8254
\begin{list}{$\bullet$}{}
 
8255
 
 
8256
\item If \texttt{ialtyb=ivimpo}: imposed velocity.
 
8257
 
 
8258
\begin{list}{$\rightarrow$}{}
 
8259
\item In the case where all the nodes of a face have a imposed displacement,
 
8260
 it is not necessary to fill the tables with boundary conditions
 
8261
 velocity mesh for this face, they will be erased. In the other case,
 
8262
 the value of the Dirichlet must be given in \texttt{rcodcl(ifac,ivar,1)} for
 
8263
 every value of \texttt{ivar} (\texttt{iuma}, \texttt{ivma} and \texttt{iwma})
 
8264
 The other boxes of \texttt{rcodcl} and \texttt{icodcl} are completed automatically.
 
8265
 
 
8266
 The tangential velocity mesh is taken like a tape speed under the
 
8267
 boundary conditions of wall for the fluid, except if wall velocity
 
8268
 was specified by the user in the interface or usclim (in which case
 
8269
 it is this speed which is considered).
 
8270
\end{list}
 
8271
 
 
8272
 \item if \texttt{ialtyb(nfac) = ibfixe}: fixed wall
 
8273
\begin{list}{$\rightarrow$}{}
 
8274
 \item the velocity is null.
 
8275
\end{list}
 
8276
 
 
8277
 \item if \texttt{ialtyb(nfac) = igliss}:  sliding wall
 
8278
\begin{list}{$\rightarrow$}{}
 
8279
\item the tangential velocity is not used.
 
8280
\end{list}
 
8281
 
 
8282
\end{list}
 
8283
}
 
8284
 
 
8285
%==================================
 
8286
\subsubsection{Modification of the viscosity}
 
8287
%==================================
 
8288
 
 
8289
The user subroutine \texttt{usvima} is used along the ALE (Arbitrary Lagrangian Eulerian
 
8290
 Method) module, it fills mesh viscosity arrays. It is called at each time step.
 
8291
The user can modify mesh viscosity values to prevent cells and nodes from huge
 
8292
 displacements in awkward areas, such as boundary layer for example.
 
8293
If \texttt{iortvm} = 0, the mesh viscosity modelling is considered as isotropic and
 
8294
 therefore only the \texttt{viscmx} array needs to be filled.
 
8295
If \texttt{iortvm} = 1, mesh viscosity modeling is orthotropic therefore all arrays
 
8296
 \texttt{viscmy}, \texttt{viscmx}, and \texttt{viscmz} need to be filled.
 
8297
Note that \texttt{viscmx}, \texttt{viscmy} and \texttt{viscmz} arrays are initialized
 
8298
 at the first time step with the value 1.
 
8299
 
 
8300
%==================================
 
8301
\subsubsection{Fluid - Structure internal coupling}\label{sec:ALE}
 
8302
%==================================
 
8303
 
 
8304
In the subroutine \texttt{usstru} the user provides the parameters of two other subroutines.
 
8305
\texttt{usstr1} is called at the beginning of the calculation. It is used to define
 
8306
 and initialise the internal structures where Fluid-Structure coupling occurs.
 
8307
For each boundary face \texttt{ifac}, \texttt{idfstr(ifac)} is the number of the structure
 
8308
 the face belongs to (if \texttt{idfstr(ifac)} = 0, the face \texttt{ifac} doesn't belong
 
8309
 to any structure). When using internal coupling, structure number necessarily needs to be
 
8310
 positive. The number of "internal" structures is automatically defined with the maximum
 
8311
 value of the \texttt{idfstr} table, meaning that internal structure numbers must be defined
 
8312
 sequentially with positive values, beginning with integer value '1'.
 
8313
 
 
8314
For each internal structure one can define here:
 
8315
\begin{list}{-}{}
 
8316
 \item an initial velocity \texttt{vstr0}
 
8317
 \item an initial displacement \texttt{xstr0} (i.e. \texttt{xstr0} is the value of the
 
8318
 displacement \texttt{xstr} compared to the initial mesh at time t = 0)
 
8319
 \item a displacement compared to equilibrium  \texttt{xstreq} (i.e. \texttt{xstreq}
 
8320
 is the initial displacement of the internal structure compared to its position at
 
8321
 equilibrium; at each time step t and for a displacement \text{xstr}(t), the associated
 
8322
 internal structure will undergo a force $-k*(\text{}(t)+XSTREQ)$ due to the spring).
 
8323
\end{list}
 
8324
\text{xstr0} and \text{vstr0} are initialised with the value 0.
 
8325
When starting a calculation using ALE, or re-starting a calculation with ALE, based
 
8326
 on a first calculation without ALE, an initial iteration 0 is automatically performed
 
8327
 in order to take initial arrays \text{xstr0}, \text{vstr0} and \text{xstreq} into
 
8328
 account. In any other case, add the following expression '\text{italin=1}' in subroutine
 
8329
 \text{usalin}, so that the code can deal with the arrays \text{xstr0}, \text{vstr0} and \text{xstreq}.
 
8330
 
 
8331
When \texttt{ihistr} is set to 1, the code writes in the output the history of the
 
8332
 displacement, of the structural velocity, of the structural acceleration anf of the
 
8333
 fluid force. The value of structural history output step is the same as the one for
 
8334
 standard variables \text{nthist}.
 
8335
 
 
8336
The second subroutine, \text{usstr2}, is called at each iteration. One defines in this
 
8337
 subroutine structural parameters (considered as potentially time dependent): i.e.,
 
8338
 mass m \text{xmstru}, friction coefficients c \text{xcstru}, and stiffness k \text{xkstru}.
 
8339
 \text{forstr} array gives fluid stresses acting on each internal structure. Moreover it's
 
8340
 possible to take external forces (gravity for example ) into account, too.
 
8341
\begin{list}{.}{}
 
8342
 \item \text{xstr} array indicates the displacement of the structure compared to it
 
8343
s position in initial mesh,
 
8344
 \item \text{xstr0} array gives the displacement of the structures in initial mesh
 
8345
 compared to structural equilibrium,
 
8346
 \item \text{vstr} array stands for structural velocity.
 
8347
\end{list}
 
8348
\text{xstr}, \text{xstr0} and \text{vstr} are \text{DATA} tables that can be used to
 
8349
 define arrays Mass, Friction and Stiffness. Those are not to be modidfied.
 
8350
 
 
8351
The 3D structural equation that is solved is the following one :
 
8352
\begin{equation}\label{eq:FluidStruct}
 
8353
\displaystyle
 
8354
\tens{m}.\partial_{tt}\vect{x}+\tens{c}.\partial_{t}\vect{x}+\tens{k}.\left(\vect{x}+\vect{x_0}\right)=\vect{f},
 
8355
\end{equation}
 
8356
where $x$ stands for the structural displacement compared to initial mesh postition
 
8357
 \text{xstr}, $x_0$ represents
 
8358
 the displacement of the structure in initial mesh compared to equilibrium.
 
8359
Note that $\tens{m}$,$\tens{c}$, and $\tens{k}$ are 3\text{x}3 matrices.
 
8360
Equation \eqref{eq:FluidStruct} is solved using a Newmark HHT algorithm.
 
8361
Note that the time step used to solve this equation, \text{dtstr}, can be
 
8362
 different from the one of fluid calculations. The user is free to define \text{dtstr}
 
8363
 array. At the beginning of the calculation \text{dtstr} is initialised to the value of
 
8364
 \text{dtcel} (fluid time step).
 
8365
 
 
8366
%==================================
 
8367
\subsection{Management of the structure property}
 
8368
%==================================
 
8369
 
 
8370
The use of \texttt{usstr2} is mandatory to run a calculation using the ale
 
8371
 module with a structure module. It is called at each time step.
 
8372
 
 
8373
For each structure, the system that will be solved is:
 
8374
 
 
8375
\begin{equation}
 
8376
M.x^{''}+C.x^{''}+K.(x-x_{0} = 0
 
8377
\end{equation}
 
8378
 
 
8379
where
 
8380
 
 
8381
\begin{list}{-}{}
 
8382
 \item $M$ is the mass stucture (\texttt{xmstru}).
 
8383
 \item $C$ is the dumping coefficient of the stucture (\texttt{xcstru}).
 
8384
 \item $K$ is the spring constant or force constant of the stucture (\texttt{xkstru}).
 
8385
 \item $x_{0}$ is the initial position
 
8386
\end{list}
 
8387
 
 
8388
Below is a list of the different variables that might be modified:
 
8389
 
 
8390
\begin{list}{$\bullet$}{}
 
8391
 
 
8392
\item{\texttt{xmstru(i,j,k})} \\
 
8393
{the mass stucture of the structure, where \texttt{i},\texttt{j} is
 
8394
the array of mass structure and \texttt{k} the index of the structure.}
 
8395
 
 
8396
\item{\texttt{xcstru(i,j,k})}\\
 
8397
{dumping coefficient of the stucture, where \texttt{i},\texttt{j} is the array of
 
8398
dumping coefficient and \texttt{k} the index of the structure.}
 
8399
 
 
8400
\item{\texttt{xkstru(i,j,k)}}\\
 
8401
{spring constant of the stucture, where \texttt{i},\texttt{j} is the array of spring
 
8402
constant and \texttt{k} the index of the structure.}
 
8403
 
 
8404
\item{\texttt{forstr(i,k)}}\\
 
8405
{force vector of the stucture, where \texttt{i} is the force vector and
 
8406
\texttt{k} the index of the structure.}
 
8407
\end{list}
 
8408
 
 
8409
%==================================
 
8410
\subsection{Management of the Atmospheric module}
 
8411
%==================================
 
8412
%==================================
 
8413
\subsubsection{Initialisation of the variables}
 
8414
%==================================
 
8415
 
 
8416
The initialisation can be done in the Graphical User Interface (GUI)
 
8417
 or in the subroutine \texttt{usativ} (called only during the calculation
 
8418
 initialisation). Under the heading ``Thermophysical models'', when in the
 
8419
 item ``Calculation features'' one of the atmospheric flow model is selected,
 
8420
 it activates an item under the same heading:``Atmospheric flows'' where the
 
8421
 path leading to a file containing meteorological data must be specified, see
 
8422
 fig. \ref {fig:Ini-atmo}. In addition is the atmospheric flow model chosen is
 
8423
 the ``dry atmosphere'', an option appear the item ``Time step'' under the
 
8424
 heading ``Numerical parameters'' plus an additional variable ``PotTemp'' 
 
8425
in the table of the ``Equation parameters'' item.
 
8426
 
 
8427
\begin{figure}[ht]
 
8428
\begin{center}
 
8429
\includegraphics[width=12cm]{gui_atmo_read}
 
8430
\caption{Thermophysical models - atmospheric flows}
 
8431
\label{fig:Ini-atmo}
 
8432
\end{center}
 
8433
\end{figure}
 
8434
 
 
8435
When the GUI is not used, \texttt{usativ} allows to initialise or modify
 
8436
 (in case of a restarted calculation) the calculation variables and the 
 
8437
values of the time step. It plays a similar role as \texttt{usiniv} for 
 
8438
the additional variables introduced with the air-cooling module. The 
 
8439
quantities that can be initialised here in user-selected zones are:
 
8440
\begin{list}{-}{}
 
8441
 \item the air velocity with the array \texttt{rtp(iel,iu)} (with
 
8442
 \texttt{iv} and \texttt{iw} for the other components),
 
8443
 \item the air temperature with the array \texttt{rtp(iel,isca(ihumid))},
 
8444
 \item turbulent quantities depending on the turbulent model selected.
 
8445
\end{list}
 
8446
The example provided in the user file performs the initialisation of the 
 
8447
variables from meteorological profiles using the interpolation routine \texttt{intprf}.
 
8448
 
 
8449
%==================================
 
8450
\subsubsection{Non standard options}
 
8451
%==================================
 
8452
The subroutine \texttt{usati1} initialises non-standard parameters for 
 
8453
atmospherical calculations. These parameters are for instance:
 
8454
\begin{list}{-}{}
 
8455
 \item \texttt{imeteo},
 
8456
 \item \texttt{irovar} for each phase,
 
8457
 \item \texttt{ivivar} for each phase.
 
8458
\end{list}
 
8459
 
 
8460
%==================================
 
8461
\subsubsection{Management of the boundary conditions}
 
8462
%==================================
 
8463
 
 
8464
The user subroutine \texttt{usatcl} allows to define the boundary conditions of the variables
 
8465
 unknown by \texttt{usclim}. It is called at each time step. Boundary conditions are 
 
8466
applied to mesh faces selected using the subroutine '\texttt{getfbr}' for instance. For 
 
8467
each type of boundary condition, these faces are grouped as physical zones characterised
 
8468
 by an arbitrary number \texttt{izone} chosen by the user. If a boundary condition is 
 
8469
retrieved from a meteorological profile, the variable \texttt{iprofm(izone)} of the zone
 
8470
 must be set to 1.\\
 
8471
Examples are provided in \texttt{usatcl}.
 
8472
 
 
8473
%==================================
 
8474
\subsection{Cooling tower modelling}
 
8475
%==================================
 
8476
 
 
8477
%==================================
 
8478
\subsubsection{Parameters}
 
8479
%==================================
 
8480
 
 
8481
\noindent
 
8482
\textit{Subroutine called only during calculation initialisation? OR AT EACH ITERATION?.}
 
8483
 
 
8484
The subroutine \texttt{uscti1} contains calculation parameters such as:
 
8485
\begin{list}{-}{}
 
8486
 \item  temperature parameters,
 
8487
 \item  the number of exchange zones at various locations,
 
8488
 \item  the air properties.
 
8489
\end{list}
 
8490
 
 
8491
%==================================
 
8492
\subsubsection{Initialisation of the variables}
 
8493
%==================================
 
8494
 
 
8495
The subroutine \texttt{usctiv} allows to initialise or modify 
 
8496
(in case of a restarted calculation) the calculation variables and the
 
8497
 values of the time step. It is called only during the calculation 
 
8498
initialisation. It plays a similar role as \texttt{usiniv} for the 
 
8499
additional variables introduced with the air-cooling module. The 
 
8500
quantities that can be initialised here in user-selected zones are:
 
8501
\begin{list}{-}{}
 
8502
 \item the air temperature by filling the array \texttt{rtp(iel,isca(ihumid))},
 
8503
 \item the air humidity by filling the array \texttt{rtp(iel,isca(itemp4))},
 
8504
 \item the air velocity by filling the array \texttt{rtp(iel,iu)} (with
 
8505
 \texttt{iv} and \texttt{iw} for the other components),
 
8506
\end{list}
 
8507
where \texttt{iel} can be an element found in a list returned by the routine
 
8508
 '\texttt{getcel}'.
 
8509
 
 
8510
%==================================
 
8511
\subsubsection{Definition of the exchange zones}
 
8512
%==================================
 
8513
 
 
8514
The subroutine \texttt{usctdz} is used to define the exchange zones of a cooling
 
8515
 tower. The user provides the following parameters:
 
8516
\begin{list}{-}{}
 
8517
 \item \texttt{imzech}: its value is related to the model used:
 
8518
      \begin{list}{$\rightarrow$}{}
 
8519
       \item 0: no model is used,
 
8520
       \item 1: Merkel model is used,
 
8521
       \item 2: Poppe model is used,
 
8522
      \end{list}
 
8523
 \item 10 exchange zone parameters.
 
8524
\end{list}
 
8525
These arguments are passed to the subroutine '\texttt{defct}' along with a 
 
8526
geometrical selection criterion.
 
8527
 
 
8528
%==================================
 
8529
\subsubsection{Management of the boundary conditions}
 
8530
%==================================
 
8531
 
 
8532
The subroutine \texttt{usctcl}, called at each time step, allows to define 
 
8533
the boundary conditions of the variables unknown by \texttt{usclim}. Boundary
 
8534
 conditions are applied to mesh faces selected using the subroutine \texttt{getfbr}
 
8535
 for instance. For each type of boundary condition, these faces are grouped as 
 
8536
physical zones characterised by an arbitrary number \texttt{izone} chosen by the
 
8537
 user. The list of boundary conditions offered in this module is given below:
 
8538
\begin{list}{-}{}
 
8539
 \item Dirichlet,
 
8540
 \item flux density (velocities, pressure, scalar),
 
8541
 \item sliding wall (velocity),
 
8542
 \item friction (velocity),
 
8543
 \item roughness (velocity),
 
8544
 \item free inlet/outlet (velocity),
 
8545
 \item symmetry.
 
8546
\end{list}