You are on page 1of 89

EXTENDED

USER GUIDE
Contents
1 Main software features 5
1.1 Immersed Boundary method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 Local Grid Refinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 Physical models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6.1 Turbulence models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6.1.1 Spalart-Allmaras model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6.1.2 K-  Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6.1.3 Dimensionless wall distance (y + ) . . . . . . . . . . . . . . . . . . . . . . 10
1.6.2 Passive scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6.3 Porous media model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.7 Solver/ Numerical methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7.1 Explicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.7.2 Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.7.3 Spacial discretization schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8 Post-processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2 Installation 15

3 GUI overview 16
3.1 Menu bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Cases list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Tool bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.4 Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.5 Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.6 Preview and post-processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.6.1 Preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.6.2 Control tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.6.3 Post-processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

4 Case set-up 26
4.1 Surfaces and volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.1 Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.1.2 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.1.3 Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2 LGR (Local Grid Refinement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.1 Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2.2 Resolutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.2.3 Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.4 Periodicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.2.5 Fluid points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.2.6 Seal and smooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.2.7 Grid generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3 Fluid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.4 BCs tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.4.1 Available boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.4.2 External flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.4.3 Building flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.4.4 Environmental terrain flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 2


4.4.5 Wind tunnel App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.4.6 Internal flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4.4.7 Free App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.4.8 Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4.4.9 Probes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4.10 Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4.11 Time dependent boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.5 Simulation (Numerical methods) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

5 Post-processors 62
5.1 Section tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.2 Section contour tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
5.3 Surface contour tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.4 Streamlines tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
5.5 Vector tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.6 Isosurfaces tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.7 Probes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.8 Legend options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

Appendices 69

A External visualizers 69

B Run KARALIT CFD in batch mode 70

C LGR best practice 71


C.1 External flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
C.2 Building & Environmental terrain flow Apps . . . . . . . . . . . . . . . . . . . . . . . . . . 76
C.3 Wind tunnel App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
C.4 Internal flow App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

D Wall Functions 82
D.1 Note on the use of Wall Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

E Tips on how to calculate the turbulence variables 83

F Input/Output files 84

G Nomenclature 87

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 3


Introduction
A new breed of CFD
KARALIT CFD is a computational fluid dynamics software based on the Ghost Cell Method, which
belongs to the more general class of mathematical methods known as the Immersed Boundary (IB)
method.

It substitutes the time-consuming, inaccurate and labor-intensive body conformal grid generation pro-
cess with automatic and extremely fast algorithms based on geometrical, logical and topological innova-
tions. The result: CAD to CFD in minutes with the highest-quality results.

A key ingredient of the software is the use of Apps to automate how you interact with the IB method.
KARALIT CFD Apps are basically templates that enable you to set up domain and boundary conditions
for specific types of applications.

Enter the simulation parameters and the App takes care of the rest, including connecting contiguous
geometry within the model.

After having created a new case in the case window, follow these simple steps to prepare a simulation
for calculation:

1. In the Surface and Volumes tab add the geometry surface, edit it, divide it or select different
zones if you need to. You may also select or build volumes where a variety of volume models can
be applied.

2. In the LGR tab set the dimensions of the computational domain and the parameters for the auto-
matic Cartesian grid generation.
3. In the Fluid tab choose the fluid-related properties. You can have inviscid or viscous fluid, com-
pressible or incompressible. You can choose whether or not using preconditioning, start a new
simulation from scratch or from a previous solution. You also have to choose the initial values of
the flow.
4. In the BCs tab set the boundary conditions for the domain boundaries as well as for all the surfaces.
In this tab you may also select the models for all selected volumes.
5. In the Simulation tab input the iterative algorithm (explicit or implicit), the CFL (Courant-Friedrichs-
Lewy) number and the number of cores that you want to use for the simulation.
6. Select what visualization file(s) you want to have at the end of your simulation.
7. Save your settings and you are ready to start the simulation.

These steps together with further possibilities offered by KARALIT CFD are explained in more detail in
the following sections.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 4


1 Main software features
KARALIT CFD has the following key features:

Immersed Boundary method


it is App orientated in order to facilitate the usage of the software

Surfaces and Volumes


LGR (automatic grid generation using a local grid refinement)
Physical models
built-in post-processor

1.1 Immersed Boundary method


KARALIT CFD is based upon the Immersed Boundary method. Similarly to most Finite volume CFD
code, ghost cells are used to impose proper boundary conditions to take into account the existence of
a solid body which is not aligned with the Cartesian mesh. No modification to the equations has to be
introduced and the same numerical methods that are traditionally used to integrate the Navier-Stokes
equations still hold valid.

This is accomplished by the following steps:


1. The bodys geometry is provided in a CAD output form (STL format).
2. A locally refined Cartesian mesh is generated. The body is immersed into the grid, but body and
grid do not conform each other.
3. The grid cells are labeled based on the position of their centers with respect to the body. With
reference to the Figure 1, cells are classified as: fluid cell when the cell center falls inside the fluid
region; solid cell when its center is on the solid side. Ghost cells are used to impose the boundary
conditions on the domain. Ghost cells are only fictitious cells that coincide with the solid cells.
When using zero thickness surfaces (i.e. sail) where there is no solid side, the ghost cells on
each side coincide with the adjacent fluid cell on the other side of the surface.
4. A fictitious body conformal grid line is built all around the bodys surface (for example in the following
figure points B and D represent the reference points of cell 16 and 15 respectively). This is obtained
by doing the following steps:

From each ghost cell center the distance to a body panel is taken and the intersection points
with the body panel are determined (i.e. point A or C).
The line connecting the ghost cell center to its closest point on the wall is extended of a
predetermined length r. An appropriate choice of r is a critical factor.
The convolution of all reference points forms an artificial grid line wrapping the bodys shape. Primitive
variables at a reference point are interpolated from the primitive variables of a cloud of closest neighbor
cell centers. Once the primitive variables at the reference point are known, variables at the ghost cell
center are calculated using linear extrapolation between the interpolated value at the reference point
and the assigned boundary condition at the body surface.

Boundary conditions can be of two types: Dirichlet type assigns the value of the variable at the boundary;
Neumann type assigns the normal derivative at boundary. With reference to the Figure 1, the following

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 5


Figure 1: Picture taken from Jae-doo Lee (Ph.D. Thesys Georgia Tech. 2006)

formula show the actual implementation of the linear extrapolation that set the variable at the ghost cell
centers:

VN,ref = (Vref n)n (1)

VT,ref = Vref VN,ref (2)

g
VN,g = VN,ref (3)
r

VT,g = VT,ref (4)


where subscripts N and T refer to the normal and tangential component of the velocity; subscripts ref
and g refer to values at the reference point and at the ghost cell center. In this example the Dirichlet
condition is applied to the normal component and the Neumann condition to the tangential component.

In the case of a turbulent flow, if the grid is not fine enough to resolve the viscous sub-layer of the
turbulent boundary layer, the described linear extrapolation method will not be able to reproduce the
correct boundary layer profiles. If this is the case the Wall Functions have to be used.

1.2 Apps
A key feature of KARALIT CFD is the use of Apps to automate the way you interact with the IB method.
KARALIT CFD Apps are basically templates that enable you to set up domain and boundary conditions
for specific types of simulations. Enter the simulation parameters and the App takes care of the rest.
The software offers six Apps specifically designed to simplify the set-up process. These Apps are the
following:

External Flow - designed for unbounded flows (i.e. Aircraft simulations);


Building Flow - designed for ground confined flows (i.e. wind forces on buildings, pedestrian
comfort);
Environmental Terrain Flow - designed for automatically managing geometries provided in .map
format (i.e. site analysis);

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 6


Wind Tunnel - designed to numerically simulate a wind tunnel (i.e. Automotive simulations);
Internal Flow - the computational domain is confined by the STL surface;
Free - designed to allow users to freely set-up the domain.

1.3 Surfaces
Surfaces are the objects of the study, the geometry of the simulation. They can identify solid or fluid
cells depending on the simulation type (external or internal flow) and are used to apply different types of
boundary conditions.

1.4 Volumes
A volume identifies a group of fluid cells used to apply a source term, model a porous media or describe
the movements of objects.

The source terms available are: constant momentum source, constant energy source, constant passive
scalar source and porosity. These source terms are added to mass, momentum and energy equations.

Moving volumes can be used to describe qualitatively the movements of simple objects (it is not ap-
propriate to describe complex geometries or complex physical phenomena). Unlike source terms, the
moving volumes feature is not implemented as an additional source term, but every fluid cell inside the
volume has a velocity vector assigned in accordance with the prescribed state of motion (translational
or rotational). This model, being a time dependent term, must be associated to the unsteady solver to
resolve the simulations in time accuracy. Because of KARALIT CFDs structure, boundary conditions
are not applied to the volume, but only to solid cells or to physical ghost cells that are located around the
bounding box. For this reason it is not possible to impose a condition over the surface of the volume. In
case of turbulent flow, it is important to refine the mesh in and around the volume, because the condition
to be met is that the turbulent viscosity on the surface of the volume is zero.

1.5 Local Grid Refinement


The computational domain is represented by a Cartesian grid generated by the Local grid refinement
algorithm, whose advantage is that it automatically assigns the smallest cells near the surface of the
body where accuracy is paramount, and larger cells in areas not critical to simulation results.

Using a fully-unstructured approach, the algorithm generates anisotropic meshes with assigned target
grid size in normal and tangential to the wall directions. You can also define how many times the finest
mesh layer has to be replicated while moving out of the wall and how many transitional layers have to
be used before reaching the grids base line dimension.
Therefore the wall region will generate a very large number of cells, needed to properly describe the body
with the desired resolutions. Increasing the size of the wall region, with propagation of the same refine-
ment, will rapidly increase the cellss count in the domain. Wall size 2 is most of times the best trade off.

The Layer size governs the coarsening process the LGR will produce, i.e. the thickness of the interme-
diate cell sizes. If layer size equals 0, the coarsening process will be the quickest possible. A layer size
between 6 and 10 will produce a good mesh. Moreover, you must be aware that the required layer size
will act on all intermediate levels larger than the specified requirements Normal layer and Tangential
layer.

An arbitrary number of box or sphere refinement windows can be assigned, as well as symmetry or
periodic conditions.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 7


1.6 Physical models
The full coupled system of the unsteady Navier-Stokes equations represents the governing equations of
all fluid flows. The compressible formulation of the flow equations is as follows:

Continuity:

+ (uj ) = 0 (5)
t xj
Momentum:

(ui ) + (ui uj + ij p ij ) = 0 (6)
t xj
Energy:
Et
+ [uj (Et + p) ui ij + qj )] = 0 (7)
t xj
 
1
Et = e + ui ui + k (8)
2
 
ui uj 2 u 2
ij = (l + t ) + ij ij k (9)
xj xi 3 x 3
 
l t T
qi = Cp + (10)
P r P rt xi
t and K, turbulent kinetic energy, are to be modeled via a turbulence model.

1.6.1 Turbulence models


The turbulence models available in KARALIT CFD are:
Spalart-Allmaras, that solves for a turbulent viscosity-like variable ;

k -  standard, that solves for the turbulent kinetic energy k and the dissipation rate .

1.6.1.1 Spalart-Allmaras model


The Spalart-Allmaras is a one-equation turbulence model which solves a transport equation for a viscosity-
like variable. This equation introduced by the model is solved decoupled from the main five equations.
The model formulation includes twelve closure coefficients and three damping functions and in incom-
pressible form writes as:

 2    
h cb1 i 1
+ uj = cb1 (1 ft2 )S c1 f 2 ft2 + ( + ) + cb2 (11)
t xj d xj xj xi xi

p
t = fv1 ; S = + fv2 ; = 2Wij Wij (12)
2 d2
1/6
1 + c6
  
1 ui uj
Wij = ; fv2 = 1 ; f = g 6 3 (13)
2 xj xi 1 + fv1 g + c63
 

g = r + c2 (r6 r); r = min , 10 ; ft2 = ct3 exp(ct4 2 ) (14)
S2 d2

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 8


cb1 = 0.1355; = 2/3; cb2 = 0.622; = 0.41

c2 = 0.3; c3 = 2; c1 = 7.1; ct3 = 1.2; ct4 = 0.5

Where the closure coeffients are:


cb1 1 + cb2
c1 = 2
+

The wall boundary condition for this model is:

wall = 0 (15)

1.6.1.2 K-  Standard
The Standard k- turbulence model belongs to the probably most popular family of two-equation models.
The popularity of these models is due to their applicability to a large number of different turbulent flows.
Karalit CFD implements the standard version of the k- by Launder and Spalding. It is based on two
transport equations, one for the kinetic energy, k, and one for its dissipation rate, :

 
k
(k) + (uj k) = Pk  + ( + t /k ) (16)
t xj xj xj

2
 
 
() + (uj ) = C1 Pk C2 + ( + t / ) (17)
t xj k k xj xj
where:

k 2 ui
t = C Pk = ij (18)
 xj

C1 = 1.44; C2 = 1.92; C = 0.09; k = 1.0;  = 1.3 (19)

As the Standard k- turbulence model only works with wall functions, the system automatically turns the
wall functions treatment on at all solid boundaries. For details on the use and limitations of the wall
functions approach you may refer to Appendix D.
Close to the wall the zero normal derivative condition is used for k and an ad hoc value for  is recon-
structed at the first grid point out of the wall. In other words, the  equation in not solved on a layer of
cells around the solid surfaces. Rather,  values are analytically computed. This approach is usually
referred to as injection. Therefore, Karalit CFD implements the following boundary conditions for k and
 at solid walls:

3/4
C k 3/2
 
k
= 0; (P ) = (20)
n wall d

where n is the unit surface normal vector, P represents the first cell center out of the wall, d its distance
to the wall and is the von Karman constant.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 9


1.6.1.3 Dimensionless wall distance (y + )
The dimensionless wall distance is a measure of the distance of the fluid cell to the wall. The GUI
calculates an indicative value of y+ for the viscous turbulent cases. It can be calculated as:
Uf ric s
y+ = (21)

