capitolo 6

The XENIOS code HB
The XENIOS code hand-book
Index
1
Foreword
2
The code base structure
3
XENIOS flow chart
4
XENIOS input file and cards
5
How to run XENIOS with sequential solver
6
How to run XENIOS with parallel solver
7
Appendices. A, B, C
1
Foreword
The present handbook describes the finite-element computer code XENIOS, written
in FORTRAN, devoted to the analysis of viscous, steady (statistically steady when
considering turbulent flows) and unsteady flows.
The program features a modular structure, aimed at making future developments
easier; initially developed for two-dimensional laminar flows, it is now capable of
handling chemically reacting turbulent flows in two- and three-dimensional geometries.
XENIOS has represented a useful testbed to test improved numerical techniques. The program,
originally conceived as a classical finite-element method, has later adopted stabilization
techniques based on the Petrov - Galerkin formulation (Streamline Upwind/Petrov-Galerkin, and
Pressure Stabilized /Petrov-Galerkin) which proved capable of containing instability effects
typical of the classical Galerkin method, while at the same time ensuring a high degree of
accuracy.
Further, the push to increase the complexity of test cases that can be tackled has led to the
application of single and multiple level parallel solution strategies, based on Generalized
Minimal Residual techniques (GMRES) like linear solver with building procedures of the
stiffness matrix based on unassembled structures.
DMA – University of Rome “La Sapienza”, September 2003
1
The XENIOS code HB
The first version of the code was laid in 1991, and focused on two aspects: the modularity of the
base structure, so as to allow straightforward code extensions, and the memory management
through dynamic allocation techniques. The latter aspect allows handling problems involving a
very large number of unknowns while reducing the memory storage to a minimum.
In the following, a detailed flow-chart of the code in its current version is reported,
with a description of the main subroutines is given.
Further, the meaning of the individual cards comprising an input file in its most
general form is made clear. Finally, two “How to” sections give the protocols for
running XENIOS with sequential and parallel solution techniques.
2
The code base structure
The basic code structure is given in Fig. 1.
PRE-PROCESSAZIONE
DATI
DI INPUT

XENIOS
SOLUZIONE
E
STAMPA DEI RISULTATI

POST-PROCESSAZIONE
DEI RISULTATI
XEGRAF
Fig. 1 - Basic structure of the finite elent code XENIOS
Actually, the code is interfaced with mesh data file formats provided by the most
popular commercial grid-generator (e.g. GAMBIT).
2.1
Memory management
Within XENIOS, all data are stored in central memory via the FORTRAN statement:
COMMON / BLANK / A (MTOT)
DMA – University of Rome “La Sapienza”, September 2003
2
The XENIOS code HB
where the array dimension MTOT must be specified once and for allin the main program
routine, named XENIOS; this in turn calls subroutines INPUT and DRIVER/DRIVEI
which handle the two dashed box in Fig. 1.
Vector A is used to store all variables required for problem solution. The dimension
of each variable is assigned while executing the probgram trough a technique named
"Dynamic Memory Allocation”. Each variable in A can be addressed through
appropriate pointers, also contained in vector A.
It is noted that, before subdividing the integration domain in elements, it is first
subdivided in groups of elements, in order to make grid generation easier in complex
flows, and to allow interfacing zones with different physical characteristics, and
discretized with elements of different form (this features enables using unstructured
meshes, by refining the computational grid only where strictly required).
The structure of vector A in a case where the integration domain consists of two
groups only is given in Fig. 2.
Fig. 2 - Structure of the global vector A
It is noted that the top of vector A contains the initial addresses of variables of groups
1 and 2, plus a series of vectors referring to the whole problem. Then, the parts referring
to each group first feature a series of integer variables, and then the pointers to the arrays
in the group.
DMA – University of Rome “La Sapienza”, September 2003
3
The XENIOS code HB
Should, for a given problem, the value chosen for MTOT turn out to be too low, the
code signals that the memory boundaries have been violated, and allows restarting the
simulation by specifying a new value of MTOT; if this is not the case, PRTDC prints out
a dictionary listing all variables with their pointers and the memory required by the
whole program. This enables making the most appropriate choice for the value of A.
DMA – University of Rome “La Sapienza”, September 2003
4
The XENIOS code HB
3
XENIOS flow chart
Figure 1 stresses that the preprocessing and solution are held distinct in the program.
The XENIOS code could simulate several flow conditions, by using different fluid
modelling for turbulence and combustion phenomena. The set of flow problems and
active degrees of freedom (DOF) are below resumed:
Problem code
Problem type
DOFs
IOPT1
laminar iso-thermal
velocity components: UX, UY, UZ
pressure: PR
IOPT2
laminar thermal
velocity components: UX, UY, UZ
pressure: PR
temperature : TE
IOPT3
turbulent iso-thermal
velocity components: UX, UY, UZ
(first order turbulence
pressure: PR
closures)
turbulent kinetic energy: KI
dissipation variable: DI
IOPT4
turbulent reacting
velocity components: UX, UY, UZ
pressure: PR
temperature or conserved scalar: TE
turbulent kinetic energy: KI
dissipation variable: DI
conserved scalar variance: G1
IOPT5
turbulent iso-thermal
velocity components: UX, UY, UZ
(second order turbulence
pressure: PR
closures)
turbulent kinetic energy: KI
dissipation variable: DI
turbulent stress tensor components:
T1 – T6
elliptic blending variable: AA
DMA – University of Rome “La Sapienza”, September 2003
5
The XENIOS code HB
In what follow, Figures 3 and 4 report a detailed flow chart of the two phases, with
reference to the solution of a turbulent flow (IOPT3). In this chart, small letters denote
"functions", and capital letters denote “subroutines".
DMA – University of Rome “La Sapienza”, September 2003
6
XENIOS Hand book
inpkey
INPDYM
INPJOB
SETTRB
mpoint
clear
inpclr
dctnry
mpoint
rdfext
dctnry
INPAV
INPMH
INPCV
INPBC
INPUT
inpkey
iclear
clear
inpkey
BCGEN
INPIC
clear
inpkey
ICGEN
INPRL
clear
inpkey
mpoint
ELCARD
dctnry
INPEL
SETEL
INPNR
XENIOS
ctrky1
INPPL
INPTC
INPOR
dctnry

