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
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}.
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
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}}.
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.
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.
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}.
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, ...).
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,
250
& & or electric arcs)\\
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
267
& \texttt{SRC.08211921} &\CS user subroutines
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
274
& \texttt{RES\_USERS.08211921} &optional directory containing the
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
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
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
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
298
& \hspace*{0.3cm}\texttt{resus1}&\syrthes calculation restart file (1
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} © 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\\
262
& \texttt{runcase} © 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)\\
267
& \texttt{runcase} &launch script (which may contain batch
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}
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.
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).
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
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}
319
& &with the {\em syrthes2ensight} utility)\\
314
323
%==================================
315
324
\subsubsection{\CS Kernel library files}
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
1448
This option can be specified in the \texttt{domain.logging\_args} field
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).
1601
1458
\item \texttt{-h} or \texttt{--help}: to display a summary of the different
1602
1459
command line options.
1605
1462
%==================================
1606
\subsection{Parameters in the launch script}
1463
\subsection{Launch scripts}
1607
1464
%==================================
1608
1465
\label{prg_runcase}%
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.
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}).
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}).
1636
\item Manchester headers: definition of the headers for the batch system
1637
specific to the cluster of the University of Manchester
1639
\item \texttt{SOLCOM}: a value of 1 will pass the \texttt{-solcom} option to the
1640
Kernel (see \ref{prg_optappelnoy})
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})
1647
\item \texttt{CASE}: name of the case directory (automatically set by
1648
\texttt{code\_saturne~create}, see \S\ref{prg_architecture})
1650
\item \texttt{PARAM}: name of the Interface parameter file, if necessary (see
1651
\ref{prg_optappelnoy})
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).
1657
\item \texttt{COMMAND\_JOIN}: Preprocessor command line option for mesh joining (see
1658
\ref{prg_optappelecs})
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})
1663
\item \texttt{COMMAND\_PERIO}: Preprocessor command line option for the definition
1664
of periodic boundary conditions (see \ref{prg_optappelecs})
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
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).\\
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.
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.
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})
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}.
1713
\item \texttt{CS\_TMP\_PREFIX}: alternate temporary directory for the
1714
calculation (see \S\ref{prg_temporarydirectory})
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''
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''}
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''}
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
1739
\item \texttt{ARG\_CS\_OUTPUT}: options for the redirection of the standard
1740
output (see \ref{prg_optappelnoy})
1742
\item \texttt{ECHOCOMM}: level for the \texttt{--echo-comm} option of the Kernel
1743
command line (see \ref{prg_optappelnoy})
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.
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.
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
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
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
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.
1768
\item \texttt{RESTART\_IN}: directory containing the files for calculation
1771
\item \texttt{PREPROCESSOR\_OUTPUT\_IN}: \texttt{preprocessor\_ouput} file for a calculation in ``calculation'' mode (see \ref{prg_executionmodes})
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.
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
1781
\ref{prg_architecture}).
1783
\item \texttt{SYRTHES\_ENV}: name of the environment file for \syrthes (usually
1784
\texttt{syrthes.env}, as proposed in the launch script).
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}).
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
1794
\hspace*{0.5cm}\texttt{MPI}: for a coupling based on MPI messages (requires a
1796
\hspace*{0.5cm}\texttt{sockets}: for a coupling based on sockets
1798
\item \texttt{EXEC\_PREPROCESSOR}: execution mode for \CS preprocessor (see \ref{prg_executionmodes})
1800
\item \texttt{EXEC\_PARTITION}: execution mode for \CS partitionner (see \ref{prg_executionmodes})
1802
\item \texttt{EXEC\_KERNEL}: execution mode for \CS kernel (see \ref{prg_executionmodes})
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.
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).
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:
1492
\begin{list}{$\bullet$}{}
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
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.
1807
1528
%==================================
1808
1529
\subsection{Graphical User Interface}
1809
1530
%==================================
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.
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).
1928
%==================================
1929
\subsection{Face and cell mesh-defined properties and selection}
1930
%==================================
1931
\label{selection_criteria}
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
1938
\begin{list}{$\bullet$}{}
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.
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
1964
\item The MED format allow integer ``attributes'', though
1965
many tools working with this format ignore those
1966
and only handle 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).
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
1988
\item Using the MED format, it is preferable to use ``groups''
1989
to colors, as many tools ignore the latter.
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
2000
A few examples are given below:
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[])+
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:
2021
\verb+"First entry" or Wall\ or\ sym+\\
2022
\verb+entry or \plane or "noone's output"+
2024
The following operators and syntaxes are allowed (fully capitalized
2025
versions of keywords are also allowed, but mixed capitals/lowercase
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$"}\\
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{\^} \\
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]} \\
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.
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.
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. \\
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.
2105
%==================================
2106
\section{Preprocessing}
2107
%==================================
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.
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.
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.
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.
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.
2141
%==================================
2142
\subsection{\pcs options and sub-options\label{sec:optpcs_ssopt}}
2143
%==================================
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:
2153
\texttt{cs\_preprocess -m fluid.msh -j --fraction 0.2 --color 2 --color 3 -j}
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:
2160
\texttt{cs\_preprocess -m fluid.msh -j --fraction 0.2 -color 2 -j --color 3}
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).
2167
\subsubsection{Option files\label{sec:optpcs:input}}
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
2178
\begin{tabular}{l l}
2179
\texttt{--ensight} & \texttt{\# activate EnSight output}\\
2180
\texttt{--med} & \texttt{\# activate MED output}\\
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}\\
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.
2193
\subsubsection{Mesh selection\label{sec:optpcs:mesh}}
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.
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.
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.
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.
2219
\texttt{cs\_preprocess -m file.1 file.2 --format ideas -m branch.cgns --grp-cel section}
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.
2227
\subsubsection{Post-processing output\label{sec:optpcs:post}}
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.}
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}.
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.
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.
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
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.
2272
\subsubsection{Faces selection\label{sec:optpcs:select}}
2274
Selection of faces occurs at several levels, especially for conforming
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
2284
\pcs selection criteria are more limited than those
2285
used by th kernel, and are generated using the following sub-options:
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\\
2294
to use the complement of the indicated colors and groups\\
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.
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):
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}\\
2315
\subsubsection{Joining of non-conforming meshes\label{sec:optpcs:join}}
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.
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.
2332
One may also modify tolerance criteria using 2 sub-options:
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}.\\
2354
\includegraphics*[width=14cm]{join_tolerance}}
2355
\caption{Maximum intersection tolerance and faces normal angle
2356
\label{fig_join_tolerance}}
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.
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:
2375
\texttt{cs\_preprocess -m mesh.des -j --fraction 0.15 --color 2 -j}
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.
2383
\subsubsection{Periodicity\label{sec:optpcs:period}}
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).
2395
\includegraphics*[height=8cm]{join_periodic}}
2396
\caption{Matching of periodic faces
2397
\label{fig_join_periodic}}
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:
2406
\texttt{--angle} $\alpha$ \texttt{--dir} $dx$ $dy$ $dz$
2409
where $\alpha$ is the rotation angle in degrees and $(dx, dy, dz)$ defines
2410
the rotation axis (using the trigonometric orientation), or by:
2413
\texttt{--matrix} $m11$ $m12$ $m13$ $m21$ $m22$ $m23$ $m31$ $m32$ $m33$
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)
2422
defines the rotation matrix.
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.
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
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
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):
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}\\
2451
\subsubsection{Element orientation correction\label{sec:optpcs:orient}}
2453
We may active the possible element orientation correction using the
2454
\texttt{--reorient} option.
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.
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.
2470
\subsection{Environment variables\label{sec:envvpcs}}
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
2479
\envvar{CS\_PREPROCESS\_MEM\_LOG}
2481
Allows defining a file name in which memory allocation, reallocation,
2482
and freeing is logged.
2484
\envvar{CS\_PREPROCESS\_MIN\_EDGE\_LEN}
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.
2497
\envvar{CS\_PREPROCESS\_IGNORE\_IDEAS\_COO\_SYS}
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.
2504
\envvar{CS\_PREPROCESS\_JOIN\_MAX\_SUB\_FACES}
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
2517
\subsubsection{System environment variables\label{sec:envpcs:sys}}
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\}}.
2528
\subsection{Optional functionality\label{sec:pcs:lib_opt}}
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:
2538
\item CGNS library. In its absence, \hyperref[fmtdesc:cgns]{CGNS}
2539
format support is deactivated.
2541
\item \med-file library. In its absence, \hyperref[fmtdesc:med]{\med}
2542
format is simply deactivated.
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.
2554
\subsection{General remarks}
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.}
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
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.
2587
\subsection{Files passed to the Kernel\label{sec:pcs:mode_comm}}
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}.
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}
2598
%==================================
2599
\section{Partitioning for parallel runs\label{sec:parall}}
2600
%==================================
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.
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.
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.
2627
\subsection{Options\label{sec:optcmd:parall}}
2629
To list the partitioner's options, use the following command:
2630
{\tt cs\_partition~-h}
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:
2636
\texttt{cs\_partition 64 128 --no-write}
2638
\subsubsection{Ignore periodicity\label{sec:optcmdpart:noperiod}}
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.
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.
2653
\subsubsection{Partitioner choice\label{sec:optpart:partlib}}
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.
2660
\subsubsection{Simulation mode\label{sec:optpart:nowrite}}
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.
2666
\subsubsection{Environment variables\label{sec:optpart:envvar}}
2668
\envvar{CS\_PARTITION\_MEM\_LOG}
2670
Allows defining a file name in which memory allocations, reallocations,
2671
and frees will be logged.
2673
%==================================
2674
\section{Main variables}
1653
%==================================
1654
\subsection{User subroutines}
1655
%==================================
1656
%==================================
1657
\label{prg_ssprgutilis}
1658
%==================================
1659
\subsubsection{Preliminary comments}
1660
%==================================
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.
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}.
1673
%==================================
1674
\subsubsection{Main variables}
2675
1675
%==================================
2677
1677
This section presents a non-exhaustive list of the main variables which
4343
3157
\texttt{nomgrp} of the type \texttt{character*} and its lenght
4344
3158
\texttt{lngnom} of the type \texttt{integer}) may be used.
4348
%==================================
4349
\subsection{Initialisation of the main key words: \textmd{\texttt{usini1}}}
4350
%==================================
4353
\textit{Subroutine only called during calculation initialisation.}
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 ...\\
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}
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
3170
\begin{list}{$\bullet$}{}
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.
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
3196
\item The MED format allow integer ``attributes'', though
3197
many tools working with this format ignore those
3198
and only handle 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).
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
3220
\item Using the MED format, it is preferable to use ``groups''
3221
to colors, as many tools ignore the latter.
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
3232
A few examples are given below:
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[])+
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:
3253
\verb+"First entry" or Wall\ or\ sym+\\
3254
\verb+entry or \plane or "noone's output"+
3256
The following operators and syntaxes are allowed (fully capitalized
3257
versions of keywords are also allowed, but mixed capitals/lowercase
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$"}\\
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{\^} \\
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]} \\
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.
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.
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. \\
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.
3337
%==================================
3338
\section{Importing and Preprocessing Meshes}
3339
%==================================
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.
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.
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).
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.
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.
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.
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.
3375
%==================================
3376
\subsection{\pcs options\label{sec:optpcs}}
3377
%==================================
3379
Main choices are done using command-line options. For example:
3381
\texttt{cs\_preprocess --num 2 fluid.med}
3383
\noindent means that we read the second mesh defined in the
3384
\texttt{fluid.med} file, while:
3386
\texttt{cs\_preprocess --no-write --post-volume fluid.med fluid.msh}
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
3393
\subsubsection{Mesh selection\label{sec:optpcs:mesh}}
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
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.
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.
3414
\subsubsection{Post-processing output\label{sec:optpcs:post}}
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
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
3429
\subsubsection{Element orientation correction\label{sec:optpcs:orient}}
3431
We may activate the possible element orientation correction using the
3432
\texttt{--reorient} option.
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.
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.
3449
\subsection{Environment variables\label{sec:envvpcs}}
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
3458
\envvar{CS\_PREPROCESS\_MEM\_LOG}
3460
Allows defining a file name in which memory allocation, reallocation,
3461
and freeing is logged.
3463
\envvar{CS\_PREPROCESS\_MIN\_EDGE\_LEN}
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.
3476
\envvar{CS\_PREPROCESS\_IGNORE\_IDEAS\_COO\_SYS}
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.
3483
\subsubsection{System environment variables\label{sec:envpcs:sys}}
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\}}.
3494
\subsection{Optional functionality\label{sec:pcs:lib_opt}}
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:
3504
\item CGNS library. In its absence, \hyperref[fmtdesc:cgns]{CGNS}
3505
format support is deactivated.
3507
\item \med-file library. In its absence, \hyperref[fmtdesc:med]{\med}
3508
format is simply deactivated.
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.
3520
\subsection{General remarks}
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.}
3533
At this stage, volume elements are sorted by type, and the fluid domain
3534
post-processing output is generated if required.
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.
3548
\subsection{Files passed to the Kernel\label{sec:pcs:mode_comm}}
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).
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.
3558
%==================================
3559
\subsection{Mesh preprocessing%
3561
%==================================
3563
\subsubsection{Joining of non-conforming meshes}\label{sec:optpcs:join}
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}.
3575
\includegraphics[width=15cm]{gui_mesh_join}
3576
\caption{Conformal or non-conformal joining}
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.
3591
One may also modify tolerance criteria using 2 options:
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}; \\
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}.\\
3613
\includegraphics*[width=14cm]{join_tolerance}}
3614
\caption{Maximum intersection tolerance and faces normal angle
3615
\label{fig_join_tolerance}}
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.
3628
\subsubsection{Periodicity\label{sec:optpcs:period}}
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).
3638
This operation can also be performed by the solver and specified
3639
either using the GUI or the \texttt{cs\_user\_periodicity} function.
3643
\includegraphics*[height=8cm]{join_periodic}}
3644
\caption{Matching of periodic faces
3645
\label{fig_join_periodic}}
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
3655
%==================================
3656
\subsubsection{Parameters for conforming or non-conforming mesh joinings}
3657
%==================================
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:
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).
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:
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.
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.
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.
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
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:
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.
3699
The call to the subroutine '\texttt{setajp}' returns the value of these parameters.
3701
%==================================
3702
\subsubsection{Parameters for the periodicity}
3703
%==================================
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.
3710
\includegraphics[width=14cm]{gui_mesh_periodicity}
3711
\caption{Periodicity}
3712
\label{fig:periodicities}
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:
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).
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:
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.
3728
In addition, the user can modify advanced parameters in case problems occur during the joining step, or to get a better mesh quality:
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.
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.
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.
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
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:
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.
3760
The call to the routine '\texttt{setapp}' returns the value of these parameters.
3762
%==================================
3763
\subsubsection{Modification of the mesh geometry}
3764
%==================================
3766
\textit{Subroutines called only during the calculation initialisation.}
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.
3772
The user subroutine \texttt{cs\_user\_mesh\_modify} may be used
3773
for advanced modification of the main \texttt{cs\_mesh\_t}} structure.
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.}
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[]}}.
3791
%==================================
3792
\section{Partitioning for parallel runs\label{sec:parall}}
3793
%==================================
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.
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
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.
3816
\subsection{Options\label{sec:optcmd:parall}}
3818
To list the partitioner's options, use the following command:
3819
{\tt cs\_partition~-h}
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:
3825
\texttt{cs\_partition 64 128 --no-write}
3827
\subsubsection{Ignore periodicity\label{sec:optcmdpart:noperiod}}
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.
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.
3842
\subsubsection{Partitioner choice\label{sec:optpart:partlib}}
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.
3849
\subsubsection{Simulation mode\label{sec:optpart:nowrite}}
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.
3855
\subsubsection{Environment variables\label{sec:optpart:envvar}}
3857
\envvar{CS\_PARTITION\_MEM\_LOG}
3859
Allows defining a file name in which memory allocations, reallocations,
3860
and frees will be logged.
3863
%==================================
3864
\section{Basic modelling setup}
3865
%==================================
3867
%==================================
3868
\subsection{Initialisation of the main parameters}
3869
%==================================
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:
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}.
3894
\includegraphics[width=13cm]{gui_mobile_mesh}
3895
\caption{Mobile mesh option}
3902
\includegraphics[width=13cm]{gui_turbulence_models}
3903
\caption{Turbulence model selection}
3910
\includegraphics[width=13cm]{gui_thermal_scalar}
3911
\caption{Thermal scalar selection}
3918
\includegraphics[width=13cm]{gui_user_scal_def_init}
3919
\caption{Definition and initialisation of the scalars}
3926
\includegraphics[width=13cm]{gui_user_scal_phys_props}
3927
\caption{Associated physical properties of the scalars}
3934
\includegraphics[width=13cm]{gui_phys_prop_ref_pressure}
3935
\caption{Setting of the reference pressure}
3942
\includegraphics[width=13cm]{gui_fluid_props}
3943
\caption{Fluid properties}
3950
\includegraphics[width=13cm]{gui_gravity_hyd_pressure}
3951
\caption{Settings of the gravity and of the hydrostatic pressure}
3958
\includegraphics[width=13cm]{gui_time_step}
3959
\caption{Time step settings}
3966
\includegraphics[width=13cm]{gui_numerical_parameters}
3967
\caption{Numerical parameters for the main variables resolution}
3974
\includegraphics[width=13cm]{gui_global_res_parameters}
3975
\caption{Global resolution parameters}
3982
\includegraphics[width=13cm]{gui_time_averages}
3983
\caption{Management of time averaged variables}
3990
\includegraphics[width=13cm]{gui_output_log}
3991
\caption{Parameters of chronological logging options}
3992
\label{gui_output_log}
3998
\includegraphics[width=13cm]{gui_output_writers}
3999
\caption{Management of postprocessing writers}
4000
\label{gui_output_writers}
4006
\includegraphics[width=13cm]{gui_output_meshes}
4007
\caption{Management of postprocessing meshes}
4008
\label{gui_output_meshes}
4014
\includegraphics[width=13cm]{gui_output_1d_profiles}
4015
\caption{Management of 1D profiles of the solution}
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.
4364
4028
For more details about the different parameters, please refer to the key
4365
4029
word list (\S\ref{prg_motscles}).
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:
4377
4041
\begin{list}{$\bullet$}{}
4378
4042
\item \texttt{usipph}: \texttt{iturb} and \texttt{icp} (don't modify these
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).
4420
%==================================
4421
\subsection{Management of boundary conditions: \textmd{\texttt{usclim}}}
4081
\subsection{Selection of mesh inputs: \textmd{\texttt{cs\_user\_mesh\_input}}}
4422
4082
%==================================
4425
\textit{Subroutine called every time step.}
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.}
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.
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.
4105
%==================================
4106
%==================================
4107
\subsection{Non-default variables initialisation} \label{sec:usiniv}
4108
%==================================
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$
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}
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.
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.
4135
\minititre{Note: value of the time step}
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.
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).
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}.
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}.
4178
\includegraphics[width=13cm]{gui_bc_regions}
4179
\caption{Definition of the boundary conditions}
4186
\includegraphics[width=13cm]{gui_bc_parameters}
4187
\caption{Parameters of the boundary conditions}
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.
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}}).
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}
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 ...).
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.
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}}.
5078
%==================================
5079
\subsection{Non-default variables initialisation:
5080
\textmd{\texttt{usiniv}}}
5081
%==================================
5084
\textit{Subroutine only called during calculation initialisation.}
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$
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}
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.
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.
5112
\minititre{Note: value of the time step}
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 (
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.
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).
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).}
5150
%==================================
5151
\subsection{Non-standard management of the chronological record files:
5152
\textmd{\texttt{ushist}}}
5153
%==================================
5157
\textit{Subroutine called every time step}
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:
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.
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
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.
5191
\item Closing of the files (only at the last time step).
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.
5208
%==================================
5209
\subsection{User source terms in Navier-Stokes: \textmd{\texttt{ustsns}}}
5210
%==================================
5213
\textit{Subroutine called every time step}
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)}
4846
%==================================
4847
\subsubsection{Modification of the turbulent viscosity}
4848
%==================================
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.}
4863
%==================================
4864
\subsubsection{Modification of the variable $C$ of the dynamic LES model}
4865
%==================================
4868
\textit{Subroutine called every time step in the case of LES with the
4871
The subroutine \texttt{ussmag} is used to modify the calculation of the variable $C$ of
4872
the LES sub-grid scale dynamic model.
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.
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.
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}$.
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
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}\\
4907
In the framework of LES, the total viscosity (molecular + sub-grid) in
4908
$kg.m^{-1}.s^{-1}$ may be written in \CS:
4911
\mu_{\text{total}}&=&\mu+\mu_{\text{sub-grid}} &
4912
\text{\ \ if\ \ }\mu_{\text{sub-grid}}>0\\
4914
\text{\ \ otherwise }\\
4915
\text{with\ }\mu_{\text{sub-grid}}&=&\rho C \overline{\Delta}^2 ||\overline{S}||
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}.
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}}.
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}}$.
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
4938
C=\frac{\widetilde{M_{ij}L{ij}}}{\widetilde{M_{kl}M_{kl}}}
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
4945
C=\widetilde{\left[\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}\right]}
4948
{\em WARNING: The subroutine {\em\texttt{ussmag}} can be activated only when
4949
the dynamic model is used.}
4951
%==================================
4952
\subsection{User source terms}
4953
%==================================
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.
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
5240
4968
\begin{displaymath}
5241
4969
\left(\frac{\rho_i\Omega_i}{\Delta t_i}-\Omega_iS_{impl,i}\right)
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.
5566
%========================================
5567
\subsection{Thermal module in a 1D wall}
5568
%========================================
5571
\textit{subroutine called at every time step}
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.\\
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$).
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.}
5595
This procedure is called twice,on initialisation and again at each time step.
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
5613
\item \texttt{nppt1d(nfpt1d)\index{nppt1d}}: number of cells in the 1D mesh associated
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.
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.
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.}
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.
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
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
5655
The 3rd call, done at each time step, allows the imposition of boundary conditions
5656
and physical values in time.
5658
%==================================
5659
\subsection{ Initialization of the options of the variables related
5660
to the ale module: \textmd{\texttt{usalin}} and \textmd{\texttt{usstr1}} }
5661
%==================================
5664
\textit{Subroutine called at the start.}
5667
\minititre{Subroutine \texttt{usalin}}
5668
This subroutine completes \texttt{usini1}.
5670
\texttt{usalin} allows to set option for the ale module, and in
5671
particular to active the ale module
5673
\minititre{Subroutine \texttt{usstr1}}
5675
\texttt{usstr1} allows to specify for the structure module the
5676
following pieces of information:
5678
\item number of structure (\texttt{nbstru}).
5679
\item initial value of deplacement, velocity and acceleration
5680
(\texttt{xstr0}, \texttt{xstreq} and \texttt{vstr0}).
5683
Below is a list of the different variables that might be modified:
5685
\begin{list}{$\bullet$}{}
5687
\item{\texttt{nbstru}} \\
5688
{the number of structures}
5690
\item{\texttt{idfstr(i)}} \\
5691
{index of the structure, where I is the index of the face}
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}
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}
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 }
5706
%==================================
5707
\subsection{Management of the boundary conditions of velocity mesh related to the ale module: \textmd{\texttt{usalcl}}}
5708
%==================================
5712
\textit{Subroutine called every time step.}
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.
5723
The main numerical variables are described below.
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}}
5734
\begin{list}{$\bullet$}{}
5736
\item If \texttt{ialtyb=ivimpo}: imposed velocity.
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.
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).
5752
\item if \texttt{ialtyb(nfac) = ibfixe}: fixed wall
5753
\begin{list}{$\rightarrow$}{}
5754
\item the velocity is null.
5757
\item if \texttt{ialtyb(nfac) = igliss}: sliding wall
5758
\begin{list}{$\rightarrow$}{}
5759
\item the tangential velocity is not used.
5767
%==================================
5768
\subsection{Management of the structure property: \textmd{\texttt{usstr2}}}
5769
%==================================
5772
\textit{Subroutine called every time step.}
5774
The use of \texttt{usstr2}
5775
is obligatory to run a calculation using the ale module with a structure module.
5777
For each structure, the system that will be solved is:
5780
M.x^{''}+C.x^{''}+K.(x-x_{0} = 0
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
5792
Below is a list of the different variables that might be modified:
5794
\begin{list}{$\bullet$}{}
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.}
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.}
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.}
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.}
5814
%==================================
5815
\subsection{Modification of the turbulent viscosity: \textmd{\texttt{usvist}}}
5816
%==================================
5818
\textit{Subroutine called every time step.}
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.}
5833
%==================================
5834
%==================================
5835
\subsection{Modification of the variable $C$ of the dynamic LES model:
5836
\textmd{\texttt{ussmag}}}
5837
%==================================
5840
\textit{Subroutine called every time step in the case of LES with the
5843
This subroutine is used to modify the calculation of the variable $C$ of
5844
the LES sub-grid scale dynamic model.
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.
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.
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}$.
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
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}\\
5879
In the framework of LES, the total viscosity (molecular + sub-grid) in
5880
$kg.m^{-1}.s^{-1}$ may be written in \CS:
5883
\mu_{\text{total}}&=&\mu+\mu_{\text{sub-grid}} &
5884
\text{\ \ if\ \ }\mu_{\text{sub-grid}}>0\\
5886
\text{\ \ otherwise }\\
5887
\text{with\ }\mu_{\text{sub-grid}}&=&\rho C \overline{\Delta}^2 ||\overline{S}||
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}.
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}}.
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}}$.
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
5910
C=\frac{\widetilde{M_{ij}L{ij}}}{\widetilde{M_{kl}M_{kl}}}
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
5917
C=\widetilde{\left[\frac{M_{ij}L{ij}}{M_{kl}M_{kl}}\right]}
5920
{\em WARNING: The subroutine {\em\texttt{ussmag}} can be activated only when
5921
the dynamic model is used.}
5923
%==================================
5924
\subsection{Temperature-enthalpy and enthalpy-temperature conversions: \textmd{\texttt{usthht}}}
5925
%==================================
5928
\textit{Subroutine optionally called.}
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
5935
%==================================
5936
\subsection{Modification of the mesh geometry: \textmd{\texttt{usmodg}}}
5937
%==================================
5940
\textit{Subroutine called only during the calculation initialisation.}
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)
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.}\\
5954
%==================================
5955
\subsection{Management of the post-processing intermediate outputs: \textmd{\texttt{usnpst}}}
5956
%==================================
5959
\textit{Subroutine called every time step(even if the user hasn't moved it to the SRC directroy).}
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
%==================================
5318
%==================================
5319
\subsection{Management of the post-processing intermediate outputs}
5320
%==================================
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
5327
test is not performed.
5968
5329
For instance, a user who wants to generate post-processing outputs (also
5969
5330
called ``chronological outputs'') at
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.
6049
\item \texttt{indmod}: indicates if the post-processing (i.e. visualization) meshes
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)
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
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})
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.
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.
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.
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.
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}.
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.
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.
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.
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.
6131
The variables to post-process on the defined ``parts'' will be specified
6132
in the subroutine \texttt{usvpst}. ``
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.
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}.
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.
5504
The additional variables to post-process on the defined meshes
5505
will be specified in the subroutine \texttt{usvpst}. ``
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.}
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
%==================================
6147
5519
\textit{Subroutine called only for each modifiable ``part'', at every
6148
5520
active time step of an associated ``writer''.}
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).
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
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.
6315
5680
%==================================
6316
\subsection{Radiative thermal transfers in semi-transparent gray media}
6317
%==================================
6319
%==================================
6320
\subsubsection{Initialisation of the radiation main key words: \textmd{\texttt{usray1}}}
6321
%==================================
6324
\textit{Subroutine called only during calculation initialisation.}
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.} \\
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
6343
For more details about the different parameters, the user may refer to the
6344
key word list (\S\ref{prg_motscles}).
6347
%==================================
6348
\subsubsection{Management of the radiation boundary conditions:
6349
\textmd{\texttt{usray2}}}
6350
%==================================
6353
\textit{Subroutine called every time step.}
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:
6380
\begin{list}{$\bullet$}{}
6382
\item \texttt{\textbf{itpimp}}: wall face with imposed temperature,
6384
\item \texttt{\textbf{ipgrno}}: for a gray or black wall face, calculation of the
6385
temperature by means of a flux balance,
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.
6391
\item \texttt{\textbf{ifgrno}}: gray or black wall face to which a conduction
6394
\item \texttt{\textbf{ifrefl}}: reflecting wall face to which a conduction
6395
flux is imposed, which is equivalent to impose this flux directly
6401
Depending on the selected boundary condition type at every wall face,
6402
the code needs to be given some supplementary pieces of information:
6404
\begin{list}{$\bullet$}{}
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).
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.
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}).
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.
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
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
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
%==================================
6453
\textit{Subroutine called every time step.}
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.\\
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).}\\
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.
6474
%==================================
6475
\subsubsection{Encapsulation of the temperature-enthalpy conversion:
6476
\textmd{\texttt{usray4}}}
6477
%==================================
6480
\textit{Subroutine called every time step.}
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.\\
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.}\\
6493
The value of the argument \texttt{mode} allows to know in which direction the
6494
conversion will be made:
6495
\begin{list}{$\bullet$}{}
6497
\item \texttt{\textbf{mode = 1}}: the fluid enthalpy in the cell must be
6498
converted into temperature (in Kelvin),
6500
\item \texttt{\textbf{mode = -1}}: the wall temperature (\texttt{text}
6501
or \texttt{tparoi}, in Kelvin) must be converted into enthalpy.
6505
{\em WARNING: the value of \texttt{mode} is passed as argument and must not be
6506
modified by the user.}\\
6510
%==================================
6511
\subsection{Utilisation of a specific physics: \textmd{\texttt{usppmo}}}
5681
\subsection{Non-standard management of the chronological record files}
5682
%==================================
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:
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.
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
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.
5717
\item Closing of the files (only at the last time step).
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
5731
%==================================
5732
\section{Advanced modelling setup}
5733
%==================================
5735
%==================================
5736
\subsection{Use of a specific physics}
6512
5737
%==================================
6513
5738
\label{prg_usppmo}%
6515
\textit{Subroutine called only during calculation initialisation.}
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}).
5743
\includegraphics[width=14cm]{gui_thermo_phys_models}
5744
\caption{Thermophysical models selection}
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
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)
7259
%==================================
7260
\subsection{Management of Boundary Conditions of the electric arc: \texttt{uselcl}}
7261
%==================================
7265
\textit {sub routine called at each time step.}
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.
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
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).
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:
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.
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.}
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
7339
%==================================
7340
\subsection{Initialisation of the variables in the electric module}
7341
%==================================
7344
\textit{subroutine called only at the initialisation of the calculation}
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.
7351
{\em WARNING: For the specific physics, it is here that all varialbes are initialsed:
7352
\texttt{usiniv} is not used}
7354
This subroutine works like \texttt{usiniv}. The values of potential and its
7355
constiuents are initialised if required.
7357
It should be noted that the enthalpy is important.
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).
7369
%====================================
7370
\subsection { Initialisation of the variable options in the electric module}
7371
%==================================
7374
\textit{subroutine called at each time step}
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)}
7381
historical exits at the probes defined in \texttt{usini1} (\texttt{ihisvr(ipp)}
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}):
7390
\begin{list}{$\rightarrow$}{}
7391
\item Electric Arc Module:
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
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.
7407
\item Joule Module effect~:
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
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.
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}
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}.
7435
%==================================
7436
\subsection{Management of variable physical properties in the electric module}
7437
%==================================
7440
\textit{Subroutine called at each time step}
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.
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.}
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)
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}
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.
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
%==================================
7472
\textit{Subroutine called at each chronological output}
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}.
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:
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}$)
7484
specifically for the Joule module effect with \texttt{ippmod(ieljou)}=2~:
7486
\item gradient of imaginary potential in $V m^{-1}$
7487
\item density of real current in $A m^{-2}$
7489
specifically for the electric arc module with \texttt{ippmod(ielarc)}=2~:
7491
\item magnetic field in $T$ (\vect{B} = \vect{rot}\,\vect{A})
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)
7499
%==================================
7500
\subsection{Compressible module}
7501
%==================================
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:
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.
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}%
7521
\textit{Subroutine called every time step.}
7523
These subroutines complete \texttt{usini1}.
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.
7530
\texttt{uscfx2} allows to specify for the molecular thermal conductivity and
7531
the volumetric viscosity the following pieces of information:
7533
\item variable or not (\texttt{iviscv})
7534
\item reference value (\texttt{viscv0})
7537
%==================================
7538
\subsubsection{Management of the boundary conditions related to the
7539
compressible module: \textmd{\texttt{uscfcl}}}
7540
%==================================
7544
\textit{Subroutine called every time step.}
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.
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
7561
In the compressible module, the different available boundary conditions
7565
\item inlet/outlet for which everything is known
7566
\item supersonic outlet
7567
\item subsonic inlet
7574
%==================================
7575
\subsubsection{Ininitialisation of the variables related to the
7576
compressible module: \textmd{\texttt{uscfxi}}}
7577
%==================================
7580
\textit{Subroutine called only during calculation initialisation.}
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.
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
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}.
7599
%==================================
7600
\subsubsection{Compressible module thermodynamics: \textmd{\texttt{uscfth}}}
7601
%==================================
7604
\textit{This subroutine is called several times every time step (boundary conditions, physical properties, solving of the energy equation, ...).}
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.
7611
%==================================
7612
\subsubsection{Management of the variable physical properties in the
7613
compressible module: \textmd{\texttt{uscfpv}}}
7614
%==================================
7617
\textit{Subroutine called every time step.}
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}.
7623
The user should make sure that the defined variation laws are valid for
7624
the whole variation range of the variables.
7626
%==================================
7627
\subsection{Lagrangian modeling of multiphasic flows with dipersed inclusions}
7628
%==================================
7631
%==================================
7632
\subsubsection{Initialisation of the main key words in the Lagrangian
7633
modeling: \textmd{\texttt{uslag1}}}
7634
%==================================
7637
\textit{Subroutine called only during calculation initialisation.}
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
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.
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.
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}.
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.
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:
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}.
6598
%==================================
6599
\subsubsection{Initialisation of the options of the variables}
6600
%==================================
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:
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
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.
6611
%==================================
6612
\subsection{Radiative thermal transfers in semi-transparent gray media}
6613
%==================================
6614
%==================================
6615
\subsubsection{Initialisation of the radiation main parameters}
6616
%==================================
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.
6622
\includegraphics[width=13cm]{gui_rad_transf_models}
6623
\caption{Radiative transfers models}
6630
\includegraphics[width=10cm]{gui_rad_transf_do_params}
6631
\caption{Radiative transfers - parameters of the DO method}
6638
\includegraphics[width=7cm]{gui_rad_transf_do_advanced}
6639
\caption{Radiative transfers - advanced parameters of the DO method}
6646
\includegraphics[width=10cm]{gui_rad_transf_p1_params}
6647
\caption{Radiative transfers - parameters of the P-1 model}
6654
\includegraphics[width=7cm]{gui_rad_transf_p1_advanced}
6655
\caption{Radiative transfers - advanced parameters of th P-1 model}
6662
\includegraphics[width=6cm]{gui_rad_transf_post_output}
6663
\caption{Calculation control - Radiative transfers postprocessign output}
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.} \\
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
6684
For more details about the different parameters, the user may refer to the
6685
key word list (\S\ref{prg_motscles}).
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}.
6695
\includegraphics[width=11cm]{gui_rad_transf_wall_model}
6696
\caption{Boundary conditions - choice of wall thermal radiative transfers}
6703
\includegraphics[width=11cm]{gui_rad_transf_wall_params}
6704
\caption{Boundary conditions - example of wall thermal radiative transfer}
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:
6733
\begin{list}{$\bullet$}{}
6735
\item \texttt{\textbf{itpimp}}: wall face with imposed temperature,
6737
\item \texttt{\textbf{ipgrno}}: for a gray or black wall face, calculation of the
6738
temperature by means of a flux balance,
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.
6744
\item \texttt{\textbf{ifgrno}}: gray or black wall face to which a conduction
6747
\item \texttt{\textbf{ifrefl}}: reflecting wall face to which a conduction
6748
flux is imposed, which is equivalent to impose this flux directly
6754
Depending on the selected boundary condition type at every wall face,
6755
the code needs to be given some supplementary pieces of information:
6757
\begin{list}{$\bullet$}{}
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).
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.
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}).
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.
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
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
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.\\
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).}\\
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.
6822
%==================================
6823
\subsubsection{Encapsulation of the temperature-enthalpy conversion}
6824
%==================================
6827
\textit{Subroutine called every time step.}
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.\\
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.}\\
6840
The value of the argument \texttt{mode} allows to know in which direction the
6841
conversion will be made:
6842
\begin{list}{$\bullet$}{}
6844
\item \texttt{\textbf{mode = 1}}: the fluid enthalpy in the cell must be
6845
converted into temperature (in Kelvin),
6847
\item \texttt{\textbf{mode = -1}}: the wall temperature (\texttt{text}
6848
or \texttt{tparoi}, in Kelvin) must be converted into enthalpy.
6852
{\em WARNING: the value of \texttt{mode} is passed as argument and must not be
6853
modified by the user.}\\
6855
%==================================
6856
\subsubsection{Input of radiative transfer parameters}
6857
%==================================
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}
6863
In this subroutine, during the first call (\texttt{iappel=1}), the boundary conditions
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.
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.
6883
%==================================
6884
\subsection{Conjugate heat transfers}
6885
%==================================
6886
%========================================
6887
\subsubsection{Thermal module in a 1D wall}
6888
%========================================
6891
\textit{subroutine called at every time step}
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.\\
6903
The use of this code requires that the thermal scalar is
6904
defined as (\texttt{iscalt}$>0$).
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.}
6915
This procedure is called twice,on initialisation and again at each time step.
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
6933
\item \texttt{nppt1d(nfpt1d)\index{nppt1d}}: number of cells in the 1D mesh associated
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.
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.
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.}
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.
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
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
6975
The $3^{rd}$ call, done at each time step, allows to impose boundary conditions
6976
and physical values in time.
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.
6992
\includegraphics[width=8cm]{gui_syrthes_coupling}
6993
\caption{Thermophysical models - coupling with \syrthes}
6998
If the subroutine \texttt{ussyrc} is used, the user must specify the arguments
6999
passed to the subroutine '\texttt{defsyr}'. These arguments are:
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.
7009
Examples are provided in '\texttt{ussyrc}'.
7012
%==================================
7013
\subsection{Lagrangian modeling of multiphase flows with dipersed inclusions}
7014
%==================================
7016
%==================================
7017
\subsubsection{Initialisation of the Lagrangian
7018
modeling parameters}\label{sec:Ini-lag}
7019
%==================================
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}.
7038
\includegraphics[width=12cm]{gui_lagr_global_settings}
7039
\caption{Lagrangian module - global settings}
7040
\label{fig:Ini-Lag1}
7046
\includegraphics[width=10cm]{gui_lagr_global_settings_coal}
7047
\caption{Lagrangian module - global settings, specific physics}
7048
\label{fig:Ini-Lag2}
7054
\includegraphics[width=8cm]{gui_lagr_global_advanced}
7055
\caption{Lagrangian module - global settings, advanced numerical options}
7056
\label{fig:Ini-Lag3}
7062
\includegraphics[width=11cm]{gui_lagr_statistics}
7063
\caption{Lagrangian module - statistics}
7064
\label{fig:Ini-Lag4}
7070
\includegraphics[width=11cm]{gui_lagr_output}
7071
\caption{Lagrangian module - output}
7072
\label{fig:Ini-Lag5}
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
8239
7678
%==================================
8240
\subsubsection{Particle relaxation time: \textmd{\texttt{uslatp}}}
7679
\subsubsection{Particle relaxation time}
8241
7680
%==================================
8244
\textit{Subroutine called every Lagrangian sub-step.}
8247
An intervention in this subroutine is not obligatory.
8250
In this subroutine, the particle relaxation time may be modified
7683
An intervention in this subroutine is not mandatory.
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}.
8255
7691
%==================================
8256
\subsubsection{Particle thermal characteristic time: \textmd{\texttt{uslatc}}}
7692
\subsubsection{Particle thermal characteristic time}
8257
7693
%==================================
8260
\textit{Subroutine called every Lagrangian sub-step.}
8263
An intervention in this subroutine is not obligatory.
8266
In this subroutine, the particle thermal characteristic time may be
8267
modified according to the chosen correlation for the calculation of the
7696
An intervention in this subroutine is not mandatory.
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}.
7706
%==================================
7707
\subsection{Compressible module}
7708
%==================================
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:
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.
7722
%==================================
7723
\subsubsection{ Initialisation of the options of the variables}
7724
%==================================
7725
\label{prg_uscfx12}%
7727
\textit{Subroutines called at each time step.}
7729
The subroutines \texttt{uscfx1} and \texttt{uscfx2} complete \texttt{usini1}.
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.
7736
\texttt{uscfx2} allows to specify for the molecular thermal conductivity and
7737
the volumetric viscosity the following pieces of information:
7739
\item variable or not (\texttt{iviscv})
7740
\item reference value (\texttt{viscv0})
7743
%==================================
7744
\subsubsection{Management of the boundary conditions}
7745
%==================================
7748
\textit{Subroutine called every time step.}
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.
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
7765
In the compressible module, the different available boundary conditions
7769
\item inlet/outlet for which everything is known
7770
\item supersonic outlet
7771
\item subsonic inlet
7777
%==================================
7778
\subsubsection{Initialisation of the variables}
7779
%==================================
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.
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
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}.
7799
%==================================
7800
\subsubsection{Thermodynamics}
7801
%==================================
7804
\textit{The subroutine \texttt{uscfth} is called several times at each time step
7805
(boundary conditions, physical properties, solving of the energy equation, ...).}
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.
7812
%==================================
7813
\subsubsection{Management of variable physical properties}
7814
%==================================
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}.
7820
The user should make sure that the defined variation laws are valid for
7821
the whole variation range of the variables.
7823
%==================================
7824
\subsection{Management of the electric arc module}
7825
%==================================
7826
%==================================
7827
\subsubsection{Initialisation of the variables}
7828
%==================================
7831
\textit{subroutine called only at the initialisation of the calculation}
7833
The subroutine \texttt{useliv} allows the user to initialise some of the specific
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.
7839
{\em WARNING: For the specific physics, it is here that all variables are initialised:
7840
\texttt{usiniv} is not used}
7842
This subroutine works like \texttt{usiniv}. The values of potential and its
7843
constituents are initialised if required.
7845
It should be noted that the enthalpy is relevant.
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
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).
7859
%==================================
7860
\subsubsection{Variable physical properties}
7861
%==================================
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.
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.}}
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)
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}
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.
7887
%==================================
7888
\subsubsection{Boundary Conditions}
7889
%==================================
7891
\minititre{Subroutine \texttt{uselcl}}
7893
\textit {subroutine called at each time step.}
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.
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
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).
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:
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.
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.}
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
7967
\minititre{Subroutine \texttt{usetcl}}
7969
\textit{Subroutine called every time step.}
7971
This subroutine is compulsory when the electrical module is used. It
7972
manages the boundary conditions for variables unknown by \texttt{usclim}.
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.
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.
7984
%====================================
7985
\subsubsection {Initialisation of the variable options}
7986
%==================================
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)}
7995
historical exits at the probes defined in \texttt{usini1} (\texttt{ihisvr(ipp)}
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}):
8007
\begin{list}{$\rightarrow$}{}
8008
\item Electric Arc Module:
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
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.
8025
\item Joule Module effect~:
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
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.
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}
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}
8059
%==================================
8060
\subsubsection[{\em EnSight} output]
8061
{Post-processing output}
8062
%==================================
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
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:
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}$)
8075
specifically for the Joule module effect with \texttt{ippmod(ieljou)}=2~:
8077
\item gradient of imaginary potential in $V m^{-1}$
8078
\item density of real current in $A m^{-2}$
8080
specifically for the electric arc module with \texttt{ippmod(ielarc)}=2~:
8082
\item magnetic field in $T$ (\vect{B} = \vect{rot}\,\vect{A})
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)
8090
%==================================
8091
\subsection{\CS-\CS coupling}
8092
%==================================
8095
\textit{Subroutine called once during the calculation initialisation.}
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:
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.
8118
%==================================
8119
\subsection{Fluid-Structure external coupling}
8120
%==================================
8123
\textit{???Subroutine called only once or at each iteration???.}
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
8131
The subroutine performs the following operations:
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
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.
8142
%==================================
8143
\subsection{ALE module}
8144
%==================================
8145
%==================================
8146
\subsubsection{Initialisation of the options}
8147
%==================================
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}.
8157
\includegraphics[width=12cm]{gui_ale_mei}
8158
\caption{Thermophysical models - mobile mesh (ALE method)}
8163
The following paragraphs are relevant if the GUI is not used.
8165
\minititre{Subroutine \texttt{usalin}}
8167
\textit{Subroutine called at the start.}
8168
This subroutine completes \texttt{usini1}.
8170
\texttt{usalin} allows to set option for the ale module, and in
8171
particular to active the ale module
8173
\minititre{Subroutine \texttt{usstr1}}
8175
\texttt{usstr1} allows to specify for the structure module the
8176
following pieces of information:
8178
\item number of structure (\texttt{nbstru}).
8179
\item initial value of deplacement, velocity and acceleration
8180
(\texttt{xstr0}, \texttt{xstreq} and \texttt{vstr0}).
8183
Below is a list of the different variables that might be modified:
8185
\begin{list}{$\bullet$}{}
8187
\item{\texttt{nbstru}} \\
8188
{the number of structures}
8190
\item{\texttt{idfstr(i)}} \\
8191
{index of the structure, where I is the index of the face}
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}
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}
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 }
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}.
8219
\includegraphics[width=12cm]{gui_ale_internal}
8220
\caption{Boundary conditions - internal coupling}
8227
\includegraphics[width=12cm]{gui_ale_external}
8228
\caption{Boundary conditions - external coupling}
8233
\minititre{Subroutine \texttt{usalcl}}
8234
When the GUI is not used, the use of \texttt{usalcl} is mandatory to run
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.
8243
The main numerical variables are described below.
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}}
8254
\begin{list}{$\bullet$}{}
8256
\item If \texttt{ialtyb=ivimpo}: imposed velocity.
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.
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).
8272
\item if \texttt{ialtyb(nfac) = ibfixe}: fixed wall
8273
\begin{list}{$\rightarrow$}{}
8274
\item the velocity is null.
8277
\item if \texttt{ialtyb(nfac) = igliss}: sliding wall
8278
\begin{list}{$\rightarrow$}{}
8279
\item the tangential velocity is not used.
8285
%==================================
8286
\subsubsection{Modification of the viscosity}
8287
%==================================
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.
8300
%==================================
8301
\subsubsection{Fluid - Structure internal coupling}\label{sec:ALE}
8302
%==================================
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'.
8314
For each internal structure one can define here:
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).
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}.
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}.
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.
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.
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.
8351
The 3D structural equation that is solved is the following one :
8352
\begin{equation}\label{eq:FluidStruct}
8354
\tens{m}.\partial_{tt}\vect{x}+\tens{c}.\partial_{t}\vect{x}+\tens{k}.\left(\vect{x}+\vect{x_0}\right)=\vect{f},
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).
8366
%==================================
8367
\subsection{Management of the structure property}
8368
%==================================
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.
8373
For each structure, the system that will be solved is:
8376
M.x^{''}+C.x^{''}+K.(x-x_{0} = 0
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
8388
Below is a list of the different variables that might be modified:
8390
\begin{list}{$\bullet$}{}
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.}
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.}
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.}
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.}
8409
%==================================
8410
\subsection{Management of the Atmospheric module}
8411
%==================================
8412
%==================================
8413
\subsubsection{Initialisation of the variables}
8414
%==================================
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.
8429
\includegraphics[width=12cm]{gui_atmo_read}
8430
\caption{Thermophysical models - atmospheric flows}
8431
\label{fig:Ini-atmo}
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:
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.
8446
The example provided in the user file performs the initialisation of the
8447
variables from meteorological profiles using the interpolation routine \texttt{intprf}.
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:
8455
\item \texttt{imeteo},
8456
\item \texttt{irovar} for each phase,
8457
\item \texttt{ivivar} for each phase.
8460
%==================================
8461
\subsubsection{Management of the boundary conditions}
8462
%==================================
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
8471
Examples are provided in \texttt{usatcl}.
8473
%==================================
8474
\subsection{Cooling tower modelling}
8475
%==================================
8477
%==================================
8478
\subsubsection{Parameters}
8479
%==================================
8482
\textit{Subroutine called only during calculation initialisation? OR AT EACH ITERATION?.}
8484
The subroutine \texttt{uscti1} contains calculation parameters such as:
8486
\item temperature parameters,
8487
\item the number of exchange zones at various locations,
8488
\item the air properties.
8491
%==================================
8492
\subsubsection{Initialisation of the variables}
8493
%==================================
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:
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),
8507
where \texttt{iel} can be an element found in a list returned by the routine
8510
%==================================
8511
\subsubsection{Definition of the exchange zones}
8512
%==================================
8514
The subroutine \texttt{usctdz} is used to define the exchange zones of a cooling
8515
tower. The user provides the following parameters:
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,
8523
\item 10 exchange zone parameters.
8525
These arguments are passed to the subroutine '\texttt{defct}' along with a
8526
geometrical selection criterion.
8528
%==================================
8529
\subsubsection{Management of the boundary conditions}
8530
%==================================
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:
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),