where s is the wall spacing (the smallest dimension of the cell), the dynamic viscosity.
r
wall
Uf ric = (22)

2
Cf U
wall = (23)
2

0.0261/7
Cf = (24)
Rex
U Lref
Rex = (25)

where Rex is the Reynolds number, L ref the reference length, U the free stream velocity and
the free stream density. Please note that relations above are valid only for the boundary layer on a flat
plate and they should be used only as a guidance to better set the mesh parameter when a turbulent
calculation is to be carried out. The actual value of y+ can be estimated only at post-processing stage.

1.6.2 Passive scalar


A passive scalar is a scalar that is transported and diffused by the fluid motion. It is passive because
depends on the flow field but it has no effects on it. A variety of engineering phenomena, including heat
transfer, mixing and environmental pollutant dispersion, can be described with the passive scalar model.
In KARALIT CFD, the passive scalar can be introduced through the inlet boundaries of the computational
domain as well as via single or multiple volumetric sources, but a single transport equation only can be
solved at a time. The turbulent transport of the passive scalar can be also modeled using the standard
gradient-diffusion model. The transport equation for passive scalar is written as follows:

C 2C
+ (Uj C) = (D + Dt ) + qs (26)
t xj xj xj
where is the fluid density, C is the scalar, D is the scalar diffusivity, Dt is the turbulent scalar diffusivity,
Uj is the velocity vector and qs is the scalar source term.

On the left-hand side of the equation, the first term is the unsteady one and the second one is the con-
vective term, while the terms on the right-hand side are the diffusion and the source terms, respectively.
The laminar diffusion coefficient is obtained from the formula D = Sc/, while the turbulent diffusivity
is derived from Dt = Sct /t . is the kinematic viscosity and Sc is the laminar Schmidt number, t is the
turbulent kinematic viscosity (calculated by the turbulent model that you have chosen) and Sct is the
turbulent Schmidt number.

1.6.3 Porous media model


A porous medium can be thought of as a solid body whose structure contains randomly distributed void
spaces through which the fluid can flow. Fluid flows can then only take place in the inter-connected
pores of the porous media; this is called the effective pore space. Media porosity is defined as the ratio
of the volume occupied by the fluid to the total volume. For natural media (i.e. a sponge or a volcanic

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 10


rock) porosity does not normally exceed 0.6. For beds of solid spheres of uniform diameter it usually
stays inside 0.2 and 0.5. Finally, for man-made materials such as metallic foams it can approach unity.
Porous media modeling can be carried out with different levels of physical approximation, ranging from no
modeling (the inner structure of the media is taken into account) to the so called one-fluid formulation,
that is widely used in industrial applications, where the presence of the porous media and its effect on
the flow field are modeled via a suitable source term in the momentum and energy equations. KARALIT
CFD offers you this kind of modeling, extended to both thick (volumetric) and thin (surfaces) media.
When using the one-fluid formulation and under hypothesis of constant porosity and single phase flow,
the volume-averaged mass, momentum conservation equations and the energy conservation equation
are re-written as:

(uj )
+ =0 (27)
t xj
(ui )
+ (ui uj + ij ) = Si, (28)
t xj
(E + (1 )s Es )
+ (Huj ui ij + JHj ) = q r + q c + q s (29)
t xj
where:
 
1
Si, = + |u| ui (30)
K 2
CE
= (31)
K
T
JHj = ef f (32)
xj

ef f = f + (1 )s (33)
is the porosity, s and f are the thermal conductivity respectively of the solid and fluid phases, CE is
called Ergun constant and K represents the intrinsic permeability.

In case of a porous surface (e.g. a membrane) a jump condition is enforced over that surface. The
imposed pressure jump is written as:
 
1
p = + u2 (34)
K 2
where is the thickness of the medium.

1.7 Solver/ Numerical methods


KARALIT CFD is an unstructured Finite-Volume code that solves the Navier-Stokes equations in density-
based formulation.

The Navier-Stokes equations represent the basic principles of mechanics and thermodynamics: the
conservation of mass (continuity equation), the conservation of momentum (Newtons second law of
Motion applied to fluids) and the conservation of energy (First law of thermodynamics). It is a coupled
system of five PDEs of mixed hyperbolic and parabolic type that accounts for the dissipation of kinetic
energy into internal energy and the compressibility (the reversible conversion of kinetic energy into
internal energy and vice versa). The energy equation is always solved for the total energy: internal,
kinetic and possibly potential terms. Volumetric source terms may be applied to each equation.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 11



+ = Smass (35)
t xj
ui
+ (ui uj + ij p ij ) = Smomentumi [i = 1, 2, 3] (36)
t xj
E
+ (Huj ui ij + qj ) = Senergy (37)
t xj
This full coupled system of the unsteady Navier-Stokes equations represents the governing equation of
all fluid flows. It can be solved with the explicit or the implicit solver. The main difference between the two
solvers is that the explicit one takes a much higher number of iterations to converge to the same level,
but each iteration takes shorter. Implicit schemes deliver the solution in shorter time and have always to
be preferred.

1.7.1 Explicit
KARALIT CFD implements the explicit Runge-Kutta methods, that represent a family of multi-stage for-
mulas with minimum storage requirement. They differ from the classical text-book Runge-Kutta formulas,
that need to store the residuals calculated at each stage. You can choose the number of stages (K) and
the corresponding coefficients (alpha). Similarly to all of the explicit schemes, the CFL number (an
adimensional time step) is limited by stability constraints. One-stage Runge-Kutta corresponds to an
explicit Euler method with a maximum allowed CF L = 1. By choosing a number of stages higher than 1,
allows to increase the stability region: 5-stages RK can stand a CFL number up to about 2.5. You have
to be aware that these limits are valid for linear equations where stability analysis can be carried out; in
case of non linear equations, theory does not always apply and these CFL limits may possibly become
smaller in order to get a stable iterative process.

If the constant time step option is not turned on, the algorithm makes use of a local time step which
destroys the time accuracy. Notice also that a K-stage RK requires K calculations of the residuals per
iteration, so, if the interest is only on a steady-state solution, the best trade off in terms of time-to-solution
is to use only 1 stage. In case the time-accuracy is required, all cells will make use of the minimum time
step computed in the whole domain. In this latter case the 5-stage RK method provides second-order
accuracy in time (1-stage RK delivers only first order accuracy) and represents the right choice.

If the preconditioning is selected, the time-accuracy is not recoverable with the constant time step option
turned on. Actually, in this case the effect will only be to slow down the convergence due to the minimum
time step requirement. Whenever the preconditioning is turned on, in order to compute time-dependent
flows the user has to rely on Implicit iterative method.

QN +1 = QN tRES N (38)

Qk = QN k tRESk1 [k = 1, 2, ..., K] (39)

1.7.2 Implicit
Implicit schemes are obtained computing the equations (the residuals) at the next, iterative step N + 1
whose solution is yet unknown, so that a linearization process of the residuals is needed. This is done
by expanding in Taylor series the unknown residuals about the previous step N and keeping only the
first linear term. This process destroys the time accuracy and the time t becomes a fake time which is
only used to drive the iterative algorithm.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 12


QN +1 = QN tRES N +1 (40)
 
I
+ RES N (QN +1 QN ) = RES N (41)
t Q
The resulting linear system can be solved either by using a Gauss-Seidel relaxation method or choosing
among the options offered by the PETSc library. When using the GS method, you have to choose the
number of sweeps, i.e. how much you want to push the linear system solution at the current iteration.
The higher the number of sweeps, the smaller the number of iterations needed to get to the same
convergence level, and the longer each iteration will take.
A number of sweeps equal to 20 most often represents the best choice in terms of time-to-solution. You
should also set the under-relaxation factor: 0.4 is most often the optimal choice.

Implicit schemes are A-stable schemes for linear equations, i.e. they can stand infinite CFL numbers. In
case of non linear equations, like the equations of Fluid Mechanics, there is no theory about the stability.
If you use the GS method a CF L = 10 should always work, however there are many applications where
a higher CFL (100 or even 1000) can be used. You will benefit from using the highest possible CFL
number. You may notice from the iterative algorithm shown above that the use of an infinite CFL number
turn the solution algorithm to a Newton-Raphson method for finding the solution of non linear equations.

Whenever the time-accuracy is needed (for instance in order to compute periodic flows like vortex shed-
ding, or it is important to accurately follow a transient situation) you have to choose the Dual Time Step-
ping option. This well know technique consists of introducing into the governing equations a second
time derivative for the true time.
Q Q F Q
= +S = + RES RES (42)
t xj

Q 3Q 4QN + QN 1
= (43)
2
The discretized true time derivative is introduced into the matrix as well as summed to the residuals at
the right-hand side. The same linear solver (either GS or PETSc) will work. Notice that a sub-iteration
procedure is introduced: the outer iterations are on the true time and the inner iterations on the fake time.
You have to choose the true time step (in seconds) and the number of true time steps. The previously
chosen CFL number and the number of iterations govern the inner iteration convergence, exactly the
same way they govern the iteration procedure to a steady-state solution. At the end of each true time
sub-iteration, you get the time accurate solution at that time step.

1.7.3 Spacial discretization schemes


The spatial discretization schemes available in KARALIT CFD are: First-order Roes scheme, 2nd-order
symmetric TVD scheme and 2nd-order Roes upwind TVD scheme.

The first-order scheme is very dissipative; it gives results more quickly than any other scheme, but it
suffers from inaccuracy.

The two 2nd-order scheme options produce a different amount of numerical dissipation. As a simple
rule, use the symmetric TVD scheme for getting a quick first idea of what is going on and then you can
restart your simulation with the more accurate upwind scheme.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 13


1.8 Post-processors
KARALIT CFD has its own post-processors, that allows you to visualize the computed solutions in the
following form:

Section and surface contour plots


Vector plots
Streamlines

Isosurfaces
Probes

All of these features will be discussed in detail in the Section 5.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 14


2 Installation
Once you have downloaded the KARALIT CFD package, double click the setup file in order to start
installation (for the Windows version) or uncompress the file (for the Linux version). Then follow the on-
screen steps until the installation is completed. If asked, allow smpd.exe, mpiexec.exe and solver3.exe
to access your network.

NOTE. If you are using Linux and want to run simulations using the terminal, you have to set the stack
size to unlimited. This is achieved by editing the file .bashrc:

Open the file .bashrc (found in /home/<USERNAME>) with a text editor.


Add the line ulimit -s unlimited.

Save the file and close it.


For the modification to be acquired, you can issue the command bash in a terminal or just start
working in a new terminal.

Now double click on the KARALITCFD.exe file in the KARALIT CFD installation folder. Insert, via the
wizard, the working directory where KARALIT CFD folders are stored.

This directory can be anywhere in your hard-drive and its name cannot contain special characters (i.e.
o, a, e, e, e, , u). It is recommended to create a new folder. After that, set the paths for the external
post-processors: Tecplot 360, EnSight and ParaView. Next, the graphical interface will open.

In order to receive a valid license for the software, go to Help menu, select License, click the Re-
quest license button and then the Copy to clipboard button; your license information will be copied
to the Operating System clipboard and they will be available for the paste in an e-mail directed to your
KARALIT sales manager. Once you received your personalized license file, please copy it in the folder
where you installed the KARALIT CFD software.

Inside your working directory a folder named 3d will be automatically created and inside it two folders:

1. cases - repository of your simulation cases.


2. surfaces - repository where the GUI expects to find the geometrical definition (.stl and .map files)
of what will be immersed into the computational domain. These objects must have been previously
created by means of an external CAD. These surfaces can be organized in sub-folders inside this
folder.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 15


3 GUI overview
The KARALIT CFD main window is divided into six main parts:
menu bar

cases list
tool bar
log

monitor
preview and post-processor

Figure 2: GUI main window

3.1 Menu bar


Here the following voices can be found:
1. File
Add folder - gives the possibility to add a new folder in the cases list so that you can better
manage and organize your case folders.
Export preview to JPG - exports in JPG format the current image of your preview.
Exit - closes the GUI. Be aware that by doing so all cases still possibly running will be
stopped.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 16


2. Case
In this menu the same options as in the tool bar are available (new, settings, duplicate, re-
name, export, import, remove) with the additional option import from folder. This option
has the same role as import, the difference being the type of files which are imported. This one
imports case folders instead of .krlt files.
3. View
It gives the possibility to choose the type of projection that you want to see in the Preview tab,
Parallel projection or Perspective projection, and the option to Refresh the GUI.

4. Preferences
When you click on Preferences a pop-up window opens that contains three tabs (see Figure 3):
Path tab - you can change the paths that you have chosen when you first run the set-up
(Working directory, Tecplot 360, EnSight, ParaView). For the next two tabs a selection is
mandatory before creating a new case.
Output tab - you need to select the format that you want for your output. For both EnSight
and ParaView you can have Visualization with polyhedra and cut-cells option. Tecplot 360
does not have this feature available.
Miscellaneous tab - Unit lets you choose whether to use the International System units
or the Imperial units. Precision lets you choose the number of significant digits to be con-
sidered for the input parameters of the simulation. Warnings lets you disable non-critical
warnings.

Figure 3: Options (a) Path (b) Output (c) Miscellaneous

5. Library
The only field Manage surfaces library... opens the surface library, located in the folder 3d/surfaces
inside the working directory. See Section 4.1 to see the description of the surface window.
6. Help
Two items are present: Information and License. Click on Information (or press F1 button on
your keyboard) to open a pop-up window (see Figure 4) where is possible to see the version of the
software that you installed on your computer, and two items, License and Home. By clicking
License is possible to read the Software license agreement and by clicking Home you will be
redirected to our internet site www.karalit.com. Just click with the mouse on the opened window
in order to close it.
Click on License to open a pop-up window (see Figure 5) that provides the information about
your license status and data needed to get a proper license file (see Figure 6).

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 17


Figure 4: Information window

Figure 5: License status window

Figure 6: License window

3.2 Cases list


The left part of the main window is dedicated to the working directory management (see Figure 7). When
you first open the GUI this part is empty.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 18


Folders to store cases can be added either by the use of the mouse (right click) or via the menu at the
top of the GUI (go to the File menu).

