HORSES3D User Manual
HORSES3D User Manual
Numath group
March 8, 2024
Contents
3 Running a Simulation 6
3.1 Control File (*.control) - Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Spatial Discretization 9
5 Restarting a Case 11
8 Explicit Solvers 26
10 p-Adaptation Methods 29
10.1 Truncation Error p-Adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
10.2 Reinforcement Learning p-Adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
10.3 Multiple truncation error estimations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1
12 Monitors 35
12.1 Residual Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
12.2 Statistics Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
12.3 Probes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
12.4 Surface Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
12.5 Volume Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
12.6 Load Balancing Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
14 Postprocessing 39
14.1 Visualization with Tecplot Format: horses2plt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
14.1.1 Solution Files (*.hsol) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
14.1.2 Statistics Files (*.stats.hsol) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
14.2 Extract geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
14.3 Merge statistics tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
14.4 Mapping result to different mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
14.5 Generate OpenFOAM mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
14.6 Generate HORSES3D solution file from OpenFOAM result . . . . . . . . . . . . . . . . . . . . . 41
2
Chapter 1
• Clone the git repository or copy the source code into a desired folder.
• Go to the folder Solver.
• Run configure script.
$ ./ configure
– MODE=DEBUG/HPC/RELEASE
– COMPILER=ifort/gfortran
– COMM=PARALLEL/SEQUENTIAL
– ENABLE THREADS=NO/YES
– WITH PETSC=YES/NO
– WITH METIS=YES/NO
– WITH HDF5=YES/NO
– WITH MKL=YES/NO
For example:
$ make a l l COMPILER= i f o r t COMM=PARALLEL
• MODE=DEBUG/HPC/RELEASE flag enables various compiler flags for different levels of code opti-
mization. Furthermore, MODE=HPC disables residual file writing to improve performance.
• The ENABLE THREADS=YES flag enables shared memory simulations using OpenMP.
• The COM=PARALLEL flag enables distributed memory simulations using MPI.
• The WITH METIS=YES flag activates METIS linking. To compile the code linking it with METIS (that
is an option for creating the mesh partitions of MPI runs), it is needed that before compilation and
running, an environment variable called METIS DIR is found. This variable must contain the path to the
METIS installation folder (it must have been compiled with the same compiler as HORSES3D).
• The WITH HDF5=YES flag activates HDF5 linking. To compile the code linking it with HDF5 (necessary
for reading HOPR meshes), it is needed that before compilation and running, an environment variable
called HDF5 DIR is found. This variable must contain the path to the HDF5 installation folder (it must
have been compiled with the same compiler as HORSES3D). In addition, the lib folder must be added to
the environment variable LD LIBRARY PATH.
• The WITH PETSC=YES flag activates PETSC linking. To compile the code linking it with PETSC, it is
needed that before compilation and running, an environment variable called PETSC DIR is found. This
variable must contain the path to the PETSC installation folder.
3
• If you use environment modules, it is advised to use the HORSES3D module file:
4
Chapter 2
Notes on the GMSH format (*.msh) and general workflow using GMSH.
• Curved geometry supported up to polynomial order 5.
• Curved geometry should be generated using following options: tools -¿ options -¿ mesh -¿ general -¿ element order.
• HORSES3D can read mesh format 4.1 and 2.2 (legacy format).
• The solution to most of the problems mesh reading is to load it in GMSH and export to format 2.2 to have a clean
ASCII file.
5
Chapter 3
Running a Simulation
6
Table 3.1: General keywords for running a case - continued.
By default, NoSlipWall is adiabatic. Isothermal wall can be activated with the following block:
#define boundary myBoundary1 myBoundary2 myBoundary3
type = NoSlipWall
w a l l type ( a d i a b a t i c / i s o t h e r m a l ) = i s o t h e r m a l
w a l l t e m p e r a t u r e = 2 0 0 0 . 0 d0 ! Wall t e m p e r a t u r e i n K
7
# end
It is also possible to set a moving wall with the keyword wall velocity = value.
For periodic boundary conditions, the second boundary that must be used as a complement must be specified
by the keyword ‘coupled boundary’. These two boundaries must have the same node position in all directions
but one. For mesh files generated by commercial software where this strict rule is not imposed a comparison
based on the minimum edge size of the face element can be used by a boolean parameter in the normal body of
the control file (not in the block body), with the keyword ‘periodic relative tolerance’.
8
Chapter 4
Spatial Discretization
HORSES3D uses a high-order discontinuous Galerkin Spectral Element (DGSEM) method. As part of the
numerical method, several options of volume and surface discretization options can be selected. Some options
are only available in certain solvers.
• Gauss
• Gauss-Lobatto
• Morinishi
• Ducros
• Kennedy-Gruber
• Pirozzoli
• Entropy conserving
• Chandrasekar
• Skew-symmetric 1 (only for Incompressible Navier–Stokes)
viscous discretization CHARACTER: Method for viscous fluxes. Options are: ’BR2’
• BR1
• BR2
• IP
9
Table 4.1: Keywords for spatial discretization - continued.
10
Chapter 5
Restarting a Case
11
Chapter 6
• Smagorinsky
• None
6.1.1 Shock-capturing
The shock-capturing module helps stabilize cases with discontinuous solutions, and may also improve the results
of under-resolved turbulent cases. It is built on top of a Sensors module that detects problematic flow regions,
classifying them according to the value of the sensor, s, mapped into the interval a ∈ [0, 1],
0,
1 s−s0
if s ≤ s0 − ∆s/2,
a= 1 + sin , if s0 − ∆s/2 < s < s0 + ∆s/2,
2 ∆s
1, elsewhere.
The values of s0 = (s1 + s2 )/2 and ∆s = s2 − s1 depend on the sensor thresholds s1 and s2 .
At the moment, flow regions where a ≤ 0 are considered smooth and no stabilization algorithm can be
imposed there. In the central region of the sensor, with 0 < a < 1, the methods shown in the next table can be
used and even scaled with the sensor value, so that their intensity increases in elements with more instabilities.
Finally, the higher part of the sensor range can implement a different method from the table; however, the
intensity is set to the maximum this time.
12
All the methods implemented introduce artificial dissipation into the equations, which can be filtered with
an SVV kernel to reduce the negative impact on the accuracy of the solution. Its intensity is controlled with the
parameters µ (similar to the viscosity of the Navier-Stokes equations) and α (scaling of the density-regularization
term of the Guermond-Popov flux), which can be set as constants or coupled to the value of the sensor or to a
Smagorinsky formulation.
Shock first method CHARACTER: Method to be used in the middle region of the None
sensor (a ∈ [0, 1]). Options are:
• None: Do not apply any smoothing
Shock second method CHARACTER: Method to be used in the top-most region of the None
sensor (a = 1). Options are:
• None: Do not apply any smoothing
13
Table 6.2: Keywords for shock-capturing algorithms in the Navier-
Stokes equations – continuation.
Shock update strategy CHARACTER: Method to compute the variable parameter of the Constant
specified shock-captruing approach in the middle region of the
sensor. Options are:
• Constant
• Sensor
• Smagorinsky: only for non-filtered and SVV
• Exponential
14
Table 6.2: Keywords for shock-capturing algorithms in the Navier-
Stokes equations – continuation.
• rhov
• rhow
• u
• v
• w
• p
• rhop
• grad rho
• div v
Sensor lower limit REAL: Lower threshold of the central sensor region, s1 Mandatory
keyword (ex-
cept GMM)
Sensor higher limit REAL: Upper threshold of the central sensor region, s2 Mandatory
keyword (ex-
cept GMM)
Sensor TE min N INTEGER: Minimum polynomial order of the coarse mesh used 1
for the truncation error estimation
Sensor TE delta N Polynomial order difference between the solution mesh and its 1
coarser representation
Sensor TE derivative CHARACTER* : Whether the face terms must be considered in Isolated
the estimation of the truncation error or not. Options are:
• Non-isolated
• Isolated
Sensor number of clusters INTEGER: Maximum number of clusters to use with the GMM 2
sensor
Sensor min. steps INTEGER: Minimum number of time steps that an element will 1
remain detected. The last positive value will be used if the sensor
“undetects” an element too early
being the low-pass one more dissipative and, thus, more suited to supersonic cases. The high-pass filter, on the
other hand, works better as part of the SVV-LES framework for turbulent cases.
The cutoff parameter P can be set as ”automatic”, which uses a sensor to differentiate troubled elements
from smooth regions. The stabilisation strategy then depends on the region:
• smooth regions: P = 4, µ = µ2 , α = α2 ,
• shocks: P = 4, µ = µ1 , α = α1 .
In addition to this, the viscosity µ1 can be set to ”Smagorinsky” to use the implemented SVV-LES approach.
In this case, the µ = µLES viscosity is computed following a Smagorinsky formulation with Cs = µ2 and the
viscosity parameters do not depend on the region anymore,
µ = Cs2 ∆2 |S|2 , α = α1 .
6.1.2 Acoustic
The Ffowcs Williams and Hawkings (FWH) acoustic analogy is implemented as a complement to the compress-
ible NS solver. It can run both during the execution of the NS (in-time) or as at a post-process step. The
version implemented includes both the solid and permeable surface variations, but both of them for a static
body subjected to a constant external flow, i.e. a wind tunnel case scenario. The specifications for the FWH are
divided in two parts: the general definitions (including the surfaces) and the observers definitions. The former
is detailed in Table 6.3, while the latter are defined in a block section, similar to the monitors (see Chapter 12):
#define a c o u s t i c o b s e r v e r 1
name = SomeName
p o s i t i o n = [ 0 . d0 , 0 . d0 , 0 . d0 ]
#end
To run the in-time computation, the observers must be defined in the control file. Beware that adding
an additional observer will require to run the simulation again. To use the post-process computation, the
solution on the surface must be saved at a regular time. Beware that it will need more storage. To run the
post-process calculation the horses.tools binary is used, with a control file similar to the one use for the NS
simulation (without monitors), and adding the keywords ”tool type” and ”acoustic files pattern”, as explained
in Table 6.3.
16
Table 6.3: Keywords for acoustic analogy
Keyword Description Default value
acoustic analogy CHARACTER(*): This is the main keyword for activating the –
acoustic analogy. The only options is: ”FWH”.
acoustic analogy permeable LOGICAL: Defines if uses a permeable or solid approach. .FALSE.
acoustic solid surface CHARACTER(*): Array containing the name of each bound- –
ary to be used as a surface for integration. In the form:
’[bc1,bc2,bc3]’. Mandatory for using the solid surface variant.
acoustic surface file CHARACTER(*): Path to a fictitious surface that will be used –
for integration. It must be tailor-made for the mesh. Mandatory
for using the permeable surface variant.
observers flush interval INTEGER: Iteration interval to flush the observers information 100
to the files.
acoustic solution save LOGICAL: Defines whether it saves the NS solution on the sur- .FALSE.
face. Mandatory for post-process computation.
acoustic save timestep REAL: Controls the time or iteration at which the FWH will be –
calculated (and saved if specified). If the key is missing it will be
done at each timestep.
acoustic files pattern CHARACTER(*): Pattern to the path of all the saved solutions –
on the surface (To be used in horses.tools for the post-process
calculation).
tool type CHARACTER(*): Necessary for post-process calculation. De- –
fines the type of post-process of horses.tools. For the FWH anal-
ogy the value must be ”fwh post”
The incompressible Navier Stokes solver has two modes: with 1 fluid and with 2 fluids. The required
keywords are listed below.
17
Table 6.5: Keywords for incompressible Navier-Stokes solver. Mode with 1 fluid
Keyword Description Default value
density (kg/mˆ3) REAL: Density of the fluid –
viscosity (pa.s) REAL: Viscosity of the fluid –
Table 6.6: Keywords for incompressible Navier-Stokes solver. Mode with 2 fluids
Keyword Description Default value
fluid 1 density (kg/mˆ3) REAL: Density of the fluid 1 –
fluid 1 viscosity (pa.s) REAL: Viscosity of the fluid 1 –
fluid 2 density (kg/mˆ3) REAL: Density of the fluid 2 –
fluid 2 viscosity (pa.s) REAL: Viscosity of the fluid 2 –
6.3 Multiphase
The multiphase flow solver implemented in HORSES3D is constructed by a combination of the diffuse interface
model of Cahn–Hilliard with the incompressible Navier–Stokes equations with variable density and artificial
compressibility. This model is entropy stable and guarantees phase conservation with an accurate representation
of surface tension effects. The modified entropy-stable version approximates:
ct + ∇⃗ · (c⃗u) = M0 ∇
⃗ 2 µ, (6.4)
√ √ ⃗ · 1 1 ⃗ u + c∇µ⃗ = −∇p ⃗ +∇
⃗ · η ∇⃗
⃗ u + ∇⃗
⃗ uT
ρ ( ρ⃗u)t + ∇ ρ⃗u⃗u + ρ⃗u · ∇⃗ + ρ⃗g , (6.5)
2 2
⃗ · ⃗u = 0,
pt + ρ0 c20 ∇ (6.6)
where c is the phase field parameter, M0 is the mobility, µ is the chemical potential, η is the viscosity and c0 is
the artificial speed of sound. The factor ρ0 is computed as max(ρ1 /ρ1 , ρ2 /ρ1 ). Mobility M0 is computed from
the control file parameters chemical characteristic time tCH , interface width ϵ and interface tension σ with the
formula M0 = L2ref ϵ/(tCH σ).
The term M0 ∇ ⃗ 2 µ can be implicity integrated to reduce the stiffnes of the problem with the keyword time
integration = IMEX. This is only recomended if the value of M0 is very high so that the time step of the explicit
scheme is very small.
This solver is run with the binary horses3d.mu.
6.4 Particles
WARNING: Lagrangian particles are only implemented for the compressible Navier Stokes (horses.ns binary)
18
WARNING: Lagrangian particles do not support MPI.
HORSES3D includes a two-way coupled Lagrangian solver. Particles are tracked along their trajectories,
according to the simplified particle equation of motion, where only contributions from Stokes drag and gravity
are retained,
dyi dui vi − u i
= ui , = + gi , (6.7)
dt dt τp
where ui and yi are the ith components of velocity and position of the particle, respectively. Furthermore, vi
accounts for the continuous velocity of the fluid at the position of the particle. We consider spherical Stokesian
particles, so their mass and aerodynamic response time are mp = ρp πDp3 /6 and τp = ρp Dp2 /18µ, respectively,
ρp being the particle density and Dp the particle diameter.
Each particle is considered to be subject to a radiative heat flux Io . The carrier phase is transparent to
radiation, whereas the incident radiative flux on each particle is completely absorbed. Because we focus on
relatively small volume fractions, the fluid-particle medium is considered to be optically thin. Under these
hypotheses, the direction of the radiation is inconsequential, and each particle receives the same radiative heat
flux, and its temperature Tp is governed by
d πDp2
(mp cV,p Tp ) = Io − πDp2 h(Tp − T ), (6.8)
dt 4
where cV,p is the specific heat of the particle, which is assumed to be constant with respect to temperature. Tp
is the particle temperature and h is the convective heat transfer coefficient, which for a Stokesian particle can
be calculated from the Nusselt number N u = hDp /k = 2.
In practical simulations, integrating the trajectory of every particle is too expensive. Therefore, particles
are agglomerated into parcels, each of them accounting for many particles with the same physical properties,
position, velocity, and temperature. The evolution of the parcels is tracked with the same set of equations
presented for the particles.
The two-way coupling means that fluid flow is modified because of the presence of particles. Therefore, the
Navier-Stokes equations are enriched with the following source terms:
0
PNp mp (u − v )δ(x − y )
n=1 τp 1,n 1 n
PNp m p
S =β n=1 τp (u 2,n − v 2 )δ(x − y n ) ,
(6.9)
P Np mp
n=1 (u 3,n − v 3 )δ(x − y n )
PNp τp2
n=1 πD p h(T p,n − T )δ(x − y n )
where δ is the Dirac delta function, Np is the number of parcels, β is the number of particles per parcel and
ui,n , yi,n , Tp,n are the velocity, spatial coordinates, and temperature of the parcel nth. The dimensionless form
of the Navier Stokes equations can be seen in the appendix at the end of this document.
Particles are solved in a box domain inside the flow domain. The box is defined with the keywords “minimum
box” and “maximum box”. The boundary conditions for the particles are defined with the keyword “bc box”.
Possible options are inflow/outflow, periodic and wall (with perfect rebound).
19
Table 6.9: Keywords for particles Navier-Stokes solver - continued
Keyword Description Default value
Gravity direction INTEGER: Array with direction of gravity. Only required if Fr –
number is specified.[0,0,-1]
particles file CHARACTER(*): Path to file with initial position of the par- –
ticles. If not provided, initialization without particles inside the
domain. Not compatible with injecting particles in the domain
(see keyword below).
vel and temp from file LOGICAL: If .true. Initial velocity and temperature of particles –
read from file. If .false., initial velocity and temperature of parti-
cles are the same as flow at the position of the particle.
injection LOGICAL: If .true. injection of particles through a face of the –
box.
particles injection INTEGER: Array with a vector indicating the direction of the –
injection. Eg., [0,1,0]
particles per step INTEGER: Number of particles injected per time step. –
particles iter period INTEGER: Iteration period for particles injection. Set to 1 to –
inject particles every time step.
particles injection velocity REAL: Array with particles injection non dimensional velocity. –
Eg., [0.d0,1.d0,0.d0]
particles injection temperature REAL: Particles injection non-dimensional temperature –
minimum box REAL: Array with minimum x,y,z coordinates of box with parti- –
cles. Eg., [0.d0,0.d0,0.d0]
maximum box REAL: Array with maximum x,y,z coordinates of box with parti- –
cles. Eg., [4.d-2,1.6d-1,4.d-2]
bc box INTEGER: Array with boundary conditions for particles box in –
the form [yz,xz,xy]. 0 is inflow/outflow, 1 is wall, 2 is periodic.
Eg., [2,0,2]. In this example planes yz and xy are periodic, while
plane xz is inflow/outflow for particles.
20
6.5 Complementary Modes
6.5.1 Wall Function
The wall function overwrites the viscous flux on the specified boundaries based on an specific law using a
Newman condition. It must be used as a complement of no slip boundary condition. Table 6.10 shows the
parameters that can be set in the control file. The frictional velocity is calculated using the instantaneous
values of the first node (either Gauss or Gauss-Lobatto) of the element neighbour of the face element (at the
opposite side of the boundary face). Currently is only supported for the compressible Navier-Stokes solver.
The standard wall function uses the Reichardt law, solving the algebraic non-linear equation using the
newton method to obtain the frictional velocity. The ABL function uses the logarithmic atmospheric boundary
layer law, using the aerodynamic roughness; the frictional velocity is without using any numerical method.
Wall Function Boundaries CHARACTER(*): Array containing the name of each boundary –
to be used. In the form: ’[bc1,bc2,bc3]’. Mandatory for using the
wall function.
Wall Function kappa REAL: von Karman constant 0.38
Wall Function C REAL: Log law ’C’ constant 4.1
Wall Function Seed REAL: Initial value for the newton method 1.0
Wall Function Damp REAL: Initial value damp for the newton method 1.0
Wall Function Tolerance REAL: Tolerance for the newton method 10−10
Wall Function max iter INTEGER: Maximum number of iterations for the newton 100
method
Wall Roughness REAL: Aerodynamic roughness for the ABL wall function. –
Mandatory value for the ABL law.
Wall Plane Displacement REAL: Plane displacement due to roughness for the ABL wall 0.0
function
Wall Function Use Average LOGICAL: Use the time average of the velocity in the wall func- .FALSE.
tion, each time step the time average is recalculated.
6.5.2 Tripping
A numerical source term is added to the momentum equations to replicate the effect of a tripping mechanism
used commonly in explerimental tests. The forcing is described via the product of two independent functions:
one that depends streamwise and vertical directions (space only) and the other one describing the spanwise
direction and time (space and time). It can be used for the compressible NS, both LES and RANS. The
keywords for the trip options are listed in table 6.11.
21
Table 6.11: Keywords for Tripping model
Keyword Description Default value
use trip LOGICAL: This is the main keyword for activating the trip .FALSE.
trip time scale REAL: Time interval between the change of the time dependent Mandatory
part of the trip.
trip number of modes INTEGER: Number of Fourier modes in the spanwise direction of Mandatory
the trip.
trip z points INTEGER: Number of points to create the Fourier Transforma- Mandatory
tion of the spanwise direction, it must be greater than the number
of modes and should be ideally equal to the number of discretiza-
tion points of the mesh in the same direction.
trip attenuation REAL ARRAY(2): Length scale of the gaussian attenuation of Mandatory
the trip, the first position is the streamwise direction and the
second is the wall-normal direction.
trip zone CHARACTER(*) ARRAY(:): Boundary condition name that Mandatory
constrains at least one surface where the trip center is located.
It can be ither one or two boundary conditions, the latter used to
generate a trip in two different positions (i.e. pressure and suction
sides of an airfoil).
trip center REAL: Position of the origin of the trip in the streamwise direc- Mandatory
tion.
trip center 2 REAL: Position of the origin of the second trip, if used, in the –
streamwise direction.
trip amplitude REAL: Maximum time varying amplitude of the trip. 1.0
trip amplitude steady REAL: Maximum steady amplitude of the trip. 0.0
random seed 1 INTEGER: Number used to initialize the random number gen- 930187532
erator of the trip. It can vary in different simulations but must
remain constant for a restart.
random seed 2 INTEGER: Number used to initialize the random number gen- 597734650
erator of the trip. It can vary in different simulations but must
remain constant for a restart.
22
Chapter 7
23
Table 7.2: Keywords for the BDF solvers.
print info LOGICAL: Specifies the verbosity of the Jacobian subroutines .TRUE.
preallocate LOGICAL: Specifies if the Jacobian must be allocated in prepro- .FALSE.
cessing (.TRUE. - only available for advective/diffusive nonlinear
conservation laws) or every time it is computed (.FALSE.)
25
Chapter 8
Explicit Solvers
Explicit time integration schemes available in HORSES3D. The main keywords to use it are shown in Table 8.1.
26
Chapter 9
The code has an implementation of the Full Approximation Scheme (FAS) nonlinear p-multigrid method. The
main keywords to use it are shown in Table 9.1.
27
Table 9.1: Keywords for the multigrid solver - continued.
28
Chapter 10
p-Adaptation Methods
The p-adaptation methods are used when the p-adaptation region is specified in the control file. There are two
different types of p-adaptation algorithms: A Truncation Error (TE) algorithm and a Reinforcement Learning
(RL) algorithm.
29
increasing = . FALSE .
write error f i l e s = . FALSE .
a d j u s t nz = . FALSE .
mode = time
interval = 1 . d0
restart f i l e s = .TRUE.
max N d e c r e a s e = 1
padapted mg sweeps p r e = 10
padapted mg sweeps p o s t = 12
padapted mg sweeps c o a r s e s t = 20
#end
31
Chapter 11
The immersed boundary is activated during the simulation if the following lines are specified in the control file:
#define IBM
name = myIBM
active = . true .
penalization = 1 . 0 d−6
semi i m p l i c i t = . false .
number o f o b j e c t s = 5
number o f i n t e r p o l a t i o n p o i n t s = 15
band r e g i o n = . true .
band r e g i o n c o e f f i c i e n t = 1.3
compute d i s t a n c e = . true .
clip axis = 1
aab = . false .
describe = . true .
p l o t obb = . false .
plot kdtree = . false .
p l o t mask = . true .
p l o t band p o i n t s = . false .
#end
A folder called ’IBM’ must be created.
32
Table 11.1: Keywords for the immersed boundary method - con-
tinued.
33
#define s t l motion 1
s t l name = mySTL
type = rotation
angular v e l o c i t y = 1 3 4 . 5 d0
motion a x i s = 2
#end
34
Chapter 12
Monitors
The monitors are specified individually as blocks in the control file. The only general keyword that can be
specified is explained in Table 12.1.
#define s t a t i s t i c s
i n i t i a l time = 1 . d0
initial iteration = 10
sampling i n t e r v a l = 10
dump i n t e r v a l = 20
@start
#end
By default, the statistic monitor will average following variables:
• u • uu • uv
• v • vv • uw
• w • ww • vw
A keyword preceded by @ is used in real-time to signalize the solver what it must do with the statistics
computation:
After reading the keyword, the solver performs the desired action and marks it with a star, e.g. @start*.
ATTENTION: Real-time keywords may not work in parallel MPI computations. I depends on how the
system is configured.
12.3 Probes
35
#define probe 1
name = SomeName
variable = SomeVariable
position = [ 0 . d0 , 0 . d0 , 0 . d0 ]
#end
• pressure • v • k
• velocity • w
• u • mach
#define s u r f a c e monitor 1
name = SomeName
marker = NameOfBoundary
variable = SomeVariable
r e f e r e n c e s u r f a c e = 1 . d0
direction = [ 1 . d0 , 0 . d0 , 0 . d0 ]
#end
• mass-flow • force
• flow • lift
• pressure-force • drag
• viscous-force • pressure-average
reference surface REAL: Reference surface [area] for the monitor. Needed for ”lift” –
and ”drag” computations.
direction REAL(3): Direction in which the force is going to be measured. –
Needed for ”pressure-force”, ”viscous-force” and ”force”. Can be
specified for ”lift” (default [0.d0,1.d0,0.d0]) and ”drag” (default
[1.d0,0.d0,0.d0])
36
12.5 Volume Monitors
Volume monitors compute the average of a quantity in the whole domain. They can be scalars(s) or vectors(v).
#define volume monitor 1
name = SomeName
v a r i a b l e = SomeVariable
#end
absolute dof unbalancing = max dof per partition − min dof per partition (12.1)
relative dof unbalancing = 100 ∗ absolute dof unbalancing/avg dof per partition (12.2)
37
Chapter 13
Advanced users can have additional control over a simulation without having to modify the source code and
recompile the code. To do that, the user can provide a set of routines that are called in different stages of the
simulation via the Problem file (ProblemFile.f90 ). A description of the routines of the Problem File can be
found in section 13.1.
To run a simulation using user-defined operations, create a folder called SETUP on the path were the
simulation is going to be run. Then, store the modified ProblemFile.f90 and the Makefile in SETUP, and
compile using:
$ make <<Options>>
where again the options are (bold are default):
• MODE=DEBUG/HPC/RELEASE
• COMPILER=ifort/gfortran
• COMM=PARALLEL/SEQUENTIAL
• ENABLE THREADS=NO/YES
38
Chapter 14
Postprocessing
Additionally, depending on the type of solution file, the user can specify additional options.
39
• Q (default) • V • N av • ux • cy
• rho • Ht • N • vx
• cz
• u • rhou • Ax Xi • wx
• omega
• v • rhov • Ax Eta • uy
NOTE: Before running the mesh in the OpenFOAM environment, the type of boundaries inside the boundary
file needs to be adjusted according to the actual type (patch, wall, and symmetry).
41
Table 14.4: Keywords for OF2Horses - continued.
42
Appendices
Non-dimensional Navier Stokes equations
To illustrate the roles of various terms in the governing equations, we present here the non-dimensionalized
governing compressible Navier Stokes equations with particles. We define the non-dimensional variables as
x∗i = xi /Lo , yi∗ = yi /Lo , t∗ = tuo /Lo , ρ∗ = ρ/ρo , u∗i = ui /uo (14.1)
Np
∂ρ∗ u∗i ∂ρ∗ u∗i u∗j ∂p∗ ∗
1 ∂τij 1 ∗ µ∗ ϕm X ∗ ∗
+ = − + + g − β (u − vi,n )δ(x∗ − yn∗ ), (14.5)
∂t∗ ∂x∗j ∂x∗i Re ∂x∗j F r2 i Np St n=1 i
" !#
∂ρ∗ e∗ ∂u∗j (ρ∗ e∗ + p∗ ) 1 ∂τij ∗ ∗
uj 1 ∂ ∗ ∂T
∗
+ = + k +
∂t∗ ∂x∗j Re ∂x∗i (γ − 1)P rMo2 ∂x∗j ∂x∗j
Np
(14.6)
ϕm Nu X
+β (T ∗ − T ∗ )δ(x∗ − yn∗ ).
3Np (γ − 1)P rMo2 St n=1 p,n
ρo Lo uo m N τ
Where Re = is the Reynolds number, F r = √ uo is the Froude number, ϕm = ρopL3p , St = τfp is the
µo go Lo o
ρp Dp2 uo
Stokes number which for Stokesian particles is St = 18Lo µo , the Prandtl number (which is assumed constant
µo cp hD
and equal to 0.72) P r = ko , the Nusselt number N u = kop = 2 (for Stokesian particles) and the Mach
uo
number Mo = √γRT .
o
43
Bibliography
44