JACB27
PROP2D
GENEL
SFGL
GENEL1
GENELD
GENELI
inpkey
iclear
clear
NRGEN
inpkey
mpoint
iclear
clear
SETNR1
SETNR2
dctnry
IDPRE27
INPID
IDPRE
SETID
mpoint
iclear
INPLM
INPLM1
FORMLM
COLHT
INPNRM
INP3Q9
mpoint
INPWRK
NWL927
IWL927
NFL927
IFL927
NPE927
IPE927
SETNRM
local
JACB9
move
clear
rowdot
dctnry
RESIN
EQSET
Fig. 3. -
DIAG
mpoint
dctnry
Flow chart of code XENIOS, data pre-processing for a turbulent flow problem
DMA – University of Rome “La Sapienza”, September 2003
7
XENIOS Hand book
clear
ITRUP1
COMBC
ELEMWL
ELEMNT
WLLIB
ELMLIB
WALL9
QUADC9
DISSBC
QDC293
QDFLUX
QDWALL
XYDOF
clear
local
SFGD
move
rowdot
NINTCL
RHOBIN
DIFFTE
EMCNNR
EMDFT2
EMDFTR
EMCV
TRBDIS
TRBPRO
MOMROT
ADDLHS
ADDRHS
LOADBC
DRIVER
XENIOS
RESGEN
NRMGEN
NRMDOF
CONVER
GMRES
TIMING
PIVOTS
PRINTP
BACK
TIMING
RLXGEN
ITRCLP
NRMGEN
NRMGEN
ITERUP
ELEMWL
RESOUT
XYDOF
PRINTD
BASIS
UPDATE
WLLIB
WALL9
DISSBC
TIMING
Fig. 4-
Flow chart of code XENIOS, solution of a turbulent flow problem
DMA – University of Rome “La Sapienza”, September 2003
8
XENIOS Hand book
The main objectives of the most important subroutines used during the preprocessing and solution phases (which appear in Figs. 3 and 4) are outlined in the
following.
INPUT:
Manages the data acquisition, and in part their pre-processing.
INPJOB:
Selects default values of cards identyifying the problem under
consideration, and replaces them with values specified in input file, when
appropriate.
On the basis of the nature of the problem to be solved, sets up arrays
LNDOF and LPOINT containing the active degrees of freedom and the
position of each degree of freeedom in the element stiffness matrix.
INPAV:
Reads from input file the values of multiplicative factors in the expression
of the perturbatting function of SU/PG and PS/PG.
INPMH:
Reads information concerning the computational grid and sets up the
cordinate array.
INPCV:
Reads from input file the value of the maximum error allowed for the
solution and residual, for convergence check.
INPBC:
Reads from input file the Dirichlet’s boundary conditions and sets uo array
F , containing them.
INPIC:
Reads from input file the initial conditions for the problem, and feeds them
into the solution array D.
INPRL:
Reads the relaxation factor assigned to each degree of freedom, and feeds
them to array RLX.
INPEL:
Manages the subroutines For processing the information relevant to each
element group.
Calls
subroutine
ELCARD
reading
and
checking
"minor-cards"
characterizing the element type.
Through subroutine SETEL selects the element form; for instance, if
elements with a second-order shape function have been chosen, calls
subroutine INP3Q9.
DMA – University of Rome “La Sapienza”, September 2003
9
XENIOS Hand book
INP3Q9:
Sets up pointers to the position the arrays occupy in the dynamic memory,
calls INPWRK which in turn manages the shape function computation, feed
the element physical properties into array AMAT, genererates connection
matrix IEN. Further, INP3Q9 generates the wall elements, elements where
flux-type boundary conditions are enforced, and periodic elements..
INPNR:
Allocates pointers for the dynamic memory of arrays DCNRM and NTD ,
which contains the director cosines of unit tensors both normal and tangent,
and the numbering of node elements, for which a local reference set has to
be identified..
In INPNR only set values are allocated in the above vectors.
INPPL:
Constitutes the link between program XENIOS and the graphycal postprocessing program XEGRAF (See Fig. 1.).
INPTC:
Reads turbulence model constants.
INPOR:
Selects and manages the model for optimal equation renumbering
INPNRM:
Computes director cosines of the local reference set Edefined at wall
elements, and fedds computed values in arrays DCNRM and NTD.
INPID:
Manages the creation of array ID , containing equation numbering, and
allocates the dynamic memory of arrays DPRED (solution at previous
iteration), RESID (residual of algebraic system of discrete equations);
IDIAG (addresses of diagonal elements of global stiffness matrix).
INPLM:
Manages arrays LM of each group; they contain numbering of equations
associated with local element node numbering.
RESIN:
Reads restart file.
EQSET:
Allocates the dynamical memory of arrays ALHS (memory space of
GMRES vectors) and BRHS (array of global forcing terms); determines the
stiffness matrix coefficients.
DRIVER:
Controls all subroutine of solution-printout phase.
ITRUP1:
Sets up the array containing the solution at previous iteration DPRED
before initiating the iteration cycle, on the basis of initial conditions.
COMPBC: Transfer boundary conditions from array F to array D.
DMA – University of Rome “La Sapienza”, September 2003
10
XENIOS Hand book
ELEMWL: Before initiating the iteration cycle, computes boundary conditions and
viscous dissipation rate for wall elements in the computational domain
(through a call to DISSBC).
Updates boundary conditions for viscous dissipation rate within the
iteration cycle.
ELEMNT:
Controls the generation of the element stiffness matrices, and forcing term
arrays, and their assembly..
For instance, in the case of elements with second order shape functions and
turbulent flows, it calls subroutine QUADC9.
QDC293:
Computes the elements of the forcing term array corresponding to flux-type
boundary conditions (FLUX).
Computes the shear stress boundary conditions applied to wall elements
(WALL).
Rotates wall element velocities from local to global reference sete
(XYDOF).
Computes the derivatives of shape functions with respect to coordinates X,
Y, Z of the global reference set.
Determines the values of the degree of freedom in integration points at
previous iteration wit respect to current one (NINTCL).
Computes diffusive properties (DIFFT1).
Computes diffuse and convective components of elelement stiffness
matrix, and production terms to be allocated in the array of element forcing
terms.
For wall nodes, rotates the equation set from global to local reference set
(MOMROT).
Assembles element matrices and vectors (ADDLHS and ADDRHS) and
inserts Dirichlet boundary conditions (LOADBC).
RESGEN:
Generates the equation set residual vector.
NRMGEN: Computes Euclidean norms of sultion residual.
NRMDOF: Computes Euclidean norm for each degree of freedom.
CONVER:
Checks solution convergence or divergence at each iteration.
DMA – University of Rome “La Sapienza”, September 2003
11
XENIOS Hand book
GMRES:
Solution routine
TIMING:
Determines CPU time for computations.
PIVOTS:
Locates and prints the number of negative or null entries in the global
factorized stiffness matrix (such values are replaced with a small nonzero
default value).
PRINTP:
Prints factorized stiffness matrix when required in input file.matrix.
RLXGEN:
Relaxes solution on the basis of values specified in input file (retain a
fraction of solution at previous iteration).
ITRCLP:
Clips turbulent quantities k and .
ITERUP:
Updates array D after each iteration; in the next iteration it will be used as
previous solution.
RESOUT:
Prints resul file.
PRINTD:
Prints solution array after rotation of velocity components into global
reference set x, y, z , at walls (XYDOF).
4
XENIOS input cards
In this Section the cards available as input to the XENIOS code, both for sequential
and parallel runs, are individually described.
Before commenting on single cards, the general structure of an input file is shown.
@ JOB
TITLE =
IECHO =
IEXEC =
IACODE =
IREADR =
IWRITR =
IPRTIN =
IRANK =
NUMITE =
DMA – University of Rome “La Sapienza”, September 2003
12
XENIOS Hand book
NSD =
NUMNP =
NUMEG =
ICOMPR =
ITURB =
ITHERM =
LINEAR =
DNTYPE =
IAXISY =
KEMOD=
@ CV
EPSRES =
EPSSOL =
@ MESH??????????????????
@ EL
GR = group no.
NTYPE =
NPRES=
LOWRE=
NICODE =
NUMAT =
MT
DENS =
VISC =
CONDC =
SP =
FL = no. of trailing strings NODE+ELEMENT
first key-point last key-point
flux value
WL = no. of trailing strings
DMA – University of Rome “La Sapienza”, September 2003
13
XENIOS Hand book
first key-point lastkey-point
value of yn (boundary layer thickness)
PE = no. of trailing strings
first key-point last key-point
flux value
SL = no. of trailing strings
first key-point lastkey-point
value of yn (boundary layer thickness)
@ IC
UX = ALL or no. of trailing strings
only value for ALL option, or first node-last node-generation-value
UY = as above
UZ = as above
PR = as above
TE = as above
KI = as above
DI = as above
G1 = as above
+ SMC variables
@ BC = CONSTANT/PARABOLIC/HALFPARABOLIC/NODES/KFREE/FREE
to specify degrees of freedom, see comment to card IC
+ NODE&ELEMENT
@ TC
CMU =
CE1 =
CE2 =
SIGMAK =
SIGMAE =
SIGMAF =
SIGMAG =
AKVK =
EE =
CD =
DMA – University of Rome “La Sapienza”, September 2003
14
XENIOS Hand book
SIGMA =
TREF =
@ AV = SUPG/UPWIND
values for each degree of freedom
@RL
values for each degree of freedom
@ OR = PROFIL
@ PL
@ END
4.1
The JOB card
The "master card" JOB contain all basic information to specify the problem under
consideration , and is composed of the following "minor-cards":
- TITLE:
alpha-numeric variable to set the job title which will also appear on
output plots
- IECHO:
provide an echo of the input file on top of the output file, values NO/YES
- IEXEC:
choice between pre-processing only, or full execution, options
PROCESSOR / EXECUTION / ITERATIVE
- IACODE:
choice between unsteady and steady problem; values TRANSIENT /
STEADY-STATE
- IREADR:
restarts execution from an already computed solution vector; degrees of
freedom to be used as initial conditions for new computational cycle
must be specified via their acronyms UX, UY, UZ, PR, TE, KI, DI, G1 or
UX, UY, UZ, PR, TE, KI, DI, G1, T1, T2, T3, T4, T5, T6, AA for second
order closures.
DMA – University of Rome “La Sapienza”, September 2003
15
XENIOS Hand book
- IWRITR:
integer indicating after how many iterations the solution vector must be
stored in memory (allows to have a solution vector even if the iteration
cycle does not go to completion).
- IPRTIN:
manages output file printout; options MINIMUM/MAXIMUM
- IRANK:
controls global stiffness matrix after factorization; options NO (no
control), CONTROL (prints pivots) and ALL (prints and full matrix).
Printouts take place at each iteration
- NUMITE:
maximum no. of iterations
- NSD:
no. of spatial dimensions; options 2D/3D
- NUMNP:
total no. of nodes in the integration domain
- NUMEG:
no. of groups in the integration domain
- ICOMPR:
incompressible
or
compressible
flow
option,
values
"INCOMPRESSIBILE", or "COMPRESSIBILE"
- ITURB:
laminar, turbulent (inert) or turbulent reacting flow; options "LAMINAR",
"TURBULENT" or "REACTING"
- KEMOD:
selects turbulence model closures. For first order closures: 0 standard k-
, 1 non-linear k-, 2 explicit algebraic stress model. For second order
closures: 0 standard, 1 elliptic blending model.
- ITHERM
controls solution of energy equation; options "THERMAL" or
"ISOTHERMAL".
- LINEAR:
purely diffusive or convective diffusive problem; options “LINEAR" or
"NON-LINEAR"
- DNTYPE:
selects model for density; options "CONSTANT", "MIXING" (inert
mixing), "EQUILIBRIUM" (full chemical equilibrium), "STRETCHED"
("Stretched Laminar Flamelet" model for finite-rate chemistry)
4.2
The CV card
DMA – University of Rome “La Sapienza”, September 2003
16
XENIOS Hand book
The master-card CV contains values which control the convergency check; it involves
the following minor-cards:
- EPSRES:
minimum tolerancefor the residual of the algebraic system of discretized
equations
- EPSSOL:
minimum tolerance for the solution
Both quantities are real numbers.
4.3
The MESH Card
???????????????????????????????
4.4
The EL Card
The master-card EL contains all information for the element generation and
management (near wall; the latter is required when dealing with turbulent flow).
Within EL , all information relating to a group are given after a card GR; the GR
contains the following minor-cards:
- NTYPE:
Selects the type of elements of the group, and can take up values 1/2/3;
for 2-D problems, 1 triangular linear element (3 nodes), 2 a
quadrangular linear element (4 nodes), 3 a quadrangular quadratic
element (9 nodes); for 3-D problems the available options are 2 and 3,
implying elements with 8 or 27 nodes, respectively.
-.NICODE:
selects the numbers of integration points in the elements, after the same
rules of card NTYPE.
- NUMAT:
Associates a type of material (specified with card MT) with a part of the
elements in a group.