On a mouse right click on a selected folder the following options will become available (names are
self-explanatory):
Add folder
Rename folder

Remove folder

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 19


Figure 7: Cases list

On a mouse right click on a selected case the following options will become available (see Section 3.3
for the description of each one):
New case
Settings
Duplicate case
Rename case
Remove case
Export case

3.3 Tool bar


The main commands are:

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 20


Use this button to create a new case from scratch. A new pop-up window will open
where you will be prompted to define a name for the case, the folder where to place
it, the App that you want to use and the system of units. Please be aware that the
case name can have a maximum of 45 characters and must be different from the
names of cases that already exist in that folder.

Use this button to re-open an already existing case. This can be also done by
double clicking the name of the case in the cases list.

Use this button to make a copy of an existing case. This option is useful any time
you might want to duplicate a case to change some parameters, while keeping the
already existing one. You will be asked what has to be included in the new folder
(LGR files, solution files, visualization files) and then you will be prompted for a new
case name and the folder where to place it. The software will check whether or not
a case with that particular name already exists to prevent you from over-writing it.

Use this button to rename an existing case.

Use this button to export an existing case. You will be asked what to include in the
folder (LGR files, solution files, visualization files) and the folder where to place it.
A file having the extension .krlt will be created.

Use this button to import cases from a different disk location other than the current
working directory. Only the files with the .krlt extension are recognized. This is an
useful option to use any time you want to import cases from, say, a colleague. You
can define a new name for it or use the same (if a case with that name doesnt exist
yet).

Use this button to remove the selected case. The entire directory of that selected
case will be deleted from your hard disk and it will disappear from the cases list on
the left side of the GUI. Please be aware that the folder will be permanently deleted.

Use this button to start running the simulation on the selected case. Whenever
the Start button is activated, it will automatically turn into Stop. If you have
already run the simulation on a case and have chosen to continue the simulation
from the previous run, the Start button will be automatically changed by the GUI
into Continue.

Use this button to directly open the case results with one of KARALIT CFD external
visualizers: Tecplot 360, EnSight or ParaView. The solution loads automatically, if
you do not have a valid solution in your folder the visualizer will open without loading
any solution. See Appendix A for information about external visualizers.

3.4 Log
The Log tab of the main GUIs window displays the content of the <P REF IX>.log file and allows
you to review all relevant information about the running simulation. The tab appears empty for a newly
created case.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 21


Figure 8: Log tab

3.5 Monitor
The Monitor tab of the main GUIs window always displays the convergence history of the normalized
residual of the quantity that has been selected in the Fluid tab.
This will help you to asses the numerical convergence of the simulation. Additional monitors are made
available to you.
In the Preview tab each surface has an assigned color, this color corresponds to the color of the
monitored quantities for that surface. You can change colors at any time from the main GUI window by
acting on the color tree. In the Monitor tab you have the possibility to zoom and/or to move the graph,
to fit it, switch on/off the grid and also to save the image in .bmp, .xbm, .xpm, .png and .jpg formats.

3.6 Preview and post-processors


The right part of the GUI is divided into three parts:

preview
control tree
post-processors

3.6.1 Preview
Inside the preview, the geometry can be rotated using the left mouse button, zoomed by rotating the
scroll mouse button or moving forward and backward the mouse with right button pressed, and moved

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 22


Figure 9: Monitor tab

by clicking the scroll mouse button.

Under the preview window, seven buttons and one check box are present:

Figure 10: Preview toolbar

The first three buttons (XY, YZ, XZ) control the view angles: XY-plane, YZ-plane, XZ-plane.
If you want to see the objects on the same plane but from the opposite side, just click twice the
button.

The Zoom in and Zoom out buttons allow to zoom the preview.
The Fit button shows all the active objects, keeping the current position.
The Reset button fits the active objects, bringing the view in the default position.

Check the Show STL triangles check box to see the mesh on the highlighted surfaces (on the
control tree at the right of the Preview).

By right clicking on the Preview, a context menu replicates the functionalities provided by the preview
toolbar plus two new ones: change of the projection, from perspective to parallel and vice versa (the
same option is also present in the top menu View), Copy view and Paste view. Using the Copy
view functionality, the view settings will be copied into the clipboard of the Operating System. Pasting
the view settings in another case, the view of the second case will be set in the exact same way of the
first case. This can be particularly useful when comparing two or more cases.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 23


If a larger preview is needed, the left part of the GUI can be hidden by clicking the < button found
beside the name of the case (above the Preview tab).

3.6.2 Control tree


This tree is used to control the objects visualized in the Preview window, that are divided into five fields:

1. fluid - check it to see the outer boundaries of the computational domain. By default it is black but
the color can be changed by simply clicking the small colored box at its right and then choosing
from the available colors offered to you in the opened pop-up window.

2. symmetry plane - if you have a symmetric flow and you already chose a symmetry plane this can
be seen by checking this check box.
3. section - check it if you want to enable a section that is going to be placed at the position that you
choose in the tab Section found below.

4. windows - if you added one or more refinement windows, they can be seen by checking this
check box.
5. fluid points - check it to see the fluid points.

Figure 11: Control tree

NOTE. Both windows and fluid points fields are related to the LGR and are explained in Section 4.2

Here each surface is listed and accompanied by a color (that can be changed) and a number that rep-
resents the opacity of the correspondent surface.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 24


3.6.3 Post-processors
The part of the built-in visualizer has seven tabs:

1. Section
2. Section contour
3. Surface contour

4. Streamlines
5. Vectors
6. Isosurfaces
7. Probes

In the Section tab you can choose the plane and the position where to place the section. The position
of the plane can be changed by dragging the cursor or just by writing the desired value in the box present
in the tab.

Figure 12: Section tab

For each section, it is also possible to show/hide the control widget and the grid. Hiding the control widget
make it easier to move the desired section when two or more sections are visualized contemporary.
This tab is always active, the other five become active only if the solution is present into the case folder
and the Show solution check box situated below is checked. The next tabs, the ones concerning the
built-in visualizer will be detailed and explained in Section 5.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 25


4 Case set-up
Starting from the main window you can create new cases or change the settings of the existing ones.
The set-up of a case is done in a new window, that contains five tabs:
1. Surfaces and Volumes
2. LGR
3. Fluid
4. BCs
5. Simulation
At the bottom of the case window a description box is provided. It contains the name of the App by
default, but it is user editable so that you can add a few lines that briefly describe the test case.

Next to the description the buttons Save, Save a copy and Close are present. The Save button
can be used to save set-up modifications of the current case, the Save a copy button can be used to
save the current set-up to a new case and the Close button allows to close the case window.

4.1 Surfaces and volumes


The problems geometrical definition is provided through surfaces and volumes. Surfaces are given in
form of STL (StereoLithography) files. Also volumes can be given in form of STL files, but they can
also be defined through the GUI. Most CAD or CAD-based commercial software programs are able to
generate such geometry files.

The tab is divided in two parts (see Figure 13): the upper part is dedicated to the surfaces, while the
lower part is dedicated to the volumes. Each one contains buttons: +, -, Duplicate and Edit, used
respectively to add, remove, duplicate and edit surfaces and volumes.

Clicking the + button a new window opens (see Figure 14). The list provided on the left side contains all
the surfaces present in your surface library. You can Add/Remove surfaces to/from your library by using
the buttons under the list. The files inside the library can be organized by dragging them into different
folders. Right-clicking on a surface or folder four options will be available:
Rename
Remove
Clean STL
Add folder
Select from the list the surface that you want to use. Select more surfaces at once using CTRL or SHIFT
keys. By selecting a folder, all the surfaces contained in it will be added to the case. Double-clicking a
surface (or a folder) the surface (or all the surfaces in the folder) will be shown in the right-side preview.
Click Save for the selection to be considered or otherwise click Cancel.

When a surface/volume is selected some of its details are listed: Elements (number of elements), Min
coo and Max coo (minimum and maximum coordinates in all three coordinates) and Dimensions (the
overall dimensions of the object). The name of the surface/volume can be changed.

By clicking the Duplicate button the surface/volume can be duplicated. A new name and a displacement
from the original object will be required.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 26


Figure 13: Surfaces and volumes tab

Figure 14: Surface library window

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 27


4.1.1 Edit
KARALIT CFD allows you to edit surfaces by clicking the Edit button. A pop-up window will automati-
cally open and some basic geometry transformations can be applied (see Figure 15).
This pop-up window is divided into three main boxes: the left one displays the control buttons for each
editing action; the right one where parameters relevant to each editing action can be entered and the
bottom one where information about the geometry is given (the number of elements, the minimum and
maximum coordinates and also its overall dimensions).

The actions available in this window are:


Translate

Rotate
Scale
Divide

Merge
Surface selection
Decimate
Clean STL

Fill holes

Figure 15: Surface edit window

By clicking on the Translate button, the Dx, Dy and Dz can be chosen. They are the distances
which are used to move the geometry in the three directions. After setting these three values, click on
the Translate button. You will also find the buttons Set xmin to 0, Set ymin to 0 and Set zmin to 0.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 28


Figure 16: Translate tab

When you finished making changes in this box, click Apply.

Note. Before clicking the Apply button, the choices are reversible by clicking the Cancel button.

The next button is Rotate. Three parameters need to be provided here: Center of rotation, Axis
around which the rotation is performed and the rotation Angle. Enter the coordinates of the center of
rotation and the three normal units of the axis of rotation. After making your choices, click the Rotate
button and when you have finished making changes in this box, click Apply.

Figure 17: Rotate tab

Note. Before clicking the Apply button, the choices are reversible by clicking the Cancel button.

The Scale button allows you to scale the geometry by the scaling factor you enter in the Sx, Sy and
Sz fields. It is also possible to scale your geometry by selecting its current units, from field, and the
desired ones, to field. Units available are: mm, cm, m, in and f t. Click Scale and then Apply to
activate your choices.

Figure 18: Scale tab

The Divide button can be used when you have a geometry that can be divided into additional individual
parts. A default name and a different color will be given to each one of the new parts (the name of the
geometry followed by a number). In order to change the default name, choose the part by selecting it

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 29


(that particular part will be highlighted in the preview) and write the new name. Each new part can be
saved into the library by clicking the Save to library button.

Figure 19: Divide tab

Note. Before clicking the Apply button, the choices are reversible by clicking the Cancel button.

In case of multiple surfaces selected, the Merge button allows to merge them into one new surface. The
name of the new surface can be defined in the Surface name field.

Figure 20: Merge tab

The Surface selection feature allows you to partition an STL into a number of parts whenever one or
more of the following is desired:

to apply different boundary conditions,


to apply different refinements (LGR),
to monitor a particular parameter.

You can choose to use the automatic area selection provided by clicking the button Auto-boundaries
or to define the areas one by one. Using the Auto-boundaries feature, the GUI automatically finds and
divides the geometry into areas. These areas are separated when a strong discontinuity of the normals
(angles larger than 45 ) is found. By doing so, all the found areas are going to be available in the areas
list. Each area has its own name and color, that are user-editable, and the number of element. Therefore
you can show/hide them via the Show check box.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 30


Figure 21: Surface selection tab

For adding areas one by one, the next available buttons and fields need to be used. Click Add for each
selection that you want to make and repeat the same procedure, depending on what you may need for
your simulation. To select the desired triangles, check the Select box and then the desired method.
If you select more triangles than you want, deselect them by checking the Deselect box and then you
can use the same methods as before. You have four different methods to select or deselect the desired
area:

Single - lets you select only the clicked triangles of the STL. On the right side click on all the
desired triangles individually. Leave the left mouse button pressed and move the pointer over the
surface to select all the underlyings triangles.
Normals - recursively selects all the neighboring triangles sharing the same normal. On the right
side click on the triangle that has the desired normal and is situated in the desired area.
Fill - selects all the triangles contained into a closed path traced over the STL surface. On the right
side click anywhere you want on the geometry and it will automatically select all of the triangles
belonging to the closed area. This method also lets you fill a selected area. To select the area to
be filled, you first need to delimit it by creating a closed chain surrounding the area of triangles.
You do this by using the Single option. Be sure that the contour is closed, then select Fill, click on
any triangle inside the desired area and the result will look like the Figure 22 below.
Area - works similar to Normals with the difference that the selection process continues until the

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 31


difference in normals orientation of two adjacent triangles exceeds 45 .

Figure 22: (a) Area border (b) Area filled

For removing an existing selection, just click the Remove boundary or Remove all boundaries button
at the top of the window. The surfaces can be individually saved as STLs in the surfaces library by
clicking Save to library or all at once by clicking Save as. By using these two options the STLs are
saved to the library, but the modification do not take effect in the current case. For this to happen you
will need to click the Save, close the window and return to the case window. If you want to discard the
selection, click Close and the window will automatically close.

NOTE. If you want to move/rotate/zoom the geometry when one of the above-mentioned buttons is ac-
tive, you have to do it by positioning the mouse in the blue area. If not, unwanted triangles will be
selected. For the more complex geometries you can hide parts of the STL by checking the box Show
present for each selection made or you can use the Cut plane. This plane, defined by the coordinates
of its origin and by its normal, allows to cut the geometry and to hide what is below or above it (check
the box Inside out to hide the part having higher values of the coordinates). The default coordinates of
the cut plane origin are the ones of the center of the bounding box of the geometry. To regain visibility
of the part of the geometry hidden by the cut plane, just click the Restore button.

The Decimate feature can be used to reduce the number of triangles allowing for faster simulation. Tri-
angles can be reduced using two different approaches: Simple and Quadric (see Figure 23).

Figure 23: (a) Decimate Simple (b) Decimate Quadric

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 32


The Simple approach takes a percentage as input that represents the percentage of triangles that will
be removed. The Quadric takes three parameters that define the spatial subdivisions (x, y and z) of
the STL. In each spatial subdivision it performs a vertex collapsing, removes the unnecessary edges
and recreates the mesh.

NOTE. The two methods differ in terms of time and memory usage: Simple decimation is slower but
uses less memory.

The Clean STL filter can be used to remove degenerate triangles from the STLs. In particular, it re-
moves triangles with zero area and useless edges and vertexes.

The Fill holes filter is a tool for healing STL surfaces. Holes whose size is smaller than a specified
quantity are filled in with triangles and the STL surface is sealed.

Once all settings are done, you can click one of the following buttons on the bottom of the window:
Save to library - it allows you to save the modified surface to the surfaces library;
Cancel - it closes the window, every operation that has not been previously saved will be dis-
carded;

Save - it allows you to import the newly modified surface into the case window, without saving it
in the surfaces library.
After saving, you are back in your main Surface and Volumes tab of the case window. The surface is
now part of the case. In the Preview tab of the main window the new geometry can be seen together
with the default computational domain.

4.1.2 Requirements
KARALIT CFD considers three types of geometries:
1. Closed surfaces (the fluid does not enter into the body, i.e. car, airplane etc.). A stringent require-
ment is that those files MUST be watertight, though the system is able to cope with some degree
of imperfection.
2. Terrain (also an open surface that can be provided in both .map or .stl formats). For further
information see Section 4.4.4.

3. Thin surfaces (zero thickness surfaces). An Immersed Boundary Method usually requires using
closed surfaces, as the essence of the method lies on the concept of what is inside and what is
outside the body. When dealing with objects characterized by a dimension which is much smaller
than the other two (think for example of a sail), being forced to deal with a solid body can reduce or
even annihilate the advantages of the IBM. KARALIT CFD offers a proprietary technology which
extends the concept of IBM to zero thickness surfaces, which are named thin surfaces in KAR-
ALIT CFDs terminology. You can import the surface geometry in STL format and impose on it
the boundary condition type of choice, with no modification whatsoever with respect to what it is
needed for thick objects.
NOTE. It is advisable to have a triangular discretization as uniform as possible, with small aspect ratio
triangles.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 33


Figure 24: (a) Hexahedron (b) Sphere (c) Cylinder (d) STL

4.1.3 Volumes
Clicking the + button a pop-up window opens giving you the possibility to create volumes of different
shapes: hexahedron, sphere, cylinder or a previously defined geometry saved as an STL. See Figure
24.
For creating a hexahedron shaped volume you need to introduce the minimum and maximum x, y and
z coordinates. For the sphere the x, y, and z center coordinates and the radius of the sphere, while for
the cylinder the first and second basis x, y, z center coordinates together with the radius of the cylinder.
The fourth option is to have an STL shaped volume, which can practically have any shape. In this case
you need only to select the geometry from the surfaces library.
You can rename the volume and also to edit it. Clicking the Edit button a pop-up window will open.
This window is the same as for the surfaces (explained above), but it will only allow Translate, Rotate
and Scale edit functions.

NOTE. Please be aware that the STL needs to be watertight.

4.2 LGR (Local Grid Refinement)


After defining the geometry with all its surfaces the mesh has to be created. The mesh is obtained
using a local grid refinement procedure. All of the existing KARALIT CFD Apps have a tab dedicated to
creating a locally refined grid where the surface is going to be immersed.
Only the default computational domain differs for each App. After the automatic meshing process, a
locally refined grid will be generated. It will be finer near the surface and coarser moving away from the

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 34


surface.

An indirect measure of the resolution of the grid is provided by the y + value. See Section 1.6.1.3 for
more information.

Figure 25: LGR tab

4.2.1 Domain
Default values of the computational domain differ from one App to another. The default dimensions of
the domain are such that the domain fits the dimension of the first surface which has been loaded into
the case. In cases containing more than one surface, the fit will be automatic only for the first one. This
can be done by using the Fit button. This button brings back the computational domain to its initial

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 35


conditions (the ones described below for each App). By default the extent of the computational domain
starts from the STLs bounding box center. If you accept the dimensions defined by the Fit feature, the
proportions described below are maintained:

External flow
The computational domain is a cube whose length is equal to thirty times the geometry largest
dimension. The center of the computational domain corresponds to the center of the geometry.
These dimensions are user-editable.
Building flow
The default dimensions of the computational domain in the width (East-West direction) and depth
(North-South direction) directions are thirty times the width and length of the geometry, respectively
(considered from the center of the geometry), and in the height direction (Zenith-Nadir direction)
the max between two times the height of the geometry and 500 m, both considered starting from
the ground (placed at Z = 0).
Environmental terrain flow
The default dimensions of the computational domain are the same of the Building flow App. Please
be aware that after generating the grid, the computational domain in the z direction will extend from
the base of the geometry to the imposed upper bound. The default value of the Ground elevation
is the z coordinate of the rectangular base described in Section 4.4.4.
Wind tunnel
This App uses a default computational domain that measures:
from the inlet - six times the length of the body in the x direction from the center of the body;
from the outlet - ten times the length of the body in the x direction from the center of the body;
from the lateral and upper walls - three times the length of the body in the y and z direction
from the center of the body.
The dimensions are user-editable together with the distances from the upstream/downstream
boundary. In order to modify the position of the geometry, check the Arrange check box and
the following two rows will become active. Here you can choose the position from where to con-
sider the distance (upstream or downstream) and the distance itself. The distance defined by
introducing the desired length from the boundary to the minimum/maximum coordinate of the ge-
ometry, or the desired number of chords to be considered. In the y direction the body will always
be centered.
Internal flow
The computational domain fits the geometry and its dimensions are not editable. They automati-
cally adjust to consider the values of the initial grid spacing that you introduced.
Free
This App is intended to give flexibility and therefore the definition of the domain is different. The
default computational domain fits the geometry like for the Internal flow App, but it is user-editable.
You can not only choose freely the dimension of the computational domain but also its position.

After setting the domain dimensions, the number of cells of the coarse mesh are required. Changing
those fields, the corresponding Grid spacings (on the right) will be updated.

4.2.2 Resolutions
The grid generation is automated and needs a minimal set of input parameters to be specified. Two
regions are created around the bodies and you can control their extension as well as their resolutions:
a wall region (highest resolution, very close to the body) and a layer region (lower resolution, from the

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 36


body toward the boundaries of the global domain).

Given the desired Normal and Tangential resolutions on the STL surfaces, the cells are split in each
Cartesian direction independently, until they reach a target size defined by the desired resolutions.

By Normal layer and Tangential layer we mean all of the intermediate cell sizes in between the wall
and the far field. The Layer size governs the coarsening process the LGR will produce, i.e. the
thickness of the intermediate cell sizes, while the Wall size field is designed to control the grid in the
immediate vicinity of the geometry.

Figure 26: Surface resolutions

NOTE. Resolutions and layers are specific for each STL, while Wall size and Layer size are shared
among all surfaces.

The grid can be refined also in box-windows and sphere-windows.


Click the + button under the Box windows list in order to add a box. By doing so a pop-up window
opens.

Figure 27: Box window

Here the position, the dimensions of the box-window and resolutions in the three directions are required.
By clicking on the Set on... button another pop-up window opens, giving you the possibility to choose
from some default possibilities on where to place your box. These default options are:
Anyone of the STLs - the box has the size of the bounding box of the geometry;
The volume - if a volume is defined previously;

The faces of the domain (min x, max x, min y, max y, min z and max z) - the box has the same
length and width as the entire face on the corresponding side of the domain and a small height
that can be later adjusted. In the figure below an example of a box refinement can be seen, the
box being the red one.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 37


Figure 28: Box window example

Select one of the given possibilities and then click OK. By doing so the window closes. Here you can
observe that the Lock on check box is checked. You can choose to leave it as it is and use only the
available modifications, or to remove the check and change freely the parameters of the box.
Lock on selector gives the following possibilities:

center - keeps the center coordinates x, y, z fixed. You can change the width, depth and/or height
of the box.
x min - keeps the minimum x coordinate of the computational domain fixed. You can change the
width of the box.

x max - keeps the maximum x coordinate of the computational domain fixed. You can change the
width of the box.
y min - keeps the minimum y coordinate of the computational domain fixed. You can change the
depth of the box.

y max - keeps the maximum y coordinate of the computational domain fixed. You can change the
depth of the box.
z min - keeps the minimum z coordinate of the computational domain fixed. You can change the
height of the box.
z max - keeps the maximum z coordinate of the computational domain fixed. You can change the
height of the box.
After choosing the desired dimension and position of the box, that can be seen in real-time in the Pre-
view tab, you need to set the maximum grid resolution in the x, y and z directions. Click the Save
button to save the modifications and to return to the case window.

Click the + button under the Sphere windows list in order to add a sphere. By doing so a pop-up
window opens. Here the coordinates of the center of the sphere, radius and resolutions in the three
directions are required. This window works like the box window.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 38


Figure 29: Sphere window

Please also refer to the Appendix C in order to master the LGR process.

4.2.3 Symmetry
In the cases where symmetric bodies are used and symmetric behavior of the flow is expected, you can
use the Symmetry option provided by the software. This is a very useful feature that allows you to
reduce to half the total cells count.
The dimensions of the computational domain remain unchanged, but the actual domain size changes
when the symmetry plane is used. For example, a case with the symmetry plane placed at the center of
STL bounding box has the actual domain size half of the original domain size.

Figure 30: Symmetry option

In the figure below an example of symmetry can be seen.

Figure 31: (a) Symmetry on the center (b) Symmetry on the minimum STL coordinates

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 39


4.2.4 Periodicity
You can set translational periodicity on bounding box faces in all Apps except Internal flow, where only
a rotational (axisymmetric) periodicity can be set.

Figure 32: (a) Translational periodicity (b) Rotational periodicity

4.2.5 Fluid points


The fluid point is used as a starting point to create the mesh, to determine the fluid zones of the domain.
It has to be placed in a region inside the global domain and it is defined by its x, y and z coordinates.
Additional fluid points can added using the + button. Note that if two fluid points fall inside the same
region, only the first one is considered. Note also that by default if no fluid points are specified, the code
creates a fluid point located at the lowest corner of the global domain. In case there is more then one
fluid region, you must set more fluid points (for instance when the fluid regions that have to be computed
are both inside and outside a closed surface).

Figure 33: Fluid points grid

In the Preview tab the fluid point is represented by a blue point that can be moved inside the compu-
tational domain with the mouse. When using the mouse, the coordinates present in the case window
change showing in real-time where the point is placed. Also note that a misplaced position of the fluid
point can lead to unwanted results in the mesh generation. For example, if you want to simulate an
internal flow and by mistake you position your fluid point outside the region covered by the STL, you will
end up having a mesh outside the STL rather than inside. On the other hand, if you positioned the fluid
point inside the car, the mesh will be generated inside the vehicle instead of around it.

Figure 34: Fluid point example

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 40


4.2.6 Seal and smooth
The Seal option turns on the surface healing method: grid is prevented from entering small gaps on
the STL surface that are at sub-grid scale. This option can help in case of defective STL files. Its
effect is not only that of avoiding the grid from propagating inside the solid zone, but also of ensuring
a smoother grid distribution at walls. This is shown in Figure 35. The surface of the airplane frame
appears smoother when the seal option is turned on (right part of the figure). This is due to the fact
that the mesh is prevented from entering the small defects on the STL surface.

Figure 35: A grid without (left) and with (right) seal option enabled

The Smooth option allows for a more gradual transition from the tiniest cells dimension (usually close
to solid surfaces) to the typical size of the background mesh. This helps avoiding the generation of
unbounded gradient values that could occur in regions of too big changes in cells size.

4.2.7 Grid generation


After setting all the parameters described in this section, you need to click on the Start local grid re-
finement button. By doing so a pop-up window opens showing the progress of the automatic mesh
generation. When the check box Closed when finished is active, this window closes when the grid
creation is completed. The button Stop can be used at any time to stop the grid creation. The button
Close closes the LGR window.

At the end of the procedure dedicated to the computational domain and its mesh, a useful piece of
information is provided: the Total number of cells. When the grid has not been generated, it indicates
the number of the cells of the initial (uniform) grid. If the local grid refinement is completed, it indicates
the resulting number of fluid cells. In the Preview tab you can see the computational domain together
with the surface(s) and with the mesh in the desired sections.

4.3 Fluid
In the Fluid tab you have the possibility to set physical properties of the flow, fluid, initial conditions,
as well as what you intend to be monitored run-time to assess numerical convergence of your equations.

In this tab you can specify the following:

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 41


Figure 36: Grid generation example

Name
User-editable fluid name, i.e. Water, Air, etc. The default name in KARALIT CFD is fluid1. Be
aware that this is just a name that has no influence on the physical parameters.
Type of fluid
Viscosity and turbulence can be activated at this point. The options are:
Inviscid and adiabatic
Viscous laminar
Viscous turbulent

An inviscid fluid (also known as ideal fluid) is a fluid that does not have fluid viscosity (i.e. = 0).
An adiabatic fluid means that it is not heat-conductive, k = 0. Laminar fluid is a fluid able to flow
smoothly in lamina (layers). Turbulent flow occurs when the fluid does not flow in layers and groups
of fluids with different energy and momentum are mixed. An example of such flow is the cigarette
smoke at the end of the laminar stream where the smoke mixes with the surrounding air.

Start from
Here you can specify initial values for a new simulation or restart an old simulation from a previously
computed flow field.
Equation of state
This is a thermodynamic equation used to describe the existing link among the fluid properties.
KARALIT CFD supports:
ideal gas - by default uses the following air constants: the Specific heats ratio = cp /cv and
the specific heat at constant pressure cp , both user-editable, while cv is the specific heat at
constant volume.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 42


The notion of ideal gas is a theoretical one stating that the gas is composed of a set of non-
interacting particles that move randomly. The ideal gas concept obeys the ideal gas law:

P = RT (44)

where P is the pressure of the gas, R is the specific gas constant, is the density of the
gas, and T is the absolute temperature of the gas. For air, R = 286.9 [J/(kgK)]. In nature
no gas is ideal but most real gasses behave like one at normal conditions of pressure and
temperature.
incompressible - implements a numerically constant density with pressure and temperature.
liquid - represents a quasi-constant density model. Default values define standard water prop-
erties. This model requires to define the Thermal expansion coefficient and the Isothermal
compressibility.
Fluid properties
Active only for viscous type of fluids, it defines viscous and thermal properties. The fluid properties
required by KARALIT CFD are the following:

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 43