Not yet active.
DMA – University of Rome “La Sapienza”, September 2003
17
XENIOS Hand book
- MT:
material
properties,
i.e.,
density,
molecular
viscosity,
thermal
conductivity and specific heat.
- WL:
Set the walls for turbulent problems
- FL:
Specifies flux-type boundary conditions.
- PE:
Specifies periodic boundary conditions.
4.5
The IC Card
The master-card IC is used to specify the initial values for problems degree of
freedoms:
- UX, UY, UZ:
specify initial conditions for velocity components; if option
"ALL" is used, the given value is applied to the whole flowfield;
if different values over the flowfield are desidered, the minor card
must report the number of trailing strings, each string containing
the indeces of the first and last node, and the value assigned to the
variable.
- PR, TE, KI, DI, G1: set initial conditions for pressure, temperature (or conserved
scalar for turbulent reacting flows), turbulent kinetic energy,
viscous dissipation rate, and conserved scalar variance; they are
assigned in the same way as UX, UY , UZ.
- T1 to T6, AA:
set initial conditions for turbulent stresses, and elliptic blending
variable; they are assigned in the same way as UX, UY , UZ.
4.6
The BC Card
The master-card BC is used to set Dirichlet’s boundary conditions; minor-cards are
the same as those for master card IC but the following additional options are available in
addition to option "ALL", already described:
DMA – University of Rome “La Sapienza”, September 2003
18
XENIOS Hand book
- CONSTANT:
assigns constant value.
- PARABOLIC:
assignes a parabola with vertex at the centre of generation nodes.
- HALFPARABOLIC: assignes half a parabola with vertex in a generation node.
- LINEAR:
assignes a linear trend with given slope between the nodes.
- KFREE/FREE:
frees nodes that in the generation process are subjected to
boundary conditions; KFREE is used with key-points and FREE
with actual node numbering.
- NODES:
switch from boundary conditions assegned through i key-points
to actual node numbering.
4.7
The TC Card
The master-card TC contains values of constants and non-dimensional numbers used
in turbulence models.
4.8
The AV Card
The master-card AV sets the artificial viscosity multiplying the expression of the
perturbation function in the SU/PG and PS/PG schemes.
4.9
The RL Card
The master-card RL sets the relaxation factors; can take values in between zero and
unity for each variable, which indicate which fraction of the previous solution is
retained in between two iterations in order to counter instability effects.
4.10 The Card OR
DMA – University of Rome “La Sapienza”, September 2003
19
XENIOS Hand book
The master-card OR actives a procedure for equation renumbering, which allows a
drastic cut of the amount of memory required.
4.11 The Card PL
The master card PL actives subroutines of XEGRAF program, enabling visualization
of input and output data and their postprocessing
4.12 The END Card
The master-card END closes the input file; anything below this card is ignored.
DMA – University of Rome “La Sapienza”, September 2003
20
XENIOS Hand book
5
How to run XENIOS with sequential solver
The procedure to run XENIOS code using the available sequential solvers is sketched by the
following 4 successive steps.
Step 1.
create the mesh data file
The mesh data file must include information about the nodal point Cartesian
coordinates, and the element nodal connectivity, in terms of node list distinguishing
between linear elements (4 or 8 nodes) and quadratic elements (9 or 27 nodes).
An example of mesh data format for the grid and the connectivity for 3D linear elements
(8 nodes) is here reported:
job title
NUMNP= nr. nodes NELTOT= nr. elements
Node name
X
Y
GROUPS= nr. groups
Z
…
ELEMENTI DEL GRUPPO NUMERO= 1
NPAR= 15 ELEMENTI= nr elements GR1 NEN=
element name
0
N1
N2
N3
N4
…
8
N5
N6
N7
N8
FINE CONNESSIONE
Remark1: to be repeated for each group
Remark2: the nodes must be ordered on the basis of their logical position, i.e.:
2D linear element
quadratic element
3D linear element
quadratic element
23
24
22
27
25
14
15
13
5
16
26
18
6
20
4
21
12
19
7
17
8
11
9
3
10
2
1
DMA – University of Rome “La Sapienza”, September 2003
21
XENIOS Hand book
e.g.:
Ventilatore BUP29
NUMNP= 102951 NELTOT= 96000
GROUPS=
20
1
-.6653000000E+02
.7409300000E+02
2
-.6394162833E+02
.7175492387E+02
3
-.6193624264E+02
.6994345898E+02
…
102951
.2732700000E+03
.9986651131E+02
ELEMENTI DEL GRUPPO NUMERO= 1
NPAR= 15 ELEMENTI=
7200 NEN= 8
1
0
1
2
82
2593
2594
2
0
2
3
83
2594
2595
…
FINE CONNESSIONE
.1995910000E+03
.2003998661E+03
.2010265492E+03
.2981174935E+03
83
2512
2513
84
2513
2514
The FORTRAN format instructions are:
FORMAT(?????????????????????
Remark3: the mesh data file must be labeled as JOBname.ext
Step 2.
create the input file
The input file includes the information concerning the flow problem (JOB card), the
finite element decomposition of the domain (EL card, number of gourps/elements, order
of approximation, &c), the boundary and initial conditions, and solution parameters. In
general an input file should at least include the following set of ordered cards:
@JOB
@MESH
@EL
@BC
@IC
@AV
@END
e.g. for a simple 2D channel flow (IOPT3):
@JOB
TITLE =CANALE EASM
IDUMP =NOYES
IECHO =NO
IEXEC =ITERATIVE
IACODE=STEADY-STATE
IREADR=UX,UY,PR,KI,DI
IPRTIN=ALLESSENTIAL
DMA – University of Rome “La Sapienza”, September 2003
22
XENIOS Hand book
IWRITR=3
NUMITE=3
NSD
=2D
NUMNP =14973
NUMEG =1
ICOMPR=INCOMPRESSIBLE
ITURB =TURBLENT
KEMOD =ST
ITHERM=ISOTHERMAL
LINEAR=NOLINEAR
DNTYPE=CONSTANT
IAXISY=2-DIMENSIONAL
IMOTIO=ABSOLUTE
IASSER=Z-Z
OMEGA =0.0
KSD
=50
IWRNRT=YES
@CV
EPSRES=1.D-3
EPSSOL=1.D-3
@MH=FILE=X-X
@EL
NUMEL =3560
NTYPE =3
NPRES =2
NICODE=3
NUMAT =1
LOWRE =0
DENS
VISC
SP
CONDC
3___________4
|
|
|
400
|
|
100
|
|_________|
1
2
421__________441
|
|
20 |
|
|
|
|_________|
1
20
21
=1.0
=3.0D-4
=1.0
=1.0
WL=1
1
713 1 0.2
@BC=NODES
UX=1
1 14261 713 1.d0
UY=3
1 713 1 0.d0
1 14261 713 0.d0
14261 14973 1 0.d0
KI=1
1 14261 713 9.88D-3
DI=1
1 14261 713 1.4D-2
@IC
UX=ALL
1.0
UY=ALL
0.0
KI=ALL
9.88D-3
DI=ALL
1.4D-2
@AV=UPWIND
1.0 1.0 0.0 1.0 0.0
@RL
0.5 0.5 0.0 0.5 0.0
@END
1.0
1.0
0.0
0.8
0.8
0.0
Remark4: the input file must be labeled as JOBname.input
DMA – University of Rome “La Sapienza”, September 2003
23
XENIOS Hand book
Step 3.
the executable file
In order to run the XENIOS code using a sequential solver it is necessary to verify that
in the input file the JOB card includes one of the following instruction:
IEXEC = EXECUTION for the direct Crout-like solver
IEXEC = ITERATIVE for Gauss-Siedel preconditioned GMRes solver
IEXEC = FLEXIBLE for Flexible preconditioned GMRes solver
The XENIOS code executable file is:
ime054.poliba.it/user1/rispoli/xeniosDMA_seq/xenios
during the execution the JOBname, for input and/or output files, could be specified:
INSERIRE NOME FILE INPUT
JOBname
INSERIRE NOME FILE OUTPUT
JOBname
Step 4.
checking the convergence
The convergence history could be checked by means of two output files, namely the:
JOBname.output and the JOBname.itera.
JOBname.output file include the following data for the execution check:
- mesh check information,
- execution control information
- equation system data,
- memory report,
- dynamic storage allocation map.
Finally the JOBname.output and JOBname.itera files show the information concerning
the error norm (RSOL) and residual norm (RINRM) at each non-linear iteration (NIT), in
terms of Euclidean norm for each DOF and for the flow field:
I T E R A T I O N S
DOF
GLOBAL
UX
NIT
1
A N A L Y S I S
RSOL
0.000000E+00
1.029901E+00
RRES
0.000000E+00
DMA – University of Rome “La Sapienza”, September 2003
RINRM
0.000000E+00
R0NRM
1.183297E+00
24
XENIOS Hand book
UY
PR
GLOBAL
UX
UY
PR
2
0.000000E+00
5.826615E-01
1.000000E+00
5.037505E-01
4.155207E-02
4.071453E-01
5.485050E-01
<<
<<
<<
6.490442E-01
1.183297E+00
…
At the completion of XENIOS code run the following result data files are printed:
JOBname.result: values of the DOFs computed in the nodal position, the vector
quantities are defined in terms of Cartesian components.
JOBname.rlocal: values of the DOFs computed in the nodal position, the vector
quantities are defined in terms of Cartesian components or where applicable (i.e. in
presence of WALL/PERIODIC/SLIP boundaries) in terms of local-to-the-boundary
frame of reference.
JOBname.tecplot: grid information together with the values of the computed DOFs, the
vector quantities are defined in terms of Cartesian components.
Remark5: the JOBname.rlocal file must be used to restart the solution renaming as JOBname.restart.
DMA – University of Rome “La Sapienza”, September 2003
25
XENIOS Hand book
Appendix.A
Building the stiffness matrix and the array of global forcing
terms
The global stiffness matrix and the array of global forcing terms are memorized
according to the following basic steps:
- building the element stiffness matrix,
- feeding the element stiffness matrices into the unassembled structure of the global
stiffness matrix,
- building the element forcing terms,
- fedding the element forcing terms into the global array of forcing terms,
- storing Dirichlet’s boundary condition into the global array of forcing terms.
When considering turbulent flows, a further step involves computing the shear stress
acting on the element faces located near-wall, to account for the boundary layer.
The fluxes ensuing from such boundary conditions add to the array of forcing termsI
of elements one or two faces adjacent to solid walls, and are then assembled in the array
of global forcing terms.
A similar situation occurs when some elements feature assigned-flux boundary
conditions (e.g., thermal flux).
In the finite element method the solution is sought by solving an equation set of the
type
Kx=b
with dimensions equal to the number of unknowns in the field.
With the GMRES, it is not required to set up the full stiffness matrix, but only the
product of K times the residual ro evaluated at the initial conditions of the integration
step.
The form in which matrix K is set up can be guided by the search of a compromise
between contained runtimes and maximum amount of memory required.
DMA – University of Rome “La Sapienza”, September 2003
26
XENIOS Hand book
The construction of the element stiffness matrix is driven by routine ELEMENT ,
which is on top of the solver branch devoted to element cycling. The routine drives
group cycling, which in turn drives the procedure for element cycling.
The coefficients of the element stiffness matrix are then evaluated on the bases of the
nature of the fluid dynamic problem, following four lines: laminar isothermal flow,
routine QDC291; laminar, non isothermal flow, QDC292; turbulent isothermal flow,
QDC293; turbulent reacting flow, QDC294.
Within each routine QDC29# the matrix coefficients are in turn evaluated by numerical
integration of the equations in discrete form, and the different contributions are
assembled in the corresponding position of the element matrix, the dimension thereof is
the sum of two contributions:
(NDOF-1)  NEN
equations for degress of freedom approximated by quadratic law,
NENP
equations for degress of freedom approximated by linear law,
where:
NDOF,
is the number of degrees of freedom of the problem under study,
NEN,
is the element number of nodes,
NENP,
is the element number of nodes for apressure approximation.
The stiffness matrix can therefore be displayed as:
 
 K vp 
 K wp 
   K pv   K pw   K pp 
 K uu 

  K vu 

 K wu 
K
 pu
 0
 0

 Kuv   Kuw 
 Kvv   Kvw 
 K wv   K ww 
 K up
0
0
0
0
0
0
0
 K kk 
0
0
0
0
DMA – University of Rome “La Sapienza”, September 2003
0  u 

0  v 
 
  w
0 
  
0   p

0   k 
 K    
 N u  


 N v  
 N w 


 0 
 N k 


 N   
27
XENIOS Hand book
The terms of the individual element stiffness matrix are transferred into the global
conservation structure is carried out via the element connection matrices LM , the
dimensions thereof are (NDOF, NEN, NUMEL), i.e., number of degrees of freeedom,
number of element nodes, number of elements in the group.
Matrices LM are obtained from matrix ID through matrix IEN; ID has dimensions
(NDOF, NUMNP), with NUMNP indicating the total number of nodes of the discretized
domain; it contains, in its final form, the equations numbered according to the
convention that a positive index denotes a degree of freeedom without specified
boundary conditions, a zero index denotes a degree of freddom with zero-value
boundary conditions, and then a negative index denotes a degree of freedom with given,
non-zero boundary conditions.
Matrix IEN has dimensions (NEN, NUMEL) and allows setting up matrix LM which,
accordingly, contains for each element in a group, the equation numbers in the global
matrix ID, associated with local element numbering, rather than global numbering.
In order to better illustrate the construction process of matrix LM a simple case is
shown of an integration domain subdivided in two groups, each comprising a single 9node element, and it is further assumed that the only unknowns are the velocity
components u e v; this case is shown in Fig. 3.
Fig. 3 - Discretized integration domain with two groups of one element each
Let the boundary conditions for u and v be zero at nodes 1, 2, 3, 4, 5 and 11, 12, 13,
14, 15; from the foregoing. matrix ID is given as:
DMA – University of Rome “La Sapienza”, September 2003
28
XENIOS Hand book
0 0 0 0 0 1 2 3 4 5 0 0 0 0 0 
ID NDOF , NUMNP   

0 0 0 0 0 6 7 8 9 10 0 0 0 0 0 
Matrices IEN for group 1 and for group 2 can be built taking into account the
spiralling element local indexing conventon , as shown in 4.
Fig. 4 - Local numbering for 9-node element
On the basis of this assumption, for group 1 it is
IEN  NEN , NUMEL  1 2 3 8 13 12 11 6 7 
Then, array IEN of group 1 associates, for instance, the node with local numbering 4
of the only element in this group the global numbering 8, which in turn relates
(according to matrix ID) to equation number 1 for variable u and 6 for variable v; in this
way matrices LM of group 1 and group 2 are set up.
0 0 0 3 0 0 0 1 2
LM  NDOF , NEN , NUMEL  

0 0 0 8 0 0 0 6 7 
0 0 0 5 0 0 0 3 4 
LM  NDOF , NEN , NUMEL  

0 0 0 10 0 0 0 8 9 
For assembling the stiffness matrix, once the connection matrices LM for each group
are set up, the procedure is as follows: A zero value denotes, as already quoted, that it is
a degree of freedom set to zero; as a consequence, the corresponding row and column
can be eliminated from the stiffness matrix and the arraty of forcing terms.. A negative
DMA – University of Rome “La Sapienza”, September 2003
29
XENIOS Hand book
index indicates a degree of freedom set to a non-zero value, then the global forcing term
array is properly modified. Finally, a positive index denotes that that degree of freddom
must be included in the globsal stiffness matrix.
Appendix.B
Storage of Dirichlet’s boundary conditions
Terms with negative LM indexing identify boundary conditions enforced on
individual degrees of freedom at the node being considered.
In order to avoid solving the relevant equation the code features a mechanism
reducing the element stiffness matrix and the array of element forcing terms.
The procedure is illustrated in the following example.
Consider the algebraic set:
a11
a
 21
a 31

a 41
a12
a13
a 22
a 23
a 32
a 33
a 42
a 43
a14   u1 
a 24  u2 
  
a 34  u3 
 
a 44  u4 
 F1 
F 
 2
 F3 
 
 F4 
[1]
If the boundary condition u2 = b, is enforced, [1] can be recast as:
a11 0 a13
 0 1 0

a 31 0 a 33

a 41 0 a 43
a14   u1   F1  a12 b 

0  u 2  
b
   

a 34  u3   F3  a 32 b
  

a 44  u4   F4  a 42 b
[2]
Eq.[2] reduces the set to be solved to the form:
DMA – University of Rome “La Sapienza”, September 2003
30
XENIOS Hand book
a11
a
 31
a 41
a13
a 33
a 43
a14   u1   F1  a12 b 
a 34  u2    F1  a 32 b
a 44  u3   F1  a 42 b
[3]
Such a procedure is worked out by subroutine LOADBC (loading boundary
conditions), by means of the statement:
BRHS  BRHS  ELEFFM  F
[4]
where BRHS is the array of global forcing terms, with dimension NEQ, i.e., the total
number of equations to be solved; ELEFFM is the (square) element stiffness matrix; F
is the vector including the boundary conditions.
As far as unconstrained degress on freedom, the code, after setting up matrices LM in
the subroutine group INPLM, and after establishing the dimensional parameters of the
global stiffness matrix in subroutine group EQSET, relinquish control of the transfer
procedure of element stiffness terms in the vectorial structur of iterative solver GMRES
by calling subroutine ADDLHS, inner to the duble group-and-element cycle.
Appendix.C
Solution of the nonlinear equation set
Once the problem is finite-element discretized, the global algebraic equation set
remains to be solved, which has the general form:
K    F
[5]
where K is a global stiffness matrix, which is a function of the values of unknowns at
the nodes , owing to the strong nonlinearity of conservation equations, matrix K can
be written as the sum of two terms
K    KC    K D
DMA – University of Rome “La Sapienza”, September 2003
[6]
31
XENIOS Hand book
where KC is the nonlinear convective part of the equation set and KD is the contribution
of diffusion terms.
From the foregoing it is apparent that when convective terms assume a predominant
role (non negligible Reynolds number), the solution of algebraic set [5] implies resorting
to iterative methods.
Among the different solution methods available, in XENIOS the so-called
"Successive Substitutions" method has been preferred, due to its ease of
implementations and stable convergence to the solution.
In fact, though its slow rate of convergence, it is known to converge for a very wide
range of Reynolds numbers, and is relatively insensitive to initial conditions.
The Successive Substitutions method can be summarized as a scheme of the
following type:
 
K  i  i+1  F i
[7]
where i is the iteration index.
For short, the solution vector  is derived at iteration i + 1 on the basis of values at
previous iteration level i.
At the end of each iteration the convergence of the solution is checked; in particular,
two convergence criteria are used in the program, based on the relative error, which
control both the solution vector and the residual vector to get an assurance of the
proximity to a steady solution.
If  denotes the set tolerance, it results:
 i+1   i
 i+1
 
[8]
where the double vertical bar denotes a Euclidean norm, i.e.:
 i+1 
N
 
i 1
 j
j 1
DMA – University of Rome “La Sapienza”, September 2003
2
[9]
32
XENIOS Hand book
where N is the total number of nodes on the computing grid.
If R denotes the set minimum tolerance for the residual vector R (), i.e., the vector
given by (for an approximate solution ) by:
K    F = R 
[10]
then :

R  i+1
Ro

 R
[11]
where Ro is the residual vector evaluated at the first iteration on the basis of initial and
boundary conditions.
The computation of norms and the convergency check are performed within the
iteration cycle
of subroutine DRIVER, in subroutines NRMGEN and CONVER,
respectively.
At each iteration, the set [5] is reduced to a linear algebraic set.
DMA – University of Rome “La Sapienza”, September 2003
33