is the dynamic viscosity.
Sutherlands law is an empirical relationship between the dynamic viscosity and the abso-
lute temperature T of an ideal gas. Therefore it can be used only for viscous flows and ideal
gases. The Sutherlands law can be expressed as:
 2/3
T Tref + S
= ref (45)
Tref T +S

where Tref is a reference temperature, ref is the viscosity at the Tref and S is the Sutherland
temperature. KARALIT CFD uses by default Tref = 293 K and gives you the possibility to
change ref . It is recommended to enable this option only when you choose to use a dynamic
viscosity of the same order as the one for air.
Prandtl number is a dimensionless number, dependent only on the fluid and the fluid state,
that represents the ratio of kinematic viscosity to thermal diffusivity:
cp
Pr = (46)

where cp is the specific heat, the dynamic viscosity and the thermal conductivity. The
Prandtl number at standard conditions is around 0.7 0.8 for air and around 7 for water.
Schmidt number is a dimensionless number, defined as the ratio of momentum diffusivity
(viscosity) and mass diffusivity, and is used to characterize fluid flows in which there are si-
multaneous momentum and mass diffusion convection processes. It is editable only if passive
scalar model is activated. The Schmidt number is expressed as:

Sc = (47)
D
where is the viscosity, the density and D the mass diffusivity.
Turbulent Schmidt number describes the ratio between the rates of turbulent transport of
momentum and the turbulent transport of mass. It is expressed as:
t
Sct = (48)
Dt
where t is the turbulent viscosity and Dt the turbulent mass diffusivity.
Characteristic length is a reference length of the given geometry. For an aircraft it can be its
length or its wing span, for a cylinder or a valve its diameter etc.
Reynolds number is a dimensionless number that represents the ratio of inertial forces to
viscous forces. It is calculated by using the values of the viscosity , the characteristic length
of the geometry L, the density and the velocity magnitude V provided in the present section:
LV
Re = (49)

In the majority of the cases the laminar flow is represented by a low Reynolds number
(Re < 2000) and the turbulent one by a high Reynolds number (Re > 4000). For the inter-
val in-between, both laminar and turbulent flows are possible.
Note that the GUI computes the value of Reynolds number as a guidance to assist you in
making the right choices about the flow modeling more appropriate to your flow regime. The
Reynolds number computed by the GUI does not enter the actual calculations. Also note that
you provided a set of choices for initial values of velocity, viscosity and reference length, if you
modify the computed value of the Reynolds number, the GUI will change the value of the fluid
dynamic viscosity accordingly.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 44


Preconditioning is an option to be used at low Mach numbers, when the density based formulation
loses efficiency. This situation requires introducing a preconditioning velocity to bring numerical
modeling back into the range of numerical efficiency. The preconditioning velocity should be used
whenever the flow is expected to be incompressible (generally Mach number, based on free stream
velocity, lower than 0.15). It is expressed as:
Vm
Ma = p (50)
( 1)Cp T

where V m is the velocity magnitude, is the specific heat ratio, Cp is the specific heat at constant
pressure and T is the temperature.
The value of the preconditioning velocity is automatically set to the value of your initialized velocity
magnitude, but it is your responsibility to check its value before starting a simulation.
Monitoring defines the simulation convergence criteria. You can select the monitoring parameter
among the following variables: density, x-momentum, y-momentum, z-momentum and energy,
and input the maximum normalized final residual that is acceptable in the Stop when convergence
reaches field. Iteration zero is taken as a reference value in order to normalize residuals calculated
at each iteration. The normalized residuals are written in log10 form.
Initial values allows you to insert the initial conditions of a simulation: , V x, V y, V z,
p, and T . In case of turbulent flows, this is the section where the turbulence model selection
occurs, together with the definition of their initial values. The available models, together with the
corresponding variables to be entered, are:
Spalart-Allmaras: turbulent viscosity-like variable SA variable (), or eddy viscosity ratio,
or turbulent intensity and turbulent length scale;
k - : turbulent kinetic energy k and dissipation rate , or turbulent intensity and eddy
viscosity ratio, or turbulent intensity and turbulent length scale, or eddy viscosity ratio
and turbulent length scale;
See appendix E for information on how to calculate the initial values for turbulent quantities.
Together with the turbulence model, you can choose whether to activate the Passive scalar
model. This is a scalar transported and diffused by the fluid motion. It is passive because de-
pends on the flow field but it has no effects on it. This feature has the following parameters:
Coupled (active by default) - means that the scalar equation is solved together with the
Navier-Stokes equations.
Frozen (available only if the Start from field in the top-left part of the tab has value previous
solution) - means that the scalar transport equation only is solved whereas the Navier-Stokes
equations, as well as the turbulence model in case of turbulent calculations, are skipped in
the solution loop.
Start from - gives the possibility to choose from Initial value or Previous solution. Using
the first option, it is possible to initialize the field with the desired value (provided below).
Init. value - it is used to set the initial value.
Periodic (selectable only if the periodicity has been activated in the LGR tab) - allows to
choose whether to exclude or not the scalar variable from the set of periodic variables.
Gravity/Body force term allows to specify a force mass term. By code definition, the force must
be aligned with either axis x, y or z.

Pressure gradient term allows to apply a volumetric source term to the momentum equation.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 45


Rotating flows allows to compute the flow field in a rotating reference frame. The system adds
two volumetric source terms in the equations that account for the centrifugal and Coriolis forces.
This term has to be defined by introducing the rotation axis, the center of rotation and the rotational
speed (expressed in revolutions per minute).
When using the rotating flows with KARALIT CFD, the inlet/outlet boundary conditions have to be
provided in the absolute reference system, subsequently the software calculates the appropriate
values that are used for the simulation. The two forces applied to the rotational flows are:
Centrifugal force ( r)
Coriolis force 2 v
where = nn /30, r is the circular radius, nn is the number of revolutions per minute and v is
the velocity with respect to the rotating system. In case of Periodic-rotating simulation, the axis
and the rotating point of the two models will be exactly the same. The GUI automatically updates
the rotating parameters if the periodic ones are modified and the other way round.

NOTE. Some of the selections that you make in the Fluid tab will modify some of the available options
in the BCs tab. If Inviscid and adiabatic flow is selected, all wall-type boundary conditions will be
automatically turned into WALL - inviscid-adiabatic. In the Wind tunnel App when the incompressible
and liquid equation of state are selected, the INLET - supersonic and the INLET - total-p, total-
T boundary conditions will not be available in the BCs tab. In the Environmental terrain flow App
and Building flow App as you enter values for velocity and wind direction in the BCs tab, the velocity
components (Initial values section) in the Fluid tab will be changed accordingly.

4.4 BCs tab


The top part of the BCs tab is App dependent and is dedicated to the boundary conditions of the
domain. The second part of the tab is common to all Apps and it is dedicated to the surfaces and
volumes boundary conditions.

4.4.1 Available boundary conditions


The WALL - non slip adiabatic bc is the standard choice for viscous calculations. It has to be used for
the adiabatic systems, where no heat exchange is present.

The WALL - constant temperature bc is a no-slip condition with a temperature assigned at the wall
surface: Twall = T . It introduces conductive energy exchange between fluid and solid.

The WALL - with heat transfer bc requires to enter the value of the heat flux. From the Fouriers law for
heat conduction the heat flux components qi are:
T
qi = (51)
xi
where is the thermal conductivity that can be obtained from the Prandtl number, defined as:
cp
Pr = (52)

where is the dynamic viscosity and cp is the specific heat at constant pressure. It is similar to the
WALL - non slip adiabatic but the normal derivative of the temperature is set to the prescribed heat flux
divided by the thermal conductivity.

The WALL - diabatic bc is similar to the previous one. The difference is that the heat flux is not as-
signed, rather it is calculated based on the current wall temperature, an assigned outside free stream

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 46


temperature and an assigned convective heat transfer coefficient.

There is also the possibility to impose a wall velocity either translational or rotational. In the translational
case the three velocity components along the x, y and z directions must be provided. For a rotating wall
it is necessary to define its rotation axis, the center of rotation and the rotational speed.

The WALL - inviscid-adiabatic bc imposes flow tangent at walls, zero normal velocity (no penetration
conditions) and sets the normal derivatives of pressure and temperature to zero.

WALL - porosity bc applies a pressure drop. You need to enter the values of the scalar intrinsic porous
permeability, the porous surface thickness, the Ergun constant and the Darcy/Forchheimer threshold
velocity.

SYMMETRY bc is used when the physical geometry of interest and the expected pattern of the flow
solution have mirror symmetry.

INLET - supersonic bc requires to enter the values of temperature, velocity magnitude and pressure.
The supersonic inlet bc must be used when you have a supersonic flow entering your computational
domain.

INLET - total-p, total-T and flow angles bc requires to enter the values of total pressure, total tempera-
ture and flow angles. Total pressure p0 and total temperature T0 represent the temperature and pressure
at a stagnation point in a fluid flow:
p0 1 T0 1
=1+ M a2 =1+ M a2 (53)
p 2 T 2
where T is the static temperature, p is the static pressure, M a is the Mach number and the ratio of
specific heats (1.4 for air).

INLET - mass flow rate and temperature bc requires to enter the values of mass flow rate and temper-
ature. The mass flow rate conditions are usually used for internal flows. The mass flow rate m is defined
as:

m = V A (54)
where is the density of the fluid, V the velocity and A the cross-sectional area.

INLET - velocity and temperature bc requires to enter the values of velocity components and tempera-
ture.

INLET - pressure bc requires to enter the values of pressure and temperature. This bc has to be used
when the pressure is known and you want to calculate for example the mass flow rate.

OUTLET - supersonic bc does not require any input because the flow is not perturbed by the down-
stream conditions. This bc must be used whenever the out-coming flow is supersonic in the direction
normal to the boundary. When the type of fluid is set to viscous turbulent for the inlet bc you need to
enter the turbulence values.

OUTLET - mass flow rate and pressure bc requires to enter the values of mass flow rate and pressure.

OUTLET - pressure bc require to enter the value of pressure.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 47


OUTLET - pressure with radial equilibrium bc can be selected only if the Rotating flows (Fluid tab)
is active. It requires to enter the value of pressure on the rotational axis.

4.4.2 External flow App


The External flow App is usually used for the applications where the body has to be completely sub-
merged by an incoming uniform flow, like for example in the case of airfoil, airplane, sphere, cylinder,
turbine blade or submarines. For this App the free-stream boundary conditions is applied in the zone far
from the body where the flow is undisturbed.

Figure 37: External flow BCs tab

You can specify the free-stream Velocity magnitude Vm . If an ideal gas has been previously selected in
the Fluid tab, it is also possible to define the velocity via the Mach number. You define the pitch and
yaw angles, in agreement with the convention presented in the Figure 38. Pitch angle is considered
positive if it returns a positive z component of the velocity vector and ranges between [90, 90], while
Yaw angle limits are [180, 180].

Figure 38: Pitch and yaw angles

Furthermore temperature and pressure must always be inserted and, in case of turbulent flows, free-
stream values for all the turbulent variables corresponding to the turbulence model selected. For the
turbulent variable values see Section 1.6.1.

4.4.3 Building flow App


The Building flow App is an application to simulate ground-confined flows in open spaces.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 48


The present App refers to a geographic reference system (East-West, South-North, Nadir-Zenith) and
applies a wall boundary condition to the ground (located at z = 0 on the Nadir-Zenith direction) and a
free-stream boundary condition everywhere else.

Figure 39: Building flow BCs tab

Because this flow is environmental, it is considered to be ground confined and therefore the minimum
coordinate of the computational domain in the z direction is set to zero.

A free-stream condition is applied to the far field, and a wall condition to the ground.

The free-stream condition is prescribed by assigning the wind velocity and origin (defined by the clock-
wise orientated angle from the North direction [0, 360]). Note that the wind direction is always parallel
to the ground. Temperature and pressure are required parameters, together with the free-stream values
of turbulence parameters when turbulent flows are being simulated.

For this App you can also choose to use an Atmospheric boundary layer. This is an inflow profile that
has the shape defined by several parameters:
aerodynamic roughness
calm sea 0.0001 m
rough sea 0.001 m
flat terrain 0.005 - 0.05 m
rural terrain 0.02 - 0.2 m
woods 0.5 - 1.5 m
urban area 0.5 - 3.0 m
reference height
displacement length (the default and also recommended value is the opposite of the aerodynamic
roughness)
Von Karman constant

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 49


adiabatic temperature gradient
first turbulence coefficient

second turbulence coefficient

4.4.4 Environmental terrain flow App


The Environmental terrain Flow App is intended to be used with geometries of terrains, i.e. hills or
mountains. It works like the Building flow App with the difference that the z coordinate is not fixed to zero
but to the minimum z coordinate of the terrain.

Figure 40: Environmental terrain BCs tab

This App is designed to be used with .map files. As KARALIT CFD geometric input is always in the form
of an STL file, the .map file is automatically converted into an equivalent .stl file. After adding the file to
the surface library, the conversion can be done in two alternative ways: you can either double click on
it in the list and the software will automatically create an .stl file that contains the geometry information
together with a .rough file that contains the roughness information, or you can simply select the .map file
and import it into the case.

In this particular App, the roughness on the surface can be both set having a constant value (setting it
as a surface boundary condition - BCs tab) or can be set by using the values given in the .rough file. If
the solver finds the .rough file in your library, it will consider the values present in it, if not the constant
value given will be considered.

The .stl and .rough files are created only if they are not already present in the surfaces library. The name
of the two files will be the same as the .map file.

To the geometry information already found in the .map file, the software adds four points, all placed at
the same height (z coordinate), in order to create a rectangular base. The z coordinate of the four points
is considered to be the minimum z among the points at the minimum and maximum x and y coordinates.
NOTE. If you do not use a .map file and you decide to enter directly an STL file, it has to have the same
characteristics explained above, with the rectangular base parallel to the XY-plane.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 50


Figure 41: Points considered for creating the rectangular base

After the surface is selected the surface library closes and you return to the case window. Here, in
the surfaces box two surfaces are present: one having the name of the surface selected and the other
one named ground. The surface ground is automatically created and it has the width and depth of
the computational domain. Changing the dimensions of the computational domain this surface will
automatically adjust.

4.4.5 Wind tunnel App


The Wind tunnel App is useful to replicate wind tunnel experiments and to create new wind tunnel sim-
ulations. The minimum z coordinate is set to zero. The computational domain comprises an inlet, an
outlet, a ground wall, an upper wall and two lateral walls. The ground can be divided into three parts.
Usually in the wind tunnel experiments the movement of the ground can be simulated by a moving belt.

You have to specify the boundary conditions at all the locations.


For the walls (three divisions of the ground, upper and lateral walls) the possibilities are:
WALL - inviscid-adiabatic
WALL - with heat transfer
WALL - non slip adiabatic
WALL - constant temperature
Heres a summary of all the inlet/outlet boundary conditions:
INLET - supersonic
INLET - total-p, Total-T
INLET - mass flow rate and temperature
INLET - velocity and temperature
INLET - pressure
OUTLET - pressure
OUTLET - supersonic
OUTLET - mass flow rate and pressure
Some of these bc may not be available for certain type of fluids (incompressible, liquid, etc.), or may have
different options active (i.e. Mach number is not available for incompressible flows). As with the other
Apps, turbulence conditions must be inserted when a turbulence model has been previously selected.
Furthermore, despite the boundary condition selected, the velocity vector is constrained to be parallel to
the upper and lower walls. This is the reason why no angle of attack (or pitch) is present.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 51


Figure 42: Wind tunnel BCs tab

4.4.6 Internal flow App


The Internal flow App is used for the applications where the fluid is confined by the body surface (i.e.
channel flow, diffusers etc.). All the surface boundary conditions are available to use in this App (see
Section 4.4.1).

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 52


4.4.7 Free App
This App gives a high level of freedom to the user. It is intended for the use with applications that do
not have yet a specific App. Here you can have boundary conditions on each face of the computational
domain: West, East, South, North, Bottom and Top conditions, and also on each existing surface. All
the boundary conditions existent in KARALIT CFD are available.

Figure 43: Free BCs tab

4.4.8 Surfaces
For the surfaces you can choose from all of the existing boundary conditions (see Section 4.4.1). To
each one of the surfaces a boundary condition has to be selected, otherwise the default selection will be
used, the WALL - inviscid adiabatic.

In case of multiple surfaces, after setting a boundary condition, it is possible to copy those settings
pressing the Copy button, and paste them pressing the Paste button in another surface.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 53


Figure 44: Surfaces BCs tab

Also for each surface, you can choose to monitor one or more of the available integral parameters, during
the simulation.

Figure 45: Monitor BCs tab

From the left hand side list, it is possible to choose all the variables to monitor. Depending on the
variable, on the right hand side new fields will be shown. If forces and/or moments are monitored, a
Pressure field allows to set the reference value of the pressure, used to calculate the integral value. If
moments are monitored, the length of the lever arm mx, my or mz connecting the axis to the point
of force application must be set.

If needed, forces and/or moments can be grouped and/or normalized. The variable to group and/or nor-
malize can be selected from a drop-down list. If the Group check box is checked, all the corresponding
components will be summed. The result will be a single line in the Monitor tab. If the Normalize
check box is checked, the reference values Area (A), Density (), Velocity (V ) and Length (L,
just for moments) will be enabled and used to normalize forces and moments according to the following
formulas:
F M
1 2 1 (55)
2 ||V || A ||2 AL
2 ||V

NOTE. These two options are not mutually exclusive.

For each surface you can export a CFD solution on a solid surface to an external finite element solver
(FEM - Finite Element Method). This option is allowed in FEM output subsection. This subsection
consists in three check boxes that allow to choose which variables among Pressure, Temperature
and Heat flux to include in FEM file. They are not mutually exclusive and each surface has its own

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 54


combination of variables.

Figure 46: FEM output

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 55


The files produced by the FEM export feature are written as follows: for each surface requiring the
output, up to three files with names <SURFACE NAME> v.txt, with v being p for the pressure, t for
the temperature or q for the heat flux. Each row contains the x, y, z coordinates of solid cell and the
variable value.

4.4.9 Probes
Use the probes feature in order to monitor the solution in specific coordinates. By pressing the Set
probes button, a pop-up window will open.

Figure 47: Probes window

Points can be added and removed by + and - buttons, and it is possible to change their coordinates
through the grid. In the check list below the variable to monitor can be selected.
The results of this monitoring feature will be available in the Monitor tab, where each variable will have
its own panel.

4.4.10 Volumes
Whenever you want to impose a source term, to model a porous media or to simulate the movement of
objects, one or more volume models can be selected from the drop-down list.
The following models are available:

Sources / Porosity
Moving translating

Moving rotating

With Sources / Porosity you can add additional terms to the Navier-Stokes equations:

Constant momentum source along x, y, z

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 56


Figure 48: Volume models

Momentum source via kinetic energy per second along x, y, z


Constant energy source
Constant energy source per Kg
Constant passive scalar source

Porosity

Figure 49: Sources / Porosity models

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 57


See Section 1.6.3 for more information about the Porosity volume model.

With Moving translating you can specify the translational speed of the volume along the three direc-
tions.

Figure 50: Moving translating model

With Moving rotating you can specify the rotational speed, the center and the axis of rotation.

Figure 51: Moving rotating model

NOTE. The Moving translating and Moving rotating models require a time-dependent calculation. If
necessary, it will be automatically activated.

4.4.11 Time dependent boundary conditions


The Time dependent boundary conditions feauture allows to set a number of pre-defined functions
to descibe the time dependence of some input variables. Four functions are available: ramp, step,
exponential and sine. For each variable you must specify:
an initial value (lower or greater than the final value);

a time (or number of iterations in case of unsteady simulation) that defines how long the variable
takes to reach the final value (or the period for the sine function).
The final value is the variable value specified in the corresponding BCs tab.

This feauture is available for:

domain free stream variables in External flow, Building flow and Environmental terrain flow apps;
inflow and outflow conditions in Wind tunnel app;
inlet and outlet conditions in every side of Free app;
inlet and outlet conditions for surfaces in all apps.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 58


Figure 52: Time dependent boundary condition window

4.5 Simulation (Numerical methods)


This tab allows you to define the simulation parameters.
The time integration methods available are:
Explicit Runge-Kutta (steady and unsteady)
Implicit Gauss-Seidel (steady and dual time stepping)

Full access to PETSc library (steady and dual time stepping)


The Explicit Runge-Kutta integration method requires to specify the No. of stages and its coefficients.
For unsteady calculation, check the Constant time step check box.
The implicit Gauss-Seidel integration method requires to specify the No. of sweeps and the Under
relaxation factor parameters. See Section 1.7.2 for more information. For unsteady calculation check
the Time accuracy with Dual Time Stepping check box and specify the No. of real time steps and the
Time step size.
The PETSc integration method uses by default the gmres Krylov method and the bjacobi precon-
ditioner, and requires you to define the No. of iterations and the Under relaxation factor. In the
Advanced settings panel you can specify a different Krylov method and Preconditioner, as well as
the Relative tolerance, the Absolute tolerance and the Divergence tolerance. For unsteady calcu-
lations check the Time accuracy with Dual Time Stepping check box and specify the No. of real time
steps and the Time step size.
The choice of the convective scheme can be made by clicking on the drop-down list in the Scheme
option. The available schemes are:

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 59


Figure 53: Simulation tab

Figure 54: Explicit Runge-Kutta method

Figure 55: Implicit Gauss-Seidel method

First-order Roes scheme;

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 60


Figure 56: Implicit PETSc method

2nd-order symmetric TVD scheme;


2nd-order Roes upwind TVD scheme.

After choosing the discretization scheme you need to designate the No. of iterations that you want to
perform and also the CFL number (Courant Friedrichs Lewy).
ut
CF L = (56)
x
where u is the velocity, t is the time step and x is the length interval. By applying the same CFL
number to the whole domain, it is easy to see that coarsen cells (larger grid spacing) run faster (larger
time step).

The option Write solution every describes the iteration interval at which to save the solution files. For
both implicit unsteady and explicit unsteady methods you can save and visualize a solution file every n
time steps, where n is given by the number entered in the box Save unsteady file every.

In this tab it is also possible to set the No. of cores that you want to use for the current simulation.
The GUI will give you only an approximation of each core load. The real domain decomposition is made
inside the software using the Metis libraries (http://glaros.dtc.umn.edu/gkhome/views/metis). The
division is made in an effort to balance the number of nodes (in our case cell centers) for each core and
to minimize the number of communications between the cores. The mesh decomposition is done at run
time.

At the end of the tab, it is possible to define the Output files needed for the current simulation. By
default, they propose the choice made in the Options window, Output tab (see Figure 3), but it is still
possible to modify this choice.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 61


5 Post-processors
Once you have a solution KARALIT CFD offers the possibility to visualize it using the integrated post-
processor. This allows you to see in real-time the solution. It has the basic and most commonly used
features. In the software main window the bottom-right part of the Preview tab is dedicated to it.

Once the solution has been written you can begin to analyze it by first checking the Show solution
button. In order to load a new solution, that had been written since you checked the Show solution box,
click the Update button (the settings made will remain). Next the use of the six tabs present above is
necessary, we are going to explain them one by one.

5.1 Section tab


Use this feature to visualize a planar surface inside your 3D volume (computational domain). Select
which plane the section is drawn on (x, y or z). The position of the section can be selected by directly
entering a value or moving the slider or moving it interactively inside the domain.

Figure 57: Section tab

This tab is associated with the Section check box in the control tree, that allows you to see the mesh
through the domain at the position chosen, and also with the contours and vectors when enabled. The
contours will be shown on the section positioned at the coordinate chosen here and the same will happen
with the vectors when positioned on the section.

5.2 Section contour tab


Use this feature to visualize the contour on the previously selected sections.

Figure 58: Section contour tab

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 62


You can choose the contour attributes at the selected section position. Select the Contour type from
the drop-down list: flood, lines and flood and lines. The flood is visualized as continuous (meaning
that it shows a smooth solution without letting you notice the passage from one level to another). For
the lines and flood and lines options the field N. ranges is active. This number defines the number
of lines that you can see as a passage from a value to another.

The Variable plotted on the section has to be chosen next. The available variables are: temperature,
pressure, density, velocity (velocity magnitude and x, y, z velocity), turbulence1, turbulence2 and mutur-
bulent (the last three variables will be available depending on the type of fluid and turbulence models
used for the simulation) and scalar (if passive scalar model is active).

Max and Min are the maximum and minimum value of the selected variable on the entire domain.
You can choose to see the legend, for this click on the Legend button.

NOTE. The modifications made in the current and in the following tabs will take effect only when the
button Update is clicked.

5.3 Surface contour tab


Use this feature to visualize the solution on the surfaces. Selecting the Show edges check box, the
edges of the reconstructed surfaces will be shown.

Figure 59: Surface contour tab

The Variable that can be plotted on the surfaces can be one of the following: temperature, pressure,
density, velocity magnitude, x, y, z velocity, y + , heat flux, Tau wall, turbulence variables (depending on the
type of fluid and turbulence models used for the simulation) and scalar (if passive scalar model is active).

Max and Min are the maximum and minimum value of the selected variable on all of the surfaces.

5.4 Streamlines tab


Use this feature to visualize the streamlines inside the computational domain.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 63


Figure 60: Streamlines tab

The streamlines can have points, lines and planes as source.

Point sources can be added by pressing the Add point button or the Add by click button. The first
one adds a point source in a predetermined position (center of the YZ-plane, at minimum x coordinate),
while the second one allows you to define the position by clicking on the Preview tab. When this mode
is enabled, the Add by click button appears pressed, meaning that the first click on the Preview tab
will add a point source. Once the left mouse button is released, the Add by click button will appear
unpressed.
Point sources are defined by the three coordinates x, y and z of the point source and the radius.
Imagine a circle having the radius that you gave as an input and from it a number of N. points stream-
lines leaving your source.

Line sources can be added by pressing the Add line button. It adds a line source in a predetermined
position (YZ-plane, from min z to max z coordinates).
Line sources are defined by the three coordinates x, y and z of the two points (Point 1, Point 2)
defining the line. N. points represents the number of streamlines leaving your source.

Plane sources can be added by pressing the Add plane button. It adds a plane source in a predeter-
mined position (YZ-plane, min x coordinate).
Plane sources are defined by the three coordinates x, y and z of the Origin and of the two points
Point 1 and Point 2 defining the plane. N. points represents the number of streamlines leaving
your source and they are usually equally distributed on the plane (depending on the number of points
required).

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 64


Figure 61: Plane sources inputs

NOTE. All the sources can be moved by drag and drop on the Preview tab or selecting the desired
source and pressing the Edit button. It will show a pop-up window with all the coordinates defining the
source.

Starting from the source defined, the possible directions of the streamlines are:

Forward, starting from the source;


Backward, from the beginning of the flow to the source;
Both (forward and backward) starting from the source.

The streamlines stop whenever they reach a zone having the velocity magnitude equal to zero or the
end of the computational domain. The following integration parameters, Initial step length, Minimum
step length, Maximum step length and Maximum steps, can be used to control the propagation of
the streamlines. The streamlines are colored using the contours of the variable that you chose, and
there is also the possibility to leave them black (selecting the item None in the drop-down list). Like in
all the tabs, information about the maximum and minimum value of the selected variable and also the
possibility to have a legend are given.

5.5 Vector tab


Use this feature to visualize vectors on the entire domain or in a section. Choose from the drop-down list
Show on among grid or section. After setting all the parameters in the Vectors tab and updating,
the section can be moved interactively from the Section tab. The settings will be maintained.

Figure 62: Vectors tab

In the case that the vectors are shown on a section and the Project box is checked, the vectors are
projected onto the section. For example, if you have a section on the XY-plane, the z component of the

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 65


velocity will be set to zero.

By default you see a maximum number Max count of 5000 vectors. This number can be modified.
It is convenient not to use a very large number because the visualization will slow down considerably.
Another parameter that allows you to reduce the number of visible vectors is named Thinning. The
number introduced here represents the number of skipped vector. Lets say you have set the thinning
number to 3, it means that you will see one vector every each three available.

The vectors can be represented in two different styles: arrow or harpoon. Their dimension is deter-
mined by the combination of two parameters: Scale mode and Scale factor. Scale mode can be set
to:

off - all vectors will have uniform dimensions;


scalar - the vectors will have different dimensions depending on the value of the variable set in
the field (below) named Variable;
vector - the vectors will have different dimensions depending on the value of the velocity magni-
tude;
vector components - the vectors will have different dimensions depending on the value of the
three components of the velocity.

The vectors can be either black, selecting None in the Variable field, either colored with the contours
of the selected variable. The legend is available when a variable is selected.

5.6 Isosurfaces tab


Use this feature to visualize the isosurfaces inside the computational domain.

Figure 63: Isosurfaces tab

You can choose to visualize the isosurfaces at a given value Value 1 or inside a range (check the
Range check box and the Value 2 field will become active). If you choose to visualize the isosurfaces
inside a range you can also select the number of steps N. steps to be seen. Once you selected the
desired Variable, the maximum and minimum values will be displayed so that you can better set the
desired value or range. Like for all the other tabs the legend is available.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 66


5.7 Probes
Use this feature to get variables values in specific points of the computational domain.

Figure 64: Probes tab

Probes points can be added using the + and Add by click buttons. The first one adds a new point in
predetermined coordinates (YZ-plane, minimum x coordinates), while the second one allows you to add
a new point by clicking directly on the preview. All points can be then moved by drag and drop using the
mouse or changing their coordinates through the points grid.

After adding all the needed points, you can see the variables values in the list below. Each point of the
list is identified by its name, that can be found in the column header. Values are automatically updated
whenever you change the points position or press the Reload button to update the solution.

5.8 Legend options


The legend options window gives the possibility to customize the legend.
The first option controls the range extension of the variable values. Domain range plots the variable
values of the entire computational domain. The corresponding range can be seen on the label on its
right. Section range is active only if the post-processor acts on the sections, and it plots the variable
values of the corresponding section. Set range allows you to define a custom range, defined by Min
and Max fields. Finally, Use log scale check box allows you to plot values in the logarithmic scale.

The second option controls the transition from one color to another. In the continuous case, the change
is fluid, it is not perceptible, while in the discrete case the transition is visible and you can also control
how many colors visualize.

N. levels controls the number of tick labels to show.

Labels can be formatted in three different ways:


default - same as exponential if exponent is greater than -4 or less than precision, decimal other-
wise

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 67


Figure 65: Legend options window

decimal - floating point decimal format, n. digits defines the precision


exponential - floating point exponential format, n. digits defines the precision

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 68


Appendices
A External visualizers
If you are going to use an external visualizer, install the visualization software of your choice and indicate
its path in the KARALIT CFD Options menu. There are three options for visualization of KARALIT CFD
simulation results: EnSight, ParaView and Tecplot.

For EnSight, download the software at www.ceisoftware.com/download/ and install it. Designate the
path to the ensight100.bat file, usually found under c:\Program Files (x86)\CEI\ensight100\bin.

Download ParaView from www.paraview.org/download/ and install it. Designate the path to the par-
aview.exe file, usually found under c:\Program Files (x86)\Paraview x.x.x\bin\.
Note that files generated for EnSight can be read-in into ParaView.

Download Tecplot at www.tecplot.com/my/ and install it. Designate the path to tec360.exe, usually
found under c:\Program Files (x86)\Tecplot\Tec360 20xxRx\bin.

Figure 66: Options window, visualizers paths

For more information on how to use these tools, please refer to http://www.tecplot.com/support/
documentation/ for Tecplot, https://www.ceisoftware.com/support/ for EnSight and http://www.
paraview.org/files/ for ParaView.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 69


B Run KARALIT CFD in batch mode
KARALIT CFD simulations can be run in batch mode in Linux and Microsoft Windows by invoking MPICH
commands. It can be useful, for example, if you have access to a cluster, or if you simply want to start
simulations without using the graphical user interface.

MPICH commands are integrated in the software and can be found under <INSTALLATION FOLDER>
\MPICH\BIN. They provide the basic command mpiexec used to start the simulation and, only on Mi-
crosoft Windows, also the smpd service manager, that manages the parallel processes.

The license file provided by the KARALIT support must be present in the KARALIT CFD installation
folder. It can be single or floating, depending on whether you need to run one or many simulations
simultaneously.
If you have a floating license, your local machine (or one cluster node) should have the license man-
ager running in order to authorize multiple simulations.
For Windows users, it is possible to start the RLM server as a service. Using a command prompt with Ad-
ministrator rights, go to the KARALIT CFD installation folder (it should be something like
c:\Program Files (x86)\KARALITCFD on Windows 64 bit PCs) and then enter the command
rlm.exe -install service -dlog rlmlog where rlm.exe is the RLM server and rlmlog is the log file of the
server. At this point the RLM server is installed but not yet started, so enter the following command from
the same command prompt to start it immediately: sc start rlm.
For Linux users this can be achieved opening a terminal window, going to the KARALIT CFD installation
folder and entering the command ./rlm. The license manager starts and authorizes as many simultane-
ous simulations as it is allowed by the license file. Please, keep in mind that the terminal window used
to start the license manager needs to stay open while simulations are running.

Now go to the KARALIT CFD working directory and find the case that you need to run.
NOTE. In cluster environments, the KARALIT CFD installation folder and working directory must be
shared among all clusters nodes, because each node needs to have access to the same case folder.

Start the simulation typing the command mpiexec -np <NUMBER OF PROCESSES> <SOLVER3
ABSOLUTE PATH> where: <NUMBER OF PROCESSES> can be found in <CASE NAME>.fluid file,
for
 example:
...
CC
CC FLUIDMODELS number of fluid models, NPROC
CC
1
 2
...
and <SOLVER3 ABSOLUTE PATH> is the path of the solver3 executable, located in the KARALIT CFD
installation folder.

The simulation starts and you can see the log directly in the terminal. Once it ends, you can open the
case from the KARALIT CFD user interface and analyze the output using the monitor tabs, the integrated
post-processor, or using one of the others post-processors supported by KARALIT CFD.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 70


C LGR best practice
The initial computational domain is characterized by a coarse uniform grid. The anisotropic mesh gen-
eration process starts halving recursively in one or more coordinate directions all cells intersected by
the immersed surfaces (STLs) and by propagating the refinement away from the surfaces toward the
bounding box boundaries. The process stops when your requirements are all met.

Figure 67: Coarse uniform grid

This anisotropic process allows the generation of cells with any aspect ratio. In this respect, KARALIT
CFD LGR is much more powerful than the majority of Cartesian mesh generators used by other com-
mercial CFD softwares.
You have to set the number of cells desired in the three coordinate directions. These numbers define
the background mesh which will be further refined near the STLs. The number of cells you can choose
is a power of 2, because of the halving process.
Then you are asked to set the cell grid spacings at the surfaces both in the Normal and Tangential
directions. The process continues recursively until all cells intersected by the STLs have grid spacings
equal to, or most likely smaller than, those you have set. The above STLs requirements may be ap-
plied to a number of contiguous cell layers by setting the Wall size to a value greater than zero (the
suggested value is 2). Since the STLs requirements are the smallest grid spacings desired in the com-
putational domain, the LGR process can be seen as a coarsening process that starts at the STLs and
proceeds (propagates) toward the domain boundaries.
The Layer size governs the thickness of all the intermediate cell sizes: it controls the grid coarsening
pace that moves from the STLs outwards. If this parameter is too small, the mesh coarsening is too
rapid and cells which are too big in size will be present in the vicinity of the STLs. On the contrary, if it is
too big, the process may end up with too small cells reaching the domain boundaries. A good suggested
value may be in the range 4 to 10.
The layer thickening process will be applied to all intermediate grid sizes larger than those set as Nor-
mal layer and Tangential layer. The suggested values for the normal and tangential layers are the
double of the corresponding values set at the surfaces. In this way the coarsening pace done by the
layer size will act on all of the intermediate cell sizes. Larger values for the layer normal and tangential
will instruct the process to apply the thickening only to larger cell sizes and the smaller cell sizes that
are in the vicinity of the immersed surfaces will not have any thickness. If this parameter is far too large,
no layer thickening at all will be applied. Please be aware that, whenever no refinement is required on a
specific surface, you can uncheck it in the Resolutions list.

There is another important best practice rule that must be followed all of the times:

When any two surfaces are very close to each other, they must be assigned the same wall normal
requirement. If not, the propagation of the smaller cells will impact the surface that has larger wall
requirement, determining a hybrid grid spacing distribution at the wall that may be responsible for
inaccuracies and, possibly, divergence.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 71


When running the LGR process, you should always look at Preview window, with the section
option turned on. After setting the bounding box requirements, the desired background mesh will
be immediately shown and, at the end of the process, the overall mesh will be visible. You should
try different parameters, look at the mesh by zooming in and out, and ensure to get a grid density
that gently decreases moving away from the surfaces. The present guidelines and the following
examples of best practice will allow you to master the LGR process in a few days.

Figure 68: Refined anisotropic grid

C.1 External flow App


The bounding box is placed at a distance of 30 times the largest size of the immersed body. The
suggested bounding box requirements are 8 or 16 cells in each directions. You can modify the bounding
box dimensions and requirements. It is however not suggested to make a smaller bounding box or to
increase the number of cells in the background grid. This is particularly important when simulating the
flow over lifting bodies. A too close external domain boundary that enforces zero circulation (i.e. zero lift)
will cause inaccuracies in the computed lift. Moreover, large cells are needed at the domain boundaries
in order to dump waves out and get a quicker and easier convergence. The domain boundaries have
to be placed where the disturbances, that the presence of the body introduce into the flow field, are
almost disappeared. Making a smaller bounding box will only get the domain boundaries closer to the
disturbances without changing significantly the overall cell count.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 72


Figure 69: External flow App, the LGR setting and the background grid

Figure 70: External flow App, the overall grid with about 329000 cells

If the flow is over a blunt body that is likely to develop a large region of recirculating flow behind, it is
suggested to use also a box window for local volume refinement. Use a box on your STL, unlock it and

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 73


Figure 71: External flow App, the overall grid with the layer size increased to 10, about 593000 cells

move it behind the body. The suggested uniform refinement is 2 to 8 times the required normal grid
spacing set at the body surface.

In order to have a finer mesh, you may halve all of the grid spacing requirements and possibly set a little
increase in both wall and layer size, until an overall grid with approximately the expected number of cells
is obtained.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 74


Figure 72: External flow App, setting a box window behind the body

Figure 73: External flow App, close up of overall grid with a refinement box, about 765000 cells

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 75


C.2 Building & Environmental terrain flow Apps
The bounding box size and requirements in the XY-plane are similar to those applied in the External flow
App. The domain height can be set to about 10 times the largest elevation of the immersed surfaces.
These two Apps differ only because the Environmental terrain App can import a .map file that contains
the site elevation and possibly the terrain roughness distribution.
When using the Building App, a refinement box window locked on the bounding box ground should
always be set. When using the Environmental terrain App, the GUI converts the .map file automatically
in STL format and adds a ground STL in order to place the free stream boundary conditions at an optimal
distance. In this case there is no need to add box window at the ground.
A box with uniform reasonable resolution may be used whenever you want to focus on a particular
area, for instance a square in a much larger urban district in pedestrian comfort applications, or on a
particular building. The box requirements must only be set on the z coordinate. The requirements on x
and y should be so large that no refinement will be applied. A box thickness 2 or 3 times the chosen z
coordinate refinement will suffice (i.e. a box with 2 or 3 cell layers in the vertical direction). The following
figures show the LGR process on a 500 m tall building in a downtown district.

Figure 74: Building flow App, LGR setting with a box locked on the ground

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 76


Figure 75: Building flow App, the overall grid with the ground thin layer, about 2.8M cells

Figure 76: Building flow App, an horizontal section of the grid

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 77


C.3 Wind tunnel App
You have total freedom setting the wind tunnel length and cross section, as well as the position of the
body. In this application you should take advantage by using an anisotropic background grid that will
be kept when the LGR process is completed. As usual 8 to 16 cells in the bounding box requirements
are fine. You should never exceed these values because the final grid structure is completely driven by
the surface and layer requirements. The bounding box requirements only set the desired mesh size at
the domain boundaries. For this type of applications both a ground refinement and a wake refinement
are always suggested. The following figure shows the refinement values used in the two box windows:
2 mm on the ground, only in the vertical direction, and 5 cm for capturing the wake.

Figure 77: Wind tunnel App, LGR setting with the two box windows, the red box behind the car and the blue box on the ground

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 78


Figure 78: Wind tunnel App, the overall grid in the vicinity of the car, about 3.7M cells

Figure 79: Wind tunnel App, a view of the grid, with anisotropic coarsening toward inlet and outlet sections

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 79


C.4 Internal flow App
The bounding box is by definition outside the computational domain, since the flow to be computed is
entirely inside the STL. This is the reason why in this App the bounding box requirements do not play
any role, the grid is in fact entirely defined by the surface requirements. So it is good practice to leave
the bounding box requirements to a minimum level, say 8 cells in each coordinate direction would be fine
in order not to take the risk of putting too many cells in regions where there is not such a need. When
setting the LGR tab the user should follow the following guidelines:

1. align the STL along the Cartesian directions, whenever possible, in order to benefit form the
anisotropic grid generation;
2. never refine Inlet and Outlet sections where it is advisable to get an effective grid coarsening;
3. do not refine in the tangential direction of enclosures, pipes, etc.;

4. if the geometry is long and thin it is better to limit the layer size in order to avoid too much
unwanted propagation and layer thickening in the thinner direction. As usual, the user should try,
look and possibly modify the settings until a satisfactory grid is obtained. We used as an example
a variable section pipe, with a couple of bends, and with a sort of ball valve in the middle.

Figure 80: Internal flow App, xz grid section of the overall grid, about 0.89M cells

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 80


Figure 81: Internal flow App, xz grid section of the overall grid, about 0.89M cells

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 81


D Wall Functions
The wall functions approach reduce the computational cost of a simulation since allow the user to set
the first computational grid point far from the wall. The wall functions implemented in Karalit are based
on the hypotesis that close to the wall the flows is dominated by the viscous terms. This is true only if a
zero pressure gradient flat plate in absence of buoyancy effects is considered.
On the basis of this hypotesis it is possible to conclude that the total shear stress is constant in a region
close to the wall. Say that, a wall modeling is implemented in Karalit CFD code by means of the following
1D Turbulent boundary layer problem:
 
ui
( + t ) =0 (57)
xn xn
u(0) = 0, u() = um (58)
where n denotes the normal direction to the wall, i represents the streamline direction in the first com-
putational cell, um represents the streamline component of the interpolated velocity in the mirror point
and is the mirror point distance. The above model is solved in the local reference system (normal-
streamline) on a 1D virtual subgrid. The eddy viscosity needed to close the model (57) is obtained by a
mixing length eddy viscosity model with a near wall van Driest damping:
 2
t +
+
yA
= y 1e (59)

where is the von Karman constant equal to 0.41, A is the van Driest constant equal to 19, and y + is
the dimensionless distance from the wall based on the local friction velocity u :
u y
y+ = (60)

An iterative procedure is required to solve the equations (57) and (59) since this equations are coupuled
in non-linear way.

D.1 Note on the use of Wall Functions


The use of wall functions is reserved only to turbulent flows. As the name states, a wall function is used
to mimic the correct behavior of the fluid that flows above a solid surface even in the case when the
grid is not fine enough to adequately resolve the boundary layer. This is in fact the typical case in most
industrial applications where resolving the wall (i.e. putting a number of grid points into the boundary
layer thickness large enough to resolve it) is generally too computationally expensive and sometimes not
possible. Nonetheless wall functions do not carry a magic stick. One should always remember that this
approach represents only a modeling of a complex physical behavior.
Wall function theory lies on the assumption that in a region close enough to the wall the total shear stress
can be consider to be constant while moving down to the wall. The very first question that one has to ask
is then: how far from the wall one can go and being still inside the range of validity of this assumption?
Roughly speaking, the constant total shear stress hypothesis holds till non dimensional wall units y + of
about 100. For a correct functioning of the wall functions, the first grid point should be placed outside
the buffer layer (y + > 30) and before the above mentioned limit of y + = 100. The literature shows that if
the first grid point is placed in the buffer layer or inside the viscous sub-layer, the wall functions accuracy
can be seriously reduced and numerical instabilities can arise.
However, in many industrial cases accurate results can also be obtained under less restrictive conditions
by using very coarse grid with very high y + value, say until 300. The upper limit is strictly linked to the
thickness of the boundary layer and a general rule doesnt really exist. Its woth mentioning that the use
of wall functions may be inadequate in some cases, for example in flows with strong pressure gradients,
in presence of recirculation zones and separations.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 82


E Tips on how to calculate the turbulence variables
The user has to assign turbulent variables as initial and/or inlet boundary conditions. In case of missing
direct knowledge of the appropriate turbulence values, the user can compute them starting from some
other turbulence-related quantities, such as turbulence intensity, turbulent length scale or the eddy vis-
cosity ratio. As a guidance, in cases of high-speed internal flows (high-turbulence cases), usually the
turbulence intensity is between 5% and 20%. For low-speed internal flows (medium-turbulence cases),
the turbulence intensity is between 1% and 5%. For external flows (low-turbulence cases), typically the
turbulence intensity is well below 1%.

The turbulent length scale l is a physical quantity that describes the size of the energy-containing eddies
in a turbulent flow. It is common to set the turbulence length scale to a certain percentage of the inlet
dimension of the problem. For external flows, you are recommended to take l to be of the order of 103 .

The eddy viscosity ratio t /, is the ratio between the turbulent viscosity t and the molecular dynamic
viscosity . Usually this ratio has a value around 10 1000.

The Spalart-Allmaras model is a one-equation turbulence model that solves a transport equation for a
turbulent viscosity-like variable .
r
3
= (U Il) (61)
2
The model k- is a two-equation turbulence model that solve two-transport equations, one equation
for the turbulent kinetic energy k and one for the specific dissipation rate. These parameters can be
computed as follow:
3 2
k= (U I) (62)
2
 1
k 2 t
 = C (63)

or
k 3/2
 = C (64)
l
where U is the mean flow velocity, I the turbulence intensity and l the turbulent length scale.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 83


F Input/Output files
Once a new case has been created and saved, KARALIT CFD adds a folder in the relative working
directory where it stores the following files:

PREFIX saves a string of a maximum 45 characters that represent the title of your case, as well as
the prefix of most of the input and output files. Please be careful not to exceed the 45 characters
limit, as a longer string will not be entirely read in by the software and your simulation will not start.
It is also advisable not to use special characters in your name definition and to avoid the use of
blanks or spaces in your cases name. You may use instead.
<PREFIX>.layout saves the App parameters and boundary conditions on bounding box; the file
contains the information present in the LGR and BCs tabs.

<PREFIX>.fluid saves the fluid/flow definition, the initial conditions and the convergence param-
eters; the file contains the information present in the Fluid tab.
<PREFIX>.dat saves the simulation parameters; the file contains the information present in the
Simulation tab.
<PREFIX>.surface saves the file names of all immersed surfaces and their boundary conditions;
the file contains the information present in the Surface and BCs tabs.
<PREFIX>.mesh currently is not used but it needs to be present in the case folder.
<PREFIX>.sav saves the settings made using the GUI. This file must be present in order to allow
the system to recognize the case folder.

The mesh generator program gridgen also requires input files, which can eventually be edited/manually
modified by users. As the button Start local grid refinement is clicked a file gridgen.in will be created.
After the grid generation is completed new files will be present in the case folder:

gridgen.in contains the information about the computational domain and grid resolution, present
in the LGR tab.

gridgen.log contains what you see in the LGR pop-up window and give users useful information
about the grid generation process and the result of it, such as the total number of fluid cells, the
smallest cells dimensions etc. It also provide valuable pieces of information to understand possible
reasons of a mesh generation failure, such as a misplaced fluid points placement, issues with the
.stl files, etc.

12 files having the extension .lgr (file names end by TMP.lgr) contain the grid information. Please
note that those files are processed by KARALIT CFD solver the first time the simulation is run and
are used to generate the .imm file which contains information about the immersion process. Their
temporary status is then replaced by a permanent one and the TMP notation in their name is
lost.

2 files visual.case and visual.geo contain the mesh information in EnSight format (visual.case
can be opened also with Tecplot and ParaView)

NOTE. As the GUI represents a graphical view of the settings available in all the files mentioned so far,
it is also possible to manually edit them by using a simple text editor and run the solver using a terminal.
Be aware, however, that the GUI will not be able to read the new case settings in the .sav file and so it
will not find the changes. These files are the input for the analysis executable solver. All of the settings
are saved in the file whose extension is .sav, which is only read by the GUI. If this file is not present the
GUI does not recognize the case folder and it will not appear in your KARALIT CFD main window.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 84


Some additional files, such as a .stl or .stla geometry file, .map or .rough files, may be present and
read by the solver when importing geometries. The prefix IB is added in the process of incorporating
surfaces into the case folder, while the prefix V is added to volumes.

At the end of the simulation some files containing the results will be added to those already present in
the case folder:

<PREFIX>.log contains some of the information available at run-time during the actual simulation
(e.g. summary of BCs, numerical schemes, domain division among CPUs in case of parallel
computation, dimension of the problem and convergence history).
<PREFIX> 1.con is the file that saves the convergence history. For all the cases the first three
columns are the same. In the first column the iteration number (in case of steady-state run) or
the physical time (in case of unsteady simulation) are shown. The second and third columns
contain the maximum residual and the root mean square residual respectively. The convergence
history shown on the screen and saved in both the log and the convergence files refers to the main
dependent variable chosen in the Fluid tab.
In the first line, at iteration number 0 the residuals are an absolute value. In all of the following lines
there are the log10 of the ratio between the current residuals and the corresponding residuals at
iteration (time) 0. The next columns represent the quantities selected in the BCs tab (one or more
of the available integral parameters that can be monitored during the iterations) for the selected
surfaces.
<PREFIX> 1.co1 and <PREFIX>.co2 are the files that save the convergence history correspond-
ing to the SA and to the k- turbulence models (when selected) respectively.
<PREFIX> 1.sol is the file that saves the flow-field main dependent variables. All output files are
saved with a frequency that the user can choose in the Simulation tab.
<PREFIX> 1.so1 and <PREFIX> 1.so2 are the files that save the flow-field solution related to
the turbulence variables (when a turbulence models is selected).

TEC<PREFIX> 1.plt is the Tecplot visualization file (it is created only if Tecplot has been selected
in the GUIs option before starting the simulation).
CEI<PREFIX> 1.case is the EnSight visualization file (it is created only if EnSight has been se-
lected in the GUIs option before starting the simulation).

PAR<PREFIX> 1.case is the ParaView visualization file (it is created only if ParaView has been
selected in the GUIs option before starting the simulation).
VIZ<PREFIX> 1 are the EnSight/ParaView visualization files. The number of viz files depends
on the number of variables saved (they are created only if either EnSight or ParaView has been
selected in the GUIs option before starting the simulation).

KCFD<PREFIX> 1 are the visualization files needed for KARALIT CFD integrated post-processor.
Those files are always created as they are used by the built-in visualizer. All external visualization
tools can be activated directly by the KARALIT CFD GUI, which automatically loads the simulation
with the STL files.
KCFD<SURFACE NAME> 1 are the visualization files on the surfaces needed for KARALIT CFD
integrated post-processor. They are specific for each surface and read also by ParaView and
EnSight.
TEC<SURFACE NAME> 1.plt are the visualization file on the surface for Tecplot (they are cre-
ated only if Tecplot has been selected in the GUIs option before starting the simulation).

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 85


<PREFIX>.imm file contains the information about the immersion and it is created the first time a
simulation is run. The software checks for the existence of the .imm file inside the case directory.
If the file is found, at any successive run after the first one, the immersion process is skipped and
the .imm file is read-in instead with a dramatic saving in computational time.
<PREFIX>.dis file contains values of the computational cells distance from the nearest solid wall.
It is created any time a turbulence model is used.
mesh data.dat stores mesh related information (number of nodes, number of fluid cells, number
of solid cells).
<SURFACE NAME> var.txt are the files produced by the FEM export feature.

If the option Visualization with polyhedra and cut-cells is selected (Simulation tab), the following
additional files are created:

tec data stores mesh related information (number of nodes, number of fluid cells, number of solid
cells, number of boundary nodes and number of boundary nodes for thin surfaces).
BND files store geometrical information of the cut-cells boundary nodes.
all surfaces.geostl contains the reconstructed STL using the cut-cells boundary faces.

all surfaces thin.geostl is present only when a thin surface is used. It contains the reconstructed
thin surface using the cut-cells boundary faces.

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 86


G Nomenclature
KARALIT CFD supports two system of units, the International System of units SI and the Imperial Sys-
tem. In the table below will be presented all the variables and related units.
NOTE. The variables indicated with * are indicated by two different units in the Imperial System: f t/s or
mph. For business choices, only the Internal flow App uses f t/s, while all the others Apps use mph.

Variable SI Imperial System


M in coo m ft
M ax coo m ft
Dimensions/Distance m ft
W idth, Depth, Height m ft
grid spacing m ft
normal, tangential, norm. layer, tang. layer m ft
x, y, z resolutions m ft
(density) kg/m3 lb/f t3
V x, V y, V z (velocity) m/s f t/s OR mph
p (pressure) Pa lbf /f t2
T (temperature) K F
cp (specif ic heat at constant pressure) J/(Kg K) Btu/(lb F )
T hermal expansion coef f icient K 1 F 1
Isothermal compressibility coef f icient P a1 (lbf /f t2 )1
(viscosity) kg/(m s) lb/(f t s)
Characteristic length m ft
T hreshold velocity m/s f t/s OR mph
SA variable m2 /s f t2 /s
(kinetic energy) m2 /s2 f t2 /s2
omega (specif ic dissipation rate) s1 s1
turbulence length scale m ft
g (square root of the inverse of the specif ic dissipation rate) s1/2 s1/2
acceleration m/s2 f t/s2
p/x, p/y, p/z (pressure gradient) N/m3 lbf /f t3
rotational speed rpm rpm
wall xvelocity, wall yvelocity, wall zvelocity m/s f t/s OR mph
mass f low rate kg/s lb/s
heat f lux W/m2 Btu/(s f t2 )
scalar intrinsic porous permeability m2 f t2
porous surf ace tickness m ft
porous media density kg/m3 lb/f t3
porous media specif ic heat J/(kg K) Btu/(lb F )
Darcy/F orchheimer threshold velocity m/s f t/s OR mph
porous/solid thermal conductivity W/(m K) Btu/(hr F f t)
solid thickness m ft
ambient temperature K F
heat transf er coef f icient W/(m2 K) Btu/(hr F f t2 )
constant momentum source N lbf
constant energy source W Btu/hr
constant energy source per Kg W/kg Btu/(lb hr)
momentum source via kinetic energy per second W Btu/hr
ABL/Aerodynamic roughness m ft
ABL/Ref erence height m ft
ABL/Displacement length m ft
ABL/Adiabatic temperature gradient K/m F/f t

KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 87


KARALIT CFD v4.0 EXTENDED USER GUIDE - Page 88
Contact your sales office or sales@karalit.com
Headquarter: Pula (CA), Italy - Tel: +39 070 278202 - info@karalit.com - www.karalit.com

Italy Office: Milan UK Office: London Germany Office USA


Tel: +39 02 87188454 Tel: +44 (0) 8006126912 Tel: +49 (69) 20163578 Tel: +1 855 KARALIT
(527 2548)

All rights reserved. KARALIT is a registered trademark of KARALIT srl. All other brand names,
product names, or trademarks belong to their respective holders.

You might also like